/* ============================================
   PRO E-COMMERCE ORDER MANAGEMENT SYSTEM
   Premium Dark Theme Design System
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Custom Properties ── */
:root {
  /* Colors */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.8);
  --bg-card-hover: rgba(30, 41, 59, 0.9);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --bg-glass-hover: rgba(255, 255, 255, 0.08);
  --bg-input: rgba(255, 255, 255, 0.06);
  --bg-sidebar: rgba(10, 14, 26, 0.95);
  --bg-modal-overlay: rgba(0, 0, 0, 0.6);

  /* Accent */
  --accent-primary: #6366f1;
  --accent-primary-light: #818cf8;
  --accent-primary-dark: #4f46e5;
  --accent-secondary: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa);
  --accent-gradient-hover: linear-gradient(135deg, #4f46e5, #7c3aed, #8b5cf6);

  /* Status Colors */
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.12);

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;

  /* Borders */
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-hover: rgba(255, 255, 255, 0.15);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);
  --shadow-glow-strong: 0 0 60px rgba(99, 102, 241, 0.25);

  /* Sidebar */
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-index */
  --z-sidebar: 100;
  --z-header: 90;
  --z-modal: 200;
  --z-toast: 300;
  --z-dropdown: 150;
}

/* ── Reset & Base ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Background pattern */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(59, 130, 246, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--accent-primary-light); text-decoration: none; }
a:hover { color: var(--accent-primary); }

img { max-width: 100%; display: block; }

input, select, textarea, button {
  font-family: inherit;
  font-size: inherit;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── LOGIN SCREEN ── */
.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  overflow: hidden;
}

.login-bg-decoration {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.blob {
  position: absolute;
  width: 500px;
  height: 500px;
  background: var(--accent-gradient);
  filter: blur(80px);
  opacity: 0.15;
  border-radius: 50%;
  animation: blob-float 20s infinite alternate cubic-bezier(0.45, 0, 0.55, 1);
}

.blob-1 { top: -100px; left: -100px; background: var(--accent-primary); }
.blob-2 { bottom: -100px; right: -100px; background: var(--accent-secondary); animation-delay: -5s; }
.blob-3 { top: 50%; left: 50%; transform: translate(-50%, -50%); background: var(--info); opacity: 0.08; width: 600px; height: 600px; }

@keyframes blob-float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, 60px) scale(1.1); }
}

.login-container {
  width: 440px;
  max-width: 90vw;
  animation: login-appear 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes login-appear {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-header {
  margin-bottom: var(--space-xl);
}

.login-logo {
  width: 80px;
  height: 80px;
  background: var(--accent-gradient);
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-lg);
  font-size: 36px;
  box-shadow: 0 10px 40px rgba(99, 102, 241, 0.4);
  transform: rotate(-5deg);
  transition: transform 0.3s ease;
}

.login-logo:hover {
  transform: rotate(0deg) scale(1.05);
}

.login-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(to bottom, #fff, #94a3b8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: var(--space-xs);
}

.login-card {
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  padding: var(--space-2xl) var(--space-xl);
  backdrop-filter: blur(30px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.login-card-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.login-card-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.login-card-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.input-wrapper input {
  padding-left: 42px !important;
}

.input-wrapper input:focus + .input-icon {
  opacity: 1;
}

.forgot-link {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-primary-light);
  transition: color 0.2s;
}

.forgot-link:hover {
  color: white;
}

.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: var(--space-lg);
  height: 52px;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: var(--space-xl) 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1px;
}

.login-divider::before, .login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.demo-account-btn {
  height: auto;
  padding: 12px;
  flex-direction: row;
  justify-content: flex-start;
  text-align: left;
  background: rgba(255,255,255,0.03);
}

.demo-account-btn.premium {
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(99, 102, 241, 0.05);
}

.demo-icon {
  font-size: 1.2rem;
  min-width: 32px;
}

.demo-text {
  display: flex;
  flex-direction: column;
}

.demo-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.demo-role {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.demo-dropdown-container {
  position: relative;
}

.demo-dropdown-trigger {
  width: 100%;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  padding: 10px;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s;
}

.demo-dropdown-trigger:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.demo-dropdown-content {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  margin-bottom: 10px;
  background: #1a1f2e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 10;
  max-height: 200px;
  overflow-y: auto;
}

.demo-dropdown-container:hover .demo-dropdown-content {
  display: block;
}

.demo-list-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.demo-list-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.demo-list-item .divider {
  padding: 8px 12px;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.login-footer {
  margin-top: var(--space-2xl);
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ── APP LAYOUT ── */
.app-wrapper {
  display: none;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.app-wrapper.active {
  display: flex;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  z-index: var(--z-sidebar);
  transition: width var(--transition-slow);
  overflow: hidden;
}

.sidebar-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  min-height: 72px;
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  min-width: 40px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-glow);
}

.sidebar-brand {
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-brand h2 {
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-brand p {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-md) var(--space-sm);
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: var(--space-md) var(--space-md) var(--space-sm);
  white-space: nowrap;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 11px var(--space-md);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  margin-bottom: 2px;
  white-space: nowrap;
  position: relative;
  user-select: none;
}

.nav-item:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary-light);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent-gradient);
  border-radius: 0 3px 3px 0;
}

.nav-item .icon {
  font-size: 1.2rem;
  min-width: 24px;
  text-align: center;
}

.nav-item .badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  min-width: 20px;
  text-align: center;
}

