/* ============================================
   COMPREI 2.0 — Premium Design System
   Dark-first SaaS / Fintech aesthetic
   ============================================ */

/* ============================================
   CSS CUSTOM PROPERTIES
   ============================================ */
:root {
  /* === LIGHT MODE === */

  /* Backgrounds */
  --bg-base:        #ECF1F8;
  --bg-primary:     #F4F7FC;
  --bg-secondary:   #FFFFFF;
  --bg-tertiary:    #EDF1F7;
  --bg-card:        #FFFFFF;
  --bg-overlay:     rgba(8, 14, 30, 0.58);

  /* Text */
  --text-primary:   #0C1426;
  --text-secondary: #4A5A78;
  --text-tertiary:  #8FA3C0;
  --text-inverse:   #FFFFFF;

  /* Borders */
  --border-color: rgba(0, 0, 0, 0.09);
  --border-light: rgba(0, 0, 0, 0.05);

  /* Accents */
  --accent-primary:      #00BF91;
  --accent-primary-dark: #009E78;
  --accent-primary-glow: rgba(0, 191, 145, 0.22);
  --accent-secondary:    #3878FF;
  --accent-danger:       #FF4466;
  --accent-warning:      #F59E0B;
  --accent-info:         #06B6D4;

  /* Shadows */
  --shadow-sm:   0 1px 4px rgba(0,0,0,0.07), 0 0 0 1px rgba(0,0,0,0.04);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.09), 0 0 0 1px rgba(0,0,0,0.05);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.10), 0 0 0 1px rgba(0,0,0,0.04);
  --shadow-xl:   0 20px 56px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.04);
  --shadow-card: 0 2px 12px rgba(0,0,0,0.07), 0 0 0 1px rgba(0,0,0,0.06);
  --shadow-glow: 0 0 0 3px var(--accent-primary-glow);

  /* Radii */
  --radius-xs:   6px;
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   20px;
  --radius-2xl:  28px;
  --radius-full: 9999px;

  /* Layout */
  --sidebar-width:     240px;
  --sidebar-collapsed: 64px;
  --bottom-nav-height: 64px;
  --header-height:     60px;

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

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Glassmorphism */
  --glass-bg:     rgba(255, 255, 255, 0.78);
  --glass-border: rgba(0, 0, 0, 0.08);
}

/* === DARK MODE — primary aesthetic === */
[data-theme="dark"] {
  /* Backgrounds — deep navy */
  --bg-base:      #060A12;
  --bg-primary:   #090E1A;
  --bg-secondary: #0D1524;
  --bg-tertiary:  #14203A;
  --bg-card:      #0D1524;
  --bg-overlay:   rgba(0, 0, 0, 0.84);

  /* Text */
  --text-primary:   #E6EEFF;
  --text-secondary: #7E96BC;
  --text-tertiary:  #3E5070;
  --text-inverse:   #090E1A;

  /* Borders */
  --border-color: rgba(255, 255, 255, 0.09);
  --border-light: rgba(255, 255, 255, 0.05);

  /* Accents — teal matching reference image */
  --accent-primary:      #00D4A8;
  --accent-primary-dark: #00AC88;
  --accent-primary-glow: rgba(0, 212, 168, 0.24);
  --accent-secondary:    #3D88FF;
  --accent-danger:       #FF4466;
  --accent-warning:      #F5A623;
  --accent-info:         #06C8E8;

  /* Shadows — deep and rich */
  --shadow-sm:   0 2px 10px rgba(0,0,0,0.50);
  --shadow-md:   0 4px 22px rgba(0,0,0,0.60), 0 0 0 1px rgba(255,255,255,0.05);
  --shadow-lg:   0 8px 40px rgba(0,0,0,0.70), 0 0 0 1px rgba(255,255,255,0.06);
  --shadow-xl:   0 20px 64px rgba(0,0,0,0.80), 0 0 0 1px rgba(255,255,255,0.07);
  --shadow-card: 0 2px 18px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.08);
  --shadow-glow: 0 0 0 3px var(--accent-primary-glow);

  /* Glassmorphism */
  --glass-bg:     rgba(13, 21, 36, 0.90);
  --glass-border: rgba(255, 255, 255, 0.09);
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
}

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

