/* SpendTracker+ Admin — layout based on the "Finora" dashboard design */
:root {
  --bg: #eef0fa;
  --shell: #f8f9fe;
  --card: #ffffff;
  --line: #eceef6;
  --text: #171a3a;
  --muted: #8a8fa8;
  --soft: #5d6283;
  --accent: #5b4bdb;
  --accent-2: #7c6cf0;
  --accent-tint: #efedff;
  --green: #12a150;
  --green-tint: #e6f7ee;
  --red: #e5484d;
  --red-tint: #fdecec;
  --amber: #e79a12;
  --amber-tint: #fff4df;
  --blue: #2f7cf6;
  --blue-tint: #e8f1ff;
  --rose: #ef4f7a;
  --rose-tint: #ffe9ef;
  --navy: #141836;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(23, 26, 58, .04), 0 8px 24px rgba(23, 26, 58, .05);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 600px at 10% -10%, #e4e1ff 0%, transparent 60%),
              radial-gradient(900px 500px at 110% 10%, #dfe9ff 0%, transparent 55%), var(--bg);
  min-height: 100vh;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

.shell {
  max-width: 1440px; margin: 24px auto; background: var(--shell);
  border-radius: 28px; box-shadow: 0 30px 80px rgba(60, 64, 120, .12);
  display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 48px); overflow: hidden;
}

/* ---------- Sidebar ---------- */
.sidebar { padding: 26px 18px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; background: rgba(255,255,255,.55); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; padding: 0 10px 22px; letter-spacing: -.3px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), #3aa0ff); display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 800; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--soft); font-weight: 500; margin-bottom: 2px; }
.nav a:hover { background: #f1f0ff; color: var(--text); }
.nav a.active { background: var(--accent-tint); color: var(--accent); font-weight: 650; }
.nav a .badge { margin-left: auto; }
.nav-label { font-size: 12px; color: var(--muted); padding: 22px 12px 8px; }
.sidebar .promo { margin-top: auto; background: linear-gradient(160deg, #f1efff, #e9f1ff); border-radius: 16px; padding: 16px; }
.promo h4 { margin: 8px 0 4px; font-size: 14px; }
.promo p { margin: 0 0 10px; color: var(--soft); font-size: 12px; line-height: 1.5; }
.promo a { color: var(--accent); font-weight: 650; font-size: 13px; }
.ico { width: 18px; height: 18px; flex: none; }

/* ---------- Main ---------- */
.main { padding: 22px 28px 34px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.search { flex: 1; max-width: 420px; display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; color: var(--muted); }
.search input { border: 0; outline: 0; background: transparent; flex: 1; color: var(--text); }
.kbd { font-size: 11px; background: #f2f3f8; border-radius: 6px; padding: 2px 6px; color: var(--muted); }
.topbar .spacer { flex: 1; }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--soft); background: transparent; border: 0; cursor: pointer; }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); border: 2px solid var(--shell); }
.me { display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, #8a7cf5, #5b4bdb); flex: none; }
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.me small { display: block; color: var(--muted); font-size: 12px; }

.page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-title h1 { margin: 0; font-size: 22px; letter-spacing: -.4px; }
.page-title p { margin: 4px 0 0; color: var(--muted); }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid rgba(236,238,246,.8); padding: 20px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.card-head h3 { margin: 0; font-size: 15px; }
.link { color: var(--accent); font-weight: 600; font-size: 13px; }

.grid { display: grid; gap: 18px; }
.dash { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.col { display: grid; gap: 18px; min-width: 0; }
.two { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }

/* Hero greeting */
.hero { background: linear-gradient(135deg, #f3f1ff 0%, #eef4ff 100%); position: relative; overflow: hidden; padding: 22px; }
.hero small { color: var(--soft); }
.hero h2 { margin: 4px 0 4px; font-size: 26px; letter-spacing: -.6px; }
.hero p { margin: 0 0 18px; color: var(--soft); }
.hero .art { position: absolute; right: 28px; top: 14px; width: 150px; height: 96px; }
.kpi { background: var(--card); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); }
.kpi .k-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 10px; }
.kpi .k-label { color: var(--soft); font-size: 12.5px; }
.kpi .k-value { font-size: 21px; font-weight: 750; margin: 4px 0 6px; letter-spacing: -.4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chg { font-size: 12px; font-weight: 600; display: inline-flex; gap: 4px; align-items: center; }
.chg.up { color: var(--green); } .chg.down { color: var(--red); } .chg.flat { color: var(--muted); }
.chg span.n { color: var(--muted); font-weight: 500; }

.tone-green { background: var(--green-tint); color: var(--green); }
.tone-violet { background: var(--accent-tint); color: var(--accent); }
.tone-rose { background: var(--rose-tint); color: var(--rose); }
.tone-blue { background: var(--blue-tint); color: var(--blue); }
.tone-amber { background: var(--amber-tint); color: var(--amber); }

/* Dark card */
.dark-card { background: radial-gradient(400px 220px at 80% 0%, #2a2f66 0%, transparent 60%), var(--navy); color: #fff; padding: 20px; border-radius: 22px; }
.plastic { height: 150px; border-radius: 16px; padding: 16px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #6a5cf0 0%, #3f35b8 45%, #1e2a6e 100%); box-shadow: 0 18px 40px rgba(0,0,0,.35); }
.plastic::after { content: ""; position: absolute; inset: -40% -10% auto auto; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.25), transparent 65%); }
.plastic .chip { width: 30px; height: 22px; border-radius: 5px; background: linear-gradient(135deg, #f6d27a, #c9993a); margin-top: 18px; }
.plastic .row { display: flex; justify-content: space-between; font-weight: 700; letter-spacing: .5px; font-size: 13px; }
.plastic .num { position: absolute; bottom: 16px; left: 16px; font-size: 12px; opacity: .85; }
.dark-card .bal-label { color: #b9bde0; margin-top: 18px; font-size: 13px; }
.dark-card .bal { font-size: 30px; font-weight: 750; letter-spacing: -.6px; margin: 4px 0 14px; }
.btn-light { display: flex; justify-content: center; align-items: center; gap: 8px; width: 100%; background: #fff; color: var(--navy); border-radius: 12px; padding: 11px; font-weight: 650; border: 0; cursor: pointer; }

/* Lists, tables */
.goal { display: flex; gap: 12px; align-items: center; padding: 10px 0; }
.goal + .goal { border-top: 1px solid var(--line); }
.goal .g-ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.goal .g-body { flex: 1; min-width: 0; }
.goal .g-top { display: flex; justify-content: space-between; font-weight: 600; font-size: 13px; }
.goal .g-sub { color: var(--muted); font-size: 12px; margin: 2px 0 7px; }
.bar { height: 6px; background: #eef0f6; border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 6px; }

.legend { display: grid; gap: 10px; }
.legend .li { display: grid; grid-template-columns: 10px 1fr auto auto; gap: 10px; align-items: center; font-size: 13px; }
.legend .sw { width: 9px; height: 9px; border-radius: 50%; }
.legend .pct { color: var(--muted); }
.legend .amt { font-weight: 600; min-width: 80px; text-align: right; }

table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 11px 12px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover { background: #fafaff; }
.table-wrap { overflow-x: auto; }
.who { display: flex; align-items: center; gap: 10px; }
.who b { display: block; font-weight: 600; }
.who small { color: var(--muted); }
.amount-pos { color: var(--green); font-weight: 650; }
.amount-neg { color: var(--text); font-weight: 650; }

.pill { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.pill.green { background: var(--green-tint); color: var(--green); }
.pill.red { background: var(--red-tint); color: var(--red); }
.pill.amber { background: var(--amber-tint); color: #b97400; }
.pill.violet { background: var(--accent-tint); color: var(--accent); }
.pill.blue { background: var(--blue-tint); color: var(--blue); }
.pill.gray { background: #f1f2f6; color: var(--soft); }
.badge { background: var(--red); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 999px; font-weight: 700; }

.quote { background: linear-gradient(135deg, #f1efff, #eaf2ff); }
.quote p { font-weight: 650; margin: 8px 0 0; line-height: 1.5; }

/* Forms */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer; background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 600; }
.btn:hover { background: #4a3bc9; }
.btn.ghost { background: #fff; color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: var(--red-tint); color: var(--red); }
.btn.sm { padding: 7px 12px; font-size: 12.5px; border-radius: 10px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; color: var(--soft); font-weight: 600; }
.input, select.input, textarea.input { width: 100%; border: 1px solid #e3e5ef; background: #fff; border-radius: 12px; padding: 10px 12px; outline: none; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
textarea.input { min-height: 120px; resize: vertical; line-height: 1.5; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters .input { width: auto; min-width: 160px; }
.tabs { display: inline-flex; background: #f1f2f8; border-radius: 12px; padding: 4px; gap: 4px; }
.tabs a { padding: 7px 12px; border-radius: 9px; color: var(--soft); font-weight: 600; font-size: 12.5px; }
.tabs a.on { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.flash { background: var(--green-tint); color: #0c6f37; padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; font-weight: 600; }
.errors { background: var(--red-tint); color: #a3262a; padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; }
.muted { color: var(--muted); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: #f7f8fc; border-radius: 14px; padding: 12px 14px; }
.stat b { display: block; font-size: 18px; margin-top: 4px; }
.pager { display: flex; gap: 6px; justify-content: flex-end; margin-top: 14px; align-items: center; }
.pager a, .pager span { padding: 6px 11px; border-radius: 9px; background: #fff; border: 1px solid var(--line); font-size: 12.5px; }
.pager .cur { background: var(--accent); color: #fff; border-color: var(--accent); }
.check { display: inline-flex; gap: 6px; align-items: center; margin-right: 14px; font-size: 13px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.price-row { display: grid; grid-template-columns: 90px 1fr 1fr 1fr 60px; gap: 8px; align-items: center; margin-bottom: 8px; font-size: 12.5px; }
.chart-box { position: relative; height: 230px; }
.donut-wrap { display: grid; grid-template-columns: 170px 1fr; gap: 16px; align-items: center; }
.donut-box { position: relative; height: 170px; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; }
.donut-center b { display: block; font-size: 16px; }
.donut-center small { color: var(--muted); font-size: 11px; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: 100%; max-width: 400px; padding: 30px; }

@media (max-width: 1200px) {
  .dash { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; margin: 0; border-radius: 0; }
  .sidebar { flex-direction: row; overflow-x: auto; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); align-items: center; }
  .sidebar .brand { padding: 0 10px 0 0; }
  .nav { display: flex; gap: 4px; }
  .nav a { white-space: nowrap; }
  .nav-label, .sidebar .promo, .sidebar .quick { display: none; }
  .main { padding: 16px; }
  .two, .donut-wrap { grid-template-columns: 1fr; }
  .hero .art { display: none; }
  .search { display: none; }
  .price-row { grid-template-columns: 70px 1fr 1fr; }
  .price-row .ios, .price-row .act { display: none; }
}
