/* =============================================================================
   Ezylife Admin — design system
   Aesthetic: refined luxury. Royal Midnight canvas, Champagne Gold accents,
   Royal Burgundy for urgency, Ivory text. Ranade (display) + Hind (body).
   ============================================================================ */

:root {
  /* Brand */
  --midnight-900: #080d1f;   /* canvas */
  --midnight-800: #0d1430;
  --midnight-700: #131b3d;   /* panels */
  --midnight-600: #1b2550;
  --midnight-500: #27336b;
  --line: #232f5e;
  --line-soft: #1a2348;

  --gold: #d4af6a;
  --gold-bright: #e6cd92;
  --gold-dim: #9d8246;
  --gold-glow: rgba(212,175,106,.14);

  --burgundy: #8a2740;
  --burgundy-bright: #c25671;
  --burgundy-glow: rgba(138,39,64,.18);

  --ivory: #f3efe4;
  --ivory-dim: #c8c5ba;
  --muted: #8b91a8;
  --muted-soft: #6a7194;
  --muted-2: #6a7194;

  --ok: #5fbf8a;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 40px rgba(0,0,0,.45);
  --shadow-soft: 0 2px 14px rgba(0,0,0,.25);

  --sidebar-w: 244px;
  --font-display: "Ranade", "Hind", Georgia, serif;
  --font-body: "Hind", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ivory);
  background:
    radial-gradient(1100px 700px at 78% -8%, rgba(212,175,106,.07), transparent 60%),
    radial-gradient(900px 600px at -5% 110%, rgba(138,39,64,.10), transparent 55%),
    var(--midnight-900);
  -webkit-font-smoothing: antialiased;
  letter-spacing: .01em;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--gold-glow); }

/* ---------- App layout ---------- */
#app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--midnight-800), var(--midnight-900));
  border-right: 1px solid var(--line-soft);
  padding: 22px 14px; z-index: 40;
}
.main-col { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }

.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--midnight-900);
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-dim));
  box-shadow: 0 4px 16px var(--gold-glow);
}
.brand-mark.lg { width: 52px; height: 52px; font-size: 27px; border-radius: 13px; }
.brand-name { font-family: var(--font-display); font-weight: 600; letter-spacing: .22em; font-size: 15px; }
.brand-sub { font-size: 11px; color: var(--gold); letter-spacing: .28em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--muted); font-size: 14px; font-weight: 500; transition: all .16s ease;
}
.nav-item .icon { color: var(--muted-2); display: inline-flex; }
.nav-item:hover { background: var(--midnight-700); color: var(--ivory-dim); }
.nav-item:hover .icon { color: var(--gold); }
.nav-item.active { background: linear-gradient(90deg, var(--gold-glow), transparent); color: var(--ivory); box-shadow: inset 2px 0 0 var(--gold); }
.nav-item.active .icon { color: var(--gold); }

.sidebar-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 8px 4px; border-top: 1px solid var(--line-soft); }
.who-name { font-size: 13px; font-weight: 600; }
.who-role { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; margin-top: 2px; }
.role-owner { color: var(--gold); }
.role-worker { color: var(--muted); }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px;
  padding: 14px 30px; background: rgba(8,13,31,.72); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-title { font-family: var(--font-display); font-size: 18px; font-weight: 500; flex: 1; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  background: var(--midnight-700); border: 1px solid var(--line); color: var(--ivory-dim);
  cursor: pointer; transition: all .15s ease;
}
.icon-btn:hover { color: var(--gold); border-color: var(--gold-dim); }
.menu-btn { display: none; }

/* ---------- Content ---------- */
.content { padding: 30px; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-h1 { font-family: var(--font-display); font-weight: 500; font-size: 30px; margin: 0; letter-spacing: .01em; }
.page-date { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ---------- KPI row ---------- */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi {
  background: linear-gradient(180deg, var(--midnight-700), var(--midnight-800));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px;
  box-shadow: var(--shadow-soft); position: relative; overflow: hidden;
}
.kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); }
.kpi-label { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.kpi-top .icon { color: var(--muted-2); }
.kpi-value { font-family: var(--font-display); font-size: 30px; font-weight: 600; margin-top: 12px; letter-spacing: .01em; }
.kpi-gold { border-color: var(--gold-dim); }
.kpi-gold::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120px 80px at 90% -20%, var(--gold-glow), transparent 70%); pointer-events: none; }
.kpi-gold .kpi-value { color: var(--gold-bright); }
.kpi-gold .kpi-top .icon { color: var(--gold); }
.kpi-burgundy { border-color: var(--burgundy); }
.kpi-burgundy .kpi-value { color: var(--burgundy-bright); }
.kpi-burgundy .kpi-top .icon { color: var(--burgundy-bright); }

/* ---------- Daily grid ---------- */
.daily-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; align-items: start; }
.alerts-grid { display: flex; flex-direction: column; gap: 20px; }

/* ---------- Panels ---------- */
.panel {
  background: linear-gradient(180deg, var(--midnight-700), var(--midnight-800));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 14px;
  box-shadow: var(--shadow-soft);
}
.panel-head { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; color: var(--gold); }
.panel-title { font-family: var(--font-display); font-weight: 500; font-size: 16px; margin: 0; color: var(--ivory); }

/* ---------- Sale rows ---------- */
.sale-list { display: flex; flex-direction: column; }
.sale-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line-soft); }
.sale-row:last-child { border-bottom: 0; }
.sale-item { font-weight: 600; font-size: 14px; }
.sale-meta { font-size: 12px; color: var(--muted); margin-top: 3px; letter-spacing: .02em; }
.sale-amount { font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--gold-bright); white-space: nowrap; }

