/* ============================================
   TIME ZERO - Mobile-First Responsive CSS
   ============================================ */

:root {
  --bg: #f9fafb;
  --surface: #ffffff;
  --surface-soft: #f4f6f5;
  --surface-hover: #eef1f0;
  --border: #e5e9e7;
  --primary: #00997a;
  --primary-strong: #00806a;
  --accent: #10a89f;
  --text: #374151;
  --text-muted: #6b7280;
  --muted: #6b7280;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #16a34a;
  --shadow: 0 12px 34px rgba(0, 128, 102, 0.12);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 18px;
  --font: "Segoe UI", "Helvetica Neue", "Open Sans", sans-serif;

  /* Mobile-first spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;

  /* Touch target minimum */
  --touch-target: 44px;

  /* Header height for calculations */
  --header-height: 56px;
  --bottom-nav-height: 60px;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  /* Prevent overscroll bounce on iOS */
  overscroll-behavior: none;
}

a {
  color: var(--accent);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* ============================================
   HEADER - Mobile First
   ============================================ */
header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
}

/* Hamburger menu button - visible on mobile */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: var(--surface-soft);
  cursor: pointer;
  padding: 0;
  border-radius: 12px;
  color: var(--primary);
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

@media (max-width: 1023px) {
  .menu-toggle {
    display: flex;
  }
}

.menu-toggle:hover {
  background: var(--primary);
  color: white;
}

.menu-toggle:active {
  transform: scale(0.95);
  background: var(--primary);
  color: white;
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
}

/* Logo - unified icon + text */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo svg {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 2px 8px rgba(0,128,102,0.2);
  padding: 7px;
  flex-shrink: 0;
}

.logo span {
  font-weight: 800;
  color: var(--primary-strong);
  font-size: 15px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  /* Hidden on mobile by default */
  display: none;
}

/* Show logo text on tablets and up */
@media (min-width: 480px) {
  .logo span {
    display: block;
  }
}

/* Current organization label in header - same style as sync/notifications buttons */
.current-org-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 16px;
  background: var(--surface-soft);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hide org label on very small screens */
@media (max-width: 480px) {
  .current-org-label {
    display: none;
  }
}

/* Top navigation - hidden on mobile */
nav.top-nav {
  display: none;
}

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-left: auto;
}

.header-sync-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  color: var(--muted);
  transition: all 0.2s;
  flex-shrink: 0;
  background: var(--surface-soft);
}

.header-sync-btn svg {
  width: 20px;
  height: 20px;
}

.header-sync-btn:hover,
.header-sync-btn:active {
  background: var(--primary);
  color: white;
}

/* Notifications link for mobile */
.notifications-link-mobile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  color: var(--muted);
  transition: all 0.2s;
  flex-shrink: 0;
  background: var(--surface-soft);
  text-decoration: none;
}

.notifications-link-mobile svg {
  width: 20px;
  height: 20px;
}

.notifications-link-mobile:hover,
.notifications-link-mobile:active {
  background: var(--primary);
  color: white;
}

/* Mobile: show link, hide dropdown */
.notifications-dropdown-desktop {
  display: none;
}

/* Desktop: hide link, show dropdown */
@media (min-width: 769px) {
  .notifications-link-mobile {
    display: none;
  }
  .notifications-dropdown-desktop {
    display: block;
  }
}

/* Notifications button in dropdown - same style as sync button */
.notifications-dropdown-desktop > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  color: var(--muted);
  transition: all 0.2s;
  flex-shrink: 0;
  background: var(--surface-soft) !important;
  padding: 0 !important;
  border: none !important;
  position: relative;
  cursor: pointer;
}

.notifications-dropdown-desktop > button svg {
  width: 20px;
  height: 20px;
}

.notifications-dropdown-desktop > button:hover,
.notifications-dropdown-desktop > button:active {
  background: var(--primary) !important;
  color: white;
}

/* User menu & dropdowns */
.user-menu {
  position: relative;
  flex-shrink: 0;
}