[data-theme="dark"] body {
  background: var(--bg-base);
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  -webkit-tap-highlight-color: transparent;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  width: 100%;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

input:disabled, select:disabled { opacity: 0.6; cursor: not-allowed; }

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

/* Custom scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* ============================================
   UTILITIES
   ============================================ */
.flex             { display: flex; }
.flex-col         { flex-direction: column; }
.items-center     { align-items: center; }
.justify-between  { justify-content: space-between; }
.justify-center   { justify-content: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }

.text-xs  { font-size: 0.75rem; }
.text-sm  { font-size: 0.875rem; }
.text-lg  { font-size: 1.125rem; }
.text-xl  { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }

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

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

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-5px); }
  75%       { transform: translateX(5px); }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.5); opacity: 0.6; }
}

.animate-fade-in  { animation: fadeIn 0.35s ease both; }
.animate-slide-in { animation: slideInRight 0.3s ease both; }
.animate-pulse    { animation: pulse 2s infinite; }
.animate-spin     { animation: spin 0.8s linear infinite; }
.animate-shake    { animation: shake 0.35s ease; }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  white-space: nowrap;
  min-height: 40px;
  letter-spacing: -0.01em;
  position: relative;
  overflow: hidden;
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-dark));
  color: #fff;
  box-shadow: 0 2px 12px var(--accent-primary-glow);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 22px var(--accent-primary-glow), 0 2px 8px rgba(0,0,0,0.2);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1.5px solid var(--border-color);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent-primary);
  background: var(--bg-tertiary);
}

[data-theme="dark"] .btn-secondary {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
}
[data-theme="dark"] .btn-secondary:hover:not(:disabled) {
  background: rgba(255,255,255,0.07);
  border-color: var(--accent-primary);
}

.btn-danger {
  background: var(--accent-danger);
  color: #fff;
  box-shadow: 0 2px 10px rgba(255,68,102,0.28);
}
.btn-danger:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(255,68,102,0.40);
}

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

[data-theme="dark"] .btn-ghost:hover:not(:disabled) {
  background: rgba(255,255,255,0.07);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
}

.btn-sm {
  padding: 6px 13px;
  font-size: 0.8125rem;
  min-height: 34px;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-base), border-color var(--transition-base);
  overflow: hidden;
}

[data-theme="dark"] .card {
  background: linear-gradient(145deg, var(--bg-secondary) 0%, rgba(10,16,28,0.98) 100%);
  border-color: rgba(255,255,255,0.08);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .card:hover {
  border-color: rgba(255,255,255,0.12);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
}

.card-body { padding: 16px 20px; }

.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-tertiary);
}

[data-theme="dark"] .card-footer {
  background: rgba(255,255,255,0.025);
}

/* ============================================
   BADGES & STATUS
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge-success {
  background: rgba(0, 212, 168, 0.14);
  color: var(--accent-primary);
  border: 1px solid rgba(0, 212, 168, 0.25);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.14);
  color: var(--accent-warning);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-danger {
  background: rgba(255, 68, 102, 0.12);
  color: var(--accent-danger);
  border: 1px solid rgba(255, 68, 102, 0.22);
}

.badge-info {
  background: rgba(61, 136, 255, 0.12);
  color: var(--accent-secondary);
  border: 1px solid rgba(61, 136, 255, 0.22);
}

/* ============================================
   STATUS INDICATOR
   ============================================ */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  letter-spacing: 0.01em;
}

.status-indicator::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-online {
  background: rgba(0, 212, 168, 0.12);
  color: var(--accent-primary);
  border: 1px solid rgba(0, 212, 168, 0.20);
}
.status-online::before {
  background: var(--accent-primary);
  box-shadow: 0 0 6px var(--accent-primary);
  animation: dotPulse 2.5s infinite;
}

