/* Dasbor ILP */
body.dash { background: var(--mist); }
.period { color: var(--muted); margin: 0 0 6px; }
.period b { color: var(--ink); font-family: var(--font-d); }
.dh { background: #fff; border-bottom: 1px solid var(--line); }
.dh .wrap { display: flex; align-items: center; gap: 18px; height: 64px; flex-wrap: wrap; }
.dh .back { font-weight: 700; font-size: .88rem; display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: var(--r); background: var(--g50); text-decoration: none; }
.dh-t { margin-left: auto; font-weight: 800; color: var(--g800); }
.dmain { padding: 36px 0 72px; }
.d-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 20px; }
.d-top h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; margin-bottom: 6px; }
.d-top p { margin: 0; }
.d-actions { display: flex; gap: 10px; }
.filters { display: flex; gap: 14px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; margin-bottom: 4px; }
.filters > div { flex: 1 1 200px; max-width: 280px; }
.filters label { display: block; font-weight: 700; font-size: .8rem; color: var(--ink); margin-bottom: 4px; }
.select-sm { padding: 8px 34px 8px 12px; font-size: .88rem; max-width: 260px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin: 18px 0 20px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 18px; border-top: 4px solid var(--line); display: flex; flex-direction: column; }
.kpi.ok { border-top-color: var(--g600); } .kpi.warn { border-top-color: var(--amber); } .kpi.bad { border-top-color: var(--red); }
.kpi-h { display: flex; gap: 8px; font-size: .78rem; color: var(--muted); font-weight: 600; line-height: 1.3; min-height: 3.1em; }
.kpi-h i { color: var(--g600); font-size: 1rem; }
.kpi b { font-size: 2rem; letter-spacing: -.03em; color: var(--ink); line-height: 1.1; margin-top: 8px; }
.kpi small { color: var(--muted); font-size: .78rem; }
.dl { font-size: .78rem; font-weight: 700; color: var(--muted); margin-top: 10px; display: flex; align-items: center; }
.dl.up { color: var(--g700); } .dl.down { color: var(--red); }
.dl i { font-size: 1.2rem; margin-left: -4px; }

.d-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 24px; min-width: 0; }
.card-h { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 18px; flex-wrap: wrap; }
.card-h h2 { font-size: 1.1rem; margin-bottom: 2px; }
.card-h p { margin: 0; }
.c-heat { grid-column: 1 / -1; }

.trend svg { width: 100%; height: auto; display: block; overflow: visible; }
.trend .gl { stroke: #e6eee8; stroke-width: 1; }
.trend .ax { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.trend .ax.sel { fill: var(--ink); font-weight: 800; }
.trend .ln { fill: none; stroke: var(--g600); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.trend .ar { fill: rgba(21,137,56,.1); }
.trend .dot { fill: #fff; stroke: var(--g600); stroke-width: 2.5; }
.trend .dot.on { fill: var(--g600); stroke: #fff; stroke-width: 3; }
.trend .tg { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 5 4; }
.trend .tgl { font-size: 11px; fill: var(--ink); font-weight: 700; font-family: var(--font); }
.trend .vl { font-size: 11px; fill: var(--ink); font-weight: 700; font-family: var(--font); }

.rank { display: grid; gap: 14px; }
.rk { display: grid; grid-template-columns: 110px 1fr 42px; gap: 12px; align-items: center; font-size: .88rem; }
.rk.sel .rk-n { font-weight: 800; color: var(--g800); }
.rk b { text-align: right; color: var(--ink); }
.rank .bar { position: relative; height: 12px; background: #e9f0ea; border-radius: 3px; }
.rank .bar i { display: block; height: 100%; border-radius: 3px; }
.rank .bar i.ok, .heat .ok { background: var(--g600); }
.rank .bar i.warn { background: var(--amber); }
.rank .bar i.bad { background: var(--red); }
.rank .bar u { position: absolute; top: -4px; bottom: -4px; width: 3px; background: var(--ink); border-radius: 2px; }
.card .legend span:nth-child(1)::before { background: var(--g600); }
.card .legend span:nth-child(2)::before { background: var(--amber); width: 12px; height: 12px; border-radius: 4px; }
.card .legend span:nth-child(3)::before { background: var(--red); width: 12px; height: 12px; border-radius: 4px; margin-right: 8px; }

.alerts { display: grid; gap: 10px; }
.alerts li { display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; align-items: start; padding: 12px 14px; border-radius: 12px; background: #f8fbf9; border: 1px solid var(--line); }
.alerts b { font-size: .92rem; color: var(--ink); line-height: 1.3; display: block; }
.alerts p { margin: 2px 0 0; font-size: .84rem; color: var(--muted); }
.alerts em { font-style: normal; font-size: .7rem; font-weight: 800; color: var(--teal); background: var(--teal-50); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.sev { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; }
.sev.warn { background: var(--amber); } .sev.bad { background: var(--red); }
.alerts li.good { display: flex; gap: 10px; color: var(--g700); font-weight: 600; background: var(--g50); }

.tbl-wrap { overflow-x: auto; }
.heat { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: .88rem; min-width: 760px; }
.heat th { text-align: center; font-size: .75rem; color: var(--muted); padding: 6px 8px; font-weight: 700; }
.heat th:first-child { text-align: left; }
.heat td { padding: 10px 8px; }
.heat td:first-child { padding-left: 0; font-weight: 600; color: var(--ink); }
.heat tr.grp td { padding: 14px 0 4px; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--g700); }
.heat td.c { text-align: center; font-weight: 700; border-radius: 8px; }
.heat td.c.ok { background: #d8f0e0; color: var(--g800); }
.heat td.c.warn { background: #fdebc2; color: #7a5200; }
.heat td.c.bad { background: #f9d3cf; color: #8e231b; }
.heat td.selc { outline: 2px solid var(--ink); outline-offset: -2px; }
.heat td.all { box-shadow: inset 0 0 0 2px rgba(11,61,28,.35); }

@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) { .d-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi b { font-size: 1.6rem; }
  .rk { grid-template-columns: 90px 1fr 38px; }
  .dh-t { display: none; }
}
@media print {
  .dh, .filters, .d-actions, .demo-note { display: none; }
  body.dash { background: #fff; }
  .card, .kpi { break-inside: avoid; box-shadow: none; }
}
