/* PrivateRadio Lead Engine — application styles
 * Scandinavian-inspired B2B interface on top of Bootstrap 5.
 * Change --pr-accent to match the final PrivateRadio brand colour.
 */

@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;
}
@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-greek-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}

:root {
    --pr-ink: #111316;
    --pr-ink-2: #3b3f46;
    --pr-muted: #6b7078;
    --pr-faint: #9aa0a8;
    --pr-line: #e7e8ea;
    --pr-line-strong: #d6d8db;
    --pr-surface: #ffffff;
    --pr-canvas: #fafaf9;
    --pr-hover: #f4f4f3;
    --pr-accent: #d4492f;
    --pr-accent-ink: #b53a23;
    --pr-accent-soft: #fbeeea;
    --pr-good: #2f7d4f;
    --pr-good-soft: #ebf5ee;
    --pr-warn: #9a6400;
    --pr-warn-soft: #fbf3e2;
    --pr-bad: #b42318;
    --pr-bad-soft: #fdeceb;
    --pr-radius: 10px;
    --pr-sidebar: 248px;

    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-color: var(--pr-ink);
    --bs-body-bg: var(--pr-canvas);
    --bs-border-color: var(--pr-line);
    --bs-link-color: var(--pr-ink);
    --bs-link-hover-color: var(--pr-accent-ink);
    --bs-link-color-rgb: 17, 19, 22;
    --bs-link-hover-color-rgb: 181, 58, 35;
    --bs-focus-ring-color: rgba(212, 73, 47, .22);
    --bs-border-radius: var(--pr-radius);
}

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { font-size: .9375rem; letter-spacing: -.005em; font-feature-settings: "cv11", "ss01"; }
h1, h2, h3, h4, h5 { letter-spacing: -.02em; font-weight: 600; color: var(--pr-ink); }
a { text-decoration: none; }
.text-muted { color: var(--pr-muted) !important; }
.small-caps { font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; color: var(--pr-faint); }
.icon { width: 18px; height: 18px; stroke-width: 1.75; flex-shrink: 0; }
svg.icon { display: inline-block; vertical-align: -3px; }
.tabular { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- shell */

.app { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--pr-sidebar);
    background: var(--pr-surface);
    border-right: 1px solid var(--pr-line);
    position: fixed; inset: 0 auto 0 0;
    display: flex; flex-direction: column;
    z-index: 1030;
}
.brand { display: flex; align-items: center; gap: .65rem; padding: 1.25rem 1.25rem 1rem; color: var(--pr-ink); }
.brand-mark {
    width: 30px; height: 30px; border-radius: 8px;
    background: var(--pr-ink); color: #fff;
    display: grid; place-items: center;
}
.brand-mark .icon { width: 16px; height: 16px; }
.brand-name { font-weight: 650; font-size: .95rem; line-height: 1.1; }
.brand-sub { font-size: .72rem; color: var(--pr-muted); }

.nav-section { padding: .75rem .75rem 0; }
.nav-section .small-caps { padding: 0 .6rem .4rem; display: block; }
.side-link {
    display: flex; align-items: center; gap: .7rem;
    padding: .5rem .6rem; margin-bottom: 2px;
    border-radius: 8px; color: var(--pr-ink-2); font-weight: 500; font-size: .9rem;
}
.side-link:hover { background: var(--pr-hover); color: var(--pr-ink); }
.side-link.active { background: var(--pr-hover); color: var(--pr-ink); box-shadow: inset 2px 0 0 var(--pr-accent); }
.side-link.active .icon { color: var(--pr-accent); }
.side-link.disabled { color: var(--pr-faint); pointer-events: none; }
.side-link .phase { margin-left: auto; font-size: .65rem; color: var(--pr-faint); border: 1px solid var(--pr-line); border-radius: 999px; padding: 0 .4rem; }
.sidebar-foot { margin-top: auto; padding: 1rem 1.25rem; border-top: 1px solid var(--pr-line); font-size: .75rem; color: var(--pr-muted); }

