/* ==========================================================================
   Ziddi Admin Control Panel — Master Obsidian Dark Theme & Design System
   ========================================================================== */

:root {
  --bg-dark: #060b14;
  --bg-surface: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-input: #1e293b;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(168, 85, 247, 0.3);

  /* Primary Brand Accents */
  --accent-purple: #a855f7;
  --accent-purple-glow: rgba(168, 85, 247, 0.35);
  --accent-purple-dark: #7c3aed;
  
  --accent-teal: #14b8a6;
  --accent-teal-glow: rgba(20, 184, 166, 0.3);

  --accent-blue: #3b82f6;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-emerald: #10b981;

  /* Text Colors */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Layout Constants */
  --sidebar-width: 260px;
  --header-height: 70px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;

  /* Font Families */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

/* Reset & Global */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
}

input, select, textarea {
  font-family: inherit;
  outline: none;
}

/* App Shell Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(15, 23, 42, 0.95);
  border-right: 1px solid var(--border-color);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: all 0.3s ease;
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-color);
}

.brand-badge {
  background: linear-gradient(135deg, var(--accent-purple-dark), var(--accent-purple));
  color: #fff;
  font-weight: 900;
  font-size: 18px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px var(--accent-purple-glow);
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(to right, #ffffff, var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.admin-tag {
  font-size: 10px;
  font-weight: 800;
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent-purple);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-highlight);
  text-transform: uppercase;
}

.sidebar-menu {
  flex: 1;
  padding: 20px 12px;
  overflow-y: auto;
}

.menu-category {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 12px 16px 6px;
  letter-spacing: 1px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  margin-bottom: 4px;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  transform: translateX(3px);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.18), rgba(168, 85, 247, 0.05));
  color: var(--accent-purple);
  border-left: 3px solid var(--accent-purple);
}

.nav-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
}

.admin-profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-purple-dark), var(--accent-teal));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
}

.admin-info {
  flex: 1;
  overflow: hidden;
}

.admin-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-role {
  font-size: 11px;
  color: var(--accent-teal);
}

.btn-logout {
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s;
}

.btn-logout:hover {
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.1);
}

/* Main Content Wrapper */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: calc(100vw - var(--sidebar-width));
  overflow-x: hidden;
  transition: margin-left 0.3s ease, max-width 0.3s ease;
}

/* Header Navbar */
.top-header {
  height: var(--header-height);
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-title-box h1 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
}

.header-title-box p {
  font-size: 12px;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.security-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
  100% { opacity: 1; transform: scale(1); }
}

.idle-timer-box {
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* Main Content Area */
.content-area {
  padding: 32px;
  flex: 1;
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.kpi-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-highlight);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-teal));
  opacity: 0.8;
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
}