.status-offline {
  background: rgba(255, 68, 102, 0.10);
  color: var(--accent-danger);
  border: 1px solid rgba(255, 68, 102, 0.18);
}
.status-offline::before { background: var(--accent-danger); }

.status-syncing {
  background: rgba(245, 166, 35, 0.10);
  color: var(--accent-warning);
  border: 1px solid rgba(245, 166, 35, 0.20);
}
.status-syncing::before {
  background: var(--accent-warning);
  animation: pulse 1.2s infinite;
}

/* ============================================
   FORMS
   ============================================ */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

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

.form-error {
  font-size: 0.75rem;
  color: var(--accent-danger);
  margin-top: 4px;
  display: none;
}
.form-error.visible {
  display: block;
  animation: shake 0.35s ease;
}

.input-group { display: flex; }
.input-group input {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  border-right: none;
}
.input-group .btn {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* Price input row */
.price-input-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.price-input-row input { flex: 1; }
.price-input-row .btn-icon { flex-shrink: 0; }

/* Price calculator result */
.price-calc-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-top: 8px;
}
[data-theme="dark"] .price-calc-result {
  background: rgba(0, 212, 168, 0.06);
  border-color: rgba(0, 212, 168, 0.15);
}
.price-calc-result span {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.price-calc-result strong {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-primary);
  letter-spacing: -0.02em;
}

/* ============================================
   MODAL / OVERLAY
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

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

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.94) translateY(14px);
  transition: transform var(--transition-base);
}

[data-theme="dark"] .modal {
  background: linear-gradient(160deg, #0F1829 0%, #0A1020 100%);
  border-color: rgba(255,255,255,0.10);
}

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

.modal-wide { max-width: 680px; }

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

.modal-title {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  background: var(--bg-tertiary);
}

[data-theme="dark"] .modal-footer {
  background: rgba(255,255,255,0.025);
}

/* Bottom sheet on mobile */
@media (max-width: 640px) {
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal {
    max-width: 100%;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-height: 88vh;
    transform: translateY(100%);
  }
  .modal-overlay.active .modal {
    transform: translateY(0);
  }
}

/* ============================================
   TOAST / SNACKBAR
   ============================================ */
.toast-container {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 20px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: calc(100% - 32px);
  max-width: 380px;
  pointer-events: none;
}

.toast {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 12px 18px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeInScale 0.3s ease both;
  pointer-events: auto;
}

[data-theme="dark"] .toast {
  background: #141E34;
  border-color: rgba(255,255,255,0.10);
}

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

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .login-page {
  background: var(--bg-base);
}

.login-page::before {
  content: '';
  position: absolute;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,212,168,0.08) 0%, transparent 65%);
  top: -280px;
  left: -200px;
  pointer-events: none;
}
.login-page::after {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(61,136,255,0.06) 0%, transparent 65%);
  bottom: -240px;
  right: -150px;
  pointer-events: none;
}

.login-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-2xl);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 420px;
  padding: 42px 36px;
  animation: fadeInScale 0.45s ease both;
  position: relative;
  z-index: 1;
}

[data-theme="dark"] .login-card {
  background: linear-gradient(160deg, #0F1829 0%, #090E1D 100%);
  border-color: rgba(255,255,255,0.10);
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
}

.login-logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 18px var(--accent-primary-glow);
}

.login-logo h1 {
  font-size: 1.875rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  color: var(--text-primary);
}

[data-theme="dark"] .login-logo h1 {
  background: linear-gradient(135deg, #E6EEFF 30%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 28px;
  letter-spacing: -0.01em;
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.password-wrapper { position: relative; }
.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 4px;
  transition: color var(--transition-fast);
}
.password-toggle:hover { color: var(--text-primary); }

/* ============================================
   SIDEBAR (Desktop)
   ============================================ */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-light);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-base), width var(--transition-base);
}

