/* legacy.css: the old style.css, frozen (F1, DESIGN.md §2, §13). What changed against style.css:
   - the seven :root blocks are gone (tokens live in tokens.css; the old names resolve through the alias block),
   - the five dark @media blocks are gone (every colour is a token, so dark needs no rules of its own),
   - no !important, no literal colour, no gradient, no backdrop-filter, no shadow on a static surface,
   - .card has no shadow, .btn-primary is plum (--acc-fill), the brand square is a flat accent (shell 1 only),
   - duplicate selectors (.badge, .card, .btn, .topnav a) are merged into one rule each,
   - element rules that would leak into the new shell (label, label > input …) are limited to body.shell-1
     with :where(), which keeps their specificity exactly as before.
   Legacy classes (card, grid, btn, badge, bo-*, kk-*, pf-*, …) keep working until their page is migrated;
   this file shrinks page by page and is deleted in F9. Do not add anything here. */

/* ---- base (shell 1 pages; ui.css redefines body for both shells) ---- */
* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.5 var(--sans);
}

a { color: var(--accent); text-decoration: none; }
:where(body.shell-1) a:hover { text-decoration: underline; }   /* shell 1 only: a.c-btn and the wordmark on shell 2 never underline */

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.muted { color: var(--muted); }
.small { font-size: 12px; }

code {
    background: var(--panel-3);
    padding: 1px 5px;
    border-radius: var(--r-1);
    font-size: 12.5px;
    font-family: var(--mono);
}

:where(body.shell-1) .mono { font-family: var(--mono); font-size: 13px; }   /* shell 2: ui.css sets the family, inputs keep --fs-in */

/* ---- old header (shell 1 only; the new shell uses c-nav names and inherits nothing from here) ---- */
.topbar {
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    padding: 0;
    margin-bottom: 26px;
    position: sticky;
    top: 0;
    z-index: 40;
}
.topbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.topbar h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}
.topbar nav {
    display: flex;
    gap: 16px;
    align-items: center;
}
.btn-link {
    color: var(--muted);
    font-size: 13px;
}
/* `.topbar nav` (class + element) is more specific than `.topnav` (class only); every rule for the menu is
   therefore written as `.topbar .topnav` so it wins. Never reuse these names in the new shell. */
.topbar .topbar-in {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 18px;
    min-height: 56px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    flex: 0 0 auto;
}
.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 30px; height: 30px;
    border-radius: var(--r-2);
    background: var(--acc-fill);
    color: var(--on-acc);
    font-size: 11.5px;
    font-weight: 700;
}
.brand-txt { font-size: 15px; }
.topbar .topnav {
    display: flex;
    gap: 2px;
    margin-left: 4px;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: center;
}
.topbar .topnav a {
    padding: 6px 11px;
    border-radius: var(--r-2);
    border-bottom: none;
    font-size: 13.5px;
    color: var(--muted);
    white-space: nowrap;
    text-decoration: none;
    transition: background .12s, color .12s;
}
.topbar .topnav a:hover { background: var(--panel-2); color: var(--text); }
.topbar .topnav a.active {
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 600;
    border-bottom: none;
}
.topbar-user {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
    font-size: 13px;
}
.nav-toggle {
    display: none;
    margin-left: auto;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--r-2);
    padding: 5px 10px;
    font-size: 16px;
    cursor: pointer;
    color: var(--text);
}

/* ---- page title (shell 1) ---- */
.page-title {
    font-size: 21px;
    font-weight: 600;
    margin: 0 0 18px;
    color: var(--text);
}

/* ---- cards: flat fill + hairline, no shadow ---- */
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 16px;
    box-shadow: none;
}
.card h2 {
    margin: 0 0 15px;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
}

/* ---- grid ---- */
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 720px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ---- forms (shell 1 pages only: the new shell styles controls in ui.css) ---- */
:where(body.shell-1) label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
}
:where(body.shell-1) label > input, :where(body.shell-1) label > select, :where(body.shell-1) label > textarea {
    display: block;
    width: 100%;
    margin-top: 5px;
    padding: 9px 11px;
    background-color: var(--panel);   /* background-color, not background: the shorthand erased the select chevron (--chev) from ui.css */
    border: 1px solid var(--border);
    border-radius: var(--r-2);
    font: inherit;
    color: var(--text);
    transition: border-color .15s;
}
:where(body.shell-1) label > select { padding-right: 36px; }   /* room for the chevron that ui.css paints */
:where(body.shell-1) label > input:focus, :where(body.shell-1) label > select:focus, :where(body.shell-1) label > textarea:focus {
    outline: 2px solid var(--focus);
    outline-offset: -1px;
    border-color: transparent;
}
:where(body.shell-1) textarea { font-family: var(--mono); font-size: 13px; resize: vertical; }