/* Sidebar footer */
.sidebar-footer {
  padding: var(--space-md);
  border-top: 1px solid var(--border-color);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-sm);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
}

.sidebar-user:hover {
  background: var(--bg-glass-hover);
}

.user-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
}

.user-info {
  overflow: hidden;
  white-space: nowrap;
}

.user-info .name {
  font-size: 0.9rem;
  font-weight: 600;
}

.user-info .role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.logout-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.logout-btn:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

/* ── MAIN CONTENT ── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left var(--transition-slow);
}

.page-header {
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  background: rgba(10, 14, 26, 0.5);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: var(--z-header);
}

.page-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.page-header-left h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

.page-header-left p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.hamburger-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
}

.hamburger-btn:hover {
  background: var(--bg-glass-hover);
}

.page-header-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.header-search {
  position: relative;
}

.header-search input {
  padding: 9px 16px 9px 38px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  width: 240px;
  outline: none;
  transition: var(--transition-fast);
  font-size: 0.9rem;
}

.header-search input:focus {
  border-color: var(--accent-primary);
  width: 300px;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.header-search .search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.notification-btn {
  position: relative;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}

.notification-btn:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
}

.notification-btn .notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  background: var(--danger);
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-primary);
}

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

/* ── PAGE (show/hide) ── */
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── STAT CARDS ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  backdrop-filter: blur(10px);
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.stat-card:hover {
  border-color: var(--border-color-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card .stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.stat-card .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.stat-card .stat-icon.blue { background: var(--info-bg); }
.stat-card .stat-icon.green { background: var(--success-bg); }
.stat-card .stat-icon.yellow { background: var(--warning-bg); }
.stat-card .stat-icon.red { background: var(--danger-bg); }
.stat-card .stat-icon.purple { background: rgba(139, 92, 246, 0.12); }

.stat-card .stat-change {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.stat-change.up { color: var(--success); background: var(--success-bg); }
.stat-change.down { color: var(--danger); background: var(--danger-bg); }

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 2px;
}

.stat-card .stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ── CHARTS ── */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  backdrop-filter: blur(10px);
}

.chart-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.chart-container {
  position: relative;
  height: 280px;
}

/* ── DATA TABLE ── */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.table-header {
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.table-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.table-search {
  padding: 8px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  font-size: 0.88rem;
  transition: var(--transition-fast);
  width: 200px;
}

.table-search:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.15);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition-fast);
}

tbody tr:hover {
  background: var(--bg-glass-hover);
}

tbody tr:last-child {
  border-bottom: none;
}

tbody td {
  padding: 12px 16px;
  font-size: 0.9rem;
  white-space: nowrap;
}

.table-footer {
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.pagination {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.pagination button {
  padding: 6px 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: 0.85rem;
}

.pagination button:hover,
.pagination button.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── BADGES & TAGS ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge.success { background: var(--success-bg); color: var(--success); }
.badge.warning { background: var(--warning-bg); color: var(--warning); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.purple { background: rgba(139, 92, 246, 0.12); color: #a78bfa; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  border: none;
}

.btn-primary:hover {
  background: var(--accent-gradient-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

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

.btn-secondary:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
  border-color: var(--border-color-hover);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

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

.btn-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

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

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-icon:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-modal-overlay);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-base);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 520px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: var(--transition-base);
  box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

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

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-glass-hover);
}

.modal-body {
  padding: var(--space-lg);
}

.modal-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
}

/* ── FORMS ── */
.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  transition: var(--transition-fast);
  font-size: 0.92rem;
}

.form-control:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-control::placeholder {
  color: var(--text-muted);
}

select.form-control {
  appearance: none;
  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='%2394a3b8' 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;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

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

/* ── TOAST NOTIFICATIONS ── */
.toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 14px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 320px;
  max-width: 420px;
  animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transition: var(--transition-base);
}

.toast.success { border-left: 3px solid var(--success); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.danger { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--info); }

.toast .toast-icon {
  font-size: 1.2rem;
  min-width: 24px;
}

.toast .toast-content {
  flex: 1;
}

.toast .toast-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.toast .toast-message {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.toast .toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 2px;
}