.main { flex: 1; margin-left: var(--pr-sidebar); min-width: 0; }
.topbar {
    height: 64px; display: flex; align-items: center; gap: 1rem;
    padding: 0 2rem; background: rgba(250, 250, 249, .86);
    backdrop-filter: saturate(160%) blur(8px);
    border-bottom: 1px solid var(--pr-line);
    position: sticky; top: 0; z-index: 1020;
}
.topbar h1 { font-size: 1.05rem; margin: 0; }
.content { padding: 2rem; max-width: 1360px; }

.avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--pr-accent-soft); color: var(--pr-accent-ink);
    display: grid; place-items: center; font-weight: 600; font-size: .75rem;
}
.user-btn { display: flex; align-items: center; gap: .6rem; background: none; border: 0; padding: .25rem .4rem; border-radius: 8px; color: var(--pr-ink); }
.user-btn:hover { background: var(--pr-hover); }
.user-btn .meta { text-align: left; line-height: 1.15; }
.user-btn .meta small { color: var(--pr-muted); font-size: .72rem; }

.btn.menu-toggle { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: none; }
    .sidebar.open { transform: none; box-shadow: 0 10px 40px rgba(0, 0, 0, .12); }
    .sidebar-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(17, 19, 22, .25); z-index: 1025; }
    .main { margin-left: 0; }
    .btn.menu-toggle { display: inline-flex; }
    .topbar { padding: 0 1rem; }
    .content { padding: 1.25rem 1rem; }
    .user-btn .meta { display: none; }
}

/* ---------------------------------------------------------- components */

.card { border: 1px solid var(--pr-line); border-radius: var(--pr-radius); box-shadow: none; background: var(--pr-surface); }
.card-header { background: transparent; border-bottom: 1px solid var(--pr-line); padding: 1rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.card-header h2 { font-size: .95rem; margin: 0; }
.card-body { padding: 1.25rem; }

.stat { padding: 1.1rem 1.25rem; height: 100%; }
.stat .label { display: flex; align-items: center; gap: .45rem; font-size: .8rem; color: var(--pr-muted); font-weight: 500; }
.stat .label .icon { width: 15px; height: 15px; }
.stat .value { font-size: 1.85rem; font-weight: 600; letter-spacing: -.03em; margin-top: .35rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .hint { font-size: .78rem; color: var(--pr-muted); margin-top: .25rem; }

.bar-list { list-style: none; margin: 0; padding: 0; }
.bar-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .25rem 1rem; padding: .45rem 0; font-size: .875rem; }
.bar-list .bar { grid-column: 1 / -1; height: 4px; background: var(--pr-hover); border-radius: 4px; overflow: hidden; }
.bar-list .bar span { display: block; height: 100%; background: var(--pr-ink); border-radius: 4px; }
.bar-list .count { font-variant-numeric: tabular-nums; color: var(--pr-ink-2); font-weight: 500; }

/* Width classes for bars (no inline styles: strict CSP). */
.w-p0 { width: 0; } .w-p5 { width: 5%; } .w-p10 { width: 10%; } .w-p15 { width: 15%; } .w-p20 { width: 20%; }
.w-p25 { width: 25%; } .w-p30 { width: 30%; } .w-p35 { width: 35%; } .w-p40 { width: 40%; } .w-p45 { width: 45%; }
.w-p50 { width: 50%; } .w-p55 { width: 55%; } .w-p60 { width: 60%; } .w-p65 { width: 65%; } .w-p70 { width: 70%; }
.w-p75 { width: 75%; } .w-p80 { width: 80%; } .w-p85 { width: 85%; } .w-p90 { width: 90%; } .w-p95 { width: 95%; } .w-p100 { width: 100%; }

.pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); border: 1px solid var(--pr-line); border-radius: var(--pr-radius); overflow: hidden; background: var(--pr-surface); }
.pipeline .stage { padding: .9rem 1rem; border-right: 1px solid var(--pr-line); }
.pipeline .stage:last-child { border-right: 0; }
.pipeline .stage .name { font-size: .75rem; color: var(--pr-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipeline .stage .num { font-size: 1.25rem; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: .15rem; }

.table { --bs-table-bg: transparent; margin: 0; font-size: .875rem; }
.table > thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--pr-muted); font-weight: 600; border-bottom-color: var(--pr-line); padding: .7rem 1.25rem; background: var(--pr-canvas); white-space: nowrap; }
.table > tbody td { padding: .8rem 1.25rem; border-bottom-color: var(--pr-line); vertical-align: middle; }
.table > tbody tr:last-child td { border-bottom: 0; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--pr-hover); }