.hint {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--muted);
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 0;
    cursor: pointer;
    color: var(--text);
}
.checkbox input { margin: 0; width: auto; }

/* tags inside hint */
.ok-tag { color: var(--ok); margin-left: 6px; font-weight: 600; }
.err-tag { color: var(--err); margin-left: 6px; font-weight: 600; }

/* ---- buttons ---- */
.btn {
    display: inline-block;
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font: 500 14px/1 var(--sans);   /* `inherit` is not a valid family in the shorthand; it fell back to button{font:inherit} (15 px) */
    cursor: pointer;
    transition: background .15s;
}
.btn-primary {
    background: var(--acc-fill);
    color: var(--on-acc);
    box-shadow: none;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary {
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--panel-2); }
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-row {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.actions .checkbox {
    margin-bottom: 4px;
}

/* ---- progress ---- */
.progress {
    position: relative;
    height: 22px;
    background: var(--panel-3);
    border-radius: var(--r-2);
    margin-bottom: 16px;
    overflow: hidden;
}
.progress-bar {
    position: absolute;
    inset: 0;
    width: 0;
    background: var(--acc-fill);
    transition: width .25s ease;
}
.progress-text {
    position: relative;
    display: block;
    text-align: center;
    line-height: 22px;
    font-size: 12px;
    font-weight: 600;
    z-index: 1;
    mix-blend-mode: difference;
    color: var(--on-acc);
}

/* ---- summary badges (one rule for both old .badge definitions) ---- */
.summary {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--r-1);
    font-size: 12px;
    font-weight: 500;
}
.badge.ok    { background: var(--ok-bg);   color: var(--ok); }
.badge.warn  { background: var(--warn-bg); color: var(--warn); }
.badge.err   { background: var(--err-bg);  color: var(--err); }
.badge.info  { background: var(--info-bg); color: var(--info); }
.badge.muted { background: var(--panel-3); color: var(--muted); }
.badge-ok  { background: var(--ok-bg);  color: var(--ok); }
.badge-no  { background: var(--err-bg); color: var(--err); }
.badge-err { background: var(--panel-3); color: var(--muted); }
.badge-dry { background: var(--warn-bg); color: var(--warn); }
.badge-skip { background: var(--panel-3); color: var(--muted); }

/* ---- results table ---- */
.results {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
    font-size: 13px;
}
.results th, .results td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.results th {
    background: var(--panel-2);
    font-weight: 500;
    color: var(--muted);
    font-size: 13px;
}
.results td.msg {
    max-width: 380px;
    word-break: break-word;
}
.row-ok    { background: color-mix(in srgb, var(--ok) 6%, transparent); }
.row-warn  { background: color-mix(in srgb, var(--warn) 6%, transparent); }
.row-err   { background: color-mix(in srgb, var(--err) 6%, transparent); }
.row-info  { background: var(--panel-2); }

.log-row td { font-size: 12px; color: var(--muted); background: var(--panel-2); }
.log-err td { color: var(--err); }
.log-warn td { color: var(--warn); }
.log-ok td { color: var(--ok); }

/* ---- alerts ---- */
.alert {
    padding: 10px 14px;
    border-radius: var(--r-2);
    margin-bottom: 14px;
    font-size: 13px;
}
.alert-err { background: var(--err-bg); color: var(--err); }
.alert-ok  { background: var(--ok-bg);  color: var(--ok); }

/* ---- login (until F8 replaces the centred card) ---- */
.centered {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}
.login-box {
    width: 100%;
    max-width: 380px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
}
.login-box header { text-align: center; margin-bottom: 22px; }
.login-box header h1 { margin: 0 0 4px; font-size: 18px; }
.login-box header p { margin: 0; font-size: 13px; }
.login-box label { margin-bottom: 14px; color: var(--text); font-weight: 500; }
.login-box .btn { width: 100%; margin-top: 6px; }
.login-box footer { text-align: center; margin-top: 18px; }