/* ---------- Alert lanes ---------- */
.alert-lane { padding-bottom: 8px; }
.alert-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line-soft); }
.alert-row:last-of-type { border-bottom: 0; }
.alert-body { flex: 1; min-width: 0; }
.alert-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-sub { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-time { font-size: 11px; color: var(--muted-2); white-space: nowrap; }
.alert-row .icon { color: var(--gold); }

.pill { font-size: 11px; padding: 4px 8px; border-radius: 999px; background: var(--midnight-600); color: var(--ivory-dim); white-space: nowrap; border: 1px solid var(--line); }
.pill-gold { background: var(--gold-glow); color: var(--gold-bright); border-color: var(--gold-dim); }
.pill-burgundy { background: var(--burgundy-glow); color: var(--burgundy-bright); border-color: var(--burgundy); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); flex: none; box-shadow: 0 0 0 4px var(--gold-glow); }
.dot-burgundy { background: var(--burgundy-bright); box-shadow: 0 0 0 4px var(--burgundy-glow); }

.lane-more { display: inline-block; margin-top: 12px; font-size: 12px; color: var(--gold); letter-spacing: .03em; }
.lane-more:hover { color: var(--gold-bright); }

/* ---------- Empty / error / skeleton ---------- */
.empty { padding: 22px 6px; text-align: left; }
.empty-title { font-size: 14px; color: var(--ivory-dim); }
.empty-sub { font-size: 12px; color: var(--muted); margin-top: 5px; }
.error-state { display: flex; align-items: center; gap: 10px; padding: 16px; color: var(--burgundy-bright); font-size: 13px; }
.error-state .btn { margin-left: auto; }
.skeleton { display: flex; flex-direction: column; gap: 10px; padding: 6px 2px; }
.skel-line { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--midnight-600), var(--midnight-500), var(--midnight-600)); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------- Stub pages ---------- */
.stub { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 70px 20px; color: var(--muted); }
.stub .icon { color: var(--gold); }
.stub-title { font-family: var(--font-display); font-size: 20px; color: var(--ivory); margin-top: 6px; }
.stub-blurb { max-width: 440px; font-size: 14px; }
.stub-note { font-size: 12px; color: var(--muted-2); margin-top: 8px; }

/* ---------- Buttons ---------- */
.btn { font-family: var(--font-body); font-size: 14px; font-weight: 600; padding: 11px 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--midnight-600); color: var(--ivory); cursor: pointer; transition: all .15s ease; }
.btn:hover { border-color: var(--gold-dim); }
.btn-gold { background: linear-gradient(135deg, var(--gold-bright), var(--gold-dim)); color: var(--midnight-900); border: 0; }
.btn-gold:hover { filter: brightness(1.06); }
.btn-gold:disabled { opacity: .6; cursor: default; }
.btn-ghost { background: transparent; }

/* ---------- Auth screens ---------- */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; background: linear-gradient(180deg, var(--midnight-700), var(--midnight-800)); border: 1px solid var(--line); border-radius: 18px; padding: 30px 28px; box-shadow: var(--shadow); }
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.auth-title { font-family: var(--font-display); font-size: 22px; font-weight: 500; }
.auth-lead { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 0 0 16px; }
.field { width: 100%; padding: 13px 14px; border-radius: 11px; background: var(--midnight-900); border: 1px solid var(--line); color: var(--ivory); font-size: 15px; font-family: var(--font-body); margin-bottom: 12px; }
.field:focus { outline: none; border-color: var(--gold-dim); box-shadow: 0 0 0 3px var(--gold-glow); }
.field-code { letter-spacing: .3em; text-align: center; }
.auth-card .btn-gold { width: 100%; }
.auth-msg { color: var(--burgundy-bright); font-size: 13px; min-height: 18px; margin-top: 10px; line-height: 1.4; }
.auth-help { margin-top: 18px; font-size: 13px; color: var(--muted); }
.auth-help summary { cursor: pointer; color: var(--gold); }
.auth-help-body { margin-top: 8px; line-height: 1.6; color: var(--ivory-dim); }
.auth-help code { background: var(--midnight-900); padding: 1px 5px; border-radius: 5px; font-size: 12px; }
.auth-warn { margin-top: 18px; padding: 11px 13px; border-radius: 10px; background: var(--burgundy-glow); border: 1px solid var(--burgundy); color: var(--ivory-dim); font-size: 12px; line-height: 1.5; }
.auth-foot { color: var(--muted-2); font-size: 12px; letter-spacing: .08em; }

/* ---------- Toasts ---------- */
.toast-host { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.toast { padding: 11px 18px; border-radius: 10px; background: var(--midnight-600); border: 1px solid var(--line); color: var(--ivory); font-size: 13px; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); transition: all .25s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { border-color: var(--ok); }
.toast-error { border-color: var(--burgundy); color: var(--burgundy-bright); }

/* ---------- Responsive ---------- */
.scrim { display: none; }
@media (max-width: 980px) {
  .daily-grid { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow); }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 35; }
  .main-col { margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .content { padding: 18px; }
  .topbar { padding: 12px 16px; }
  .page-h1 { font-size: 24px; }
  .kpi-value { font-size: 25px; }
}
@media (max-width: 420px) {
  .kpi-row { grid-template-columns: 1fr 1fr; gap: 12px; }
}
