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

:root {
  --color-primary: #1a56db;
  --color-primary-dark: #1e40af;
  --color-primary-light: #3b82f6;
  --color-primary-lighter: #dbeafe;
  --color-accent: #06b6d4;
  --color-accent-dark: #0891b2;
  --color-success: #059669;
  --color-success-light: #d1fae5;
  --color-warning: #d97706;
  --color-warning-light: #fef3c7;
  --color-error: #dc2626;
  --color-error-light: #fee2e2;
  --color-info: #2563eb;
  --color-info-light: #dbeafe;
  --bg-body: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-sidebar: linear-gradient(180deg, #0f172a 0%, #1e3a5f 100%);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-on-primary: #ffffff;
  --text-sidebar: #cbd5e1;
  --text-sidebar-active: #ffffff;
  --border-color: #e2e8f0;
  --border-color-light: #f1f5f9;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.05);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.05);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;
  --sidebar-width: 270px;
  --sidebar-collapsed-width: 0px;
  --header-height: 64px;
}

[data-theme='dark'] {
  --bg-body: #0f172a;
  --bg-surface: #1e293b;
  --bg-card: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --border-color: #334155;
  --border-color-light: #1e293b;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.2);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.35);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.4);
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-body);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* 2. Layout */
#app {
  display: flex;
  min-height: 100vh;
}

#sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  z-index: 1000;
  transition: transform var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.nav-section-title {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 2px;
  color: var(--text-muted);
  padding: 12px 24px 8px;
  margin-top: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: var(--text-sidebar);
  text-decoration: none;
  transition: all var(--transition-fast);
  margin: 2px 12px;
  border-radius: var(--radius-md);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  font-weight: 600;
  border-left: 3px solid var(--color-accent);
}

.nav-item .nav-icon {
  margin-right: 12px;
  font-size: 1.1rem;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--color-accent);
  color: white;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-sidebar);
  font-size: 0.85rem;
}

#main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition-normal);
  min-width: 0;
}

#header {
  height: var(--header-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  justify-content: space-between;
}

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

.header-title {
  font-weight: 600;
  font-size: 1.1rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-balance {
  background: var(--color-primary-lighter);
  color: var(--color-primary);
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.85rem;
}

#main-content {
  padding: 24px;
  flex: 1;
}

.hamburger-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-primary);
  cursor: pointer;
}

/* 3. Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

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

.card-body {
  padding: 24px;
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-body);
}

.stat-card {
  text-align: center;
  padding: 24px;
}

.stat-card .stat-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  color: var(--color-primary);
}

.stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-card .stat-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

.product-card {
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card .product-category {
  font-size: 0.75rem;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.product-card .product-name {
  font-weight: 600;
  margin: 8px 0;
  font-size: 0.95rem;
  line-height: 1.4;
  flex: 1;
}

.product-card .product-price {
  color: var(--color-primary);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.product-card .product-meta {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

/* 4. Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  text-decoration: none;
  line-height: 1.5;
}

.btn:active {
  transform: scale(0.97);
}

.btn:hover {
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

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

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

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

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

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

.btn-warning {
  background: var(--color-warning);
  color: white;
}
.btn-warning:hover {
  background: #b45309;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--bg-body);
  color: var(--text-primary);
}

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

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
}

/* 5. Forms */
.form-group {
  margin-bottom: 20px;
}

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

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  background: var(--bg-surface);
  color: var(--text-primary);
  transition: all var(--transition-fast);
  font-family: inherit;
}

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

.form-input:disabled, .form-select:disabled, .form-textarea:disabled {
  background: var(--bg-body);
  cursor: not-allowed;
  opacity: 0.7;
}

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

.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-error {
  color: var(--color-error);
  font-size: 0.78rem;
  margin-top: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.input-group {
  display: flex;
}

.input-group .form-input {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.input-group .input-group-append {
  padding: 10px 14px;
  background: var(--bg-body);
  border: 1.5px solid var(--border-color);
  border-left: 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  display: flex;
  align-items: center;
  color: var(--text-secondary);
}

/* 6. Tables */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

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

.table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--bg-body);
  border-bottom: 2px solid var(--border-color);
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color-light);
  font-size: 0.875rem;
  vertical-align: middle;
}

.table tbody tr:hover {
  background: rgba(26,86,219,0.03);
}

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

/* 7. Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-success {
  background: var(--color-success-light);
  color: var(--color-success);
}

.badge-warning {
  background: var(--color-warning-light);
  color: var(--color-warning);
}

.badge-error {
  background: var(--color-error-light);
  color: var(--color-error);
}

.badge-info {
  background: var(--color-info-light);
  color: var(--color-info);
}

.badge-default {
  background: var(--bg-body);
  color: var(--text-muted);
}

.badge-primary {
  background: var(--color-primary-lighter);
  color: var(--color-primary);
}

/* 8. Modal */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

#modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95);
  transition: transform var(--transition-normal);
}

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

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

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

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background var(--transition-fast);
}

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

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* 9. Toast */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 300px;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease forwards;
  opacity: 1;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: auto;
}

.toast.removing {
  opacity: 0;
  transform: translateX(100%);
}