.user-menu button {
  border: none;
  background: var(--surface-soft);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 10px;
  min-height: 44px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.user-menu button:hover,
.user-menu button:active {
  background: var(--primary);
  color: white;
}

.user-menu .dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 200px;
  display: none;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
}

.user-menu.open .dropdown {
  display: flex;
}

.user-menu .dropdown a,
.user-menu .dropdown button {
  padding: var(--space-md) var(--space-lg);
  text-decoration: none;
  color: var(--text);
  min-height: var(--touch-target);
  display: flex;
  align-items: center;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 14px;
  cursor: pointer;
}

.user-menu .dropdown a:hover,
.user-menu .dropdown button:hover {
  background: var(--surface-soft);
}

/* Avatar */
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

.avatar-lg {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  font-size: 22px;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* Notification badge */
.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

.notifications .dropdown {
  padding: 0;
  min-width: 280px;
  max-width: calc(100vw - 32px);
}

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

/* Organization selector - hidden on mobile to save space */
.org-selector {
  display: none;
}

/* Hide username on mobile, show only avatar */
.user-menu .username-text {
  display: none;
}

/* ============================================
   LAYOUT - Mobile First
   ============================================ */
.layout {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--header-height));
  /* Add padding for bottom nav on mobile */
  padding-bottom: var(--bottom-nav-height);
}

/* Sidebar - Off-canvas on mobile */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: 280px;
  height: calc(100vh - var(--header-height));
  background: var(--surface);
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 99;
  overflow-y: auto;
  padding: var(--space-lg);
}

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

/* Sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 98;
}

.sidebar-overlay.visible {
  display: block;
}

/* Sidebar navigation */
.sidebar .nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.sidebar .nav a {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-sm);
  color: var(--muted);
  border: 1px solid transparent;
  min-height: var(--touch-target);
  font-size: 14px;
}

.sidebar .nav a.active {
  color: var(--primary-strong);
  border-color: var(--border);
  background: var(--surface-soft);
}

.sidebar .nav a:hover,
.sidebar .nav a:active {
  background: var(--surface-soft);
  color: var(--primary-strong);
}

.sidebar .nav a svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Main content */
.main {
  flex: 1;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  max-width: 100%;
  overflow-x: hidden;
}

/* ============================================
   BOTTOM NAVIGATION - Mobile Only
   ============================================ */
.bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  padding: 6px 4px;
  min-height: 52px;
}

.bottom-nav a.active {
  color: var(--primary);
}

.bottom-nav a:active {
  background: var(--surface-soft);
}

.bottom-nav a svg {
  width: 24px;
  height: 24px;
}

/* ============================================
   SECTION TITLES & TYPOGRAPHY
   ============================================ */
.section-title {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  font-weight: 700;
  font-size: 18px;
  color: var(--primary-strong);
}

.section-title .actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.muted-small {
  color: var(--muted);
  font-size: 12px;
}

.value {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
}

/* ============================================
   GRID SYSTEM - Responsive
   ============================================ */
.grid {
  display: grid;
  gap: var(--space-lg);
}

/* Single column on mobile */
.grid-4 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: 1fr; }

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.card h2 {
  margin: 0 0 var(--space-sm);
  font-size: 15px;
  color: var(--primary-strong);
}

/* ============================================
   BUTTONS - Touch Friendly
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: var(--touch-target);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,128,102,0.2);
}

.btn-primary:hover,
.btn-primary:active {
  background: var(--primary-strong);
}

.btn-ghost {
  background: var(--surface);
  color: var(--primary-strong);
  border-color: var(--border);
}

.btn-ghost:hover,
.btn-ghost:active {
  background: var(--surface-soft);
}

.btn-sm {
  min-height: 36px;
  padding: var(--space-xs) var(--space-md);
  font-size: 13px;
}

.btn-icon {
  width: var(--touch-target);
  padding: 0;
}

/* ============================================
   FORMS & INPUTS - Touch Friendly
   ============================================ */
