/* =====================================================================================
   Apple-style layer: system SF fonts, #f5f5f7 surfaces, Apple blue, soft depth, frosted bars.
   Loaded after main.css.
   ===================================================================================== */
:root {
  --blue: #155eef;
  --blue-600: #1150d6;
  --blue-700: #0b3fae;
  --blue-900: #0a2463;
  --blue-50: #eef4ff;
  --blue-100: #dce7ff;
  --blue-200: #b8ceff;
  --ink: #1d1d1f;
  --text: #424245;
  --muted: #86868b;
  --line: #e8e8ed;
  --line-2: #d2d2d7;
  --bg-soft: #f5f5f7;
  --ok: #248a3d; --ok-bg: #e8f7ec;
  --warn: #b25000; --warn-bg: #fff4e5;
  --bad: #d70015; --bad-bg: #fff0f1;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI Variable Text", "Segoe UI", Inter, Roboto, Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Segoe UI Variable Display", "Segoe UI", Inter, Roboto, Arial, sans-serif;
  --r: 20px;
  --r-sm: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 24px rgba(0,0,0,.06);
  --shadow-lg: 0 2px 6px rgba(0,0,0,.05), 0 24px 60px rgba(0,0,0,.12);
}
body { letter-spacing: -0.011em; }
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.028em; }
h3 { font-weight: 600; letter-spacing: -0.018em; }
.btn { font-weight: 500; padding: 13px 22px; }
.btn:hover { box-shadow: none; background: #2b6ff5; border-color: #2b6ff5; }
.btn.secondary:hover { background: #fff; }
.btn.white:hover { background: #f5f9ff; border-color: #f5f9ff; }
.btn.ghost-white:hover { background: rgba(255,255,255,.12); border-color: #fff; }
.btn.danger:hover { background: var(--bad-bg); border-color: #f2c4bf; }
input, select, textarea { border: 1px solid var(--line-2); border-radius: 12px; background: #fff; }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 4px rgba(21,94,239,.18); }

/* frosted header + light footer */
.site-header { background: rgba(255,255,255,.72); backdrop-filter: saturate(1.8) blur(20px); -webkit-backdrop-filter: saturate(1.8) blur(20px); border-bottom: 1px solid rgba(0,0,0,.06); }
.site-nav a { font-weight: 400; color: var(--ink); }
.site-nav a.on { font-weight: 500; }
.site-footer { background: var(--bg-soft); color: var(--muted); border-top: 1px solid var(--line); }
.footer-grid h4 { color: var(--ink); font-weight: 600; font-size: .85rem; }
.footer-grid a { color: var(--text); font-size: .88rem; }
.footer-grid a:hover { color: var(--blue); }
.footer-base { border-top-color: var(--line); color: var(--muted); }

/* hero and CTA in Apple blue */
.hero { background: radial-gradient(1100px 520px at 80% -15%, #5b8cff 0%, transparent 60%), linear-gradient(135deg, #155eef 0%, #0b3fae 60%, #082f87 100%); }
.hero h1 .soft { color: #c3d5ff; }
.cta { background: radial-gradient(800px 400px at 0% 100%, #5b8cff 0%, transparent 60%), linear-gradient(135deg, #155eef, #0a3aa3); }
.card, .step, .faq-list details, .stats, .form-card, .auth-card, .sample { border-color: rgba(0,0,0,.06); }
.card, .step { border-radius: 22px; }
.icon { border-radius: 12px; }

/* ---------------- app: macOS-like light sidebar */
.app { background: var(--bg-soft); }
.sidebar { background: rgba(246,246,248,.86); backdrop-filter: saturate(1.8) blur(24px); -webkit-backdrop-filter: saturate(1.8) blur(24px);
  border-right: 1px solid rgba(0,0,0,.07); color: var(--text); }
.sidebar .logo img { width: 168px; }
.sidebar .role { background: rgba(0,0,0,.05); color: var(--muted); font-weight: 500; }
.side-nav a { color: var(--ink); font-weight: 450; border-radius: 10px; padding: 9px 12px; }
.side-nav a svg { color: var(--blue); opacity: 1; }
.side-nav a:hover { background: rgba(0,0,0,.05); color: var(--ink); }
.side-nav a.on { background: var(--blue); color: #fff; box-shadow: none; }
.side-nav a.on svg { color: #fff; }
.side-nav .sep { background: rgba(0,0,0,.08); }
.side-foot .card-me { background: #fff; border: 1px solid rgba(0,0,0,.06); color: var(--muted); }
.side-foot .who { color: var(--ink); }
.side-foot button { border-color: var(--line-2); color: var(--ink); background: #fff; }
.side-foot button:hover { background: var(--bg-soft); color: var(--ink); }
.mobile-bar { background: rgba(255,255,255,.92); backdrop-filter: blur(20px); border-bottom: 1px solid var(--line); }
.mobile-bar button { background: var(--bg-soft); color: var(--ink); }
.topbar h1 { font-weight: 700; font-size: 2rem; }

.panel, .kpi { border: 0; box-shadow: var(--shadow); border-radius: var(--r); }
.panel-head { border-bottom-color: var(--line); }
.panel-head h2 { font-weight: 600; font-size: 1.05rem; }
.kpi .l { font-weight: 500; }
.kpi .v { font-weight: 700; }
.kpi.primary { background: linear-gradient(135deg, #155eef, #0b3fae); }
.kpi .v.neg { color: var(--bad); }
table.data th { background: #fafafc; font-weight: 500; }
table.data tr.click:hover td { background: #f5f9ff; }
.pill { font-weight: 500; }
.tabs a { border: 0; background: rgba(0,0,0,.05); }
.tabs a.on { background: var(--blue); }
.proj-card:hover { background: #f7faff; }

/* segmented control */
.seg { display: inline-flex; background: rgba(0,0,0,.06); padding: 3px; border-radius: 10px; gap: 2px; flex-wrap: wrap; }
.seg a { padding: 6px 12px; border-radius: 8px; font-size: .84rem; color: var(--ink); text-decoration: none; font-weight: 500; }
.seg a.on { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.04); }

/* charts */
.chart-wrap { padding: 14px 16px 8px; }
svg.chart { width: 100%; height: auto; display: block; font-family: var(--font); }
svg.chart .grid { stroke: #ececf1; stroke-width: 1; }
svg.chart .axis { fill: #86868b; font-size: 11px; }
svg.chart .bar-in { fill: #155eef; }
svg.chart .bar-out { fill: #ff9f0a; }
svg.chart .bar-alt { fill: #64d2ff; }
svg.chart rect:hover { opacity: .82; }
svg.chart .line-profit { stroke: #34c759; stroke-width: 2.5; stroke-linejoin: round; }
svg.chart .line-profit-dot { fill: #fff; stroke: #34c759; stroke-width: 2; }
svg.chart .ln-a { stroke: #155eef; stroke-width: 2.5; stroke-linejoin: round; }
svg.chart .ln-a-area { fill: rgba(21,94,239,.10); }
svg.chart .ln-b { stroke: #64d2ff; stroke-width: 2; stroke-dasharray: 5 4; }
.legend { display: flex; gap: 14px; font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.lg::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }
.lg.in::before { background: #155eef; }
.lg.out::before { background: #ff9f0a; }
.lg.alt::before { background: #64d2ff; }
.lg.profit::before { background: #34c759; height: 3px; vertical-align: 3px; }
svg.donut { width: 150px; height: 150px; flex: none; }
svg.donut .donut-bg { stroke: #f0f0f3; }
svg.donut .donut-v { font: 700 17px var(--display); fill: var(--ink); }
svg.donut .donut-l { font: 500 10px var(--font); fill: var(--muted); }
.seg-c1 { stroke: #155eef; } .seg-c2 { stroke: #64d2ff; } .seg-c3 { stroke: #34c759; } .seg-c4 { stroke: #5e5ce6; }
.seg-c5 { stroke: #ff9f0a; } .seg-c6 { stroke: #ff375f; } .seg-c7 { stroke: #ac8e68; } .seg-c8 { stroke: #c7c7cc; }
.dot-cat { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; flex: none; }
.dot-cat.c1 { background: #155eef; } .dot-cat.c2 { background: #64d2ff; } .dot-cat.c3 { background: #34c759; } .dot-cat.c4 { background: #5e5ce6; }
.dot-cat.c5 { background: #ff9f0a; } .dot-cat.c6 { background: #ff375f; } .dot-cat.c7 { background: #ac8e68; } .dot-cat.c8 { background: #c7c7cc; }
.donut-row { display: flex; gap: 22px; align-items: center; }
.legend-list { list-style: none; margin: 0; padding: 0; flex: 1; display: grid; gap: 9px; font-size: .88rem; color: var(--ink); }
.legend-list li { display: flex; align-items: center; }
.legend-list b { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.hbar { margin-bottom: 15px; }
.hbar:last-child { margin-bottom: 0; }
.hbar-top { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; color: var(--ink); margin-bottom: 6px; }
.hbar-top a { color: var(--ink); text-decoration: none; font-weight: 500; }
.hbar-top a:hover { color: var(--blue); }
.hbar-top b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbar-track { height: 8px; background: #f0f0f3; border-radius: 999px; overflow: hidden; }
.hbar-track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #155eef, #5b8cff); border-radius: 999px; transition: width .6s ease; }
.hbar-track.ok i { background: linear-gradient(90deg, #248a3d, #34c759); }
.block-title { font-size: 1.25rem; margin: 6px 0 16px; font-weight: 600; }
.block-title:not(:first-child) { margin-top: 36px; }
.stage-mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 22px; }
.stage-mini div { background: var(--bg-soft); border-radius: 14px; padding: 12px; text-align: center; }
.stage-mini b { display: block; font: 700 1.4rem var(--display); color: var(--ink); }
.stage-mini span { font-size: .78rem; color: var(--muted); }
.fin-mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.fin-mini div { background: var(--bg-soft); border-radius: 14px; padding: 12px 14px; }
.fin-mini span { display: block; font-size: .76rem; color: var(--muted); }
.fin-mini b { font: 700 1.02rem var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.ledger { display: flex; gap: 14px; padding: 10px 22px; border-top: 1px solid var(--line); font-size: .86rem; color: var(--text); }
.ledger span:first-child { min-width: 96px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ledger .in, .ok-text { color: var(--ok); }
.ledger .out { color: var(--ink); }
.bad-text { color: var(--bad); }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: .9rem; padding: 4px 8px; border-radius: 8px; }
.icon-btn:hover { background: var(--bad-bg); color: var(--bad); }
@media (max-width: 860px) {
  .sidebar { background: rgba(246,246,248,.97); }
  .fin-mini, .stage-mini { grid-template-columns: 1fr 1fr; }
  .donut-row { flex-direction: column; align-items: stretch; }
  svg.donut { margin: 0 auto; }
  .topbar .acts { width: 100%; }
}

/* Keep money and dates on one line in ledgers */
table.data td.num-col, table.data th.num-col { white-space: nowrap; }
table.data td.nowrap { white-space: nowrap; }