.toast-exit {
  animation: slideOutRight 0.3s ease forwards;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* ── KANBAN BOARD ── */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.kanban-column {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  min-height: 400px;
  display: flex;
  flex-direction: column;
}

.kanban-column-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kanban-column-header h4 {
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.kanban-column-header .count {
  background: var(--bg-glass);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.kanban-column.pending .kanban-column-header { border-top: 3px solid var(--warning); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.kanban-column.in-progress .kanban-column-header { border-top: 3px solid var(--info); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.kanban-column.completed .kanban-column-header { border-top: 3px solid var(--success); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }

.kanban-cards {
  padding: var(--space-md);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  overflow-y: auto;
}

.kanban-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  cursor: pointer;
  transition: var(--transition-fast);
}

.kanban-card:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-color-hover);
  transform: translateY(-1px);
}

.kanban-card .card-platform {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-primary-light);
  margin-bottom: var(--space-xs);
}

.kanban-card .card-title {
  font-size: 0.92rem;
  font-weight: 500;
  margin-bottom: var(--space-sm);
}

.kanban-card .card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.kanban-card .card-progress {
  margin-top: var(--space-sm);
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: var(--space-xs);
}

.progress-bar .progress-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

/* ── UPLOAD ZONE ── */
.upload-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  text-align: center;
  cursor: pointer;
  transition: var(--transition-base);
  background: var(--bg-glass);
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.05);
}

.upload-zone .upload-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.upload-zone h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.upload-zone p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.upload-zone .browse-link {
  color: var(--accent-primary-light);
  text-decoration: underline;
  cursor: pointer;
}

/* Bill preview cards */
.bill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.bill-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition-fast);
}

.bill-card:hover {
  border-color: var(--border-color-hover);
}

.bill-card .bill-preview {
  height: 140px;
  background: var(--bg-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  opacity: 0.3;
  overflow: hidden;
}

.bill-card .bill-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
}

.bill-card .bill-info {
  padding: var(--space-md);
}

.bill-card .bill-info h4 {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.bill-card .bill-info p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.bill-card .bill-status {
  padding: var(--space-sm) var(--space-md);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── ACTIVITY FEED ── */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition-fast);
}

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

.activity-item:hover {
  background: var(--bg-glass);
  margin: 0 calc(-1 * var(--space-md));
  padding-left: var(--space-md);
  padding-right: var(--space-md);
  border-radius: var(--radius-md);
}

.activity-dot {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.activity-dot.upload { background: var(--info-bg); }
.activity-dot.task { background: var(--success-bg); }
.activity-dot.order { background: var(--warning-bg); }
.activity-dot.alert { background: var(--danger-bg); }

.activity-text {
  flex: 1;
}

.activity-text p {
  font-size: 0.9rem;
}

.activity-text p strong {
  color: var(--text-primary);
}

.activity-time {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── FILTER BAR ── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.filter-chip {
  padding: 7px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition-fast);
  user-select: none;
}

.filter-chip:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
}

.filter-chip.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary-light);
  border-color: rgba(99, 102, 241, 0.3);
}

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

.empty-state .empty-icon {
  font-size: 4rem;
  margin-bottom: var(--space-md);
  opacity: 0.3;
}

.empty-state h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.empty-state p {
  font-size: 0.9rem;
  max-width: 400px;
  margin: 0 auto;
}

/* ── OCR RESULT ── */
.ocr-result {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-top: var(--space-lg);
}

.ocr-result h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

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

.ocr-field {
  background: var(--bg-glass);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.ocr-field label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: var(--space-xs);
}

.ocr-field .value {
  font-size: 1rem;
  font-weight: 600;
}

/* ── PROCESSING INDICATOR ── */
.processing-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 250;
  align-items: center;
  justify-content: center;
}

.processing-overlay.active {
  display: flex;
}

.processing-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-xl) var(--space-2xl);
  text-align: center;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto var(--space-md);
}

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

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .charts-grid { grid-template-columns: 1fr; }
  .kanban-board { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .main-content {
    margin-left: 0 !important;
  }

  .hamburger-btn {
    display: block;
  }

  .page-body {
    padding: var(--space-md);
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .header-search input {
    width: 160px;
  }

  .header-search input:focus {
    width: 200px;
  }

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

  .ocr-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .page-header {
    padding: var(--space-md);
  }

  .filter-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: var(--space-sm);
  }
}

/* ── NOTIFICATION PANEL ── */
.notif-panel {
  position: fixed;
  top: 0;
  right: -380px;
  width: 380px;
  height: 100vh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  z-index: var(--z-modal);
  transition: right var(--transition-slow);
  display: flex;
  flex-direction: column;
}

.notif-panel.open {
  right: 0;
  box-shadow: -10px 0 30px rgba(0,0,0,0.3);
}

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

.notif-panel-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.notif-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
}

.notif-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  transition: var(--transition-fast);
  cursor: pointer;
}

.notif-item:hover {
  background: var(--bg-glass-hover);
}

.notif-item.unread {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
}

.notif-item .notif-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.notif-text {
  flex: 1;
}

.notif-text p {
  font-size: 0.88rem;
  line-height: 1.4;
}

.notif-text .notif-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Quick switch hidden class */
.hidden { display: none !important; }
