/* Дизайн-система витрин банка «Северный». Тёмная тема — «полярная ночь», светлая — «полярный день».
   Фирменный элемент — северное сияние: градиент бирюза → лёд → фиолет. */
@import url(fonts.css);

:root {
  color-scheme: dark;
  --bg: #0b1322; --bg-2: #0f1a2e; --panel: #111d33; --panel-2: #172744; --line: #22324f; --line-2: #2e4166;
  --ink: #eaf2ff; --ink-2: #b4c3dc; --muted: #7f91b1;
  --teal: #3ddbb4; --ice: #5cb8ff; --violet: #9a8cff; --coral: #ff6b6b; --amber: #ffb547; --good: #3ddbb4;
  --teal-soft: rgba(61, 219, 180, .16); --ice-soft: rgba(92, 184, 255, .16); --coral-soft: rgba(255, 107, 107, .16);
  --aurora: linear-gradient(100deg, #3ddbb4 0%, #5cb8ff 45%, #9a8cff 100%);
  --heat-0: #13233f; --heat-1: #1e4f6e; --heat-2: #2f8a8a; --heat-3: #e0a53f; --heat-4: #ff6b6b;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .6);
  --display: 'Unbounded', 'Onest', system-ui, sans-serif;
  --text: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef3f9; --bg-2: #e6edf6; --panel: #ffffff; --panel-2: #f4f7fb; --line: #dbe3ee; --line-2: #c5d1e2;
  --ink: #0e1b31; --ink-2: #3a4b67; --muted: #6a7a95;
  --teal: #0e9f7e; --ice: #1d74d8; --violet: #6150dd; --coral: #d93a3a; --amber: #c07a00; --good: #0e8a6e;
  --teal-soft: rgba(14, 159, 126, .12); --ice-soft: rgba(29, 116, 216, .12); --coral-soft: rgba(217, 58, 58, .1);
  --aurora: linear-gradient(100deg, #0e9f7e 0%, #1d74d8 50%, #6150dd 100%);
  --heat-0: #e7eef7; --heat-1: #b9d7ea; --heat-2: #6fb7b0; --heat-3: #f0b24a; --heat-4: #e04848;
  --shadow: 0 24px 50px -28px rgba(20, 40, 80, .35);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--ink); background: var(--bg); font: 15px/1.5 var(--text); font-variant-numeric: tabular-nums;
       -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, select, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ice); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { margin: 0; }

/* ------------------------------------------------------------------------------------------- каркас отчёта */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 22px 14px;
        background: var(--bg-2); border-right: 1px solid var(--line); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--aurora); display: grid; place-items: center;
              font: 700 17px/1 var(--display); color: #08111f; flex: none; }
.brand-name { font: 600 14px/1.15 var(--display); letter-spacing: -.01em; }
.brand-name small { display: block; font: 400 12px/1.3 var(--text); color: var(--muted); letter-spacing: 0; margin-top: 3px; }
.rail nav { display: flex; flex-direction: column; gap: 2px; }
.rail nav a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; text-decoration: none;
              color: var(--ink-2); font-size: 14px; }
.rail nav a:hover { background: var(--panel); color: var(--ink); }
.rail nav a[aria-current="page"] { background: var(--panel-2); color: var(--ink); font-weight: 600; }
.rail nav a .glyph { width: 26px; height: 26px; flex: none; border-radius: 7px; display: grid; place-items: center; font-size: 12px;
                     background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.rail nav a[aria-current="page"] .glyph { background: var(--aurora); border-color: transparent; color: #08111f; }
.rail .spacer { flex: 1; }
.rail .tool { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line);
              background: transparent; cursor: pointer; color: var(--ink-2); font-size: 13px; text-align: left; }
.rail .tool:hover { color: var(--ink); border-color: var(--line-2); }
.rail .tool .count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 99px; background: var(--teal-soft);
                     color: var(--teal); font-size: 12px; font-weight: 600; text-align: center; }
.rail .hint { color: var(--muted); font-size: 12px; padding: 10px 8px 0; line-height: 1.4; }

.page { min-width: 0; padding: 30px 36px 48px; }
.page-head { display: flex; flex-wrap: wrap; gap: 18px 32px; align-items: flex-end; margin-bottom: 26px; }
.page-head .titles { flex: 1 1 420px; max-width: 760px; }
.page-head h1 { font: 600 30px/1.1 var(--display); letter-spacing: -.02em; }
.page-head .lead { margin-top: 10px; color: var(--ink-2); font-size: 15px; max-width: 64ch; }
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Сегментированный переключатель и выпадающие списки */
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 9px; cursor: pointer; color: var(--ink-2); font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--panel-2); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line-2); }
.select { position: relative; display: inline-flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.select select { appearance: none; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 34px 8px 12px;
                 color: var(--ink); font-size: 14px; cursor: pointer;
                 background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
                 background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink);
       border-radius: 12px; padding: 8px 14px; cursor: pointer; font-size: 14px; }
