/* ============================================================
   AnodsCocoa Purchase Analytics System - Custom Styles
   Premium Chocolate/Cocoa Theme
   ============================================================ */

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

:root {
  /* Caramel Golden Theme (Primary Accent: #DD9E59) */
  --cocoa-darkest:  #211812; /* Deep Dark Roasted Cocoa */
  --cocoa-dark:     #33251c; /* Dark Warm Chocolate */
  --cocoa-deep:     #18110c;
  --cocoa-mid:      #DD9E59; /* Caramel Accent */
  --cocoa-medium:   #e4ab6d;
  --cocoa-warm:     #ebba82;
  --cocoa-gold:     #DD9E59; /* Primary Accent: #DD9E59 */
  --cocoa-amber:    #e5a968; /* Secondary Warm Amber */
  --cocoa-cream:    #211812; /* Primary Text (Warm Dark Coffee) */
  --cocoa-light:    #faf8f5; /* App background */
  --cocoa-white:    #ffffff;
  
  --success:        #2ecc71;
  --danger:         #e74c3c;
  --warning:        #f1c40f;
  --info:           #3498db;
  --sidebar-width:  260px;
  --transition:     0.3s ease;

  /* Theme Layout Variables */
  --bg-app:         #faf8f5; /* Warm light cream background */
  --bg-panel:       #ffffff; /* Pure white cards */
  --text-primary:   #211812; /* Dark coffee text */
  --text-secondary: #66554c; /* Warm slate-brown labels */
  --border-light:   #f0ede9; /* Soft warm border */
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

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

/* ============================================================
   Scrollbar
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #faf7f2; }
::-webkit-scrollbar-thumb { background: rgba(200, 134, 10, 0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--cocoa-gold); }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #FAF7F2 0%, #E6DCD2 100%);
  position: relative;
  overflow: hidden;
}

/* Animated cocoa wave background */
.login-bg-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

.login-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 440px;
  margin: 1.5rem;
  background: #FFFFFF;
  border: 1px solid rgba(200, 134, 10, 0.18);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  box-shadow: 0 24px 48px rgba(45, 18, 0, 0.08), 0 0 0 1px rgba(200, 134, 10, 0.05);
  animation: cardEntrance 0.8s cubic-bezier(0.23, 1, 0.32, 1) both;
}

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

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo .brand-icon {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--cocoa-gold), var(--cocoa-amber));
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1rem;
  box-shadow: 0 8px 24px rgba(200, 134, 10, 0.4);
  animation: iconPulse 3s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(200, 134, 10, 0.4); }
  50% { box-shadow: 0 8px 40px rgba(200, 134, 10, 0.7); }
}

.login-logo h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: var(--cocoa-gold);
  letter-spacing: 0.05em;
}

.login-logo p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 0.25rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  background: #FFFFFF;
  border: 1px solid rgba(200,134,10,0.22);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  transition: all var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--cocoa-gold);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(200,134,10,0.15);
}

.form-control::placeholder { color: #a58b76; }

.input-group { position: relative; }
.input-icon {
  position: absolute;
  left: 1rem; top: 50%;
  transform: translateY(-50%);
  color: rgba(200,134,10,0.65);
  font-size: 1rem;
}
.input-group .form-control { padding-left: 2.8rem; }

.btn-login {
  width: 100%;
  padding: 0.9rem;
  background: linear-gradient(135deg, var(--cocoa-gold) 0%, var(--cocoa-amber) 100%);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(200,134,10,0.25);
}

.btn-login::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transition: left 0.5s ease;
}

.btn-login:hover::before { left: 100%; }
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(200,134,10,0.5); }
.btn-login:active { transform: translateY(0); }

.alert {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
.alert-danger { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.3); color: #86efac; }
.alert-warning { background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.3); color: #fcd34d; }

/* ============================================================
   MAIN LAYOUT - Sidebar + Content
   ============================================================ */
.wrapper { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--cocoa-dark) 0%, var(--cocoa-darkest) 100%);
  border-right: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 1000;
  transition: transform var(--transition);
  overflow-y: auto;
}

.sidebar-header {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-logo-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--cocoa-gold), var(--cocoa-amber));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.sidebar-brand h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--cocoa-gold);
  line-height: 1.2;
}