[data-theme="dark"] .sidebar {
  background: linear-gradient(180deg, #080D1C 0%, #060B16 100%);
  border-right-color: rgba(255,255,255,0.06);
}

.sidebar-header {
  padding: 22px 18px 16px;
  border-bottom: 1px solid var(--border-light);
}

[data-theme="dark"] .sidebar-header {
  border-bottom-color: rgba(255,255,255,0.05);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 2px 12px var(--accent-primary-glow);
}

.sidebar-logo-text {
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-primary);
}

[data-theme="dark"] .sidebar-logo-text {
  background: linear-gradient(90deg, #E6EEFF, var(--accent-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  flex: 1;
  padding: 10px 10px;
  overflow-y: auto;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
  margin-bottom: 2px;
  position: relative;
  border: 1px solid transparent;
}

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

[data-theme="dark"] .sidebar-nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}

.sidebar-nav-item.active {
  background: linear-gradient(135deg, rgba(0,212,168,0.18), rgba(0,212,168,0.07));
  color: var(--accent-primary);
  border-color: rgba(0,212,168,0.20);
}

[data-theme="dark"] .sidebar-nav-item.active {
  background: linear-gradient(135deg, rgba(0,212,168,0.15), rgba(0,212,168,0.05));
  box-shadow: 0 0 0 1px rgba(0,212,168,0.15) inset;
}

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

.sidebar-nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

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

[data-theme="dark"] .sidebar-footer {
  border-top-color: rgba(255,255,255,0.05);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.sidebar-user:hover { background: var(--bg-tertiary); }
[data-theme="dark"] .sidebar-user:hover { background: rgba(255,255,255,0.05); }

.sidebar-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.8125rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.sidebar-user-info { flex: 1; min-width: 0; }

.sidebar-user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.sidebar-user-role {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* ============================================
   BOTTOM NAV (Mobile)
   ============================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom, 0);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

[data-theme="dark"] .bottom-nav {
  background: rgba(9, 14, 26, 0.94);
  border-top-color: rgba(255,255,255,0.07);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  height: 100%;
  color: var(--text-tertiary);
  font-size: 0.6rem;
  font-weight: 700;
  transition: color var(--transition-fast);
  position: relative;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bottom-nav-item svg { width: 22px; height: 22px; }

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

.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 2.5px;
  background: var(--accent-primary);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 1px 8px var(--accent-primary);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  padding-bottom: calc(var(--bottom-nav-height) + 28px);
}

.page-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244, 247, 252, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-height);
}

[data-theme="dark"] .page-header {
  background: rgba(9, 14, 26, 0.92);
  border-bottom-color: rgba(255,255,255,0.06);
}

.page-title {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-body {
  padding: 24px;
  max-width: 1240px;
}

/* ============================================
   DASHBOARD GREETING
   ============================================ */
.dash-greeting {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
}

.dash-greeting-text {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  line-height: 1.1;
}

[data-theme="dark"] .dash-greeting-text {
  background: linear-gradient(90deg, #E6EEFF 0%, #B8D0FF 55%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dash-greeting-date {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  margin-top: 4px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-transform: capitalize;
}

/* ============================================
   GRID LAYOUTS
   ============================================ */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ============================================
   STAT CARDS (KPI)
   ============================================ */
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .stat-card {
  background: linear-gradient(145deg, #0F1829 0%, #090E1C 100%);
  border-color: rgba(255,255,255,0.08);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,212,168,0.5), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: rgba(0,212,168,0.25);
}

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

.stat-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.stat-card-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

.stat-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card-value {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.04em;
}

.stat-card-trend {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================
   PRODUCT CARDS
   ============================================ */
.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-base);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: rgba(0,212,168,0.30);
}

.product-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--bg-tertiary);
}

.product-image-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
}

.product-info {
  padding: 12px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.product-meta { font-size: 0.75rem; color: var(--text-tertiary); }

.product-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin-top: 4px;
  letter-spacing: -0.02em;
}

/* ============================================
   LIST CARDS (list index)
   ============================================ */