.kpi-icon.purple { background: rgba(168, 85, 247, 0.15); color: var(--accent-purple); }
.kpi-icon.teal { background: rgba(20, 184, 166, 0.15); color: var(--accent-teal); }
.kpi-icon.amber { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.kpi-icon.blue { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }

.kpi-title {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.kpi-value {
  font-size: 28px;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.kpi-trend {
  font-size: 12px;
  font-weight: 700;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.kpi-trend.up { color: var(--accent-emerald); }
.kpi-trend.down { color: var(--accent-rose); }

/* Glass Panels & Sections */
.glass-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(12px);
  margin-bottom: 32px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.panel-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Data Tables & Horizontal Swipeable Containers */
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  position: relative;
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.data-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
  white-space: nowrap;
}

.data-table tbody tr {
  transition: background 0.2s ease;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-purple { background: rgba(168, 85, 247, 0.15); color: var(--accent-purple); border: 1px solid var(--accent-purple-glow); }
.badge-emerald { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-amber { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-rose { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); border: 1px solid rgba(244, 63, 94, 0.3); }
.badge-blue { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); border: 1px solid rgba(59, 130, 246, 0.3); }

/* Buttons & Inputs */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-purple-dark), var(--accent-purple));
  color: #fff;
  box-shadow: 0 4px 14px var(--accent-purple-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-purple-glow);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
  background: var(--accent-rose);
  color: #fff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 14px;
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 12px var(--accent-purple-glow);
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* SQL Console Editor */
.sql-editor-box {
  background: #040810;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: var(--font-mono);
  color: #a7f3d0;
  font-size: 14px;
  min-height: 120px;
  resize: vertical;
  width: 100%;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(4, 8, 16, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  padding: 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.modal-backdrop.active .modal-card {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
}

.modal-close {
  background: transparent;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}

/* Login Page Specific */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(circle at center, #0f172a 0%, #060b14 100%);
}

.login-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px);
  text-align: center;
}

.login-logo {
  font-size: 40px;
  margin-bottom: 12px;
}

/* Modal Sizes */
.modal-card.modal-lg {
  max-width: 820px;
}

.modal-card.modal-xl {
  max-width: 1040px;
}

/* Tab Navigation inside Modals / Panels */
.tab-nav-bar {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
  padding-bottom: 8px;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  white-space: nowrap;
  border: 1px solid transparent;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  color: var(--accent-purple);
  background: rgba(168, 85, 247, 0.15);
  border-color: var(--border-highlight);
}

/* Filter Chips & Pills */
.filter-pill-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-pill {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filter-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.filter-pill.active {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(124, 58, 237, 0.35));
  border-color: var(--accent-purple);
  color: #fff;
  box-shadow: 0 0 12px var(--accent-purple-glow);
}

.preset-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed var(--border-color);
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-chip:hover {
  background: rgba(168, 85, 247, 0.12);
  border-color: var(--accent-purple);
  color: var(--text-main);
}

/* Smartphone Push Notification Simulator */
.phone-mockup-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 10px;
}

.phone-mockup {
  width: 320px;
  height: 580px;
  background: #020617;
  border: 10px solid #1e293b;
  border-radius: 44px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(168, 85, 247, 0.15);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.phone-notch-island {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 22px;
  background: #000;
  border-radius: 14px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.phone-camera-lens {
  width: 9px;
  height: 9px;
  background: #0f172a;
  border-radius: 50%;
  border: 1.5px solid #334155;
}

.phone-status-bar {
  padding: 14px 20px 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  z-index: 5;
}

.phone-screen-content {
  flex: 1;
  padding: 16px 14px;
  background: radial-gradient(circle at 50% 20%, #1e1b4b 0%, #090d16 80%);
  display: flex;
  flex-direction: column;
  position: relative;
}

.phone-lock-time {
  text-align: center;
  margin-top: 25px;
  margin-bottom: 25px;
}

.phone-lock-clock {
  font-size: 46px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  letter-spacing: -1px;
}

.phone-lock-date {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
  font-weight: 600;
}

/* The actual Push Notification Banner Card */
.phone-notification-banner {
  background: rgba(30, 41, 59, 0.88);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  padding: 14px 14px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  animation: dropNotification 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.25s ease;
}

@keyframes dropNotification {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.phone-notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.phone-notif-app {
  display: flex;
  align-items: center;
  gap: 7px;
}

.phone-app-icon {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.phone-app-name {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #cbd5e1;
}

.phone-notif-time {
  font-size: 9px;
  color: #94a3b8;
}

.phone-notif-title {
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 3px;
  line-height: 1.3;
}

.phone-notif-body {
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.4;
  word-break: break-word;
}

.phone-notif-footer {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9px;
  color: var(--accent-purple);
  font-weight: 700;
}

/* Toast Container */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.admin-toast {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-highlight);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  color: var(--text-main);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 420px;
  backdrop-filter: blur(12px);
  animation: slideToastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.3s ease;
}

.admin-toast.toast-success {
  border-color: rgba(16, 185, 129, 0.5);
}

.admin-toast.toast-error {
  border-color: rgba(244, 63, 94, 0.5);
}

.admin-toast.toast-info {
  border-color: var(--border-highlight);
}

@keyframes slideToastIn {
  from {
    transform: translateX(50px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ==========================================================================
   Store Products, Variants & Media Uploads Design System
   ========================================================================== */
.product-thumb-sm {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-color);
  background: #040810;
  display: block;
}

.product-thumb-placeholder {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-dim);
}

.product-image-upload-box {
  border: 2px dashed var(--border-highlight);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  background: rgba(168, 85, 247, 0.03);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.product-image-upload-box:hover {
  background: rgba(168, 85, 247, 0.08);
  border-color: var(--accent-purple);
}

.product-upload-preview {
  max-width: 140px;
  max-height: 140px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  object-fit: contain;
  margin-top: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.variant-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  font-size: 11.5px;
  color: var(--text-main);
  margin: 2px 4px 2px 0;
  transition: all 0.2s;
}

.variant-chip:hover {
  border-color: var(--accent-purple);
  background: rgba(168, 85, 247, 0.1);
}

.variant-chip.oos {
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.3);
  background: rgba(244, 63, 94, 0.05);
}

.filter-pills-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-pill {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-pill:hover,
.filter-pill.active {
  background: var(--accent-purple);
  color: #fff;
  border-color: var(--accent-purple);
  box-shadow: 0 2px 10px var(--accent-purple-glow);
}

.modal-card-lg {
  max-width: 820px !important;
}

.invoice-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.015);
}

.invoice-item-row:last-child {
  border-bottom: none;
}

/* ==========================================================================
   SQL Query Console & Result Area
   ========================================================================== */
.sql-top-row {
  display: grid;
  grid-template-columns: minmax(0, 2.5fr) minmax(0, 1fr);
  gap: 20px;
  min-width: 0;
  width: 100%;
  align-items: stretch;
}

.sql-editor-box-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sql-editor-box {
  background: #040810;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: var(--font-mono);
  color: #a7f3d0;
  font-size: 14px;
  height: 180px;
  resize: vertical;
  width: 100%;
  line-height: 1.5;
}

.sql-schema-box {
  min-width: 0;
  border-left: 1px solid var(--border-color);
  padding-left: 20px;
  display: flex;
  flex-direction: column;
}

.sql-schema-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sql-schema-list {
  height: 145px;
  overflow-y: auto;
  padding-right: 4px;
}

.sql-results-card {
  margin-top: 18px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: rgba(4, 8, 16, 0.75);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
}

.sql-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 12px;
}

.sql-results-stats {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.sql-results-hint {
  font-size: 11px;
  color: var(--accent-purple);
  background: rgba(168, 85, 247, 0.12);
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(168, 85, 247, 0.25);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sql-results-scrollable {
  max-height: 440px;
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  width: 100%;
}

.sql-results-scrollable thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #0f172a;
  box-shadow: 0 1px 0 var(--border-color);
  white-space: nowrap;
}

.sql-results-scrollable td {
  white-space: nowrap;
}

/* ==========================================================================
   Smooth Glowing Scrollbars
   ========================================================================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.35);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 85, 247, 0.65);
}

/* Mobile Hamburger Menu & Backdrop */
.mobile-menu-btn {
  display: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 18px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: 12px;
}

.mobile-menu-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent-purple);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 99;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* 1. Large Laptops / Desktops (max-width: 1400px) */
@media (max-width: 1400px) {
  .kpi-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

/* 2. Medium Screens & Small Laptops (max-width: 1100px) */
@media (max-width: 1100px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .sql-top-row {
    grid-template-columns: 1fr !important;
  }

  .sql-schema-box {
    border-left: none !important;
    border-top: 1px solid var(--border-color);
    padding-left: 0 !important;
    padding-top: 14px;
    margin-top: 12px;
  }

  .sql-schema-list {
    height: auto;
    max-height: 200px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
  }
}

/* 3. Tablets & Mobile Landscape (max-width: 1024px) */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 0px;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.8);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .sidebar-backdrop.active {
    display: block;
  }

  .main-wrapper {
    margin-left: 0 !important;
    max-width: 100vw !important;
  }

  .top-header {
    padding: 0 16px;
  }

  .content-area {
    padding: 20px 16px 120px 16px !important;
  }

  .cofounder-bottom-bar,
  #cofounder-bottom-bar {
    left: 0 !important;
    padding: 10px 16px;
  }
}

/* 4. Small Tablets & Phones (max-width: 640px) */
@media (max-width: 640px) {
  .top-header {
    height: auto;
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .header-title-box h1 {
    font-size: 16px;
  }

  .header-title-box p {
    font-size: 11px;
  }

  .security-badge {
    font-size: 10px;
    padding: 4px 8px;
  }

  .kpi-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .kpi-card {
    padding: 16px;
  }

  .kpi-value {
    font-size: 22px;
  }

  .glass-panel {
    padding: 16px;
    margin-bottom: 20px;
  }

  .panel-title {
    font-size: 15px;
  }

  .sql-results-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .cofounder-bottom-bar,
  #cofounder-bottom-bar {
    padding: 8px 12px;
    gap: 8px;
  }

  .modal-card {
    width: 95vw !important;
    max-height: 90vh !important;
    padding: 18px !important;
    overflow-y: auto;
  }
}

/* ==========================================================================
   Bottom Funnel Popover Modal & User 360 Detail Cards Studio
   ========================================================================== */
.modal-bottom-funnel {
  align-items: flex-end !important;
  padding: 0 !important;
  overflow: hidden;
}

.modal-bottom-funnel .modal-card-drawer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-highlight);
  border-left: 1px solid var(--border-highlight);
  border-right: 1px solid var(--border-highlight);
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 1300px;
  max-height: 92vh;
  margin: 0 auto;
  padding: 24px 32px 36px;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.85);
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.modal-bottom-funnel.active .modal-card-drawer {
  transform: translateY(0);
}