.sidebar-brand p {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sidebar-nav { flex: 1; padding: 1rem 0; }

.nav-section {
  padding: 0.5rem 1.25rem 0.25rem;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1.25rem;
  color: rgba(255,255,255,0.72);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 10px;
  margin: 0.1rem 0.75rem;
  transition: all var(--transition);
  position: relative;
}

.nav-item i { width: 18px; text-align: center; font-size: 0.9rem; flex-shrink: 0; }

.nav-item:hover,
.nav-item.active {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; height: 60%;
  width: 4px;
  background: var(--cocoa-gold);
  border-radius: 0 4px 4px 0;
}

.sidebar-footer {
  padding: 1rem 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

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

/* TOPBAR */
.topbar {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(200,134,10,0.12);
  padding: 0.875rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-left { display: flex; align-items: center; gap: 1rem; }

.sidebar-toggle {
  background: none;
  border: 1px solid rgba(200,134,10,0.22);
  color: var(--text-primary);
  width: 36px; height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  display: none;
}

.sidebar-toggle:hover { background: rgba(200,134,10,0.1); color: var(--cocoa-gold); }

.page-title { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); }

.topbar-right { display: flex; align-items: center; gap: 0.75rem; }

.user-badge {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: rgba(200,134,10,0.06);
  border: 1px solid rgba(200,134,10,0.15);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text-primary);
}

.user-avatar {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--cocoa-gold), var(--cocoa-amber));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--cocoa-darkest);
}

.btn-logout {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  color: #fca5a5;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  display: flex; align-items: center; gap: 0.4rem;
}

.btn-logout:hover { background: rgba(239,68,68,0.2); color: #fca5a5; }

/* PAGE CONTENT */
.page-content { padding: 1.5rem; flex: 1; }

/* ============================================================
   CARDS & STATS
   ============================================================ */
.stat-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
  box-shadow: 0 4px 20px rgba(45, 18, 0, 0.02);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: 0.05;
  transform: translate(20px, -20px);
  background: var(--cocoa-gold);
}

.stat-card:hover {
  border-color: rgba(200,134,10,0.25);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(45,18,0,0.06);
}