.list-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .list-card {
  background: linear-gradient(145deg, #0F1829 0%, #090E1C 100%);
  border-color: rgba(255,255,255,0.08);
}

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

[data-theme="dark"] .list-card:hover {
  border-color: rgba(0,212,168,0.42);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(0,212,168,0.12);
}

.list-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.list-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.list-card-meta {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

.list-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.list-card-value {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--accent-primary);
  letter-spacing: -0.03em;
}

/* ============================================
   LIST ITEMS (Shopping List)
   ============================================ */
.list-item {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all var(--transition-fast);
  cursor: pointer;
  margin-bottom: 6px;
}

[data-theme="dark"] .list-item {
  background: rgba(13, 21, 36, 0.80);
  border-color: rgba(255,255,255,0.06);
}

.list-item:hover {
  border-color: var(--accent-primary);
  background: var(--bg-tertiary);
}

[data-theme="dark"] .list-item:hover {
  background: rgba(0,212,168,0.05);
  border-color: rgba(0,212,168,0.30);
}

.list-item.completed { opacity: 0.55; }

.list-item.completed .list-item-name {
  text-decoration: line-through;
  color: var(--text-tertiary);
}

.list-item-checkbox {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  cursor: pointer;
  touch-action: manipulation;
}

.list-item-checkbox:hover {
  border-color: var(--accent-primary);
  background: rgba(0,212,168,0.10);
}

.list-item.completed .list-item-checkbox {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
  box-shadow: 0 0 12px var(--accent-primary-glow);
}

.list-items-group { margin-bottom: 20px; }
.list-items-group:last-child { margin-bottom: 0; }

.list-items-group-header {
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--font-sans);
  width: 100%;
  min-height: 46px;
  margin: 0 0 10px;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-primary) !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  touch-action: manipulation;
  transition: all var(--transition-fast);
  font-weight: 600;
}

[data-theme="dark"] .list-items-group-header {
  background: linear-gradient(135deg, #0F1829, #0A1220);
  border-color: rgba(255,255,255,0.08);
}

.list-items-group-header:hover {
  border-color: var(--accent-primary);
}

[data-theme="dark"] .list-items-group-header:hover {
  border-color: rgba(0,212,168,0.35);
  background: rgba(0,212,168,0.05);
}

.list-items-group-title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  color: inherit;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.list-items-group-chevron {
  flex-shrink: 0;
  color: currentColor;
  transition: transform var(--transition-fast);
}

.list-items-group.collapsed .list-items-group-chevron {
  transform: rotate(-90deg);
}

.list-items-group.collapsed .list-items-group-body { display: none; }

.list-items-group-empty {
  padding: 16px;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-tertiary);
  font-size: 0.875rem;
  text-align: center;
  margin-bottom: 6px;
}

.list-item-image {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--bg-tertiary);
  flex-shrink: 0;
}

.list-item-placeholder {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

[data-theme="dark"] .list-item-placeholder {
  background: rgba(255,255,255,0.05);
}

.list-item-content { flex: 1; min-width: 0; }

.list-item-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.list-item-details {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 2px;
  font-weight: 500;
}

.list-item-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-primary);
  flex-shrink: 0;
  text-align: right;
  letter-spacing: -0.02em;
}

.list-item-total {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-align: right;
}

.list-item-delete {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  touch-action: manipulation;
}

.list-item-delete:hover {
  background: rgba(239, 68, 68, 0.10);
  color: #EF4444;
}

/* ============================================
   CATEGORY GRID
   ============================================ */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.category-item {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.category-item:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.category-item.active {
  border-color: var(--accent-primary);
  background: rgba(0,212,168,0.06);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

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

.category-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  letter-spacing: -0.01em;
}

.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  border: 1px solid;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.category-badge-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

/* ============================================
   CORRIDOR SECTION
   ============================================ */
.corridor-section { margin-bottom: 16px; }

.corridor-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

[data-theme="dark"] .corridor-header {
  background: rgba(255,255,255,0.04);
}

.corridor-color {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.corridor-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 52px 24px;
  text-align: center;
  color: var(--text-tertiary);
}

.empty-state-icon {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--text-tertiary);
}