.btn:hover { border-color: var(--ice); }
.btn.primary { background: var(--aurora); color: #08111f; border-color: transparent; font-weight: 600; }

/* Сетка панелей. Панели разного «веса»: hero — крупная, tile — обычная, inset — без фона. */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
.panel { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; min-width: 0; }
.panel.hero { border-radius: 22px; padding: 26px 28px; background:
  radial-gradient(120% 140% at 0% 0%, var(--teal-soft), transparent 55%),
  radial-gradient(120% 140% at 100% 0%, rgba(154, 140, 255, .12), transparent 60%), var(--panel); }
.panel.inset { background: transparent; border-style: dashed; }
.panel h2 { font: 600 16px/1.3 var(--text); letter-spacing: -.005em; }
.panel .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.panel .body { margin-top: 14px; }
.c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; }
.c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c9 { grid-column: span 9; } .c12 { grid-column: span 12; }

/* Ключевые цифры */
.metric .label { color: var(--ink-2); font-size: 13px; }
.metric .value { font: 600 34px/1.1 var(--display); letter-spacing: -.03em; margin-top: 8px; white-space: nowrap; }
.metric .value small { font: 500 15px/1 var(--text); color: var(--ink-2); margin-left: 4px; letter-spacing: 0; }
.metric .delta { margin-top: 8px; font-size: 13px; color: var(--muted); }
.metric .spark { margin-top: 12px; height: 40px; }
.up-bad, .down-bad { color: var(--coral); font-weight: 600; }
.up-good, .down-good { color: var(--good); font-weight: 600; }

/* Подпись «откуда цифры» под панелью */
.source { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; background: var(--panel-2);
        border: 1px solid var(--line); color: var(--ink-2); font-size: 12px; cursor: help; white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.chip.dim::before { background: var(--violet); }

/* SVG-графики */
svg { display: block; width: 100%; overflow: visible; }
svg text { fill: var(--muted); font: 12px var(--text); font-variant-numeric: tabular-nums; }
svg .ink { fill: var(--ink); } svg .ink2 { fill: var(--ink-2); }
svg .strong { fill: var(--ink); font-weight: 600; }
svg .gridline { stroke: var(--line); stroke-width: 1; }
svg .axis { stroke: var(--line-2); stroke-width: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-2); }
.legend i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: 7px; }

/* Таблицы */
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: right; color: var(--muted); font-weight: 500; font-size: 12px; padding: 0 10px 8px; }
table.data td { text-align: right; padding: 9px 10px; border-top: 1px solid var(--line); white-space: nowrap; }
.panel .body:has(> table) { overflow-x: auto; }
table.data th:first-child, table.data td:first-child { text-align: left; padding-left: 0; }
table.data tr.hl td { background: var(--coral-soft); }
table.data tr.hl td:first-child { box-shadow: inset 3px 0 0 var(--coral); padding-left: 10px; }

/* Подсказка */
#tip { position: fixed; z-index: 50; pointer-events: none; display: none; max-width: 320px; padding: 10px 12px; border-radius: 12px;
       background: var(--panel-2); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 13px; line-height: 1.45; }
#tip b { font-weight: 600; }
#tip .t { font-weight: 600; margin-bottom: 4px; }

/* Панель «Как посчитано»: все запросы страницы к семантическому слою */
.inspector { position: fixed; z-index: 40; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--bg-2);
             border-left: 1px solid var(--line-2); box-shadow: var(--shadow); transform: translateX(105%);
             transition: transform .28s cubic-bezier(.2, .8, .2, 1); display: flex; flex-direction: column; }
.inspector.open { transform: none; }
.inspector header { padding: 22px 24px 14px; border-bottom: 1px solid var(--line); }
.inspector header h2 { font: 600 18px/1.2 var(--display); }
.inspector header p { margin: 8px 0 0; color: var(--ink-2); font-size: 13px; }
.inspector .close { position: absolute; top: 18px; right: 18px; }
.inspector .list { overflow-y: auto; padding: 8px 24px 24px; }
.inspector details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.inspector summary { cursor: pointer; display: flex; gap: 10px; align-items: baseline; list-style: none; }
.inspector summary::-webkit-details-marker { display: none; }
.inspector summary .what { font-weight: 600; font-size: 14px; flex: 1; }
.inspector summary .ms { color: var(--muted); font-size: 12px; }
.inspector .members { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.inspector .member { font-size: 13px; color: var(--ink-2); }
.inspector .member b { color: var(--ink); font-weight: 600; }
.inspector .member code { color: var(--teal); font-size: 12px; }
.inspector pre { margin: 8px 0 0; padding: 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line);
                 font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink-2); overflow: auto; max-height: 260px; }

.error-box { padding: 16px 18px; border-radius: 14px; background: var(--coral-soft); border: 1px solid var(--coral); color: var(--ink); margin-bottom: 18px; }
.skeleton { min-height: 120px; border-radius: 12px; background: linear-gradient(90deg, var(--panel) 0%, var(--panel-2) 50%, var(--panel) 100%);
            background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 1180px) {
  .c3 { grid-column: span 6; } .c4, .c5, .c7, .c8, .c9 { grid-column: span 12; } .c6 { grid-column: span 12; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; }
  .rail nav { flex-direction: row; flex-wrap: wrap; } .rail .spacer, .rail .hint { display: none; }
  .page { padding: 22px 16px 40px; }
  .c3 { grid-column: span 12; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
