/* ZupZap management console — sidebar layout */
:root {
  --a-purple: #4F3DD6; --a-purple-dark: #3B2C9F; --a-purple-soft: #EEEBFF;
  --a-orange: #FF6B1A; --a-orange-soft: #FFEBDD;
  --a-ink: #1E1B2E; --a-muted: #7A7490; --a-border: #ECE8F5; --a-bg: #F6F5FB; --a-card: #fff;
  --a-green: #1E9B5A; --a-green-soft: #E3F7EC; --a-red: #D8453B; --a-red-soft: #FDE8E6;
  --c-tea: #3F3BBF; --c-coffee: #FF6B3D; --c-juice: #FFC436; --c-sandwich: #4CAF6E; --c-snacks: #8E6BFF;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; background: var(--a-bg); color: var(--a-ink); }
.hide { display: none !important; }

/* layout */
.a-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.a-side { background: linear-gradient(180deg, #2E2680 0%, #231C66 100%); color: #fff; padding: 22px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.a-side .brand { font-weight: 900; font-size: 32px; padding: 4px 12px 0; letter-spacing: -.5px; }
.a-side .brand .zup { color: #fff; } .a-side .brand .zap { color: var(--a-orange); }
.a-side .tag { color: #B9B2E6; font-size: 14px; padding: 0 12px 22px; }
.a-nav button { width: 100%; display: flex; align-items: center; gap: 14px; background: none; border: none; color: #DAD5F5; font-size: 15.5px; padding: 13px 14px; border-radius: 12px; cursor: pointer; text-align: left; margin-bottom: 4px; }
.a-nav button svg { width: 22px; height: 22px; flex: 0 0 auto; }
.a-nav button:hover { background: rgba(255,255,255,.08); color: #fff; }
.a-nav button.active { background: #5B4BE6; color: #fff; font-weight: 700; }
.a-nav .badge { margin-left: auto; background: var(--a-orange); color: #fff; font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.a-main { padding: 22px 26px 40px; min-width: 0; }

/* header */
.a-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.a-head h1 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.4px; }
.a-head .date { color: var(--a-muted); font-size: 15px; margin-top: 2px; }
.a-head-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.a-select { position: relative; }
.a-select select { appearance: none; background: #fff; border: 1px solid var(--a-border); border-radius: 12px; padding: 10px 36px 10px 38px; font-size: 14px; font-weight: 600; color: var(--a-ink); min-width: 190px; }
.a-select::before { content: "📍"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; }
.a-select::after { content: "⌄"; position: absolute; right: 12px; top: 45%; transform: translateY(-50%); color: var(--a-muted); }
.a-bell { position: relative; width: 42px; height: 42px; border-radius: 12px; background: #fff; border: 1px solid var(--a-border); display: grid; place-items: center; color: var(--a-orange); }
.a-bell svg { width: 22px; height: 22px; }
.a-bell b { position: absolute; top: -6px; right: -6px; background: var(--a-orange); color: #fff; font-size: 11px; border-radius: 999px; padding: 1px 6px; }
.a-user { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.a-user .av { width: 38px; height: 38px; border-radius: 50%; background: var(--a-purple); color: #fff; display: grid; place-items: center; font-weight: 800; }
.a-cta { background: var(--a-orange); color: #fff; border: none; border-radius: 12px; padding: 12px 18px; font-weight: 800; font-size: 15px; cursor: pointer; box-shadow: 0 8px 18px rgba(255,107,26,.25); }
.a-cta:hover { filter: brightness(.96); }
.a-btn { background: var(--a-purple); color: #fff; border: none; border-radius: 10px; padding: 10px 16px; font-weight: 700; font-size: 14px; cursor: pointer; }
.a-btn.ghost { background: var(--a-purple-soft); color: var(--a-purple); }
.a-btn.green { background: var(--a-green); } .a-btn.red { background: var(--a-red); }
.a-btn.sm { padding: 7px 12px; font-size: 13px; }
.a-btn:disabled { opacity: .5; cursor: not-allowed; }

/* cards */
.a-card { background: var(--a-card); border: 1px solid var(--a-border); border-radius: 18px; padding: 18px 20px; box-shadow: 0 2px 10px rgba(40,30,90,.04); }
.a-card h2 { margin: 0; font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.a-card h2 .ic { width: 28px; height: 28px; border-radius: 8px; background: var(--a-purple-soft); display: grid; place-items: center; font-size: 15px; }
.a-card .hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.a-card .hd a, .a-link { color: var(--a-purple); font-weight: 700; font-size: 14px; text-decoration: none; cursor: pointer; }
.a-grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.a-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.a-grid-main { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; margin-top: 16px; }
@media (max-width: 1200px) { .a-grid4 { grid-template-columns: 1fr 1fr; } .a-grid-main, .a-grid2 { grid-template-columns: 1fr; } }
@media (max-width: 820px) { .a-shell { grid-template-columns: 1fr; } .a-side { position: static; height: auto; } }

.kpi { display: flex; gap: 16px; align-items: flex-start; }
.kpi .ic { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; font-size: 28px; flex: 0 0 auto; }
.kpi .ic.blue { background: #E3EDFF; } .kpi .ic.orange { background: var(--a-orange-soft); } .kpi .ic.red { background: #FFE3E0; } .kpi .ic.yellow { background: #FFF3D6; }
.kpi .lbl { color: var(--a-muted); font-size: 15px; }
.kpi .val { font-size: 34px; font-weight: 900; line-height: 1.1; margin: 2px 0 6px; }
.kpi .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kpi .delta { font-size: 13px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--a-green-soft); color: var(--a-green); }
.kpi .delta.down { background: var(--a-red-soft); color: var(--a-red); }
.kpi .vs { color: var(--a-muted); font-size: 13px; }
.kpi .side { margin-left: auto; text-align: right; color: var(--a-muted); font-size: 12.5px; }
.kpi .side b { display: block; color: var(--a-ink); font-size: 15px; }

/* charts */
.chart-wrap { width: 100%; overflow-x: auto; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; margin-top: 8px; font-size: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.donut-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: center; }
.donut-legend div { display: grid; grid-template-columns: 14px 1fr auto auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--a-border); font-size: 14.5px; }
.donut-legend div:last-child { border-bottom: none; }
.donut-legend i { width: 12px; height: 12px; border-radius: 50%; }
.donut-legend b { font-weight: 800; }
.donut-legend span:last-child { color: var(--a-muted); min-width: 48px; text-align: right; }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 12px 12px; border-bottom: 1px solid var(--a-border); vertical-align: middle; }
th { background: #F7F6FC; color: var(--a-muted); font-weight: 700; font-size: 13.5px; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; }
.pill { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.pill.green { background: var(--a-green-soft); color: var(--a-green); }
.pill.grey { background: #EEECF5; color: var(--a-muted); }
.pill.orange { background: var(--a-orange-soft); color: var(--a-orange); }
.pill.red { background: var(--a-red-soft); color: var(--a-red); }
.prod { display: inline-flex; align-items: center; gap: 10px; }
.prod i { width: 32px; height: 32px; border-radius: 10px; background: var(--a-purple-soft); display: grid; place-items: center; font-style: normal; font-size: 16px; }

/* approvals */
.appr { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--a-border); }
.appr:last-child { border-bottom: none; }
.appr .ic { width: 42px; height: 42px; border-radius: 12px; background: var(--a-purple-soft); display: grid; place-items: center; font-size: 18px; flex: 0 0 auto; }
.appr .who { width: 150px; } .appr .who b { display: block; font-size: 14.5px; } .appr .who span { color: var(--a-muted); font-size: 13px; }
.appr .what { flex: 1; } .appr .what b { display: block; font-size: 14px; } .appr .what span { color: var(--a-muted); font-size: 13px; }
.appr .ago { color: var(--a-muted); font-size: 13px; white-space: nowrap; }
.appr .acts { display: flex; gap: 6px; }
.review { margin-top: 12px; width: 100%; background: var(--a-orange-soft); color: var(--a-orange); border: 1px solid #FFD2B8; border-radius: 12px; padding: 13px; font-weight: 800; font-size: 15px; cursor: pointer; }

/* forms */
label { display: block; font-size: 13px; color: var(--a-muted); margin: 10px 0 5px; }
input, select { width: 100%; padding: 10px 12px; font-size: 14px; border: 1px solid var(--a-border); border-radius: 10px; background: #fff; color: var(--a-ink); }
input:focus, select:focus { outline: none; border-color: var(--a-purple); box-shadow: 0 0 0 3px rgba(79,61,214,.12); }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.form-grid.c4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .form-grid, .form-grid.c4 { grid-template-columns: 1fr 1fr; } }
.muted { color: var(--a-muted); }
.empty { color: var(--a-muted); padding: 18px 0; text-align: center; }
.toast { position: fixed; right: 22px; bottom: 22px; background: var(--a-ink); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; z-index: 100; max-width: 420px; }
.toast.ok { background: var(--a-green); } .toast.err { background: var(--a-red); }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tab { padding: 8px 14px; border-radius: 999px; background: #EEECF5; cursor: pointer; font-weight: 600; font-size: 14px; }
.tab.active { background: var(--a-purple); color: #fff; }

/* login */
.a-login { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #EEEBFF, #FFF1E6); padding: 20px; }
.a-login .box { width: 100%; max-width: 420px; background: #fff; border-radius: 22px; padding: 30px 26px; box-shadow: 0 16px 40px rgba(40,30,90,.12); }
.a-login .brand { font-weight: 900; font-size: 34px; } .a-login .brand .zup { color: var(--a-purple); } .a-login .brand .zap { color: var(--a-orange); }
.a-login .sub { color: var(--a-muted); margin-bottom: 8px; }
.a-login .a-cta { width: 100%; margin-top: 18px; }
