/* VishualsVault — premium dark, iOS-inspired. Black, almond + emerald light, glass panels. */
:root {
  color-scheme: dark;
  --bg: #000;
  --text: #f4f1ea;
  --text-2: rgba(235, 235, 245, 0.62);
  --text-3: rgba(235, 235, 245, 0.34);
  --glass: rgba(28, 28, 30, 0.52);
  --glass-strong: rgba(36, 36, 40, 0.74);
  --glass-hi: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.085);
  --line-2: rgba(255, 255, 255, 0.14);
  --emerald: #34d399;
  --emerald-2: #10b981;
  --emerald-deep: #065f46;
  --emerald-glow: rgba(52, 211, 153, 0.32);
  --almond: #ead3b2;
  --almond-2: #d9b98c;
  --almond-glow: rgba(234, 211, 178, 0.24);
  --red: #ff6b5e;
  --red-soft: rgba(255, 107, 94, 0.14);
  --amber: #ffcf70;
  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --blur: blur(26px) saturate(170%);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI Variable Display", "Segoe UI", Inter, Roboto, "Helvetica Neue", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body {
  color: var(--text);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--emerald); text-decoration: none; }
img.pixel { image-rendering: pixelated; image-rendering: crisp-edges; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- ambient light ---------- */
.ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.ambient .orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.55; will-change: transform; }
.ambient .o1 { width: 52vmax; height: 52vmax; left: -18vmax; top: -22vmax; background: radial-gradient(circle, rgba(16, 185, 129, 0.55), rgba(6, 95, 70, 0.15) 55%, transparent 70%); animation: drift1 28s var(--ease) infinite alternate; }
.ambient .o2 { width: 46vmax; height: 46vmax; right: -16vmax; bottom: -20vmax; background: radial-gradient(circle, rgba(234, 211, 178, 0.38), rgba(217, 185, 140, 0.1) 55%, transparent 70%); animation: drift2 34s var(--ease) infinite alternate; }
.ambient .o3 { width: 30vmax; height: 30vmax; right: 10vmax; top: 18vh; background: radial-gradient(circle, rgba(52, 211, 153, 0.16), transparent 70%); animation: drift3 40s var(--ease) infinite alternate; }
.ambient::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 120%, rgba(0,0,0,0) 0%, rgba(0,0,0,0.55) 70%); }
@keyframes drift1 { to { transform: translate(12vmax, 8vmax) scale(1.08); } }
@keyframes drift2 { to { transform: translate(-10vmax, -6vmax) scale(1.12); } }
@keyframes drift3 { to { transform: translate(-14vmax, 10vmax) scale(0.9); } }

#app { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; }

/* ---------- glass ---------- */
.glass {
  background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.015)), var(--glass);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 20px 50px -20px rgba(0,0,0,0.8);
}
.card { padding: 18px; }