.toast-success { background: #059669; }
.toast-error { background: #dc2626; }
.toast-warning { background: #d97706; }
.toast-info { background: #2563eb; }

/* 10. Loading */
#loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5000;
}

#loading-overlay.active {
  display: flex;
}

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

[data-theme='dark'] #loading-overlay {
  background: rgba(15,23,42,0.8);
}

/* 11. Grid */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* 12. Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-primary { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-error { color: var(--color-error); }
.text-warning { color: var(--color-warning); }
.text-muted { color: var(--text-muted); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.m-0 { margin: 0; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 32px; }
.ml-auto { margin-left: auto; }

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.align-center { align-items: center; }

.gap-1 { gap: 8px; } .gap-2 { gap: 16px; } .gap-3 { gap: 24px; }

.hidden { display: none !important; }
.block { display: block; }
.w-full { width: 100%; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 13. Animations */
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.animate-fade-in { animation: fadeIn 0.3s ease; }
.animate-slide-up { animation: slideUp 0.4s ease; }

/* 14. Page-specific styles */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.hero-section {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
  border-radius: var(--radius-xl);
  padding: 40px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.hero-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.hero-subtitle {
  font-size: 1rem;
  opacity: 0.85;
  margin-bottom: 24px;
}

.hero-stats {
  display: flex;
  gap: 32px;
}

.hero-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.hero-stat-label {
  font-size: 0.8rem;
  opacity: 0.75;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.category-card {
  text-align: center;
  padding: 20px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.category-card:hover {
  border-color: var(--color-primary-light);
  transform: translateY(-2px);
}

.category-card.active {
  border-color: var(--color-primary);
  background: var(--color-primary-lighter);
}

.category-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.category-name {
  font-weight: 600;
  font-size: 0.85rem;
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.search-box input {
  padding-left: 40px;
}

.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-chip {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--border-color);
  background: transparent;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-weight: 500;
  color: var(--text-primary);
}

.filter-chip:hover, .filter-chip.active {
  border-color: var(--color-primary);
  background: var(--color-primary-lighter);
  color: var(--color-primary);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.empty-state-title {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 1.25rem;
}

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

.deposit-methods {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.deposit-method {
  padding: 16px;
  text-align: center;
  cursor: pointer;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  background: var(--bg-surface);
}

.deposit-method:hover, .deposit-method.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-lighter);
}

.deposit-method-icon {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.deposit-method-name {
  font-weight: 600;
  font-size: 0.85rem;
}

.order-summary {
  background: var(--bg-body);
  padding: 20px;
  border-radius: var(--radius-md);
}

.order-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.9rem;
}

.order-summary-total {
  border-top: 2px solid var(--border-color);
  margin-top: 8px;
  padding-top: 12px;
  font-weight: 700;
  font-size: 1.1rem;
}

.pagination {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-top: 24px;
}

.pagination-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-primary);
}

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

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--bg-body);
  color: var(--text-muted);
}

.tab-nav {
  display: flex;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 24px;
  gap: 0;
}

.tab-item {
  padding: 12px 24px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition-fast);
}

.tab-item:hover {
  color: var(--text-primary);
}

.tab-item.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

.chart-bar-container {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 200px;
  padding: 20px 0;
  margin-bottom: 24px;
}

.chart-bar {
  flex: 1;
  background: var(--color-primary-lighter);
  border-radius: 4px 4px 0 0;
  transition: height var(--transition-normal);
  min-height: 4px;
  position: relative;
}

.chart-bar:hover {
  background: var(--color-primary-light);
}

.chart-bar-label {
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.chart-bar-value {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-primary);
}

.quick-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--color-primary-lighter);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 16px;
}

.api-key-box {
  background: var(--bg-body);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-family: monospace;
  font-size: 0.85rem;
  word-break: break-all;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border-color);
}

.switch {
  position: relative;
  width: 44px;
  height: 24px;
  display: inline-block;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  inset: 0;
  background: var(--border-color);
  border-radius: 24px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.switch-slider:before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition-fast);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.switch input:checked + .switch-slider {
  background: var(--color-primary);
}

.switch input:checked + .switch-slider:before {
  transform: translateX(20px);
}

.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color-light);
}

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

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  background: var(--bg-body);
}

.activity-content {
  flex: 1;
}

.activity-title {
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 2px;
}

.activity-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* 15. Responsive */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  #sidebar {
    transform: translateX(-100%);
  }
  
  #sidebar.active {
    transform: translateX(0);
  }
  
  #main {
    margin-left: 0;
  }
  
  .hamburger-btn {
    display: flex;
  }
  
  .grid-4, .grid-3, .grid-2 {
    grid-template-columns: 1fr;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  #main-content {
    padding: 16px;
  }
  
  .hero-section {
    padding: 24px;
  }
  
  .hero-title {
    font-size: 1.5rem;
  }
  
  .hero-stats {
    flex-wrap: wrap;
    gap: 16px;
  }
  
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
  }
  
  .sidebar-overlay.active {
    display: block;
  }
  
  .tab-nav {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 2px;
  }
  
  .category-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
  
  .search-box {
    max-width: 100%;
    width: 100%;
  }
}
