:root {
  --navy: #12375a;
  --teal: #00a9b8;
  --brown: #8e3b26;
  --ink: #1d2733;
  --ink-2: #4a5868;
  --muted: #7a8796;
  --line: #e2e7ee;
  --line-2: #cfd7e1;
  --page: #f4f6f9;
  --surface: #ffffff;
  --sub: #f0f4f8;
  --key: #e3ebf3;
  --input: #fffbe6;
  --input-line: #f0dc8c;
  --neg: #b4232a;
  --ok: #1b7f4b;
  --radius: 10px;
  --font: "Noto Sans Georgian", "Sylfaen", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--font); font-size: 14px; }
a { color: var(--navy); }
button { font-family: inherit; }

/* header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.top-in { display: flex; align-items: center; gap: 20px; padding: 10px 24px; max-width: 1800px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 16px; }
.brand img.ebit { height: 38px; }
.brand img.cub { height: 24px; }
.brand .sep { width: 1px; height: 30px; background: var(--line-2); }
.brand .title { font-weight: 600; color: var(--navy); font-size: 15px; white-space: nowrap; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { text-decoration: none; color: var(--ink-2); padding: 8px 14px; border-radius: 8px; font-weight: 500; }
.nav a:hover { background: var(--sub); }
.nav a.on { background: var(--navy); color: #fff; }
.nav a.out { color: var(--muted); }

main { max-width: 1800px; margin: 0 auto; padding: 20px 20px 48px; }
h1 { font-size: 20px; margin: 0 0 4px; color: var(--navy); font-weight: 600; }
.sub { color: var(--muted); font-size: 13px; margin: 0 0 16px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.kpi .l { color: var(--muted); font-size: 12.5px; }
.kpi .v { font-size: 22px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; color: var(--ink); }
.kpi .v small { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.kpi.main { border-top: 3px solid var(--teal); }

/* tables */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.scroll { overflow: auto; max-height: calc(100vh - 250px); border-radius: var(--radius); }
table.t { border-collapse: separate; border-spacing: 0; width: 100%; font-variant-numeric: tabular-nums; font-size: 13px; }
.t th, .t td { padding: 6px 8px; white-space: nowrap; border-bottom: 1px solid var(--line); text-align: right; }
.t thead th { position: sticky; top: 0; background: var(--navy); color: #fff; font-weight: 500; z-index: 2; }
.t thead th .m { display: block; font-size: 11px; opacity: .75; font-weight: 400; }
.t th:first-child, .t td:first-child { text-align: left; position: sticky; left: 0; background: inherit; z-index: 1; min-width: 270px; }
.t thead th:first-child { z-index: 3; background: var(--navy); }
.t tbody tr { background: var(--surface); }
.t tbody tr:hover { background: #f7fafc; }
.t td.tot, .t th.tot { border-left: 1px solid var(--line-2); font-weight: 600; }
.t .neg { color: var(--neg); }
.t tr.b td { font-weight: 600; background: var(--sub); }
.t tr.key td { font-weight: 700; background: var(--key); color: var(--navy); }
.t tr.i td:first-child { padding-left: 28px; color: var(--ink-2); }
.t tr.pct td { color: var(--muted); font-style: italic; }
.t tr.ref td { color: var(--ink-2); }
.t tr.gap td { border-top: 10px solid var(--page); }
.t tr.sect td { background: var(--page); color: var(--navy); font-weight: 600; padding-top: 14px; border-bottom: 1px solid var(--line-2); }

/* inputs */
.t td.in { padding: 0; }
.t td.in input {
  width: 100%; min-width: 70px; border: 0; border-bottom: 1px solid transparent; background: var(--input);
  font: inherit; text-align: right; padding: 6px 8px; color: var(--ink); font-variant-numeric: tabular-nums;
}
.t td.in input:hover { background: #fff5cc; }
.t td.in input:focus { outline: 2px solid var(--teal); outline-offset: -2px; background: #fff; }
.t td.all input { background: #fff; border-left: 1px dashed var(--line-2); color: var(--navy); font-weight: 600; }
.t td.ro { color: var(--muted); }
.t td.saved input { animation: saved 1.2s ease-out; }
@keyframes saved { from { background: #d7f5e6; } }

/* assumptions layout */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tabs button { border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); padding: 8px 14px;
  border-radius: 999px; cursor: pointer; font-size: 13.5px; }
.tabs button.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.hint { color: var(--muted); font-size: 12.5px; margin: 0 0 10px; }
.block { margin-bottom: 18px; }
.block h2 { font-size: 15px; color: var(--navy); margin: 0 0 8px; font-weight: 600; }
.bar { display: flex; align-items: center; gap: 12px; margin: 18px 0 0; }
.btn { border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); padding: 8px 14px; border-radius: 8px; cursor: pointer; }
.btn:hover { border-color: var(--neg); color: var(--neg); }
.t.narrow th:first-child, .t.narrow td:first-child { min-width: 420px; }
.t.narrow { width: auto; }
.t.narrow td.in input { min-width: 140px; }

.toast { position: fixed; right: 20px; bottom: 20px; background: var(--ink); color: #fff; padding: 10px 16px;
  border-radius: 8px; opacity: 0; transform: translateY(8px); transition: all .2s; z-index: 50; font-size: 13px; }
.toast.on { opacity: 1; transform: none; }
.toast.err { background: var(--neg); }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; }
.login .box { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 32px 36px; width: 360px; }
.login .logos { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 22px; }
.login .logos img.ebit { height: 54px; }
.login .logos img.cub { height: 28px; }
.login h1 { text-align: center; font-size: 17px; margin-bottom: 18px; }
.login input { width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px; font: inherit; }
.login button { width: 100%; margin-top: 12px; padding: 10px; background: var(--navy); color: #fff; border: 0; border-radius: 8px; font: inherit; cursor: pointer; }
.login .err { color: var(--neg); font-size: 13px; margin-top: 10px; text-align: center; }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand .title { display: none; }
  .t th:first-child, .t td:first-child { min-width: 220px; }
}