/* ---- contact verify chips ---- */
.info-tag { color: var(--info); margin-left: 6px; font-weight: 600; font-size: 12px; }
.btn-inline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: var(--r-1);
    font: 12px/1.4 var(--sans);
    cursor: pointer;
    margin-right: 10px;
}
.btn-inline:hover { background: var(--panel-2); }
.btn-inline:disabled { opacity: 0.5; cursor: not-allowed; }

.contact-chip {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--r-1);
    font-size: 12px;
    margin: 3px 4px 3px 0;
}
.contact-chip.ok  { background: var(--ok-bg);  color: var(--ok); }
.contact-chip.err { background: var(--err-bg); color: var(--err); }

/* ---- environment banner: OTE is quiet (no pastel box), only production is a band ---- */
.env-banner {
    padding: 12px 18px;
    border-radius: var(--r-2);
    margin-bottom: 18px;
    font-size: 14px;
    border: 1px solid transparent;
}
.env-banner strong { font-size: 15px; }
:where(body.shell-1) .env-ote {   /* shell 2 uses the same class names on .c-frame for the border only (ui.css) */
    background: var(--panel-2);
    border-color: var(--border);
    color: var(--muted);
}
:where(body.shell-1) .env-prod {
    background: var(--err-bg);
    border-color: var(--err);
    color: var(--err);
}

/* ---- debug log panel ---- */
.debug-log {
    background: var(--ink);
    color: var(--on-ink-2);
    padding: 14px;
    border-radius: var(--r-2);
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.5;
    max-height: 400px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}
#debugCard h2 { font-size: 15px; }

/* ---- WHOIS ---- */
.whois-card {
    border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px;
    margin-bottom: 14px; background: var(--panel-2);
}
.whois-card h3 { margin: 0 0 12px; font-size: 16px; }
.whois-card .err-text { color: var(--err); }
table.kv { width: 100%; border-collapse: collapse; }
table.kv th {
    text-align: left; width: 170px; padding: 5px 10px 5px 0;
    color: var(--muted); font-weight: 500; vertical-align: top; font-size: 13px;
}
table.kv td { padding: 5px 0; font-size: 13px; }
.results-wrap { margin-top: 18px; }

/* ---- povuci iz domena ---- */
.pull-box {
    display: flex; align-items: flex-end; gap: 10px;
    padding: 12px 14px; background: var(--panel-2); border: 1px solid var(--border);
    border-radius: var(--radius); margin-bottom: 14px; flex-wrap: wrap;
}
.pull-box label { font-size: 13px; color: var(--muted); }
.pull-box input { margin-top: 4px; }
.pull-box .btn { white-space: nowrap; }

/* ---- bulk izmene ---- */
.op-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.op-tab {
    padding: 10px 18px; border: 1px solid var(--border); background: var(--panel);
    border-radius: var(--r-2) var(--r-2) 0 0; cursor: pointer; font-size: 14px; color: var(--muted);
}
.op-tab.active { background: var(--acc-fill); color: var(--on-acc); border-color: var(--acc-fill); font-weight: 600; }
.op-run {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 14px; gap: 16px; flex-wrap: wrap;
}
.info-muted { color: var(--muted); font-size: 13px; }
.info-ok { color: var(--ok); font-weight: 600; }
.info-err { color: var(--err); font-weight: 600; }

/* ---- početna: mreža alata (deleted with the new home page in F3) ---- */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(252px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.tool {
    display: block;
    text-decoration: none;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 17px 18px;
    box-shadow: none;
    transition: border-color .12s;
}
.tool:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--line-strong);
}
.tool-ikona {
    display: inline-grid;
    place-items: center;
    width: 34px; height: 34px;
    border-radius: var(--r-2);
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 17px;
    margin-bottom: 11px;
}
.tool-naziv { font-weight: 600; color: var(--text); font-size: 14.5px; margin-bottom: 3px; }
.tool-opis  { color: var(--muted); font-size: 12.5px; line-height: 1.5; }

/* ---- podnožje (shell 1) ---- */
.sitefoot {
    margin-top: 40px;
    padding: 18px 0 26px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
}

/* ---- uži ekrani (shell 1 header) ---- */
@media (max-width: 900px) {
    .nav-toggle { display: block; }
    .topbar .topnav {
        display: none;
        order: 10;
        width: 100%;
        flex-direction: column;
        gap: 1px;
        padding-bottom: 10px;
        flex-basis: 100%;
    }
    .topbar .topnav.open { display: flex; }
    .topbar .topnav a { padding: 9px 11px; width: 100%; }
    .topbar .topbar-in { flex-wrap: wrap; }
    .topbar-user { margin-left: auto; }
}

/* ---- formerly dark-only patches for Backorder (.bo-*), Admin (.kk-*, .sec-key) and <pre>: now one
   token rule each, valid in both themes; a page block that sets the same property still wins by order ---- */
.bo-table tr:hover td { background: var(--panel-2); }
.bo-table th { color: var(--muted); border-bottom-color: var(--border); }
.bo-table td { border-bottom-color: var(--border); }
.bo-tabs { border-bottom-color: var(--border); }
.bo-tab.active { color: var(--text); }
.bo-tab .cnt { background: var(--panel-3); color: var(--text); }
.bo-dom { color: var(--text); }
.bo-tonight { background: var(--info-soft); border-color: var(--info-line); }
.bo-empty { color: var(--muted); }
.kk { background: var(--panel-2); border-color: var(--border); }
.kk-greska { background: var(--err-soft); border-color: var(--err-line); color: var(--err-text); }
.sec-key { background: var(--panel-2); border-color: var(--border); }
pre, .mono { color: var(--text); }

/* ---- stanje EPP naloga (strip na vrhu strane) ---- */
.eb{display:inline-flex;align-items:baseline;gap:9px;padding:7px 13px;margin:0 0 14px;
    border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--panel);
    font-size:13px;cursor:pointer;user-select:none;transition:border-color .12s}
.eb:hover{border-color:var(--brand)}
.eb:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
.eb-l{color:var(--muted)}
.eb-v{color:var(--text-strong);font-variant-numeric:tabular-nums;font-size:15px;font-weight:600}
.eb-c{font-size:11px;font-weight:400;color:var(--muted)}
.eb-t{color:var(--text-soft);font-size:11.5px}
.eb-w{color:var(--warn);font-size:11.5px}
.eb.eb-low .eb-v{color:var(--warn)}
.eb.eb-err{color:var(--err-text);border-color:var(--err-line);cursor:pointer}
.eb.eb-busy{color:var(--text-soft)}
.eb::after{content:"↻";margin-left:2px;color:var(--muted);font-size:12px}
.eb.eb-busy::after{content:"…"}

/* ---- F8-lite: old pages inside shell 2 (live/MIGRACIJA-F8-lite.md) ----
   An old page keeps its own markup inside .c-main; these two rules stop it from widening the page on a phone.
   :where() keeps the specificity of the class alone, so a page rule still wins. Shell 1 is untouched. */
:where(body.shell-2) .btn-row { flex-wrap: wrap; }                  /* dostupnost, whois-javni: five buttons in one row */
:where(body.shell-2) .results-wrap { overflow-x: auto; }            /* backorder: the queue table scrolls inside its card */
/* On the phone ui.css takes the side padding off .c-main because new pages draw full-bleed frames; an old page's
   cards and h1 would touch the screen edge. Only a page opened with 'cmd' => false prints h1.page-title in .c-main. */
@media (max-width: 900px) {
    :where(body.shell-2) .c-main:has(> h1.page-title) { padding-left: 16px; padding-right: 16px; }
}
/* The shell-1 label rules above do not reach shell 2, so on an old page "Text <textarea>" sat side by side. Only the
   layout is carried over (block label, full-width field under it); ui.css keeps drawing the controls. The whole
   scope is inside :where(), so the specificity stays that of `label`: .checkbox and page rules still win. */
:where(body.shell-2 .c-main:has(> h1.page-title)) label { display: block; }
:where(body.shell-2 .c-main:has(> h1.page-title)) label > :is(input:not([type=checkbox]):not([type=radio]), select, textarea) {
    display: block; width: 100%; margin-top: 5px;
}