.inputs {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin: var(--space-md) 0;
}

.input,
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="date"],
select,
textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  background: var(--surface);
  font-weight: 500;
  font-size: 16px; /* Prevents zoom on iOS */
  color: var(--text);
  min-height: var(--touch-target);
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
}

.input:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 128, 102, 0.1);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234f6a60' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* Form groups */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* ============================================
   TABLES - Responsive
   ============================================ */
.table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px; /* Force scroll on mobile */
}

th, td {
  padding: var(--space-md) var(--space-sm);
  border-bottom: 1px solid var(--border);
  text-align: left;
  color: var(--text);
  font-size: 13px;
}

th {
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover td,
.clickable-row:active td {
  background: var(--surface-soft);
}

/* Mobile card view for tables */
.mobile-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.mobile-card-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-lg);
}

.mobile-card-item .item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.mobile-card-item .item-title {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}

.mobile-card-item .item-subtitle {
  font-size: 12px;
  color: var(--muted);
}

.mobile-card-item .item-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

.mobile-card-item .stat {
  display: flex;
  flex-direction: column;
}

.mobile-card-item .stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
}

.mobile-card-item .stat-value {
  font-weight: 600;
  font-size: 14px;
}

/* ============================================
   PILLS & BADGES
   ============================================ */
.pill {
  display: inline-flex;
  align-items: center;
  padding: var(--space-xs) var(--space-md);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--primary-strong);
  font-weight: 600;
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.badge-success {
  background: rgba(22, 163, 74, 0.1);
  color: var(--success);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

/* ============================================
   HERO STATS CARDS (Dashboard)
   ============================================ */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  border-radius: 10px 0 0 10px;
}

