/* Оформлення за концептом версії 4: темна бічна панель, світле тло, білі картки. */
@font-face { font-family: Carlito; src: url("/static/fonts/Carlito-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Carlito; src: url("/static/fonts/Carlito-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --navy: #0B1D3A; --gold: #C5A55A; --bg: #F3F5F8; --card: #FFFFFF; --line: #E3E7EE; --line2: #EEF1F6;
  --text: #0B1D3A; --muted: #45536B; --muted2: #5F6C83; --link: #1C5CAB;
  --red: #D03B3B; --red-bg: #FBE9E9; --red-tx: #9B1C1C;
  --amber: #EC835A; --amber-bg: #FCEBE3; --amber-tx: #8F3A14;
  --yellow-bg: #FFF4D6; --yellow-tx: #7A5600;
  --green: #0CA30C; --green-bg: #E4F4E4; --green-tx: #006300;
  --gray-bg: #E7EBF2; --blue: #2F6FCF; --brown: #A8892F;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.35 Carlito, Calibri, "Segoe UI", Roboto, sans-serif; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--navy); text-decoration: underline; }
h1 { font-size: 26px; margin: 0; line-height: 1.15; }
h2 { font-size: 18px; margin: 0; }
h3 { font-size: 15px; margin: 0; }
p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .muted2 { color: var(--muted2); }
.small { font-size: 13px; } .bold { font-weight: 700; }
.neg { color: var(--red-tx); } .pos { color: var(--green-tx); }
.nowrap { white-space: nowrap; }

.layout { display: flex; min-height: 100vh; }
.side { flex: 0 0 232px; background: var(--navy); color: #C9D2E0; padding: 24px 16px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { padding: 0 12px; display: flex; flex-direction: column; gap: 8px; }
.brand img { width: 160px; height: auto; display: block; }
.brand span { font-size: 12px; font-weight: 700; color: var(--gold); letter-spacing: .14em; text-transform: uppercase; }
.menu { display: flex; flex-direction: column; gap: 3px; }
.menu a { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 12px; border-radius: 8px; color: #C9D2E0; }
.menu a:hover { background: rgba(255,255,255,.05); text-decoration: none; color: #fff; }
.menu a.on { background: rgba(255,255,255,.09); color: #fff; font-weight: 700; }
.ico { flex: none; fill: none; stroke: #93A0B8; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.menu a.on .ico { stroke: var(--gold); }
.menu .badge { margin-left: auto; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.who { margin-top: auto; padding: 12px; border-top: 1px solid rgba(255,255,255,.12); display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.who b { color: #fff; } .who a { color: var(--gold); font-size: 13px; }
.main { flex: 1 1 auto; min-width: 0; padding: 26px 28px 40px; display: flex; flex-direction: column; gap: 16px; }
.head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px; }
.head .sub { color: var(--muted); margin-top: 4px; }
.head .tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.head > div { min-width: 0; max-width: 100%; }
.head .tools > * { min-width: 0; max-width: 100%; }
.head .tools form.inline { display: inline-flex; gap: 6px; }
.head .tools select { min-width: 0; max-width: 100%; text-overflow: ellipsis; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card.tight { padding: 16px 18px; gap: 6px; }
a.card { color: var(--text); } a.card:hover { text-decoration: none; border-color: #C9D2E0; }
.card-h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.card-h .more { font-size: 14px; font-weight: 700; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); }
.split { display: flex; flex-wrap: wrap; gap: 16px; }
.split > .wide { flex: 6 1 520px; min-width: 0; } .split > .narrow { flex: 5 1 420px; min-width: 0; }
.big { font-size: 50px; font-weight: 700; line-height: 1.05; }
.kpi { font-size: 30px; font-weight: 700; line-height: 1.15; }
.unit { font-size: 16px; color: var(--muted2); font-weight: 400; margin-left: 6px; }
.label { color: var(--muted); }
.rowline { display: flex; justify-content: space-between; gap: 16px; padding: 3px 0; }
.sep { border-top: 1px solid var(--line2); padding-top: 12px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; background: var(--gray-bg); color: var(--muted); }
.pill.red { background: var(--red-bg); color: var(--red-tx); } .pill.amber { background: var(--amber-bg); color: var(--amber-tx); }
.pill.yellow { background: var(--yellow-bg); color: var(--yellow-tx); } .pill.green { background: var(--green-bg); color: var(--green-tx); }
.pill.blue { background: #E3EDFB; color: #14457F; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--muted2); }
.dot.red { background: var(--red); } .dot.amber { background: var(--amber); } .dot.green { background: var(--green); } .dot.yellow { background: #E0A800; }

table { border-collapse: collapse; width: 100%; }
.tbl th { text-align: left; font-size: 13px; font-weight: 400; color: var(--muted2); padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: bottom; }
.tbl td { padding: 7px 8px; border-bottom: 1px solid var(--line2); vertical-align: top; }
.tbl th:first-child, .tbl td:first-child { padding-left: 0; }
.tbl th:last-child, .tbl td:last-child { padding-right: 0; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r, .tbl th.r { text-align: right; }
.tbl .c { text-align: center; }
.tbl tr.total td { font-weight: 700; border-top: 1px solid var(--navy); }
.tbl tr.grp td { font-weight: 700; padding-top: 12px; }
.tbl tr.sub td:first-child { padding-left: 16px; color: var(--muted); }
.tbl td.warn { background: var(--red-bg); color: var(--red-tx); font-weight: 700; }
.tbl td.low { background: var(--yellow-bg); }
.tbl td.wk, .tbl th.wk { text-align: right; padding: 6px 0 6px 10px; min-width: 62px; white-space: nowrap; }
.tbl th.nw { white-space: nowrap; }
.tbl th.cur { color: var(--navy); font-weight: 700; }
.scroll { overflow-x: auto; }
.chart { display: block; width: 100%; height: auto; min-width: 460px; }
.chart .tick { font-size: 11px; fill: var(--muted2); } .chart .val { font-size: 13px; font-weight: 700; fill: var(--navy); } .chart .val.small { font-size: 11px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 18px; height: 3px; vertical-align: middle; margin-right: 6px; background: var(--navy); }
.legend i.dash { background: repeating-linear-gradient(90deg, var(--muted2) 0 5px, transparent 5px 9px); }
.legend i.box { height: 10px; width: 10px; border-radius: 2px; }

.alert { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line2); }
.alert:last-child { border-bottom: 0; }
.alert .mark { flex: none; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 14px; margin-top: 1px; }
.alert.critical .mark { background: var(--red); } .alert.important .mark { background: var(--amber); } .alert.notice .mark { background: #E0A800; }
.alert .body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.alert .t { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; font-weight: 700; }
.alert .t .sev { font-size: 13px; white-space: nowrap; }
.alert.critical .sev { color: var(--red-tx); } .alert.important .sev { color: var(--amber-tx); } .alert.notice .sev { color: var(--yellow-tx); }
.alert ul { margin: 2px 0 0; padding-left: 18px; }
.note { background: var(--yellow-bg); color: #5C4300; border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.note.info { background: #E9F0FB; color: #14315C; } .note.err { background: var(--red-bg); color: var(--red-tx); } .note.ok { background: var(--green-bg); color: var(--green-tx); }
.notes { display: flex; flex-direction: column; gap: 8px; }

form.inline { display: inline; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 12px 14px; align-items: end; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.form label.wide2 { grid-column: 1 / -1; }
input, select, textarea { font: inherit; color: var(--text); padding: 7px 10px; border: 1px solid #C9D2E0; border-radius: 8px; background: #fff; min-height: 36px; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9DB8E2; border-color: var(--link); }
input[type=checkbox] { min-height: 0; width: 17px; height: 17px; padding: 0; }
.check { flex-direction: row !important; align-items: center; gap: 8px !important; color: var(--text) !important; font-size: 14px !important; }
.btn { font: inherit; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--navy); background: var(--navy); color: #fff; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #17305A; color: #fff; text-decoration: none; }
.btn.ghost { background: #fff; color: var(--navy); border-color: #C9D2E0; } .btn.ghost:hover { background: var(--bg); }
.btn.danger { background: #fff; color: var(--red-tx); border-color: #E7B5B5; }
.btn.sm { min-height: 28px; padding: 0 10px; font-size: 13px; }
.seg { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg a { padding: 5px 12px; border-radius: 7px; color: var(--muted); font-weight: 700; font-size: 14px; }
.seg a.on { background: var(--navy); color: #fff; } .seg a:hover { text-decoration: none; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs a { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-weight: 700; font-size: 14px; }
.tabs a.on { background: var(--navy); color: #fff; border-color: var(--navy); } .tabs a:hover { text-decoration: none; }
details > summary { cursor: pointer; font-weight: 700; color: var(--link); white-space: nowrap; }
.pill.wrap { white-space: normal; border-radius: 10px; align-self: flex-start; }
fieldset.checks { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 0; display: flex; flex-direction: column; gap: 4px; grid-column: 1 / -1; }
fieldset.checks legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
.foot { color: var(--muted2); font-size: 13px; margin-top: 8px; }

.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--navy); padding: 24px; }
.login .box { width: min(380px, 100%); background: #fff; border-radius: 14px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.login .logo { background: var(--navy); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.login .logo img { width: 170px; height: auto; }
.login .logo span { font-size: 12px; font-weight: 700; color: var(--gold); letter-spacing: .14em; text-transform: uppercase; }
.login label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }

@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .side { position: static; height: auto; flex: none; padding: 14px 12px; gap: 12px; }
  .brand { flex-direction: row; align-items: center; justify-content: space-between; }
  .brand img { width: 110px; }
  .menu { flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .menu a { flex: none; min-height: 36px; padding: 0 10px; }
  .menu a span.t { white-space: nowrap; }
  .who { margin-top: 0; flex-direction: row; flex-wrap: wrap; gap: 4px 12px; padding: 8px 12px 0; }
  .main { padding: 16px 14px 32px; }
  .big { font-size: 40px; }
  h1 { font-size: 22px; }
}
/* Телефон: таблиці з класом stack (його ставить app.js) показуються картками, перша колонка прогнозу по тижнях закріплена. */
.tbl.sticky1 th:first-child, .tbl.sticky1 td:first-child { position: sticky; left: 0; background: var(--card); z-index: 1; }
@media (max-width: 640px) {
  .tbl.sticky1 th:first-child, .tbl.sticky1 td:first-child { max-width: 128px; padding-right: 8px; box-shadow: 1px 0 0 var(--line2); }
  .tbl.stack, .tbl.stack tbody { display: block; width: 100%; }
  .tbl.stack tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--line2); }
  .tbl.stack tr:last-child { border-bottom: 0; }
  .tbl.stack tr.hdr { display: none; }
  .tbl.stack td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 2px 0; border: 0; text-align: right; min-width: 0; overflow-wrap: anywhere; }
  .tbl.stack td::before { content: attr(data-l); flex: 0 1 46%; text-align: left; color: var(--muted2); font-size: 13px; font-weight: 400; }
  .tbl.stack td:first-child { display: block; text-align: left; font-weight: 700; }
  .tbl.stack td:first-child::before, .tbl.stack td.span::before { content: none; }
  .tbl.stack td.span { display: block; text-align: left; }
  .tbl.stack tr:not(.total) td.span { font-weight: 400; }
  .tbl.stack td .v { min-width: 0; }
  .tbl.stack td.e { display: none; }
  .tbl.stack td.long { display: block; text-align: left; }
  .tbl.stack td.long::before { display: block; }
  .tbl.stack tr.total { border-top: 1px solid var(--navy); }
  .tbl.stack tr.total td { border-top: 0; }
  .tbl.stack td.nowrap { white-space: normal; }
}
@media print { .side, .tools, form { display: none !important; } .main { padding: 0; } .card { break-inside: avoid; } }
