/* ═══════════════════════════════════════════════════
   Ebrrar Stock Taking — Main Stylesheet
   ═══════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

/* ── Tokens ── */
:root {
  --purple:        #7b22b8;
  --purple-light:  #f3e8fd;
  --purple-mid:    #9d44d6;
  --purple-dark:   #4a0f82;
  --purple-900:    #1e0636;
  --amber:         #d97706;
  --amber-light:   #fef3c7;
  --red:           #dc2626;
  --red-light:     #fee2e2;
  --blue:          #1d6fa4;
  --blue-light:    #dbeafe;
  --green:         #15803d;
  --green-light:   #dcfce7;
  --ink:           #111827;
  --ink2:          #374151;
  --ink3:          #6b7280;
  --ink4:          #9ca3af;
  --surface:       #ffffff;
  --surface2:      #f9fafb;
  --surface3:      #f3f4f6;
  --border:        #e5e7eb;
  --border2:       #d1d5db;
  --r:             10px;
  --r-lg:          16px;
  --shadow:        0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:     0 4px 16px rgba(0,0,0,0.10);
  --shadow-xl:     0 20px 60px rgba(0,0,0,0.18);
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: #f5f0fa;
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════
   LOGIN
══════════════════════════════════════ */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2a0a4a 0%, #4a1272 50%, #1e0636 100%);
  padding: 20px;
}

.login-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-xl);
  animation: fadeUp 0.35s ease;
}

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

.login-logo img {
  height: 44px;
  object-fit: contain;
}

.login-logo-sub {
  font-size: 11px;
  color: var(--ink3);
  margin-top: 1px;
}

.login-title { font-size: 26px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.login-sub   { font-size: 14px; color: var(--ink3); margin-bottom: 32px; }

.login-field { margin-bottom: 16px; }
.login-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink2);
  margin-bottom: 6px;
}

.login-field input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border2);
  border-radius: var(--r);
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface2);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.login-field input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(123,34,184,0.12);
  background: var(--surface);
}