.hero-card.revenue::before { background: linear-gradient(180deg, #16a34a 0%, #22c55e 100%); }
.hero-card.units::before { background: linear-gradient(180deg, #3b82f6 0%, #60a5fa 100%); }
.hero-card.top::before { background: linear-gradient(180deg, #f59e0b 0%, #fbbf24 100%); }
.hero-card.margin::before { background: linear-gradient(180deg, #8b5cf6 0%, #a78bfa 100%); }

.hero-card .label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.hero-card .value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.hero-card .sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.hero-card .change {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
}

.hero-card .change.positive { background: rgba(22, 163, 74, 0.1); color: #16a34a; }
.hero-card .change.negative { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.hero-card .change.neutral { background: var(--surface-soft); color: var(--text-muted); }

.hero-card .icon {
  position: absolute;
  right: var(--space-lg);
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.08;
}

/* ============================================
   PERIOD TABS
   ============================================ */
.period-tabs {
  display: flex;
  overflow-x: auto;
  gap: var(--space-xs);
  padding: var(--space-xs);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  -webkit-overflow-scrolling: touch;
}

.period-tab {
  padding: var(--space-sm) var(--space-md);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  min-height: 36px;
  display: flex;
  align-items: center;
}

.period-tab:hover,
.period-tab:active {
  background: var(--surface-soft);
  color: var(--text);
}

.period-tab.active {
  background: var(--primary);
  color: white;
}

/* ============================================
   CHARTS
   ============================================ */
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-lg);
}

.chart-card h3 {
  margin: 0 0 var(--space-lg);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.chart-card h3 svg {
  color: var(--text-muted);
  width: 18px;
  height: 18px;
}

.chart-container {
  position: relative;
  height: 250px;
  width: 100%;
}

/* ============================================
   TOP PRODUCTS LIST
   ============================================ */
.top-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-lg);
}

.top-card h3 {
  margin: 0 0 var(--space-lg);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.top-product-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  transition: background 0.15s;
  margin-bottom: var(--space-sm);
  cursor: pointer;
}

.top-product-item:hover,
.top-product-item:active {
  background: var(--surface-soft);
}

.top-product-item:last-child {
  margin-bottom: 0;
}

.top-product-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.top-product-rank.gold { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: white; }
.top-product-rank.silver { background: linear-gradient(135deg, #94a3b8, #64748b); color: white; }
.top-product-rank.bronze { background: linear-gradient(135deg, #d97706, #b45309); color: white; }

.top-product-info {
  flex: 1;
  min-width: 0;
}

.top-product-name {
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-product-sku {
  font-size: 12px;
  color: var(--text-muted);
  font-family: monospace;
}

.top-product-stats {
  text-align: right;
  flex-shrink: 0;
}

.top-product-revenue {
  font-weight: 600;
  font-size: 14px;
  color: #16a34a;
}

.top-product-units {
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================
   DAILY TABLE
   ============================================ */
.daily-table {
  margin-top: var(--space-lg);
  max-height: 200px;
  overflow-y: auto;
}

.daily-table table {
  width: 100%;
  min-width: auto;
  font-size: 13px;
}

.daily-table th {
  position: sticky;
  top: 0;
  background: var(--surface);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  color: var(--text-muted);
}

.empty-state svg {
  margin-bottom: var(--space-md);
  opacity: 0.4;
}

.empty-state h4 {
  margin: 0 0 var(--space-sm);
  color: var(--text);
  font-size: 16px;
}

.empty-state p {
  margin: 0;
  font-size: 13px;
}

/* ============================================
   DASHBOARD GRID
   ============================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

/* ============================================
   PRODUCT DETAIL
   ============================================ */
.product-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.product-image {
  width: 100%;
  max-width: 200px;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.product-info {
  flex: 1;
}

.product-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 var(--space-sm);
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  font-size: 13px;
  color: var(--muted);
}

/* ============================================
   FILTERS
   ============================================ */
.filters {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  flex: 1;
  min-width: 150px;
}

.filter-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-xs);
  flex-wrap: wrap;
  padding: var(--space-lg) 0;
}

.pagination a,
.pagination span {
  min-width: var(--touch-target);
  min-height: var(--touch-target);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
}

.pagination a:hover,
.pagination a:active {
  background: var(--surface-soft);
}

.pagination .current {
  background: var(--primary);
  color: white;
}

/* ============================================
   ALERTS & MESSAGES
   ============================================ */
.alert {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: var(--space-lg);
}

.alert-success {
  background: rgba(22, 163, 74, 0.1);
  color: #166534;
  border: 1px solid rgba(22, 163, 74, 0.2);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #92400e;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  color: #991b1b;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  color: #1e40af;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ============================================
   LOADING STATES
   ============================================ */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   UTILITIES
   ============================================ */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.font-mono { font-family: monospace; }
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hidden { display: none !important; }
.visible-mobile { display: block; }
.hidden-mobile { display: none; }

/* ============================================
   TABLET BREAKPOINT (768px+)
   ============================================ */
@media (min-width: 768px) {
  :root {
    --header-height: 70px;
  }

  header {
    padding: var(--space-lg) var(--space-xl);
  }

  .logo-mark {
    width: 56px;
    height: 36px;
  }

  .logo-title {
    font-size: 18px;
  }

  .user-menu .username-text {
    display: inline;
  }

  .org-selector button {
    max-width: 180px;
  }

  .main {
    padding: var(--space-xl);
  }

  .section-title {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  /* 2-column grids on tablet */
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .inputs {
    grid-template-columns: repeat(2, 1fr);
  }

  .filters {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .product-header {
    flex-direction: row;
    align-items: flex-start;
  }

  .visible-mobile { display: none; }
  .hidden-mobile { display: block; }
}

/* ============================================
   DESKTOP BREAKPOINT (1024px+)
   ============================================ */
@media (min-width: 1024px) {
  /* Hide hamburger on desktop */
  .menu-toggle {
    display: none;
  }

  /* Show top nav on desktop */
  nav.top-nav {
    display: flex;
    gap: var(--space-md);
    margin-left: var(--space-lg);
  }

  nav.top-nav a {
    font-size: 14px;
    color: var(--muted);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
  }

  nav.top-nav a.active {
    color: var(--primary-strong);
    background: var(--surface-soft);
  }

  nav.top-nav a:hover {
    background: var(--surface-soft);
    color: var(--primary-strong);
  }

  /* Layout with visible sidebar */
  .layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    padding-bottom: 0;
  }

  /* Sidebar always visible on desktop */
  .sidebar {
    position: static;
    transform: none;
    height: auto;
    min-height: calc(100vh - var(--header-height));
  }

  .sidebar-overlay {
    display: none !important;
  }

  /* Hide bottom nav on desktop */
  .bottom-nav {
    display: none;
  }

  .main {
    padding: var(--space-lg) var(--space-xl);
    gap: var(--space-lg);
    min-width: 0; /* Prevent overflow */
  }

  /* Full grids on desktop */
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }

  .hero-stats {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
  }

  .dashboard-grid {
    grid-template-columns: 1.5fr 1fr;
  }

  .inputs {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .chart-container {
    height: 300px;
  }
}

/* ============================================
   LARGE DESKTOP (1400px+)
   ============================================ */
@media (min-width: 1400px) {
  .layout {
    grid-template-columns: 280px 1fr;
  }

  .main {
    padding: var(--space-2xl) 48px;
  }

  .hero-stats {
    gap: var(--space-lg);
  }

  .hero-card {
    padding: var(--space-lg) var(--space-xl);
  }

  .hero-card .value {
    font-size: 26px;
  }
}

/* ============================================
   EXTRA LARGE DESKTOP (1800px+)
   ============================================ */
@media (min-width: 1800px) {
  .layout {
    grid-template-columns: 300px 1fr;
  }

  .main {
    padding: var(--space-2xl) 64px;
  }

  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-xl);
  }

  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
  }
}

/* ============================================
   USER PREFERENCE CLASSES
   ============================================ */

/* Hide sidebar on desktop when user prefers */
body.sidebar-hidden .sidebar {
  display: none;
}

body.sidebar-hidden .layout {
  grid-template-columns: 1fr;
}

/* Hide top nav when user prefers */
body.topnav-hidden nav.top-nav {
  display: none !important;
}

/* Compact mode */
body.compact-mode {
  --space-xs: 2px;
  --space-sm: 4px;
  --space-md: 8px;
  --space-lg: 12px;
  --space-xl: 16px;
  --space-2xl: 24px;
}

body.compact-mode .card {
  padding: var(--space-md);
}

body.compact-mode .hero-card {
  padding: var(--space-md);
}

body.compact-mode .hero-card .value {
  font-size: 20px;
}

body.compact-mode th,
body.compact-mode td {
  padding: var(--space-sm);
}

/* ============================================
   LANDING PAGE STYLES
   ============================================ */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-xl);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.navbar .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.navbar .logo .logo-icon {
  flex-shrink: 0;
  border-radius: 10px;
}

.navbar .logo .logo-text {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-links .btn {
  padding: 10px 20px;
  font-size: 14px;
  min-height: auto;
  border-radius: 8px;
}

.nav-links .btn:hover {
  color: white;
}

/* Mobile menu */
@media (max-width: 1023px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    flex-direction: column;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    gap: var(--space-md);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links a {
    padding: var(--space-md);
    width: 100%;
    text-align: center;
  }

  .navbar {
    position: relative;
  }

  .navbar .container {
    flex-wrap: wrap;
  }
}

/* Hero section */
.hero {
  padding: 80px var(--space-xl);
  text-align: center;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
}

.hero .container {
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 42px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 var(--space-lg);
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--muted);
  margin: 0 0 var(--space-2xl);
}

.btn-lg {
  padding: var(--space-lg) var(--space-2xl);
  font-size: 16px;
  min-height: 52px;
}

/* Features section */
.features {
  padding: 80px var(--space-xl);
  background: var(--bg);
}

.features .container {
  max-width: 1200px;
  margin: 0 auto;
}

.features h2 {
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 48px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-xl);
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-xl);
  text-align: center;
}

.feature-card h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-strong);
  margin: 0 0 var(--space-md);
}

.feature-card p {
  color: var(--muted);
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}

/* Footer */
footer {
  padding: var(--space-xl);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

footer .container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-lg);
}

footer p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
}

.footer-links a {
  color: var(--muted);
  font-size: 13px;
}

.footer-links a:hover {
  color: var(--primary);
}

/* Auth pages */
.auth-section {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 var(--space-xl);
  text-align: center;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.auth-form .form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.auth-form label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.btn-block {
  width: 100%;
}

.auth-links {
  text-align: center;
  margin-top: var(--space-lg);
  font-size: 14px;
  color: var(--muted);
}

.auth-links a {
  color: var(--primary);
  font-weight: 500;
}

.auth-note {
  margin-top: var(--space-lg);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* Pricing page */
.pricing-section {
  padding: 60px var(--space-xl);
  background: var(--bg);
  min-height: calc(100vh - 200px);
}

.pricing-section .container {
  max-width: 1200px;
  margin: 0 auto;
}

.pricing-section h1 {
  text-align: center;
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 var(--space-md);
}

.pricing-subtitle {
  text-align: center;
  font-size: 16px;
  color: var(--muted);
  margin: 0 0 48px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-xl);
  max-width: 1000px;
  margin: 0 auto;
}

.pricing-grid-2 {
  grid-template-columns: repeat(2, 1fr);
  max-width: 700px;
}

@media (max-width: 600px) {
  .pricing-grid-2 {
    grid-template-columns: 1fr;
  }
}

.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  text-align: center;
  position: relative;
}

.pricing-card.featured {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.pricing-card .badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  padding: 4px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.pricing-card h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 var(--space-md);
}

.pricing-card .price {
  font-size: 36px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: var(--space-xl);
}

.pricing-card .price span {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.features-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-xl);
  text-align: left;
}

.features-list li {
  padding: var(--space-sm) 0;
  color: var(--text);
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.features-list li:last-child {
  border-bottom: none;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

/* Legal pages */
.legal-section {
  padding: 60px var(--space-xl);
  background: var(--bg);
}

.legal-section .container {
  max-width: 800px;
  margin: 0 auto;
}

.legal-section h1 {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 var(--space-2xl);
}

.legal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-2xl);
}

.legal-content h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-strong);
  margin: var(--space-xl) 0 var(--space-md);
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content p {
  color: var(--text);
  line-height: 1.7;
  margin: 0 0 var(--space-md);
}

/* ============================================
   RESPONSIVE LANDING - All Devices
   ============================================ */

/* Large Desktop (1400px+) */
@media (min-width: 1400px) {
  .hero h1 {
    font-size: 52px;
  }

  .hero-subtitle {
    font-size: 20px;
  }

  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2xl);
  }

  .pricing-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Desktop (1024px - 1399px) */