.stat-card-wide {
  grid-column: span 2;
}

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.stat-icon.gold   { background: rgba(200,134,10,0.1); color: var(--cocoa-gold); }
.stat-icon.green  { background: rgba(34,197,94,0.08); color: #16a34a; }
.stat-icon.blue   { background: rgba(59,130,246,0.08); color: #2563eb; }
.stat-icon.purple { background: rgba(168,85,247,0.08); color: #9333ea; }
.stat-icon.red    { background: rgba(239,68,68,0.08); color: #dc2626; }
.stat-icon.amber  { background: rgba(230,162,14,0.1); color: var(--cocoa-gold); }

.stat-value {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-change {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

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

/* ============================================================
   PANEL / CARD GENERIC
   ============================================================ */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  overflow: hidden;
  min-width: 0;
  box-shadow: 0 4px 20px rgba(45, 18, 0, 0.02);
}

.panel-header {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid rgba(200,134,10,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: rgba(200, 134, 10, 0.02);
}

.panel-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 0.5rem;
}

.panel-title i { color: var(--cocoa-gold); }

.panel-body { padding: 1.25rem 1.5rem; }

/* ============================================================
   TABLES
   ============================================================ */
.table-responsive { overflow-x: auto; border-radius: 12px; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  background: rgba(200,134,10,0.05);
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(200,134,10,0.12);
  white-space: nowrap;
}

.data-table td {
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(200,134,10,0.08);
  vertical-align: middle;
}

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

.data-table tr:hover td { background: rgba(200,134,10,0.02); }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-gold   { background: rgba(200,134,10,0.2); color: var(--cocoa-gold); border: 1px solid rgba(200,134,10,0.3); }
.badge-green  { background: rgba(34,197,94,0.15); color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.badge-red    { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.badge-blue   { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }
.badge-amber  { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
.badge-gray   { background: rgba(107,114,128,0.2); color: #9ca3af; border: 1px solid rgba(107,114,128,0.3); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  border: none;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--cocoa-gold) 0%, var(--cocoa-amber) 100%);
  color: var(--cocoa-darkest);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(200,134,10,0.4); }

.btn-secondary {
  background: rgba(245,230,200,0.08);
  color: var(--cocoa-cream);
  border: 1px solid rgba(245,230,200,0.15);
}
.btn-secondary:hover { background: rgba(245,230,200,0.14); }

.btn-danger {
  background: rgba(239,68,68,0.12);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.25);
}
.btn-danger:hover { background: rgba(239,68,68,0.22); }

.btn-success {
  background: rgba(34,197,94,0.12);
  color: #4ade80;
  border: 1px solid rgba(34,197,94,0.25);
}
.btn-success:hover { background: rgba(34,197,94,0.22); }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.78rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }

/* ============================================================
   FORMS (Main App)
   ============================================================ */
.form-group { margin-bottom: 1.25rem; }

.form-label-app {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #000000;
  margin-bottom: 0.4rem;
  letter-spacing: 0.04em;
}

.form-control-app {
  width: 100%;
  background: #FFFFFF;
  border: 1px solid rgba(200,134,10,0.25);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  transition: all var(--transition);
  outline: none;
}

.form-control-app:focus {
  border-color: var(--cocoa-gold);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(200,134,10,0.15);
}

.form-control-app::placeholder { color: #a58b76; }

select.form-control-app option {
  background: #FFFFFF;
  color: var(--text-primary);
}

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

.form-row {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.field-error {
  font-size: 0.75rem;
  color: #f87171;
  margin-top: 0.3rem;
  display: block;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: #FFFFFF;
  border: 1px solid rgba(200,134,10,0.18);
  border-radius: 20px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  transform: translateY(20px) scale(0.97);
  transition: all var(--transition);
  box-shadow: 0 24px 64px rgba(45,18,0,0.08);
}

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

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

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cocoa-gold);
  display: flex; align-items: center; gap: 0.5rem;
}

.modal-close {
  background: none;
  border: 1px solid rgba(200,134,10,0.15);
  color: var(--text-secondary);
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}

.modal-close:hover { background: rgba(239,68,68,0.1); color: #dc2626; border-color: rgba(239,68,68,0.25); }

/* ============================================================
   CHARTS
   ============================================================ */
.chart-container {
  position: relative;
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden;
}
.chart-container canvas {
  width: 100% !important;
  max-width: 100% !important;
}

/* ============================================================
   GRID UTILITIES
   ============================================================ */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ============================================================
   PRICE INDICATOR BADGES
   ============================================================ */
.price-up   { color: var(--danger);  font-weight: 600; }
.price-down { color: var(--success); font-weight: 600; }
.price-same { color: var(--warning); font-weight: 600; }

/* ============================================================
   ANALYTICS PAGE
   ============================================================ */
.analytics-stat {
  text-align: center;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(200,134,10,0.06);
  border: 1px solid rgba(200,134,10,0.12);
}

.analytics-stat .value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--cocoa-gold);
}

.analytics-stat .label {
  font-size: 0.75rem;
  color: #000000;
  font-weight: 600;
  margin-top: 0.2rem;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-secondary);
}

.empty-state i { font-size: 3rem; margin-bottom: 1rem; display: block; color: rgba(200,134,10,0.3); }
.empty-state p { font-size: 0.9rem; }

/* ============================================================
   RESPONSIVE - Tablet & Mobile
   ============================================================ */
@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%);
    box-shadow: 0 0 40px rgba(0,0,0,0.6);
  }
  .sidebar.open { transform: translateX(0); }

  .main-content { margin-left: 0; }
  .sidebar-toggle { display: flex; }

  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; gap: 0.85rem; }

  .page-content { padding: 0.85rem; }

  .topbar { padding: 0.65rem 0.85rem; }

  .user-badge span { display: none; }

  .stat-value { font-size: 1.35rem; }

  .stat-card-wide {
    grid-column: span 1 !important;
  }

  /* Modal Mobile Optimization */
  .modal-overlay {
    align-items: flex-end; /* Slides modal from bottom on mobile, feels native */
    padding: 0;
  }
  .modal-box {
    padding: 1.5rem 1.25rem;
    max-height: 90vh;
    border-radius: 24px 24px 0 0;
    border-bottom: none;
    transform: translateY(100%) scale(1);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .modal-overlay.active .modal-box {
    transform: translateY(0) scale(1);
  }
  .modal-close {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  .form-row { grid-template-columns: 1fr; gap: 0.85rem; }
  
  /* Input touch optimization (prevents iOS auto-zoom on focus) */
  input, select, textarea, .form-control, .form-control-app, .srch-input {
    font-size: 16px !important;
    padding: 0.85rem 1rem !important;
  }
  
  /* Searchable Dropdown mobile touch targets */
  .srch-item {
    padding: 0.8rem 1rem !important; /* Larger touch area */
    min-height: 44px; /* Standard mobile touch target */
  }
  
  /* Filter bar form adjustments for mobile */
  .panel-body form {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.85rem !important;
  }
  .panel-body form > div {
    width: 100%;
  }
  .panel-body form select,
  .panel-body form input {
    width: 100% !important;
  }
  .panel-body form button,
  .panel-body form a {
    width: 100%;
    padding: 0.85rem !important;
    font-size: 16px;
    justify-content: center;
  }
  
  /* Responsive Tables */
  .table-responsive {
    border-radius: 12px;
    border: 1px solid rgba(200,134,10,0.15);
    background: rgba(0, 0, 0, 0.2);
    -webkit-overflow-scrolling: touch;
  }
  .data-table th, .data-table td {
    white-space: nowrap;
    padding: 0.85rem 1rem !important;
    font-size: 0.85rem;
  }
  #statsRow {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 480px) {
  .login-card { padding: 2.25rem 1.25rem; margin: 1rem; border-radius: 20px; }
  .login-logo h1 { font-size: 1.45rem; }
  .login-logo .brand-icon { width: 56px; height: 56px; font-size: 1.5rem; margin-bottom: 0.75rem; }
  
  /* Toast Notification mobile bounds */
  .toast-container {
    left: 1rem;
    right: 1rem;
    top: 1rem;
  }
  .toast {
    width: 100%;
    min-width: unset;
  }
  
  /* Panel Header stacking on small screens */
  .panel-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
    padding: 0.85rem 1rem !important;
  }
  #vendorFilterWrap {
    width: 100%;
    margin-top: 0.25rem;
    border-top: 1px solid rgba(200,134,10,0.08);
    padding-top: 0.5rem;
  }
  
  /* Compact stats on small screen */
  .analytics-stat {
    padding: 0.65rem 0.5rem !important;
  }
  .analytics-stat .value {
    font-size: 1.05rem !important;
  }
}