/* ---------- auth / lock ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: calc(28px + var(--sat)) 16px calc(28px + var(--sab)); }
.auth-inner { width: 100%; max-width: 400px; text-align: center; animation: rise 0.9s var(--ease) both; }
.record { position: relative; width: 156px; height: 156px; margin: 0 auto 26px; }
.record::before { content: ""; position: absolute; inset: -34px; border-radius: 50%; background: conic-gradient(from 0deg, rgba(52,211,153,0.0), rgba(52,211,153,0.55), rgba(234,211,178,0.45), rgba(52,211,153,0.0) 70%); filter: blur(28px); animation: spin 9s linear infinite; }
.record::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid rgba(234,211,178,0.22); box-shadow: 0 0 40px rgba(52,211,153,0.25), inset 0 0 30px rgba(52,211,153,0.12); }
.record img { position: relative; z-index: 1; width: 100%; height: 100%; border-radius: 50%; animation: spin 7s linear infinite; filter: drop-shadow(0 10px 30px rgba(0,0,0,0.8)); }
.record.idle img { animation-duration: 14s; }
@keyframes spin { to { transform: rotate(360deg); } }
.brand-title { font-size: 40px; line-height: 1.05; font-weight: 750; letter-spacing: -0.035em; margin: 0; background: linear-gradient(100deg, var(--almond) 0%, #fff 45%, var(--emerald) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% 100%; animation: sheen 8s ease-in-out infinite alternate; }
@keyframes sheen { to { background-position: 100% 0; } }
.brand-sub { color: var(--text-2); margin: 8px 0 28px; font-size: 15px; letter-spacing: 0.01em; }
.auth-card { padding: 22px; text-align: left; border-radius: var(--r-xl); }
.auth-card h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: -0.01em; }
.auth-card p.hint { margin: 0 0 18px; color: var(--text-2); font-size: 14px; }
.auth-foot { margin-top: 18px; color: var(--text-3); font-size: 12px; display: flex; gap: 6px; justify-content: center; align-items: center; }
.lock-reason { display: inline-flex; gap: 8px; align-items: center; margin-bottom: 14px; padding: 6px 12px; border-radius: 999px; font-size: 13px; color: var(--almond); background: rgba(234,211,178,0.08); border: 1px solid rgba(234,211,178,0.18); }

/* ---------- forms ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; color: var(--text-2); margin: 0 0 6px 4px; }
.input, select.input, textarea.input {
  width: 100%; font-size: 16px; padding: 13px 14px; border-radius: var(--r-sm);
  background: rgba(118,118,128,0.16); border: 1px solid transparent; outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  -webkit-appearance: none; appearance: none;
}
select.input { background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 15px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
select.input option { background: #1c1c1e; }
textarea.input { min-height: 84px; resize: vertical; }
.input:focus { border-color: rgba(52,211,153,0.6); background: rgba(118,118,128,0.22); box-shadow: 0 0 0 4px rgba(52,211,153,0.12); }
.input::placeholder { color: var(--text-3); }
input[type="date"].input { min-height: 50px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.row > .shrink { flex: 0 0 auto; }
.form-error { color: var(--red); font-size: 14px; min-height: 20px; margin: 2px 0 10px 4px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer; border-radius: 14px; padding: 13px 18px; font-weight: 600; font-size: 16px;
  background: rgba(118,118,128,0.2); color: var(--text);
  transition: transform 0.15s var(--ease), background 0.2s, box-shadow 0.25s, opacity 0.2s;
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn.block { width: 100%; }
.btn.primary { background: linear-gradient(180deg, #3ee0a6, #12b882); color: #02140d; box-shadow: 0 8px 28px -8px var(--emerald-glow), inset 0 1px 0 rgba(255,255,255,0.35); }
.btn.primary:hover { box-shadow: 0 10px 36px -6px rgba(52,211,153,0.5), inset 0 1px 0 rgba(255,255,255,0.35); }
.btn.almond { background: linear-gradient(180deg, #f3e2c8, #d8b98e); color: #1d140a; box-shadow: 0 8px 28px -10px var(--almond-glow), inset 0 1px 0 rgba(255,255,255,0.5); }
.btn.ghost { background: transparent; color: var(--emerald); padding: 10px 12px; }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.sm { padding: 8px 12px; font-size: 14px; border-radius: 11px; }
.btn.icon { padding: 0; width: 40px; height: 40px; border-radius: 50%; background: rgba(118,118,128,0.18); }
.btn.icon svg { width: 20px; height: 20px; }
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.link-btn { background: none; border: 0; color: var(--text-2); cursor: pointer; font-size: 14px; padding: 10px; }
.link-btn:hover { color: var(--text); }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; min-height: 100dvh; }
.sidebar { display: none; }
.main { flex: 1; min-width: 0; padding: calc(10px + var(--sat)) calc(16px + var(--sar)) calc(110px + var(--sab)) calc(16px + var(--sal)); max-width: 1180px; margin: 0 auto; width: 100%; }
.page.anim { animation: rise 0.55s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0 6px; position: sticky; top: 0; z-index: 5; }
.topbar .actions { display: flex; gap: 8px; }
.eyebrow { color: var(--text-2); font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.large-title { font-size: 34px; font-weight: 760; letter-spacing: -0.03em; line-height: 1.1; margin: 2px 0 14px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 4px 10px; }
.section-title h3 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.015em; }
.section-title .more { color: var(--emerald); font-size: 15px; cursor: pointer; background: none; border: 0; }

/* bottom tab bar (phones) */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + var(--sab)); z-index: 20;
  display: flex; align-items: center; gap: 2px; padding: 7px; border-radius: 30px; width: min(440px, calc(100% - 24px));
  justify-content: space-between;
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 5px; border-radius: 22px; color: var(--text-3); font-size: 10.5px; font-weight: 600; cursor: pointer; border: 0; background: none; transition: color 0.2s, background 0.25s; }
.tab svg { width: 23px; height: 23px; }
.tab.on { color: var(--text); background: rgba(255,255,255,0.08); }
.tab.on svg { color: var(--emerald); filter: drop-shadow(0 0 8px rgba(52,211,153,0.6)); }
.tab.add { flex: 0 0 56px; height: 50px; border-radius: 22px; background: linear-gradient(180deg, #3ee0a6, #12b882); color: #02140d; box-shadow: 0 6px 22px -6px var(--emerald-glow); }
.tab.add svg { width: 26px; height: 26px; }

@media (min-width: 900px) {
  .tabbar { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; width: 250px; flex: 0 0 250px;
    padding: 22px 14px; margin: 0; border-radius: 0; border-width: 0 1px 0 0;
  }
  .sidebar .logo { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; font-weight: 750; font-size: 18px; letter-spacing: -0.02em; }
  .sidebar .logo img { width: 34px; height: 34px; border-radius: 50%; animation: spin 14s linear infinite; }
  .nav { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 13px; color: var(--text-2); cursor: pointer; border: 0; background: none; font-size: 15px; font-weight: 550; text-align: left; width: 100%; transition: background 0.2s, color 0.2s; }
  .nav svg { width: 20px; height: 20px; }
  .nav:hover { background: rgba(255,255,255,0.05); color: var(--text); }
  .nav.on { background: linear-gradient(90deg, rgba(52,211,153,0.16), rgba(52,211,153,0.03)); color: var(--text); box-shadow: inset 0 0 0 1px rgba(52,211,153,0.18); }
  .nav.on svg { color: var(--emerald); }
  .nav .count { margin-left: auto; font-size: 12px; background: rgba(234,211,178,0.14); color: var(--almond); padding: 2px 8px; border-radius: 999px; }
  .sidebar .spacer { flex: 1; }
  .main { padding: 26px 34px 60px; }
  .only-mobile { display: none !important; }
}
@media (max-width: 899px) { .only-desktop { display: none !important; } }

/* ---------- dashboard ---------- */
.grid { display: grid; gap: 12px; }
.grid.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .grid.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.dash-top { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .dash-top { grid-template-columns: 1.6fr 1fr; } }

.hero { position: relative; overflow: hidden; padding: 22px; border-radius: var(--r-xl); min-height: 200px; }
.hero::before { content: ""; position: absolute; width: 340px; height: 340px; right: -120px; top: -160px; border-radius: 50%; background: radial-gradient(circle, rgba(52,211,153,0.45), transparent 65%); filter: blur(10px); animation: pulse 6s ease-in-out infinite alternate; }
.hero::after { content: ""; position: absolute; width: 260px; height: 260px; left: -90px; bottom: -150px; border-radius: 50%; background: radial-gradient(circle, rgba(234,211,178,0.28), transparent 65%); }
@keyframes pulse { to { transform: scale(1.15); opacity: 0.75; } }
.hero > * { position: relative; z-index: 1; }
.hero .label { color: var(--text-2); font-size: 14px; font-weight: 600; }
.hero .big { font-size: clamp(34px, 8vw, 48px); font-weight: 760; letter-spacing: -0.035em; margin: 6px 0 4px; line-height: 1.05; }
.hero .sub { color: var(--text-2); font-size: 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.delta { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 13px; font-weight: 650; }
.delta.up { color: var(--emerald); background: rgba(52,211,153,0.12); }
.delta.down { color: var(--red); background: var(--red-soft); }
.delta.flat { color: var(--text-2); background: rgba(255,255,255,0.06); }
.spark { display: flex; align-items: flex-end; gap: 6px; height: 54px; margin-top: 18px; }
.spark i { flex: 1; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, rgba(52,211,153,0.85), rgba(52,211,153,0.15)); min-height: 4px; transform-origin: bottom; }
.anim .spark i { animation: grow 0.9s var(--ease) both; }
.spark i.cur { background: linear-gradient(180deg, var(--almond), rgba(234,211,178,0.2)); box-shadow: 0 0 18px rgba(234,211,178,0.35); }
.spark-labels { display: flex; gap: 6px; margin-top: 6px; }
.spark-labels span { flex: 1; text-align: center; font-size: 11px; color: var(--text-3); }
@keyframes grow { from { transform: scaleY(0); } }

.onway { cursor: pointer; padding: 20px; border-radius: var(--r-xl); position: relative; overflow: hidden; transition: transform 0.25s var(--ease), border-color 0.25s; display: flex; flex-direction: column; }
.onway:hover { border-color: rgba(234,211,178,0.3); }
.onway:active { transform: scale(0.985); }
.onway::before { content: ""; position: absolute; inset: auto -60px -80px auto; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(234,211,178,0.3), transparent 65%); }
.onway .head { display: flex; align-items: center; justify-content: space-between; }
.onway .head .label { font-weight: 650; color: var(--almond); display: flex; align-items: center; gap: 8px; }
.onway .chev { color: var(--text-3); }
.onway .amt { font-size: 30px; font-weight: 750; letter-spacing: -0.03em; margin: 12px 0 2px; }
.onway .others { color: var(--text-2); font-size: 13px; }
.onway .meta { margin-top: auto; padding-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: rgba(255,255,255,0.06); color: var(--text-2); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; }
.pill.paid { background: rgba(52,211,153,0.12); color: var(--emerald); }
.pill.partial { background: rgba(234,211,178,0.12); color: var(--almond); }
.pill.unpaid { background: var(--red-soft); color: var(--red); }
.pill.paid .dot { background: var(--emerald); box-shadow: 0 0 8px var(--emerald); }
.pill.partial .dot { background: var(--almond); box-shadow: 0 0 8px var(--almond); }
.pill.unpaid .dot { background: var(--red); box-shadow: 0 0 8px var(--red); }

.kpi { padding: 16px; border-radius: var(--r-lg); min-width: 0; }
.kpi .k { color: var(--text-2); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi .k svg { width: 15px; height: 15px; color: var(--emerald); }
.kpi .v { font-size: 22px; font-weight: 720; letter-spacing: -0.025em; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi .s { color: var(--text-3); font-size: 12.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi.clickable { cursor: pointer; }

.quotes { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.quotes::-webkit-scrollbar { display: none; }
.quote { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 10px; padding: 12px 16px 12px 12px; border-radius: 18px; color: var(--text); font-weight: 600; transition: transform 0.2s var(--ease), border-color 0.2s; }
.quote:hover { border-color: rgba(52,211,153,0.35); }
.quote:active { transform: scale(0.97); }
.quote .qi { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(135deg, rgba(52,211,153,0.3), rgba(234,211,178,0.25)); }
.quote .qi svg { width: 18px; height: 18px; color: #fff; }
.quote small { display: block; color: var(--text-3); font-weight: 500; font-size: 12px; }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); margin: 12px 0 0; font-size: 14px; }
.banner svg { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 1px; }
.banner.warn { background: rgba(255,207,112,0.1); border: 1px solid rgba(255,207,112,0.25); color: var(--amber); }
.banner.danger { background: var(--red-soft); border: 1px solid rgba(255,107,94,0.3); color: var(--red); }
.banner.info { background: rgba(52,211,153,0.08); border: 1px solid rgba(52,211,153,0.2); color: var(--text); }

/* ---------- chips / segmented ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 4px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid var(--line); background: rgba(255,255,255,0.04); color: var(--text-2); transition: all 0.2s var(--ease); }
.chip:hover { color: var(--text); }
.chip.on { color: #02140d; background: linear-gradient(180deg, #3ee0a6, #12b882); border-color: transparent; box-shadow: 0 6px 18px -6px var(--emerald-glow); }
.chip.cur.on { color: #1d140a; background: linear-gradient(180deg, #f3e2c8, #d8b98e); box-shadow: 0 6px 18px -8px var(--almond-glow); }
.filters { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }

/* ---------- job cards ---------- */
.jobs { display: grid; gap: 10px; }
@media (min-width: 1100px) { .jobs.two { grid-template-columns: 1fr 1fr; } }
.job { padding: 16px; border-radius: var(--r-lg); }
.anim .job { animation: rise 0.5s var(--ease) both; }
.job .top { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.avatar { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-weight: 750; font-size: 16px; color: #02140d; background: linear-gradient(135deg, var(--emerald), var(--almond)); box-shadow: 0 6px 18px -8px var(--emerald-glow); }
.job .info { flex: 1; min-width: 0; }
.job .client { font-weight: 680; font-size: 16px; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job .desc { color: var(--text-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.job .date { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.job .amt { text-align: right; flex: 0 0 auto; }
.job .amt b { display: block; font-size: 17px; font-weight: 720; letter-spacing: -0.02em; }
.job .amt .pill { margin-top: 4px; }
.progress { height: 6px; border-radius: 99px; background: rgba(255,255,255,0.07); overflow: hidden; margin: 14px 0 8px; }
.progress i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--emerald-2), var(--emerald), var(--almond)); box-shadow: 0 0 14px rgba(52,211,153,0.5); transition: width 0.8s var(--ease); }
.money-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); gap: 10px; }
.money-row b { color: var(--text); font-weight: 650; }
.money-row .bal b { color: var(--almond); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; margin-top: 12px; border-radius: 14px; background: rgba(118,118,128,0.14); }
.seg button { border: 0; background: transparent; padding: 10px 4px; border-radius: 11px; font-size: 13.5px; font-weight: 650; color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: all 0.25s var(--ease); }
.seg button svg { width: 16px; height: 16px; }
.seg button:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.seg button:active { transform: scale(0.96); }
.seg button.on.paid { background: linear-gradient(180deg, rgba(62,224,166,0.95), rgba(18,184,130,0.95)); color: #02140d; box-shadow: 0 6px 18px -8px var(--emerald-glow); }
.seg button.on.unpaid { background: var(--red-soft); color: var(--red); box-shadow: inset 0 0 0 1px rgba(255,107,94,0.3); }
.seg button.on.partial { background: linear-gradient(180deg, #f3e2c8, #d8b98e); color: #1d140a; box-shadow: 0 6px 18px -8px var(--almond-glow); }
.age { font-size: 12px; color: var(--amber); }
.month-head { margin: 18px 4px 8px; display: flex; justify-content: space-between; color: var(--text-2); font-size: 13px; font-weight: 650; letter-spacing: 0.03em; text-transform: uppercase; }
.empty { text-align: center; padding: 38px 20px; color: var(--text-2); border-radius: var(--r-lg); }
.empty .em-icon { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 18px; display: grid; place-items: center; background: rgba(52,211,153,0.1); color: var(--emerald); }
.empty .em-icon svg { width: 26px; height: 26px; }
.empty h4 { margin: 0 0 4px; color: var(--text); font-size: 17px; }
.search { position: relative; margin-bottom: 10px; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-3); }
.search .input { padding-left: 40px; }

/* ---------- lists ---------- */
.list { border-radius: var(--r-lg); overflow: hidden; }
.li { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background 0.2s; }
.li:last-child { border-bottom: 0; }
.li:hover { background: rgba(255,255,255,0.03); }
.li .grow { flex: 1; min-width: 0; }
.li .t { font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .st { color: var(--text-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .end { text-align: right; flex: 0 0 auto; }
.li .end b { display: block; font-weight: 700; }
.li .end small { color: var(--text-3); font-size: 12px; }
.li.static { cursor: default; }
.li.static:hover { background: none; }
.rank { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 10px; display: grid; place-items: center; font-weight: 750; font-size: 14px; background: rgba(255,255,255,0.06); color: var(--text-2); }
.rank.r1 { background: linear-gradient(135deg, #3ee0a6, #0e9f6e); color: #02140d; box-shadow: 0 0 18px rgba(52,211,153,0.45); }
.rank.r2 { background: linear-gradient(135deg, #f3e2c8, #cfae7f); color: #1d140a; box-shadow: 0 0 16px rgba(234,211,178,0.35); }
.rank.r3 { background: linear-gradient(135deg, #d9dde3, #8f969f); color: #111; }
.meter { height: 5px; border-radius: 9px; background: rgba(255,255,255,0.07); margin-top: 7px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--emerald-2), var(--almond)); }

/* podium */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 10px; align-items: end; margin-bottom: 12px; }
.pod { text-align: center; padding: 16px 10px; border-radius: var(--r-lg); cursor: pointer; min-width: 0; }
.pod .avatar { margin: 0 auto 8px; }
.pod .n { font-weight: 680; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod .a { font-size: 15px; font-weight: 750; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod .c { color: var(--text-3); font-size: 12px; }
.pod.first { padding-top: 24px; padding-bottom: 22px; border-color: rgba(52,211,153,0.35); box-shadow: 0 0 40px -10px rgba(52,211,153,0.45), 0 1px 0 rgba(255,255,255,0.06) inset; }
.pod.first .avatar { width: 54px; height: 54px; font-size: 20px; border-radius: 18px; }
.pod .medal { font-size: 12px; font-weight: 750; letter-spacing: 0.06em; color: var(--emerald); margin-bottom: 8px; }
.pod.second .medal { color: var(--almond); }
.pod.third .medal { color: #c9ced6; }

/* ---------- charts ---------- */
.chart-card { padding: 18px; border-radius: var(--r-xl); }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.chart-head .v { font-size: 28px; font-weight: 750; letter-spacing: -0.03em; }
.chart-head .l { color: var(--text-2); font-size: 13px; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.bars { position: relative; display: flex; align-items: flex-end; gap: 3px; height: 200px; margin-top: 18px; padding-top: 8px; }
.bars .gridline { position: absolute; left: 0; right: 0; border-top: 1px dashed rgba(255,255,255,0.07); font-size: 10px; color: var(--text-3); }
.bars .gridline span { position: absolute; right: 0; top: -14px; }
.bar { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: pointer; min-width: 0; }
.bar .fill { width: min(100%, 34px); border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, rgba(62,224,166,0.95), rgba(16,185,129,0.25)); transform-origin: bottom; min-height: 2px; transition: filter 0.2s; }
.anim .bar .fill { animation: grow 0.8s var(--ease) both; }
.bar .fill.zero { background: rgba(255,255,255,0.06); }
.bar .bill { position: absolute; width: min(100%, 34px); left: 50%; transform: translateX(-50%); height: 2px; border-radius: 2px; background: var(--almond); box-shadow: 0 0 10px var(--almond); }
.bar:hover .fill, .bar.sel .fill { filter: brightness(1.3) drop-shadow(0 0 10px rgba(52,211,153,0.6)); }
.bar.peak .fill { background: linear-gradient(180deg, #f3e2c8, rgba(234,211,178,0.25)); }
.xlabels { display: flex; gap: 3px; margin-top: 8px; }
.xlabels span { flex: 1; text-align: center; font-size: 10.5px; color: var(--text-3); white-space: nowrap; overflow: visible; min-width: 0; }
.readout { min-height: 40px; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,0.04); font-size: 13.5px; color: var(--text-2); display: flex; gap: 14px; flex-wrap: wrap; }
.readout b { color: var(--text); }
.two-col { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 1000px) { .two-col { grid-template-columns: 1fr 1fr; } }

/* ---------- sheet (modal) ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: flex-end; justify-content: center; animation: fade 0.25s ease both; }
.overlay.closing { animation: fade 0.2s ease reverse both; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; overflow-y: auto; border-radius: 30px 30px 0 0; padding: 10px 18px calc(22px + var(--sab)); background: linear-gradient(180deg, rgba(48,48,52,0.82), rgba(24,24,26,0.92)); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--line-2); border-bottom: 0; box-shadow: 0 -20px 60px rgba(0,0,0,0.6); animation: slideup 0.42s var(--ease) both; }
.overlay.closing .sheet { animation: slideup 0.22s ease reverse both; }
@keyframes slideup { from { transform: translateY(100%); } }
.grabber { width: 38px; height: 5px; border-radius: 9px; background: rgba(255,255,255,0.22); margin: 0 auto 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.sheet-head h3 { margin: 0; font-size: 20px; letter-spacing: -0.015em; }
.sheet-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.sheet-sum div { padding: 10px 12px; border-radius: 13px; background: rgba(255,255,255,0.05); min-width: 0; }
.sheet-sum small { display: block; color: var(--text-3); font-size: 12px; }
.sheet-sum b { font-size: 15px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-actions { display: flex; gap: 10px; margin-top: 8px; }
.sheet-actions .btn { flex: 1; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin: -6px 0 14px; }
@media (min-width: 700px) {
  .overlay { align-items: center; }
  .sheet { border-radius: 28px; border-bottom: 1px solid var(--line-2); padding-bottom: 22px; animation: pop 0.35s var(--ease) both; }
  .overlay.closing .sheet { animation: pop 0.2s ease reverse both; }
  .grabber { display: none; }
}
@keyframes pop { from { opacity: 0; transform: scale(0.94) translateY(10px); } }

/* ---------- settings ---------- */
.settings { display: grid; gap: 14px; }
@media (min-width: 1000px) { .settings { grid-template-columns: 1fr 1fr; align-items: start; } }
.group { padding: 18px; border-radius: var(--r-xl); }
.group h4 { margin: 0 0 4px; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.group h4 svg { width: 19px; height: 19px; color: var(--emerald); }
.group > p { margin: 0 0 14px; color: var(--text-2); font-size: 14px; }
.kv { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv .grow { flex: 1; min-width: 0; }
.kv .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv .st { color: var(--text-3); font-size: 12.5px; }
.steps { margin: 0 0 14px; padding-left: 20px; color: var(--text-2); font-size: 14px; }
.steps li { margin-bottom: 6px; }
.steps b { color: var(--text); }
.code { font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; background: rgba(0,0,0,0.45); border: 1px solid var(--line); border-radius: 12px; padding: 12px; max-height: 180px; overflow: auto; white-space: pre; color: #cfe9de; margin-bottom: 10px; }
.usage-item { margin-bottom: 14px; }
.usage-item .top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; gap: 10px; }
.usage-item .top span:last-child { color: var(--text-2); }
.usage-bar { height: 8px; border-radius: 9px; background: rgba(255,255,255,0.07); overflow: hidden; }
.usage-bar i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--emerald-2), var(--emerald)); transition: width 0.8s var(--ease); }
.usage-bar.warn i { background: linear-gradient(90deg, #e9b44c, var(--amber)); }
.usage-bar.danger i { background: linear-gradient(90deg, #e2483c, var(--red)); }
.usage-mini { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(255,255,255,0.04); font-size: 12.5px; color: var(--text-2); cursor: pointer; border: 0; width: 100%; text-align: left; }
.usage-mini .ring { width: 30px; height: 30px; flex: 0 0 auto; }
.usage-mini b { color: var(--text); display: block; font-size: 13px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.status-dot.ok { background: var(--emerald); box-shadow: 0 0 8px var(--emerald); }
.status-dot.bad { background: var(--red); box-shadow: 0 0 8px var(--red); }
.status-dot.none { background: var(--text-3); }

/* ---------- toast ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + var(--sab)); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: calc(100% - 32px); }
@media (min-width: 900px) { .toasts { bottom: 30px; } }
.toast { pointer-events: auto; padding: 12px 18px; border-radius: 16px; font-size: 14.5px; font-weight: 600; display: flex; gap: 10px; align-items: center; animation: toastin 0.4s var(--ease) both; max-width: 100%; background: rgba(40,40,44,0.9); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--line-2); box-shadow: 0 16px 40px rgba(0,0,0,0.6); }
.toast svg { width: 18px; height: 18px; color: var(--emerald); flex: 0 0 auto; }
.toast.err svg { color: var(--red); }
.toast.out { animation: toastin 0.3s ease reverse both; }
@keyframes toastin { from { opacity: 0; transform: translateY(16px) scale(0.96); } }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,0.15); border-top-color: var(--emerald); animation: spin 0.8s linear infinite; }
.center-load { min-height: 60vh; display: grid; place-items: center; }
.muted { color: var(--text-2); }
.tiny { font-size: 12.5px; color: var(--text-3); }
.mt { margin-top: 14px; }
.hstack { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* hide records in the app switcher / when backgrounded */
body.privacy #app { filter: blur(28px) brightness(0.4); }

:where(svg) { width: 18px; height: 18px; }
.auth-foot svg, .lock-reason svg { width: 15px; height: 15px; }
.readout svg { width: 15px; height: 15px; vertical-align: -2px; margin-right: 4px; }
.seg button { white-space: nowrap; }
@media (max-width: 420px) { .seg button { font-size: 13px; padding: 10px 2px; } .seg button svg { display: none; } }