@media (min-width: 1024px) and (max-width: 1399px) {
  .hero h1 {
    font-size: 42px;
  }

  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Tablet Landscape (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .navbar .container {
    padding: 0 var(--space-lg);
  }

  .hero {
    padding: 60px var(--space-xl);
  }

  .hero h1 {
    font-size: 36px;
  }

  .hero-subtitle {
    font-size: 17px;
  }

  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }

  .features {
    padding: 60px var(--space-xl);
  }

  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }

  .pricing-card:last-child {
    grid-column: 1 / -1;
    max-width: 400px;
    margin: 0 auto;
  }
}

/* Tablet Portrait & Large Mobile (481px - 767px) */
@media (min-width: 481px) and (max-width: 767px) {
  .navbar {
    padding: var(--space-md) var(--space-lg);
  }

  .navbar .logo .logo-text {
    font-size: 16px;
  }

  .nav-links a:not(.btn) {
    display: none;
  }

  .hero {
    padding: 50px var(--space-lg);
  }

  .hero h1 {
    font-size: 30px;
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: 15px;
  }

  .features {
    padding: 50px var(--space-lg);
  }

  .features h2 {
    font-size: 26px;
    margin-bottom: 32px;
  }

  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  .feature-card {
    padding: var(--space-lg);
  }

  .pricing-section {
    padding: 50px var(--space-lg);
  }

  .pricing-section h1 {
    font-size: 28px;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
  }

  .auth-section {
    padding: var(--space-xl);
  }

  .auth-card {
    padding: var(--space-xl);
  }

  .legal-section {
    padding: 40px var(--space-lg);
  }

  footer {
    padding: var(--space-lg);
  }

  footer .container {
    flex-direction: column;
    text-align: center;
    gap: var(--space-md);
  }
}