[data-theme="dark"] .empty-state-icon {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-light);
}

.empty-state-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.empty-state-desc {
  font-size: 0.875rem;
  max-width: 260px;
  line-height: 1.5;
}

/* ============================================
   LOADING / SKELETON
   ============================================ */
.loading-spinner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.loading-spinner::after {
  content: '';
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    rgba(255,255,255,0.06) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  border-radius: var(--radius-md);
}

/* ============================================
   SEARCH BAR
   ============================================ */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 9px 16px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

[data-theme="dark"] .search-bar { background: var(--bg-tertiary); }

.search-bar:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

.search-bar input {
  border: none;
  background: transparent;
  padding: 0;
  box-shadow: none;
  font-size: 0.9rem;
}

.search-bar input:focus { box-shadow: none; border: none; }

/* ============================================
   AVATAR
   ============================================ */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}

/* ============================================
   FAB
   ============================================ */
.fab {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 18px);
  right: 18px;
  width: 54px;
  height: 54px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-dark));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px var(--accent-primary-glow), 0 8px 32px rgba(0,0,0,0.3);
  z-index: 90;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.fab:hover {
  transform: scale(1.07);
  box-shadow: 0 6px 28px var(--accent-primary-glow), 0 12px 40px rgba(0,0,0,0.35);
}

.fab:active { transform: scale(0.96); }

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

[data-theme="dark"] .progress-bar { background: rgba(255,255,255,0.08); }

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
  box-shadow: 0 0 8px var(--accent-primary-glow);
}

/* ============================================
   DATA TABLE (Reports)
   ============================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 13px 16px;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.data-table tr:hover td {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

[data-theme="dark"] .data-table tr:hover td {
  background: rgba(255,255,255,0.03);
}

@media (max-width: 640px) {
  .data-table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ============================================
   DROPDOWN MENU
   ============================================ */
.dropdown { position: relative; }

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  min-width: 200px;
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.97);
  transition: all var(--transition-fast);
  overflow: hidden;
}

[data-theme="dark"] .dropdown-menu {
  background: #0F1829;
  border-color: rgba(255,255,255,0.10);
}

.dropdown.active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
  cursor: pointer;
}

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

[data-theme="dark"] .dropdown-item:hover { background: rgba(255,255,255,0.06); }

.dropdown-divider {
  height: 1px;
  background: var(--border-light);
  margin: 4px 0;
}

/* ============================================
   THEME TOGGLE
   ============================================ */
.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

[data-theme="dark"] .theme-toggle:hover { background: rgba(255,255,255,0.08); }

/* ============================================
   SIDEBAR OVERLAY (mobile)
   ============================================ */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

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

/* ============================================
   QTY CONTROL
   ============================================ */
.qty-control {
  display: flex;
  align-items: center;
  gap: 4px;
}

.qty-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.qty-btn:hover { border-color: var(--accent-primary); color: var(--accent-primary); }

.qty-input {
  width: 58px;
  text-align: center;
  padding: 7px 4px;
  font-weight: 700;
  font-size: 1rem;
}

/* ============================================
   USER ROW
   ============================================ */
.user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition-fast);
}

.user-row:hover { background: var(--bg-tertiary); }
[data-theme="dark"] .user-row:hover { background: rgba(255,255,255,0.03); }
.user-row .user-info { flex: 1; }

/* ============================================
   PRODUCT SELECTOR
   ============================================ */
.product-selector { max-height: 58vh; overflow-y: auto; }

.add-item-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.add-item-filters select {
  min-width: 0;
  padding: 8px 10px;
  font-size: 0.8125rem;
}

.add-item-actions {
  gap: 8px;
}

.product-selector-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--border-light);
}