.badge-soft { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 600; padding: .2rem .55rem; border-radius: 999px; background: var(--pr-hover); color: var(--pr-ink-2); border: 1px solid var(--pr-line); }
.badge-soft.good { background: var(--pr-good-soft); color: var(--pr-good); border-color: transparent; }
.badge-soft.warn { background: var(--pr-warn-soft); color: var(--pr-warn); border-color: transparent; }
.badge-soft.bad { background: var(--pr-bad-soft); color: var(--pr-bad); border-color: transparent; }
.badge-soft.accent { background: var(--pr-accent-soft); color: var(--pr-accent-ink); border-color: transparent; }

.btn { font-weight: 500; border-radius: 8px; padding: .5rem .95rem; font-size: .875rem; display: inline-flex; align-items: center; gap: .45rem; justify-content: center; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { --bs-btn-bg: var(--pr-ink); --bs-btn-border-color: var(--pr-ink); --bs-btn-hover-bg: #000; --bs-btn-hover-border-color: #000; --bs-btn-active-bg: #000; --bs-btn-active-border-color: #000; --bs-btn-disabled-bg: var(--pr-ink); --bs-btn-disabled-border-color: var(--pr-ink); }
.btn-accent { --bs-btn-color: #fff; --bs-btn-bg: var(--pr-accent); --bs-btn-border-color: var(--pr-accent); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--pr-accent-ink); --bs-btn-hover-border-color: var(--pr-accent-ink); --bs-btn-active-bg: var(--pr-accent-ink); --bs-btn-active-color: #fff; }
.btn-outline-secondary { --bs-btn-color: var(--pr-ink); --bs-btn-border-color: var(--pr-line-strong); --bs-btn-hover-bg: var(--pr-hover); --bs-btn-hover-color: var(--pr-ink); --bs-btn-hover-border-color: var(--pr-line-strong); --bs-btn-active-bg: var(--pr-hover); --bs-btn-active-color: var(--pr-ink); background: var(--pr-surface); }
.btn-icon { padding: .45rem; }

.form-label { font-size: .82rem; font-weight: 550; color: var(--pr-ink-2); margin-bottom: .35rem; }
.form-control, .form-select { border-color: var(--pr-line-strong); border-radius: 8px; padding: .55rem .8rem; font-size: .9rem; }
.form-control:focus, .form-select:focus { border-color: var(--pr-accent); box-shadow: 0 0 0 3px var(--bs-focus-ring-color); }
.form-text { color: var(--pr-muted); font-size: .78rem; }
.invalid-feedback { font-size: .78rem; }

.alert { border-radius: var(--pr-radius); font-size: .875rem; border: 1px solid transparent; display: flex; gap: .6rem; align-items: flex-start; padding: .8rem 1rem; }
.alert-success { background: var(--pr-good-soft); color: var(--pr-good); }
.alert-warning { background: var(--pr-warn-soft); color: var(--pr-warn); }
.alert-danger { background: var(--pr-bad-soft); color: var(--pr-bad); }
.alert-info { background: var(--pr-hover); color: var(--pr-ink-2); border-color: var(--pr-line); }

.dropdown-menu { border-color: var(--pr-line); border-radius: var(--pr-radius); box-shadow: 0 12px 32px rgba(17, 19, 22, .08); font-size: .875rem; padding: .35rem; }
.dropdown-item { border-radius: 6px; padding: .45rem .7rem; display: flex; align-items: center; gap: .55rem; }
.dropdown-item:active { background: var(--pr-hover); color: var(--pr-ink); }

.empty { text-align: center; padding: 2rem 1rem; color: var(--pr-muted); font-size: .875rem; }
.empty .icon { width: 22px; height: 22px; color: var(--pr-faint); margin-bottom: .5rem; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-head h2 { font-size: 1.5rem; margin: 0; }
.page-head p { margin: .25rem 0 0; color: var(--pr-muted); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--pr-line); font-size: .85rem; }
.timeline li:last-child { border-bottom: 0; }
.timeline .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pr-line-strong); margin-top: .45rem; flex-shrink: 0; }
.timeline .when { color: var(--pr-muted); font-size: .75rem; }

code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82em; }
pre.debug { background: #111316; color: #f1f1f1; padding: 1rem; border-radius: var(--pr-radius); font-size: .75rem; white-space: pre-wrap; text-align: left; max-height: 50vh; overflow: auto; }

/* ---------------------------------------------------------------- auth */

.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--pr-surface); }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: 3rem clamp(1.5rem, 6vw, 6rem); }
.auth-box { width: 100%; max-width: 400px; }
.auth-box.wide { max-width: 640px; }
.auth-box h1 { font-size: 1.6rem; margin-bottom: .35rem; }
.auth-box .lead { color: var(--pr-muted); font-size: .95rem; margin-bottom: 2rem; }
.auth-aside {
    background: var(--pr-ink); color: #f4f4f3; padding: 3rem clamp(1.5rem, 5vw, 5rem);
    display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.auth-aside .wave { position: absolute; right: -60px; bottom: -40px; width: 520px; opacity: .14; color: #fff; }
.auth-aside h2 { color: #fff; font-size: 1.9rem; max-width: 22ch; line-height: 1.2; }
.auth-aside p { color: #b9bcc2; max-width: 40ch; }
.auth-aside .accent-line { width: 36px; height: 3px; background: var(--pr-accent); border-radius: 3px; margin-bottom: 1.25rem; }
.auth-aside .foot { font-size: .78rem; color: #8b8f96; }
.auth-wrap.single { grid-template-columns: 1fr; }
.auth-wrap.single .auth-panel { align-items: center; }

@media (max-width: 991.98px) {
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
}

/* ----------------------------------------------------------- installer */

.steps { display: flex; gap: .5rem; margin-bottom: 2rem; flex-wrap: wrap; }
.steps .step { display: flex; align-items: center; gap: .45rem; font-size: .78rem; color: var(--pr-faint); font-weight: 500; }
.steps .step .n { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--pr-line-strong); display: grid; place-items: center; font-size: .7rem; }
.steps .step.done { color: var(--pr-good); }
.steps .step.done .n { background: var(--pr-good-soft); border-color: transparent; }
.steps .step.current { color: var(--pr-ink); }
.steps .step.current .n { background: var(--pr-ink); color: #fff; border-color: var(--pr-ink); }
.steps .sep { width: 18px; height: 1px; background: var(--pr-line-strong); align-self: center; }
.check-list { list-style: none; padding: 0; margin: 0; border: 1px solid var(--pr-line); border-radius: var(--pr-radius); }
.check-list li { display: flex; gap: .7rem; align-items: flex-start; padding: .65rem 1rem; border-bottom: 1px solid var(--pr-line); font-size: .85rem; }
.check-list li:last-child { border-bottom: 0; }
.check-list .ok { color: var(--pr-good); }
.check-list .warn { color: var(--pr-warn); }
.check-list .fail { color: var(--pr-bad); }
.check-list .detail { color: var(--pr-muted); font-size: .78rem; }
.fieldset-title { font-size: .8rem; font-weight: 600; color: var(--pr-ink); margin: 1.5rem 0 .75rem; padding-bottom: .4rem; border-bottom: 1px solid var(--pr-line); }

/* ------------------------------------------------------------ modules */

.sidebar-scroll { overflow-y: auto; flex: 1; padding-bottom: 1rem; }
.nav-section { padding-top: .5rem; }
.side-link { padding: .42rem .6rem; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--pr-line); background: var(--pr-surface); border-radius: var(--pr-radius) var(--pr-radius) 0 0; }
.filters .form-control, .filters .form-select { width: auto; min-width: 150px; padding: .4rem .7rem; font-size: .85rem; }
.filters .grow { flex: 1 1 220px; }
.sort-link { color: inherit; }
.sort-link.active { color: var(--pr-ink); }
.table td a.row-link { color: var(--pr-ink); font-weight: 550; }
.table td a.row-link:hover { color: var(--pr-accent-ink); }
.dl { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: .55rem 1rem; font-size: .875rem; margin: 0; }
.dl dt { color: var(--pr-muted); font-weight: 500; }
.dl dd { margin: 0; word-break: break-word; }
.section-title { font-size: .95rem; margin: 0; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: .75rem; overflow-x: auto; padding-bottom: 1rem; }
.board-col { background: var(--pr-surface); border: 1px solid var(--pr-line); border-radius: var(--pr-radius); display: flex; flex-direction: column; min-height: 200px; }
.board-col header { padding: .75rem .9rem; border-bottom: 1px solid var(--pr-line); display: flex; justify-content: space-between; font-size: .82rem; font-weight: 600; }
.board-col .items { padding: .6rem; display: flex; flex-direction: column; gap: .5rem; overflow-y: auto; max-height: 70vh; }
.board-card { border: 1px solid var(--pr-line); border-radius: 8px; padding: .65rem .75rem; background: var(--pr-canvas); font-size: .82rem; }
.board-card .name { font-weight: 600; color: var(--pr-ink); display: block; margin-bottom: .2rem; }
.board-card form { margin-top: .5rem; }
.board-card .form-select { font-size: .78rem; padding: .25rem 1.8rem .25rem .5rem; }
.result-list { list-style: none; margin: 0; padding: 0; }
.result-list li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .5rem 0; border-bottom: 1px solid var(--pr-line); font-size: .85rem; }
.result-list li:last-child { border-bottom: 0; }
.result-list .src { color: var(--pr-muted); font-size: .75rem; word-break: break-all; }
.inline-form { display: inline; }
.mail-body { white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; background: var(--pr-canvas); border: 1px solid var(--pr-line); border-radius: var(--pr-radius); padding: 1rem; margin: 0; max-height: 60vh; overflow: auto; }
.gate { border-left: 3px solid var(--pr-good); padding: .6rem .9rem; background: var(--pr-good-soft); border-radius: 6px; font-size: .85rem; }
.gate.blocked { border-left-color: var(--pr-bad); background: var(--pr-bad-soft); }
.gate ul { margin: .25rem 0 0; padding-left: 1.1rem; }
.nav-tabs-lite { display: flex; gap: .25rem; border-bottom: 1px solid var(--pr-line); margin-bottom: 1rem; }
.nav-tabs-lite a { padding: .5rem .8rem; font-size: .85rem; color: var(--pr-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.nav-tabs-lite a.active { color: var(--pr-ink); border-bottom-color: var(--pr-accent); font-weight: 550; }
.check-col { width: 36px; }
.var-chip { font-family: ui-monospace, monospace; font-size: .75rem; background: var(--pr-hover); border: 1px solid var(--pr-line); border-radius: 6px; padding: .1rem .4rem; display: inline-block; margin: 0 .25rem .3rem 0; }
textarea.form-control.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }
