/* ==========================================================================
   Hooldusradar: disainisüsteem (üks fail, build-sammu ei ole).
   Põhimõtted: hele rahulik taust, valged ümarad paneelid, tume aktiivne
   menüüvalik, värv ainult tähendusega:
     lilla  = kiri ja suhtlus        münt = edenemine ja edu
     merevaik = vajab tähelepanu     roos = probleem (andmed, põrge)
     hall  = neutraalne / lõpetatud  test = kriipsjoon, testandmed
   Avalik viide vanale versioonile on merevaik, mitte punane: see ei ole
   turvadiagnoos.
   ========================================================================== */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url('../fonts/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url('../fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --bg: #f2f3ef;
    --surface: #ffffff;
    --surface-2: #f7f7f4;
    --line: #e6e6e0;
    --line-strong: #d5d6ce;
    --ink: #17181c;
    --ink-2: #3b3f4a;
    --ink-3: #636876;
    --ink-4: #9398a5;

    --violet: #6a58d6;  --violet-soft: #efedfd; --violet-line: #d9d3fa; --violet-ink: #4935b8;
    --mint: #1d9a67;    --mint-soft: #e4f6ec;   --mint-line: #bfe8d2;   --mint-ink: #12704a;
    --amber: #c9861c;   --amber-soft: #fcf2df;  --amber-line: #f2dbb0;  --amber-ink: #87560b;
    --rose: #c9435e;    --rose-soft: #fcecef;   --rose-line: #f4ccd5;   --rose-ink: #9b2640;
    --slate-soft: #eef0f2; --slate-line: #dfe2e6; --slate-ink: #4b5160;

    --r-panel: 20px;
    --r-inner: 14px;
    --r-ctl: 11px;
    --shadow: 0 1px 2px rgba(23, 24, 28, .04), 0 6px 20px rgba(23, 24, 28, .04);
    --focus: 0 0 0 3px rgba(106, 88, 214, .28);
    --gap: 18px;
    --side-w: 256px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.5;
    font-feature-settings: 'cv11', 'ss01';
    -webkit-font-smoothing: antialiased;
}
a { color: var(--violet-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -.015em; color: var(--ink); }
h1 { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.08rem; font-weight: 650; }
h3 { font-size: .95rem; font-weight: 650; }
p { margin: 0 0 .6rem; }
code { font-size: .86em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; }
small { font-size: .84rem; }
[x-cloak] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.faint { color: var(--ink-4); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- layout */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); gap: var(--gap); padding: var(--gap); min-height: 100vh; }
.main { min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }
.page { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }

/* Külgmenüü: ujuv paneel */
.side {
    position: sticky; top: var(--gap); align-self: start;
    height: calc(100vh - 2 * var(--gap));
    background: var(--surface); border-radius: var(--r-panel); box-shadow: var(--shadow);
    display: flex; flex-direction: column; padding: 20px 14px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 18px; color: var(--ink); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 36px; height: 36px; flex-shrink: 0; }
.brand__name { font-weight: 750; font-size: 1.12rem; letter-spacing: -.02em; line-height: 1.1; }
.brand__sub { display: block; font-size: .74rem; font-weight: 500; color: var(--ink-4); letter-spacing: 0; }
.nav-group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.nav-group__title { font-size: .7rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-4); padding: 6px 12px 4px; }
.nav-link {
    display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 12px;
    color: var(--ink-2); font-weight: 550; font-size: .94rem; text-decoration: none;
}
.nav-link svg { width: 19px; height: 19px; flex-shrink: 0; color: var(--ink-3); }
.nav-link:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.nav-link.is-active { background: var(--ink); color: #fff; }
.nav-link.is-active svg { color: #fff; }
.nav-link:focus-visible { outline: none; box-shadow: var(--focus); }
.nav-count {
    margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .74rem; font-weight: 700; font-variant-numeric: tabular-nums;
    background: var(--slate-soft); color: var(--slate-ink);
}
.nav-count--amber { background: var(--amber-soft); color: var(--amber-ink); }
.nav-count--mint { background: var(--mint-soft); color: var(--mint-ink); }
.nav-count--violet { background: var(--violet-soft); color: var(--violet-ink); }
.nav-link.is-active .nav-count { background: rgba(255, 255, 255, .18); color: #fff; }
.side__foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.side__copy { font-size: .74rem; color: var(--ink-4); padding: 8px 12px 0; }

/* Ülariba */
.topbar {
    display: flex; align-items: center; gap: 14px; min-height: 64px;
    background: var(--surface); border-radius: var(--r-panel); box-shadow: var(--shadow); padding: 12px 14px 12px 22px;
}
.topbar__titles { min-width: 0; flex: 1; }
.crumb { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--ink-3); margin-bottom: 1px; }
.crumb a { color: var(--ink-3); }
.topbar h1 { font-size: 1.35rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 10px; }
.topbar__actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.menu-btn { display: none; }
.env-pill {
    display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 13px; border-radius: 999px;
    font-size: .84rem; font-weight: 650; white-space: nowrap; text-decoration: none;
}
.env-pill:hover { text-decoration: none; }
.env-pill--test { background: var(--amber-soft); color: var(--amber-ink); border: 1px dashed var(--amber); }
.env-pill--live { background: var(--mint-soft); color: var(--mint-ink); }
.env-pill--off { background: var(--slate-soft); color: var(--slate-ink); }
.env-pill__dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.user-btn {
    display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 10px 0 4px; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; font: inherit; color: var(--ink);
}
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--violet-soft); color: var(--violet-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .84rem; }
.user-btn__name { font-weight: 600; font-size: .88rem; line-height: 1.15; text-align: left; }
.user-btn__name small { display: block; color: var(--ink-4); font-weight: 500; font-size: .74rem; }
.dropdown { position: relative; }
.dropdown__sheet {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 240px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-inner); box-shadow: 0 12px 32px rgba(23, 24, 28, .12); padding: 8px;
}
.dropdown__who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.dropdown__who small { display: block; color: var(--ink-3); }
.dropdown__item { display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: 9px; background: none; border: 0; font: inherit; color: var(--ink-2); cursor: pointer; }
.dropdown__item:hover { background: var(--surface-2); text-decoration: none; }
.dropdown__item--danger { color: var(--rose-ink); }

/* ---------------------------------------------------------------- paneelid */
.panel { background: var(--surface); border-radius: var(--r-panel); box-shadow: var(--shadow); padding: 22px; min-width: 0; }
.panel--flush { padding: 0; overflow: hidden; }
.panel--flush > .panel__head { padding: 20px 22px 0; }
.panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel__head h2 { font-size: 1.12rem; }
.panel__sub { font-size: .88rem; color: var(--ink-3); margin: 3px 0 0; }
.panel__link { font-size: .86rem; font-weight: 600; white-space: nowrap; color: var(--ink-2); display: inline-flex; align-items: center; gap: 4px; }
.panel__foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; font-size: .88rem; }

/* 12-veeruline ruudustik, kõrgus sisu järgi */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.stack { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }

/* ---------------------------------------------------------------- tegevusplaadid */
.todo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.todo {
    display: flex; flex-direction: column; gap: 10px; min-width: 0;
    background: var(--surface); border-radius: var(--r-panel); box-shadow: var(--shadow); padding: 20px;
    color: var(--ink); text-decoration: none; border: 1px solid transparent; transition: border-color .12s, transform .12s;
}
.todo:hover { text-decoration: none; border-color: var(--line-strong); transform: translateY(-1px); }
.todo__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.todo__icon { width: 38px; height: 38px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; }
.todo__icon svg { width: 20px; height: 20px; }
.todo__n { font-size: 2.3rem; font-weight: 750; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.todo__label { font-weight: 650; font-size: 1rem; }
.todo__hint { font-size: .86rem; color: var(--ink-3); line-height: 1.4; }
.todo__cta { margin-top: auto; font-size: .86rem; font-weight: 650; display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); }
.todo--amber .todo__icon { background: var(--amber-soft); color: var(--amber-ink); }
.todo--violet .todo__icon { background: var(--violet-soft); color: var(--violet-ink); }
.todo--mint .todo__icon { background: var(--mint-soft); color: var(--mint-ink); }
.todo--ink .todo__icon { background: var(--slate-soft); color: var(--ink); }
.todo--zero .todo__n { color: var(--ink-4); }

/* ---------------------------------------------------------------- numbrid */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px; }
.stat { background: var(--surface-2); border-radius: var(--r-inner); padding: 12px 14px; min-width: 0; }
.stat__label { font-size: .8rem; color: var(--ink-3); font-weight: 550; }
.stat__value { font-size: 1.6rem; font-weight: 720; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 2px; }
.stat__value small { font-size: .9rem; font-weight: 550; color: var(--ink-3); margin-left: 3px; }
.stat__meta { font-size: .78rem; color: var(--ink-4); margin-top: 2px; }

/* Päris ja test kõrvuti: test on kriipsjoonega ja viirutatud */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.split__col { border-radius: var(--r-inner); padding: 14px; border: 1px solid var(--line); min-width: 0; }
.split__col--test {
    border: 1.5px dashed var(--amber-line);
    background: repeating-linear-gradient(135deg, #fffdf8 0 10px, #fcf7ec 10px 20px);
}
.split__col--test .stat { background: rgba(255, 255, 255, .8); }
.split__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.split__head h3 { display: flex; align-items: center; gap: 8px; }
.split__note { font-size: .82rem; color: var(--ink-3); margin: 10px 0 0; line-height: 1.45; }

/* ---------------------------------------------------------------- märgised */
.badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px;
    font-size: .78rem; font-weight: 650; line-height: 1.35; white-space: nowrap; vertical-align: middle;
    background: var(--slate-soft); color: var(--slate-ink);
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; flex-shrink: 0; }
.badge--plain::before { display: none; }
.badge--violet { background: var(--violet-soft); color: var(--violet-ink); }
.badge--mint { background: var(--mint-soft); color: var(--mint-ink); }
.badge--amber { background: var(--amber-soft); color: var(--amber-ink); }
.badge--rose { background: var(--rose-soft); color: var(--rose-ink); }
.badge--slate { background: var(--slate-soft); color: var(--slate-ink); }
.badge--ink { background: var(--ink); color: #fff; }
.badge--test { background: #fff; color: var(--amber-ink); border: 1px dashed var(--amber); padding: 2px 9px 2px 7px; }
.tag-test { display: inline-flex; align-items: center; font-size: .66rem; font-weight: 750; letter-spacing: .06em; color: var(--amber-ink); border: 1px dashed var(--amber); border-radius: 6px; padding: 0 5px; line-height: 1.5; background: #fff; }
.version { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--ink); }

/* ---------------------------------------------------------------- nupud */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: var(--r-ctl);
    background: var(--ink); color: #fff; border: 1px solid var(--ink); font: inherit; font-size: .9rem; font-weight: 620; cursor: pointer;
    text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: #2a2c33; text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--ink-4); }
.btn--soft { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.btn--soft:hover { background: var(--slate-soft); }
.btn--violet { background: var(--violet); border-color: var(--violet); }
.btn--violet:hover { background: var(--violet-ink); }
.btn--danger { background: var(--surface); color: var(--rose-ink); border-color: var(--rose-line); }
.btn--danger:hover { background: var(--rose-soft); }
.btn--sm { height: 34px; padding: 0 12px; font-size: .84rem; border-radius: 10px; }
.btn--icon { width: 40px; padding: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions form { margin: 0; }

/* ---------------------------------------------------------------- vormid */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > label, .label { font-size: .84rem; font-weight: 600; color: var(--ink-2); }
input[type=text], input[type=email], input[type=url], input[type=number], input[type=date], input[type=search], input[type=password], input:not([type]), select, textarea {
    width: 100%; font: inherit; font-size: .93rem; color: var(--ink); background: var(--surface);
    border: 1px solid var(--line-strong); border-radius: var(--r-ctl); padding: 9px 12px; min-height: 42px;
    transition: border-color .12s, box-shadow .12s;
}
textarea { min-height: 96px; line-height: 1.5; resize: vertical; }
select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23636876' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--violet); box-shadow: var(--focus); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--ink); margin: 0; flex-shrink: 0; }
input[type=file] { font: inherit; font-size: .88rem; }
.check { display: inline-flex; align-items: flex-start; gap: 10px; font-weight: 500; font-size: .93rem; color: var(--ink-2); cursor: pointer; line-height: 1.45; }
.check input { margin-top: 2px; }
.help { font-size: .84rem; color: var(--ink-3); margin: 0; line-height: 1.5; }
.error { font-size: .82rem; color: var(--rose-ink); margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-section + .form-section { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.form-section > h2 { margin-bottom: 4px; }
.form-section > .help { margin-bottom: 14px; }
details.disclosure { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
details.disclosure > summary { cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--ink-2); list-style: none; display: flex; align-items: center; gap: 6px; }
details.disclosure > summary::before { content: '+'; width: 20px; height: 20px; border-radius: 6px; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
details.disclosure[open] > summary::before { content: '–'; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > form, details.disclosure > div { margin-top: 12px; }

/* Filtririba */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px; background: var(--surface-2); border-radius: var(--r-inner); margin-bottom: 16px; }
.filters .field { margin: 0; flex: 1 1 160px; min-width: 0; }
.filters .field--wide { flex: 2 1 240px; }
.filters .field > label { font-size: .76rem; }
.filters input, .filters select { min-height: 40px; }
.filters__actions { display: flex; gap: 8px; }

/* Vahekaardid */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 5px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); }
.tabs button, .tabs a { font: inherit; font-size: .9rem; font-weight: 600; color: var(--ink-3); background: none; border: 0; border-radius: 10px; padding: 8px 14px; cursor: pointer; text-decoration: none; }
.tabs button:hover, .tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs .is-active { background: var(--ink); color: #fff; }

/* ---------------------------------------------------------------- tabelid */
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
.panel--flush .table-wrap { margin: 0; padding: 0; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .72rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-4); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .93rem; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfbf9; }
.panel--flush th:first-child, .panel--flush td:first-child { padding-left: 22px; }
.panel--flush th:last-child, .panel--flush td:last-child { padding-right: 22px; }
.cell-main { font-weight: 650; color: var(--ink); }
a.cell-main { color: var(--ink); }
a.cell-main:hover { color: var(--violet-ink); }
.cell-sub { display: block; font-size: .82rem; color: var(--ink-3); margin-top: 2px; }
.cell-actions { text-align: right; white-space: nowrap; }
.cell-actions .actions { justify-content: flex-end; flex-wrap: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 22rem; display: block; }

/* Loend (töölaud, detailid) */
.list { display: flex; flex-direction: column; }
.list-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; padding-top: 2px; }
.list-row__icon { width: 34px; height: 34px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; }
.list-row__icon svg { width: 17px; height: 17px; }
.list-row__main { min-width: 0; }
.list-row__title { font-weight: 650; color: var(--ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.list-row__sub { display: block; font-size: .84rem; color: var(--ink-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row__sub--wrap { white-space: normal; }
.list-row__side { font-size: .8rem; color: var(--ink-4); white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.tone-violet { background: var(--violet-soft); color: var(--violet-ink); }
.tone-mint { background: var(--mint-soft); color: var(--mint-ink); }
.tone-amber { background: var(--amber-soft); color: var(--amber-ink); }
.tone-rose { background: var(--rose-soft); color: var(--rose-ink); }
.tone-slate { background: var(--slate-soft); color: var(--slate-ink); }

/* Võti-väärtus read */
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 9px 0; border-top: 1px solid var(--line); font-size: .92rem; }
.kv:first-child { border-top: 0; padding-top: 0; }
.kv > span:first-child { color: var(--ink-3); }
.kv strong { font-weight: 650; text-align: right; }

/* Kirjeldusloend */
.dl { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 10px 18px; margin: 0; font-size: .93rem; }
.dl dt { color: var(--ink-3); font-size: .86rem; padding-top: 1px; }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- müügivoog */
.funnel { display: flex; flex-direction: column; gap: 9px; }
.funnel__row { display: grid; grid-template-columns: 10.5rem minmax(0, 1fr) 3rem 3.5rem; gap: 12px; align-items: center; }
.funnel__label { font-size: .9rem; font-weight: 600; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px; min-width: 0; }
.funnel__label:hover { color: var(--violet-ink); text-decoration: none; }
.funnel__track { height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.funnel__bar { height: 100%; border-radius: 999px; }
.funnel__n { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.funnel__now { text-align: right; font-size: .78rem; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.funnel__head { display: grid; grid-template-columns: 10.5rem minmax(0, 1fr) 3rem 3.5rem; gap: 12px; font-size: .7rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-4); }
.funnel__head span:nth-child(3), .funnel__head span:nth-child(4) { text-align: right; }
.bar-violet { background: var(--violet); } .bar-mint { background: var(--mint); } .bar-slate { background: #b9bec8; } .bar-amber { background: var(--amber); } .bar-rose { background: var(--rose); } .bar-ink { background: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-size: .84rem; font-weight: 600;
    background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); text-decoration: none;
}
.chip:hover { text-decoration: none; border-color: var(--line-strong); }
.chip b { font-variant-numeric: tabular-nums; }
.chip--amber { background: var(--amber-soft); border-color: var(--amber-line); color: var(--amber-ink); }
.chip--rose { background: var(--rose-soft); border-color: var(--rose-line); color: var(--rose-ink); }

/* Segmentriba + legend */
.segbar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--surface-2); gap: 2px; }
.segbar span { display: block; height: 100%; min-width: 3px; }
.legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 18px; margin-top: 14px; }
.legend__row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 5px 0; font-size: .88rem; }
.legend__row a { color: var(--ink-2); text-decoration: none; }
.legend__row a:hover { color: var(--ink); text-decoration: underline; }
.legend__dot { width: 10px; height: 10px; border-radius: 3px; }
.legend__n { font-weight: 650; font-variant-numeric: tabular-nums; }
.legend__n--zero { color: var(--ink-4); font-weight: 500; }
.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--ink); border-radius: 999px; }

/* ---------------------------------------------------------------- teated */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: var(--r-inner); font-size: .9rem; line-height: 1.5; background: var(--slate-soft); color: var(--slate-ink); }
.notice svg { width: 19px; height: 19px; flex-shrink: 0; margin-top: 1px; }
.notice > div { flex: 1; min-width: 0; }
.notice--amber { background: var(--amber-soft); color: var(--amber-ink); }
.notice--rose { background: var(--rose-soft); color: var(--rose-ink); }
.notice--mint { background: var(--mint-soft); color: var(--mint-ink); }
.notice--violet { background: var(--violet-soft); color: var(--violet-ink); }
.notice a { color: inherit; font-weight: 650; text-decoration: underline; }
.notice__close { background: none; border: 0; font-size: 1.2rem; line-height: 1; cursor: pointer; color: inherit; opacity: .6; }

/* ---------------------------------------------------------------- muu */
.empty { padding: 26px 12px; text-align: center; color: var(--ink-3); font-size: .92rem; }
.empty strong { display: block; color: var(--ink-2); margin-bottom: 3px; }
.timeline { display: flex; flex-direction: column; }
.timeline__row { display: grid; grid-template-columns: 8.2rem minmax(0, 1fr); gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.timeline__row:first-child { border-top: 0; padding-top: 0; }
.timeline__t { color: var(--ink-4); font-size: .8rem; font-variant-numeric: tabular-nums; padding-top: 2px; }
.timeline__k { display: inline-block; font-size: .7rem; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-4); margin-right: 6px; }
.letter { white-space: pre-wrap; font: inherit; font-size: .93rem; line-height: 1.6; background: var(--surface-2); padding: 18px; border-radius: var(--r-inner); margin: 0; overflow-wrap: anywhere; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .9rem; color: var(--ink-3); }
.facts b { color: var(--ink); font-weight: 650; }
.evid-url { display: block; max-width: 11rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 0 0; font-size: .86rem; color: var(--ink-3); }
.panel--flush .pager { padding: 14px 22px 18px; }
.pager__nav { display: flex; align-items: center; gap: 8px; }
.pager__disabled { opacity: .4; pointer-events: none; }
.intro { font-size: .95rem; color: var(--ink-3); margin: -4px 0 0; }

/* ---------------------------------------------------------------- sisselogimine */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth__card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 24px; box-shadow: var(--shadow); padding: 34px 32px; }
.auth__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.auth h1 { font-size: 1.45rem; margin-bottom: 6px; }
.auth__lead { color: var(--ink-3); margin-bottom: 22px; }
.auth .btn { width: 100%; height: 46px; margin-top: 6px; }
.auth__foot { margin-top: 22px; font-size: .8rem; color: var(--ink-4); text-align: center; }

/* ---------------------------------------------------------------- kohandumine */
@media (max-width: 1360px) {
    .todo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
    .span-3, .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; }
}
@media (max-width: 1024px) {
    :root { --gap: 14px; }
    .app { grid-template-columns: minmax(0, 1fr); padding: 12px; }
    .side {
        position: fixed; z-index: 60; top: 0; left: 0; bottom: 0; height: 100vh; width: min(300px, 86vw);
        border-radius: 0 var(--r-panel) var(--r-panel) 0; transform: translateX(-105%); transition: transform .2s ease;
    }
    .app.nav-open .side { transform: none; }
    .backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(23, 24, 28, .35); border: 0; }
    .menu-btn { display: inline-flex; }
    .topbar { position: sticky; top: 12px; z-index: 30; padding: 10px 10px 10px 12px; min-height: 58px; }
    .topbar h1 { font-size: 1.15rem; }
    .user-btn__name { display: none; }
    .user-btn { padding: 0 4px; }
}
@media (max-width: 760px) {
    .env-pill__text { display: none; }
    .env-pill { padding: 0 11px; }
    .panel { padding: 18px 16px; }
    .panel--flush > .panel__head { padding: 18px 16px 0; }
    .table-wrap { margin: 0 -16px; padding: 0 16px; }
    .todo-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .todo { padding: 16px; flex-direction: row; flex-wrap: wrap; align-items: center; }

    .todo__n { font-size: 1.9rem; }
    .todo__icon { display: none; }
    .todo__body { flex: 1; min-width: 0; }
    .todo__cta { flex-basis: 100%; }
    .split { grid-template-columns: minmax(0, 1fr); }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .dl dt { margin-top: 10px; }
    .legend { grid-template-columns: minmax(0, 1fr); }
    .funnel__row, .funnel__head { grid-template-columns: 7.4rem minmax(0, 1fr) 2.4rem; }
    .funnel__now, .funnel__head span:nth-child(4) { display: none; }
    .timeline__row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .topbar__actions .btn:not(.menu-btn):not(.keep) { display: none; }
    .filters .field { flex-basis: 100%; }

    /* Tabelid kaartideks (mobiil-tabel.js lisab klassid ja sildid). */
    table.m-cards thead { display: none; }
    table.m-cards, table.m-cards tbody { display: block; }
    table.m-cards tr {
        display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px;
        padding: 14px 0; border-bottom: 1px solid var(--line);
    }
    table.m-cards tbody tr:last-child { border-bottom: 0; }
    table.m-cards tbody tr:hover td { background: none; }
    table.m-cards td { display: block; padding: 0; border: 0; grid-column: 1 / -1; font-size: .9rem; min-width: 0; }
    table.m-cards td[data-label]::before { content: attr(data-label); display: block; font-size: .7rem; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-4); }
    table.m-cards td.m-primary { grid-column: 1; font-size: 1rem; }
    table.m-cards td.m-status { grid-column: 2; grid-row: 1; text-align: right; }
    table.m-cards td.m-actions { padding-top: 6px; }
    table.m-cards td.m-actions .actions { justify-content: flex-start; flex-wrap: wrap; }
    .panel--flush table.m-cards tr { padding-left: 16px; padding-right: 16px; }
    .panel--flush table.m-cards td:first-child, .panel--flush table.m-cards td:last-child { padding-left: 0; padding-right: 0; }
    .evid-url, .truncate { max-width: 100%; }
}

/* Tekstisisesed ikoonid (nooled lingides) */
.todo__cta svg, .panel__link svg, .crumb svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn.menu-btn { display: none; }
@media (max-width: 1024px) { .btn.menu-btn { display: inline-flex; } }
.split .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.split { align-items: start; }
.env-pill__short { display: none; }
@media (max-width: 760px) {
    .env-pill__short { display: inline; }
    .todo__top { flex: 0 0 auto; }
    .todo__body { flex: 1 1 60%; }
}

/* Paneeli sisu kohandub paneeli laiusele (mitte ekraanile): kitsas külgtulp
   1280 px juures ei suru plokke ega legendi kokku. */
.panel { container-type: inline-size; }
@container (max-width: 640px) {
    .split { grid-template-columns: minmax(0, 1fr); }
}
@container (min-width: 460px) and (max-width: 640px) {
    .split .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@container (max-width: 460px) {
    .legend { grid-template-columns: minmax(0, 1fr); }
}

/* Mobiilis on filtritest nähtav ainult otsing; ülejäänu avaneb nupust. */
.filters__toggle { display: none; }
@media (max-width: 760px) {
    .filters__toggle { display: inline-flex; }
    .filters:not(.is-open) .field:not(.field--wide):not(.field--keep) { display: none; }
    .filters { gap: 8px; }
    .filters .field--wide { flex: 1 1 100%; }
}

/* Hooldustöö: sammuriba, enne ja pärast, järgmine samm */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; counter-reset: none; }
.steps__item { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding-top: 2px; }
.steps__item::after { content: ''; position: absolute; top: 16px; left: 40px; right: 6px; height: 2px; border-radius: 2px; background: var(--line); }
.steps__item:last-child::after { display: none; }
.steps__item.is-done::after { background: var(--mint-line); }
.steps__n { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .88rem; background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--line); position: relative; z-index: 1; }
.steps__n svg { width: 16px; height: 16px; }
.steps__label { font-size: .86rem; font-weight: 600; color: var(--ink-3); line-height: 1.3; }
.steps__item.is-done .steps__n { background: var(--mint-soft); color: var(--mint-ink); border-color: var(--mint-line); }
.steps__item.is-done .steps__label { color: var(--ink-2); }
.steps__item.is-current .steps__n { background: var(--ink); color: #fff; border-color: var(--ink); }
.steps__item.is-current .steps__label { color: var(--ink); }
@media (max-width: 760px) {
    .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 14px; }
    .steps__item:nth-child(3n)::after { display: none; }
}
details.disclosure > summary .muted { margin-left: auto; font-weight: 500; font-size: .84rem; }
.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.compare__col h3 { margin: 0 0 4px; font-size: .92rem; }
@media (max-width: 640px) { .compare { grid-template-columns: 1fr; } }
.next-step { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.next-step:first-of-type { border-top: 0; padding-top: 0; }
.next-step .btn { align-self: flex-start; }
.next-step .help { margin: 0; }

/* Pealkiri: pikk nimi lüheneb, olekusilt ei lõiku, kitsal ribal läheb järgmisele reale */
.topbar h1 { white-space: normal; overflow: visible; flex-wrap: wrap; row-gap: 4px; min-width: 0; }
.topbar__name { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__state { flex-shrink: 0; display: inline-flex; }

/* Seadistuse tähelepanekud ridadena */
.obs-row { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 6px 18px; padding: 12px 0; border-top: 1px solid var(--line); }
.obs-row:first-child { border-top: 0; padding-top: 2px; }
.obs-row__area { font-weight: 650; font-size: .92rem; }
.obs-row__area small { display: block; font-weight: 500; color: var(--ink-3); font-size: .82rem; margin-top: 2px; }
.obs-row__main { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.obs-row__badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.obs-row__src { font-size: .84rem; color: var(--ink-3); overflow-wrap: anywhere; }
.obs-row__src a { font-weight: 600; }
@container (max-width: 520px) { .obs-row { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
    /* Pealkiri saab alati vähemalt poole ribast; kui tegevused kõrvale ei mahu, lähevad need teisele reale. */
    .topbar { flex-wrap: wrap; row-gap: 8px; }
    .topbar__titles { flex: 1 1 45%; }
    .topbar__actions { margin-left: auto; }
}

/* Filtririda: üksik valikväli ei veni üle rea, märkeruut on väljade ja nupuga ühel joonel */
.filters .field--keep { flex: 0 1 18rem; }
.filters .check { align-self: flex-end; min-height: 40px; align-items: center; white-space: nowrap; }
.filters .check input { margin-top: 0; }
@media (max-width: 760px) { .filters .field--keep { flex: 1 1 100%; } }