.login-btn {
  width: 100%;
  padding: 13px;
  background: var(--purple);
  color: white;
  border: none;
  border-radius: var(--r);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  margin-top: 8px;
}
.login-btn:hover  { background: var(--purple-dark); }
.login-btn:active { transform: scale(0.98); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.login-err {
  font-size: 13px;
  color: var(--red);
  margin-top: 10px;
  text-align: center;
  min-height: 20px;
}

.login-hint {
  font-size: 12px;
  color: var(--ink4);
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.login-hint strong {
  color: var(--ink3);
  font-weight: 500;
  font-family: 'DM Mono', monospace;
}

/* ══════════════════════════════════════
   APP SHELL
══════════════════════════════════════ */
#app { display: none; min-height: 100vh; }

.sidebar {
  width: 224px;
  background: var(--purple-900);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.25s ease;
}

.sidebar-logo {
  padding: 20px 18px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo img   { height: 30px; object-fit: contain; }
.sidebar-logo-text  { font-size: 13px; font-weight: 600; color: #fff; line-height: 1.2; }
.sidebar-logo-sub   { font-size: 10px; color: rgba(255,255,255,0.35); }

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

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.28);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 10px;
  margin: 18px 0 6px;
}
.nav-section-label:first-child { margin-top: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: rgba(255,255,255,0.52);
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 2px;
  user-select: none;
}
.nav-item:hover  { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.85); }
.nav-item.active { background: rgba(155,68,214,0.25); color: #d4a0f7; }
.nav-item svg    { width: 17px; height: 17px; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
}

.sidebar-bottom {
  padding: 14px 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.user-info:hover { background: rgba(255,255,255,0.07); }

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.82); }
.user-role { font-size: 11px; color: rgba(255,255,255,0.35); }

.logout-btn {
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  margin-left: auto;
  padding: 4px;
  transition: color 0.15s;
  background: none;
  border: none;
  line-height: 1;
}
.logout-btn:hover { color: rgba(255,255,255,0.75); }

/* ── Main Content ── */
.main     { margin-left: 224px; min-height: 100vh; }
.topbar   {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.page-title { font-size: 17px; font-weight: 600; color: var(--ink); }
.page-date  { font-size: 12px; color: var(--ink3); font-family: 'DM Mono', monospace; }
.content    { padding: 28px; }

/* ── Views ── */
.view        { display: none; animation: fadeIn 0.2s ease; }
.view.active { display: block; }

/* ══════════════════════════════════════
   METRIC CARDS
══════════════════════════════════════ */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.metric-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.metric-icon svg          { width: 18px; height: 18px; }
.metric-icon.purple       { background: var(--purple-light); color: var(--purple); }
.metric-icon.amber        { background: var(--amber-light);  color: var(--amber); }
.metric-icon.red          { background: var(--red-light);    color: var(--red); }
.metric-icon.blue         { background: var(--blue-light);   color: var(--blue); }

.metric-label { font-size: 12px; color: var(--ink3); margin-bottom: 4px; font-weight: 500; }
.metric-value { font-size: 26px; font-weight: 600; color: var(--ink); line-height: 1; }
.metric-sub   { font-size: 12px; margin-top: 6px; }
.metric-sub.up   { color: var(--green); }
.metric-sub.warn { color: var(--amber); }
.metric-sub.down { color: var(--red); }
.metric-sub.muted{ color: var(--ink4); }

/* ══════════════════════════════════════
   CARDS / LAYOUT
══════════════════════════════════════ */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 20px;
}

.card-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title { font-size: 14px; font-weight: 600; color: var(--ink); }

.two-col   { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

/* ══════════════════════════════════════
   TABLE
══════════════════════════════════════ */
.tbl            { width: 100%; border-collapse: collapse; }
.tbl th         { font-size: 11px; font-weight: 600; color: var(--ink3); text-transform: uppercase; letter-spacing: 0.05em; padding: 10px 20px; text-align: left; border-bottom: 1px solid var(--border); background: var(--surface2); white-space: nowrap; }
.tbl td         { padding: 12px 20px; font-size: 13px; color: var(--ink2); border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td      { background: var(--surface2); }
.tbl-actions    { display: flex; gap: 6px; }

/* ══════════════════════════════════════
   BADGES
══════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-purple { background: var(--purple-light); color: var(--purple-dark); }
.badge-amber  { background: var(--amber-light);  color: #92400e; }
.badge-red    { background: var(--red-light);    color: #991b1b; }
.badge-blue   { background: var(--blue-light);   color: #1e40af; }
.badge-green  { background: var(--green-light);  color: #14532d; }
.badge-gray   { background: var(--surface3);     color: var(--ink3); }

/* ══════════════════════════════════════
   BUTTONS
══════════════════════════════════════ */
.btn {
  padding: 8px 16px;
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn svg           { width: 14px; height: 14px; }
.btn-primary       { background: var(--purple); color: white; }
.btn-primary:hover { background: var(--purple-dark); }
.btn-secondary     { background: var(--surface); border: 1.5px solid var(--border2); color: var(--ink2); }
.btn-secondary:hover { background: var(--surface2); }
.btn-danger        { background: var(--red-light); color: var(--red); }
.btn-danger:hover  { background: #fca5a5; }
.btn-ghost         { background: transparent; color: var(--ink3); }
.btn-ghost:hover   { background: var(--surface3); color: var(--ink); }
.btn-sm            { padding: 5px 10px; font-size: 12px; }
.btn-sm svg        { width: 12px; height: 12px; }
.btn:disabled      { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* ══════════════════════════════════════
   FORMS (general)
══════════════════════════════════════ */
.form-row   { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; padding: 16px 20px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 12px; font-weight: 500; color: var(--ink2); }

input[type="text"],
input[type="number"],
input[type="password"],
input[type="date"],
select,
textarea {
  padding: 8px 12px;
  border: 1.5px solid var(--border2);
  border-radius: var(--r);
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(123,34,184,0.1);
}

/* ══════════════════════════════════════
   STOCK TAKE
══════════════════════════════════════ */
.st-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to right, #faf5ff, var(--surface));
}
.st-title { font-size: 20px; font-weight: 600; color: var(--ink); }
.st-sub   { font-size: 13px; color: var(--ink3); margin-top: 2px; }
.st-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  background: var(--purple-light);
  color: var(--purple-dark);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.revenue-section {
  padding: 12px 24px;
  background: var(--blue-light);
  border-bottom: 1px solid #bfdbfe;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.revenue-label { font-size: 13px; color: var(--blue); font-weight: 500; }
.revenue-section input {
  width: 160px;
  background: white;
  border-color: #93c5fd;
  font-family: 'DM Mono', monospace;
}
.revenue-section input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29,111,164,0.12); }

.cat-header {
  padding: 8px 24px 6px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.cat-name {
  font-size: 10px;
  font-weight: 700;
  color: var(--ink3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.st-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.st-item:last-child  { border-bottom: none; }
.st-item:hover       { background: #faf5ff; }

.st-checkbox {
  width: 20px; height: 20px;
  border-radius: 5px;
  border: 2px solid var(--border2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.st-checkbox.checked { background: var(--purple); border-color: var(--purple); }
.st-checkbox.checked::after {
  content: '';
  width: 11px; height: 7px;
  border-left: 2.5px solid white;
  border-bottom: 2.5px solid white;
  transform: rotate(-45deg) translate(1px,-1px);
  display: block;
}

.st-item-info { flex: 1; min-width: 0; }
.st-item-name { font-size: 14px; font-weight: 500; color: var(--ink); }
.st-item-meta { font-size: 12px; color: var(--ink3); margin-top: 1px; }

.st-qty-wrap {
  display: flex; align-items: center; gap: 8px;
  transition: opacity 0.15s;
}
.st-qty-wrap.dim { opacity: 0.28; pointer-events: none; }

.qty-ctrl {
  width: 30px; height: 30px;
  border-radius: 7px;
  border: 1.5px solid var(--border2);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 17px; color: var(--ink2);
  transition: all 0.1s;
  user-select: none;
  line-height: 1;
}
.qty-ctrl:hover { border-color: var(--purple); color: var(--purple); }

.qty-display {
  font-size: 14px; font-weight: 600; color: var(--ink);
  min-width: 38px; text-align: center;
  font-family: 'DM Mono', monospace;
}

.st-item-cost {
  font-size: 13px; font-weight: 500;
  min-width: 90px; text-align: right;
  color: var(--ink2);
  font-family: 'DM Mono', monospace;
}

.st-footer {
  padding: 16px 24px;
  background: var(--surface);
  border-top: 2px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; bottom: 0;
  flex-wrap: wrap; gap: 12px;
}
.st-total-label { font-size: 12px; color: var(--ink3); }
.st-total-value { font-size: 22px; font-weight: 700; color: var(--purple); font-family: 'DM Mono', monospace; }
.st-footer-right { display: flex; align-items: center; gap: 12px; }
.st-count        { font-size: 13px; color: var(--ink3); }

/* ── Success ── */
.success-wrap    { display: none; text-align: center; padding: 60px 40px; }
.success-icon-big {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--purple-light);
  margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
}
.success-icon-big svg  { width: 36px; height: 36px; }
.success-title         { font-size: 22px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.success-detail        { font-size: 14px; color: var(--ink3); margin-bottom: 24px; }
.success-summary       { background: var(--surface2); border-radius: var(--r-lg); border: 1px solid var(--border); padding: 20px; display: inline-block; min-width: 280px; margin-bottom: 24px; text-align: left; }
.summary-row           { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; gap: 16px; }
.summary-row:last-child{ margin-bottom: 0; border-top: 1px solid var(--border); padding-top: 8px; font-weight: 600; }

/* ══════════════════════════════════════
   CHARTS / BARS
══════════════════════════════════════ */
.bar-chart-row {
  padding: 10px 20px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border);
}
.bar-chart-row:last-child { border-bottom: none; }
.bar-name  { font-size: 13px; color: var(--ink2); width: 140px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-bg    { flex: 1; height: 8px; background: var(--surface3); border-radius: 4px; overflow: hidden; }
.bar-fill  { height: 100%; border-radius: 4px; background: var(--purple); transition: width 0.5s ease; }
.bar-val   { font-size: 12px; color: var(--ink3); min-width: 65px; text-align: right; font-family: 'DM Mono', monospace; }

.cvr-row {
  padding: 10px 20px;
  display: flex; align-items: center; gap: 14px;
  border-bottom: 1px solid var(--border);
}
.cvr-row:last-child  { border-bottom: none; }
.cvr-day             { font-size: 13px; color: var(--ink3); width: 60px; flex-shrink: 0; }
.cvr-bars            { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.cvr-bar-row         { display: flex; align-items: center; gap: 8px; }
.cvr-label           { font-size: 11px; color: var(--ink4); width: 34px; flex-shrink: 0; }
.cvr-bg              { flex: 1; height: 9px; background: var(--surface3); border-radius: 4px; overflow: hidden; }
.cvr-fill-cost       { height: 100%; background: var(--purple); border-radius: 4px; }
.cvr-fill-rev        { height: 100%; background: var(--blue); border-radius: 4px; }
.cvr-amt             { font-size: 11px; color: var(--ink3); min-width: 80px; text-align: right; font-family: 'DM Mono', monospace; }
.cvr-margin          { font-size: 12px; font-weight: 600; min-width: 40px; text-align: right; }
.cvr-margin.good     { color: var(--green); }
.cvr-margin.warn     { color: var(--amber); }
.cvr-margin.bad      { color: var(--red); }

/* ── Alerts ── */
.alert-row           { padding: 12px 20px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); }
.alert-row:last-child{ border-bottom: none; }
.alert-dot           { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.alert-dot.critical  { background: var(--red); }
.alert-dot.low       { background: var(--amber); }
.alert-item-name     { flex: 1; font-size: 13px; font-weight: 500; color: var(--ink); }
.alert-stock-info    { font-size: 12px; color: var(--ink3); }

/* ══════════════════════════════════════
   USERS (settings)
══════════════════════════════════════ */
.user-row            { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.user-row:last-child { border-bottom: none; }
.user-row-avatar     { width: 36px; height: 36px; border-radius: 50%; background: var(--purple-light); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--purple-dark); flex-shrink: 0; }

/* ══════════════════════════════════════
   MODALS
══════════════════════════════════════ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15,6,30,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--surface);
  border-radius: 20px;
  width: 100%; max-width: 460px;
  box-shadow: var(--shadow-xl);
  transform: translateY(16px) scale(0.97);
  transition: transform 0.22s ease;
  overflow: hidden;
}
.modal-backdrop.open .modal { transform: translateY(0) scale(1); }

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.modal-title   { font-size: 17px; font-weight: 600; color: var(--ink); }
.modal-close   { background: none; border: none; cursor: pointer; color: var(--ink3); padding: 2px; line-height: 1; transition: color 0.15s; }
.modal-close:hover { color: var(--ink); }
.modal-close svg   { width: 20px; height: 20px; }

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

.modal-field   { margin-bottom: 16px; }
.modal-field:last-child { margin-bottom: 0; }
.modal-field label { display: block; font-size: 13px; font-weight: 500; color: var(--ink2); margin-bottom: 6px; }

/* Confirm modal variant */
.modal-confirm-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
}
.modal-confirm-icon.danger { background: var(--red-light); }
.modal-confirm-icon svg    { width: 26px; height: 26px; }
.modal-confirm-text {
  text-align: center;
}
.modal-confirm-text h3 { font-size: 17px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.modal-confirm-text p  { font-size: 14px; color: var(--ink3); line-height: 1.5; }

/* ══════════════════════════════════════
   TOAST
══════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--ink);
  color: white;
  padding: 12px 18px;
  border-radius: var(--r);
  font-size: 13px; font-weight: 500;
  z-index: 9999;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: none;
  display: flex; align-items: center; gap: 8px;
  max-width: 320px;
  box-shadow: var(--shadow-md);
}
.toast.show        { transform: translateY(0); opacity: 1; }
.toast.success     { background: #15803d; }
.toast.error       { background: var(--red); }
.toast.warning     { background: var(--amber); }
.toast svg         { width: 16px; height: 16px; flex-shrink: 0; }

/* ══════════════════════════════════════
   LOADING
══════════════════════════════════════ */
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(30,6,54,0.5);
  display: none;
  align-items: center; justify-content: center;
  z-index: 9998;
}
.loading-overlay.active { display: flex; }

.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(255,255,255,0.18);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

/* ══════════════════════════════════════
   MISC
══════════════════════════════════════ */
.empty      { padding: 40px 20px; text-align: center; color: var(--ink4); font-size: 13px; }
.empty strong { display: block; font-size: 15px; color: var(--ink3); margin-bottom: 4px; }
.mono       { font-family: 'DM Mono', monospace; }
.text-purple{ color: var(--purple); }
.text-green { color: var(--green); }
.text-amber { color: var(--amber); }
.text-red   { color: var(--red); }
.text-muted { color: var(--ink3); }
.fw-600     { font-weight: 600; }
small       { font-size: 12px; color: var(--ink3); }

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

.chart-legend {
  display: flex; gap: 14px; align-items: center;
}
.legend-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 2px;
  margin-right: 4px;
}

/* ══════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════ */
@keyframes fadeIn  { from { opacity: 0; }             to { opacity: 1; } }
@keyframes fadeUp  { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin    { to   { transform: rotate(360deg); } }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 900px) {
  .metrics-grid { grid-template-columns: repeat(2,1fr); }
  .two-col, .three-col { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .sidebar { transform: translateX(-224px); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-xl); }
  .main  { margin-left: 0; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .metrics-grid { grid-template-columns: repeat(2,1fr); gap: 10px; }
  .st-item { padding: 10px 14px; gap: 10px; }
}

/* ══════════════════════════════════════
   HAMBURGER + MOBILE NAV
══════════════════════════════════════ */
.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink2);
  border-radius: var(--r);
  transition: background 0.15s;
  flex-shrink: 0;
}
.hamburger-btn:hover { background: var(--surface3); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 99;
}
.sidebar-overlay.active { display: block; }

@media (max-width: 700px) {
  .hamburger-btn { display: flex; }

  .sidebar {
    transform: translateX(-224px);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }

  .main { margin-left: 0; }

  .topbar { padding: 0 14px; height: 52px; }
  .content { padding: 14px; }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .two-col, .three-col { grid-template-columns: 1fr; }

  .st-item { padding: 10px 14px; gap: 10px; }
  .st-header { padding: 16px 14px 12px; }
  .st-footer { padding: 12px 14px; }
  .revenue-section { padding: 10px 14px; }
  .cat-header { padding: 8px 14px 6px; }

  .tbl th, .tbl td { padding: 10px 12px; font-size: 12px; }

  .form-row { padding: 12px 14px; gap: 8px; }
  .form-row .form-group input,
  .form-row .form-group select { min-width: 0; }

  .modal { border-radius: 16px 16px 0 0; position: fixed; bottom: 0; left: 0; right: 0; max-width: 100%; }
  .modal-backdrop { align-items: flex-end; padding: 0; }

  .success-wrap { padding: 40px 20px; }
  .success-summary { min-width: 0; width: 100%; }

  .card-head { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }
  .bar-name { width: 100px; }
  .cvr-amt { min-width: 60px; font-size: 10px; }
}

@media (max-width: 400px) {
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric-card { padding: 14px; }
  .metric-value { font-size: 20px; }
}