/* Mobile (up to 480px) */
@media (max-width: 480px) {
  .navbar {
    padding: var(--space-sm) var(--space-md);
  }

  .navbar .logo .logo-icon {
    width: 32px;
    height: 32px;
  }

  .navbar .logo .logo-text {
    font-size: 14px;
  }

  .navbar .logo {
    gap: 8px;
  }

  .nav-links {
    gap: var(--space-sm);
  }

  .nav-links a:not(.btn) {
    display: none;
  }

  .nav-links .btn {
    padding: var(--space-sm) var(--space-md);
    font-size: 13px;
    min-height: 38px;
  }

  .hero {
    padding: 40px var(--space-md);
  }

  .hero h1 {
    font-size: 24px;
    line-height: 1.3;
  }

  .hero-subtitle {
    font-size: 15px;
    margin-bottom: var(--space-xl);
  }

  .btn-lg {
    padding: var(--space-md) var(--space-lg);
    font-size: 14px;
    min-height: 46px;
    width: 100%;
  }

  .features {
    padding: 40px var(--space-md);
  }

  .features h2 {
    font-size: 22px;
    margin-bottom: 24px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .feature-card {
    padding: var(--space-lg);
  }

  .feature-card h3 {
    font-size: 16px;
  }

  .feature-card p {
    font-size: 13px;
  }

  .pricing-section {
    padding: 40px var(--space-md);
  }

  .pricing-section h1 {
    font-size: 24px;
  }

  .pricing-subtitle {
    font-size: 14px;
    margin-bottom: 32px;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .pricing-card {
    padding: var(--space-xl);
  }

  .pricing-card h3 {
    font-size: 20px;
  }

  .pricing-card .price {
    font-size: 30px;
  }

  .auth-section {
    padding: var(--space-lg);
    min-height: calc(100vh - 160px);
  }

  .auth-card {
    padding: var(--space-xl);
    border-radius: var(--radius);
  }

  .auth-card h1 {
    font-size: 22px;
  }

  .legal-section {
    padding: 32px var(--space-md);
  }

  .legal-section h1 {
    font-size: 24px;
  }

  .legal-content {
    padding: var(--space-lg);
  }

  .legal-content h2 {
    font-size: 16px;
  }

  .legal-content p {
    font-size: 14px;
  }

  footer {
    padding: var(--space-lg) var(--space-md);
  }

  footer .container {
    flex-direction: column;
    text-align: center;
    gap: var(--space-md);
  }

  footer p {
    font-size: 12px;
  }

  .footer-links {
    gap: var(--space-md);
  }

  .footer-links a {
    font-size: 12px;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  header,
  .sidebar,
  .bottom-nav,
  .menu-toggle,
  .btn {
    display: none !important;
  }

  .layout {
    display: block;
  }

  .main {
    padding: 0;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* ============================================
   DARK MODE
   ============================================ */
body.dark-mode {
  --bg: #0f1419;
  --surface: #1a2129;
  --surface-soft: #232d38;
  --surface-hover: #2d3a47;
  --border: #3d4a57;
  --primary: #00b894;
  --primary-strong: #00cca3;
  --accent: #1dd1a1;
  --text: #e8eaed;
  --text-muted: #9aa5b1;
  --muted: #9aa5b1;
  --danger: #ff6b6b;
  --warning: #ffc107;
  --success: #2ed573;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
}

body.dark-mode .logo svg path {
  fill: var(--primary);
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
  background: var(--surface-soft);
  border-color: var(--border);
  color: var(--text);
}

body.dark-mode input:focus,
body.dark-mode select:focus,
body.dark-mode textarea:focus {
  border-color: var(--primary);
  background: var(--surface);
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
  color: var(--text-muted);
}

body.dark-mode .btn-ghost {
  background: var(--surface-soft);
  color: var(--text);
  border-color: var(--border);
}

body.dark-mode .btn-ghost:hover {
  background: var(--surface-hover);
}

body.dark-mode .card {
  background: var(--surface);
  border-color: var(--border);
}

body.dark-mode .table th {
  background: var(--surface-soft);
  border-color: var(--border);
}

body.dark-mode .table td {
  border-color: var(--border);
}

body.dark-mode .table tr:hover td {
  background: var(--surface-soft);
}

body.dark-mode .sidebar {
  background: var(--surface);
  border-color: var(--border);
}

body.dark-mode .sidebar .nav a {
  color: var(--text-muted);
}

body.dark-mode .sidebar .nav a:hover,
body.dark-mode .sidebar .nav a.active {
  background: var(--surface-soft);
  color: var(--primary);
}

body.dark-mode .bottom-nav {
  background: var(--surface);
  border-color: var(--border);
}

body.dark-mode .bottom-nav a {
  color: var(--text-muted);
}

body.dark-mode .bottom-nav a.active {
  color: var(--primary);
}

body.dark-mode .modal-content {
  background: var(--surface);
  border-color: var(--border);
}

body.dark-mode .stats-card {
  background: var(--surface);
  border-color: var(--border);
}

body.dark-mode .tag {
  background: var(--surface-soft);
  color: var(--text-muted);
}

body.dark-mode .tag.success {
  background: rgba(46, 213, 115, 0.2);
  color: var(--success);
}

body.dark-mode .tag.danger {
  background: rgba(255, 107, 107, 0.2);
  color: var(--danger);
}

body.dark-mode .tag.warning {
  background: rgba(255, 193, 7, 0.2);
  color: var(--warning);
}

body.dark-mode header {
  background: var(--surface);
  border-color: var(--border);
}

body.dark-mode .menu-toggle {
  background: var(--surface-soft);
  color: var(--primary);
}

body.dark-mode .top-nav a {
  color: var(--text-muted);
}

body.dark-mode .top-nav a:hover,
body.dark-mode .top-nav a.active {
  color: var(--primary);
}

body.dark-mode .dropdown-menu {
  background: var(--surface);
  border-color: var(--border);
}

body.dark-mode .dropdown-item {
  color: var(--text);
}

body.dark-mode .dropdown-item:hover {
  background: var(--surface-soft);
}

body.dark-mode .form-label {
  color: var(--text);
}

body.dark-mode .form-hint {
  color: var(--text-muted);
}

body.dark-mode .section-title {
  color: var(--text);
}

body.dark-mode .empty-state {
  color: var(--text-muted);
}

body.dark-mode .breadcrumb a {
  color: var(--text-muted);
}

body.dark-mode .breadcrumb span {
  color: var(--text);
}

body.dark-mode .notification-item {
  background: var(--surface);
  border-color: var(--border);
}

body.dark-mode .notification-item.unread {
  background: var(--surface-soft);
}

body.dark-mode .metric-card {
  background: var(--surface);
  border-color: var(--border);
}

body.dark-mode .tabs .tab {
  color: var(--text-muted);
}

body.dark-mode .tabs .tab.active {
  color: var(--primary);
  border-color: var(--primary);
}

body.dark-mode .filter-btn {
  background: var(--surface-soft);
  color: var(--text-muted);
  border-color: var(--border);
}

body.dark-mode .filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

body.dark-mode .chart-container {
  background: var(--surface);
}

body.dark-mode ::selection {
  background: var(--primary);
  color: white;
}
