:root {
  --navy: #1f4e79;
  --blue: #2f75b5;
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #1d2433;
  --muted: #6b7489;
  --line: #e3e7ef;
  --red: #c00000;
  --green: #2e7d32;
  --amber: #fff2cc;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", Calibri, Arial, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }

.topbar { display: flex; align-items: center; gap: 24px; padding: 0 24px; height: 56px; background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; font-size: 18px; letter-spacing: .3px; }
.brand span { color: #9bc2e6; }
.tabs { display: flex; gap: 4px; flex: 1; }
.tab { background: transparent; color: #cfe0f3; border: 0; padding: 8px 14px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.tab:hover { background: rgba(255,255,255,.08); color: #fff; }
.tab.active { background: rgba(255,255,255,.16); color: #fff; font-weight: 600; }
.meta { font-size: 12px; color: #cfe0f3; white-space: nowrap; }

main { padding: 20px 24px 40px; max-width: 1500px; margin: 0 auto; }
.panel { display: none; }
.panel.active { display: block; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.kpi .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.kpi .value { font-size: 24px; font-weight: 700; margin-top: 4px; }
.kpi .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1000px) { .grid2 { grid-template-columns: 1fr; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin-bottom: 16px; }
.card h3 { margin: 0 0 12px; font-size: 15px; color: var(--navy); }
.note { color: var(--muted); margin: -4px 0 12px; font-size: 13px; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; font-size: 13px; width: auto; }
th, td { padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--blue); color: #fff; font-weight: 600; text-align: right; position: sticky; top: 0; }
th:first-child, td:first-child { text-align: left; }
td { text-align: right; font-variant-numeric: tabular-nums; }
tr.header td { font-weight: 600; color: var(--navy); background: #f7f9fc; }
tr.total td { font-weight: 700; border-top: 1px solid #c9d3e3; }
tr.highlight td { background: var(--amber); font-weight: 700; }
td.neg { color: var(--red); }
td.ytd, th.ytd { background-clip: padding-box; }
th.ytd { background: var(--navy); }
tr:hover td { background: #f1f5fb; }
.error { color: var(--red); padding: 8px 0; }
.loading { color: var(--muted); padding: 8px 0; }

.link { background: none; border: 0; color: #9bc2e6; cursor: pointer; font-size: 12px; padding: 0 0 0 8px; text-decoration: underline; }
.login { position: fixed; inset: 56px 0 0; background: var(--bg); display: flex; align-items: center; justify-content: center; z-index: 4; }
.login[hidden] { display: none; }
.login .card { width: 340px; text-align: center; }
.login #googleButton { display: flex; justify-content: center; min-height: 44px; }
.google-local { width: 280px; height: 40px; border: 1px solid #dadce0; border-radius: 4px; background: #fff; color: #3c4043; font-size: 14px; font-weight: 500; cursor: pointer; }
.google-local:hover { background: #f7f8f8; }
.otp-input { width: 100%; font-family: monospace; font-size: 26px; letter-spacing: .4em; text-align: center; padding: 8px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; }
.otp-input:focus { outline: 2px solid var(--blue); border-color: transparent; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 12px; text-align: left; cursor: pointer; }
.btn { width: 100%; background: var(--navy); color: #fff; border: 0; border-radius: 8px; padding: 10px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn:disabled { opacity: .6; cursor: default; }
.otp-actions { display: flex; justify-content: space-between; margin-top: 10px; }
.link.dark { color: var(--blue); padding: 0; }
.link:disabled { color: var(--muted); cursor: default; text-decoration: none; }