.product-selector-item:hover { background: var(--bg-tertiary); }
[data-theme="dark"] .product-selector-item:hover { background: rgba(255,255,255,0.05); }
.product-selector-item .product-info { flex: 1; }
.product-selector-item.already-added { opacity: 0.68; }

.add-item-check {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--accent-primary);
}

@media (max-width: 640px) {
  .add-item-filters { grid-template-columns: 1fr; }
  #modalAddItem .product-selector-item {
    min-width: 0;
  }
  #modalAddItem .product-selector-item .list-item-placeholder {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px;
    max-width: 40px;
    aspect-ratio: 1;
    overflow: hidden;
  }
  #modalAddItem .product-selector-item .list-item-icon {
    width: 28px;
    height: 28px;
    max-width: 28px;
    max-height: 28px;
    object-fit: contain;
  }
  #modalAddItem .product-selector-item .product-info {
    min-width: 0;
    overflow: hidden;
  }
  .add-item-actions { flex-wrap: wrap; }
  .add-item-actions .text-sm { width: 100%; }
}

/* ============================================
   UPLOAD AREA
   ============================================ */
.upload-area {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  color: var(--text-tertiary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--accent-primary);
  background: rgba(0,212,168,0.05);
  color: var(--accent-primary);
}

.upload-area img {
  max-height: 200px;
  margin: 0 auto;
  border-radius: var(--radius-md);
}

/* ============================================
   PRODUCT ICONS
   ============================================ */
.product-icon-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.list-item-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */
@media (min-width: 1024px) {
  .bottom-nav { display: none; }
  .main-content { padding-bottom: 28px; }
  .fab { bottom: 28px; right: 28px; }
  .toast-container { bottom: 28px; }
  .category-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); z-index: 200; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .page-header { padding: 10px 16px; }
  .page-body { padding: 14px 16px; }
  .page-title { font-size: 1rem; }
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .stat-card { padding: 16px; }
  .stat-card-value { font-size: 1.5rem; }
  .login-card { padding: 32px 24px; }
  .dash-greeting-text { font-size: 1.5rem; }
  .list-item {
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
  }
  .list-item-name {
    white-space: normal;
    overflow: hidden;
    text-overflow: clip;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow-wrap: anywhere;
    line-height: 1.25;
  }
}

/* ============================================
   PRINT
   ============================================ */
@media print {
  .sidebar, .bottom-nav, .page-header, .fab, .btn, .toast-container { display: none !important; }
  .main-content { margin-left: 0; }
}

/* ============================================
   VIEW SWITCHING
   ============================================ */
.view { display: none; }
.view.active { display: block; animation: fadeInScale 0.32s ease both; }

/* ============================================
   PRODUCT ICON PICKER
   ============================================ */

/* Preview — selected icon display */
.product-icon-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  min-height: 56px;
}

[data-theme="dark"] .product-icon-preview {
  background: rgba(255,255,255,0.04);
}

.product-icon-preview-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.product-icon-preview span {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Grid — all icon options */
.product-icon-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.product-icon-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  background: var(--bg-tertiary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-tertiary);
  min-height: 56px;
}

[data-theme="dark"] .product-icon-option {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.07);
}

.product-icon-option:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--bg-secondary);
}

[data-theme="dark"] .product-icon-option:hover {
  background: rgba(0,212,168,0.08);
}