/* ============================================================
   FLOATING PARTICLES (Login)
   ============================================================ */
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.4; }
  50%       { transform: translateY(-20px) rotate(180deg); opacity: 0.7; }
}

.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: float linear infinite;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  min-width: 260px;
  padding: 0.85rem 1.2rem;
  border-radius: 12px;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  backdrop-filter: blur(10px);
  animation: toastIn 0.4s cubic-bezier(0.23,1,0.32,1) both;
  cursor: pointer;
}

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

.toast-success { background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.3); color: #86efac; }
.toast-error   { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.toast-warning { background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.3); color: #fcd34d; }
.toast-info    { background: rgba(59,130,246,0.15); border: 1px solid rgba(59,130,246,0.3); color: #93c5fd; }

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid rgba(200,134,10,0.3);
  border-top-color: var(--cocoa-gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 0.5rem;
  border-radius: 8px;
  font-size: 0.83rem;
  color: var(--text-primary);
  background: rgba(0,0,0,0.03);
  border: 1px solid rgba(200,134,10,0.15);
  text-decoration: none;
  transition: all var(--transition);
}

.page-link:hover, .page-link.current {
  background: rgba(200,134,10,0.15);
  color: var(--cocoa-gold);
  border-color: rgba(200,134,10,0.3);
}

/* ============================================================
   SEARCH / FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.search-input {
  flex: 1;
  min-width: 200px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(200,134,10,0.18);
  border-radius: 10px;
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  color: var(--cocoa-cream);
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: all var(--transition);
}

.search-input:focus {
  border-color: var(--cocoa-gold);
  box-shadow: 0 0 0 3px rgba(200,134,10,0.1);
}

.search-wrap { position: relative; flex: 1; min-width: 200px; }
.search-wrap i {
  position: absolute;
  left: 0.85rem; top: 50%;
  transform: translateY(-50%);
  color: rgba(200,134,10,0.5);
  font-size: 0.85rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
.app-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(200,134,10,0.08);
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 999;
}

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