.drawer-drag-pill {
  width: 44px;
  height: 5px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  margin: 0 auto 16px;
  cursor: pointer;
}

.drawer-drag-pill:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* User 7-Hub Cards Grid */
.user-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.user-hub-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.user-hub-card:hover {
  background: rgba(168, 85, 247, 0.08);
  border-color: var(--accent-purple);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.15);
}

.user-hub-card.active {
  background: rgba(168, 85, 247, 0.15);
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.3);
}

.user-hub-card.loaded {
  border-color: var(--accent-teal);
}

.user-hub-card .hub-icon {
  font-size: 24px;
  margin-bottom: 6px;
}

.user-hub-card .hub-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-main);
  margin-bottom: 4px;
}

.user-hub-card .hub-subtitle {
  font-size: 10.5px;
  color: var(--text-muted);
}

.user-hub-card .hub-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
}

.user-hub-card.active .hub-badge {
  background: var(--accent-purple);
  color: #fff;
}

/* Detail Panel Container */
.user-hub-detail-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  min-height: 280px;
  flex: 1;
  overflow-y: auto;
}

/* Day Tabs & Day Exercises */
.day-tabs-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.day-tab-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.day-tab-btn:hover {
  color: var(--text-main);
  border-color: var(--border-highlight);
}

.day-tab-btn.active {
  background: var(--accent-purple);
  color: #fff;
  border-color: var(--accent-purple);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.exercise-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  transition: background 0.15s;
}

.exercise-item-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.tdee-metric-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.tdee-metric-box .metric-num {
  font-size: 26px;
  font-weight: 900;
  font-family: var(--font-mono);
  margin: 4px 0;
}

.tdee-metric-box.primary .metric-num {
  color: var(--accent-purple);
}

.tdee-metric-box.teal .metric-num {
  color: var(--accent-teal);
}

.tdee-metric-box.amber .metric-num {
  color: var(--accent-amber);
}

.target-interest-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--accent-purple);
  font-weight: 600;
  margin: 2px 4px 2px 0;
}