.product-icon-option.active {
  border-color: var(--accent-primary);
  background: rgba(0,212,168,0.12);
  color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

.product-icon-option-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

@media (max-width: 480px) {
  .product-icon-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ============================================
   HISTORY DETAIL
   ============================================ */
.history-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.history-detail-title {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.history-detail-total {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--accent-primary);
  letter-spacing: -0.04em;
}

/* ============================================
   DARK MODE AMBIENT GLOW
   ============================================ */
[data-theme="dark"] .main-content {
  position: relative;
}

[data-theme="dark"] .main-content::before {
  content: '';
  position: fixed;
  top: 0; left: var(--sidebar-width); right: 0; bottom: 0;
  background:
    radial-gradient(ellipse 55% 40% at 15% 5%, rgba(0,212,168,0.05) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 85% 90%, rgba(61,136,255,0.04) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

@media (max-width: 1023px) {
  [data-theme="dark"] .main-content::before {
    left: 0;
  }
}

/* ============================================
   CADASTROS VIEW — Tabs, Grid, List
   ============================================ */

/* --- Tab bar --- */
.cadastro-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 4px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  width: fit-content;
  max-width: 100%;
}

[data-theme="dark"] .cadastro-tabs {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.06);
}

.cadastro-tab {
  padding: 7px 16px;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.cadastro-tab:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

[data-theme="dark"] .cadastro-tab:hover {
  background: rgba(255,255,255,0.07);
}

.cadastro-tab.active {
  background: var(--bg-secondary);
  color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .cadastro-tab.active {
  background: linear-gradient(135deg, rgba(0,212,168,0.18), rgba(0,212,168,0.08));
  color: var(--accent-primary);
  box-shadow: 0 0 0 1px rgba(0,212,168,0.20) inset;
}

/* --- Product grid (compact card view) --- */
.product-grid-compact {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
  gap: 12px;
}

.product-grid-compact .product-card {
  min-width: 0;
}

#productsContainer .product-grid-compact {
  align-items: stretch;
}

#productsContainer .product-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  overflow: hidden;
}

#productsContainer .product-info {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 12px;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  text-align: center;
}

#productsContainer .product-name,
#productsContainer .product-meta,
#productsContainer .product-price {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-align: center;
}

#productsContainer .product-name {
  min-height: 2.25em;
  line-height: 1.28;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

#productsContainer .product-category-line {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  overflow: hidden;
}

#productsContainer .product-category-line .category-badge {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  overflow: hidden;
  white-space: nowrap;
}

#productsContainer .product-category-line .category-badge span {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#productsContainer .product-category-line .category-badge-icon {
  flex: 0 0 auto;
}

#productsContainer .product-meta {
  color: var(--text-tertiary);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#productsContainer .product-price {
  margin-top: 2px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#productsContainer .product-info > .badge {
  align-self: center;
  max-width: 100%;
  margin-top: 2px !important;
}

/* Constrain image/placeholder height in compact grid */
.product-grid-compact .product-image {
  aspect-ratio: unset;
  height: 88px;
  width: 100%;
  object-fit: cover;
}

.product-grid-compact .product-image-placeholder {
  aspect-ratio: unset;
  height: 88px;
  width: 100%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
}

[data-theme="dark"] .product-grid-compact .product-image-placeholder {
  background: rgba(255,255,255,0.04);
}

/* Icon inside card placeholder */
.product-card-icon {
  width: 42px;
  height: 42px;
  object-fit: contain;
  opacity: 0.85;
}

/* Category badge line inside card */
.product-category-line {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 0;
}

/* --- Cadastro list (categories / subcategories / corridors) --- */
.cadastro-list {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

[data-theme="dark"] .cadastro-list {
  background: linear-gradient(145deg, var(--bg-secondary) 0%, rgba(10,16,28,0.98) 100%);
  border-color: rgba(255,255,255,0.08);
}

.cadastro-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition-fast);
  cursor: pointer;
}

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

.cadastro-row:hover { background: var(--bg-tertiary); }

[data-theme="dark"] .cadastro-row:hover { background: rgba(255,255,255,0.04); }

.cadastro-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cadastro-color {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

.cadastro-main {
  flex: 1;
  min-width: 0;
}

.cadastro-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cadastro-meta {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 2px;
  font-weight: 500;
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .product-grid-compact {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
  }
  .product-grid-compact .product-image,
  .product-grid-compact .product-image-placeholder {
    height: 76px;
  }
  .cadastro-tabs {
    width: 100%;
  }
  .cadastro-tab {
    padding: 6px 12px;
    font-size: 0.75rem;
    flex: 1;
    text-align: center;
  }
}
