/* ===========================================================================
   tacho — AK86 internal revenue instrument
   Design language: cockpit at night. Full dark theme, AK86 red/teal, Pragmatica,
   faint plus-grid, backlit glows. Signature = the dashboard KPI tiles.
   =========================================================================== */

:root {
    /* brand */
    --red:        #E1233A;   /* brightened for legibility on dark (fills, links) */
    --red-deep:   #BA1424;   /* original brand red — gradients & hairlines */
    --teal:       #50BBB8;

    /* dark surfaces */
    --bg:         #121214;   /* app background (deepest) */
    --surface:    #1b1b1e;   /* cards, panels, sheets */
    --surface-2:  #242429;   /* inputs, raised, hover */
    --line:       rgba(255,255,255,.08);
    --line-strong:rgba(255,255,255,.15);

    /* text */
    --ink:        #ECECEF;   /* primary */
    --ink-soft:   #ABABB4;   /* secondary */
    --gray-mid:   #7C7C85;   /* muted labels */

    --white:      #FFFFFF;   /* pure white — text on accent fills */

    --grad-brand: linear-gradient(135deg, var(--red-deep), var(--teal));
    --grad-dark:  linear-gradient(155deg, #202023 0%, #141416 100%);

    --font-display: "pragmatica-extended", "Helvetica Neue", Arial, sans-serif;
    --font-body:    "pragmatica", "Helvetica Neue", Arial, sans-serif;

    --r:    14px;
    --r-sm: 9px;
    --shadow:    0 1px 2px rgba(0,0,0,.35), 0 14px 34px -18px rgba(0,0,0,.62);
    --shadow-lg: 0 34px 80px -34px rgba(0,0,0,.78);

    /* backlit glows */
    --glow-teal: 0 0 24px -8px rgba(80,187,184,.55);
    --glow-red:  0 10px 30px -14px rgba(225,35,58,.6);

    --sidebar-w: 252px;

    /* faint technical plus-grid — small & dim */
    --plus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26'%3E%3Cpath d='M13 9.5v7 M9.5 13h7' stroke='%23ffffff' stroke-width='1' stroke-opacity='0.05' stroke-linecap='round'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; color-scheme: dark; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0; line-height: 1.1; }

/* Section heading helper — Pragmatica Extended, caps, punchy */
h1, .display {
    font-family: var(--font-display);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .01em;
}

h2 {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1.15rem;
}

.eyebrow {
    font-family: var(--font-body);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .16em;
    font-size: .72rem;
    color: var(--gray-mid);
}

/* ---------------------------------------------------------------- App shell */

body.app {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
    /* cockpit depth: twin ambient blooms + edge vignette over the base */
    background:
        radial-gradient(1100px 560px at 100% -12%, rgba(80,187,184,.07), transparent 60%),
        radial-gradient(900px 520px at -8% 112%, rgba(225,35,58,.05), transparent 60%),
        radial-gradient(150% 130% at 50% 38%, transparent 52%, rgba(0,0,0,.4)),
        var(--bg);
    background-attachment: fixed;
}

.sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    background: var(--grad-dark);
    background-image: var(--plus), var(--grad-dark);
    background-size: 26px 26px, cover;
    color: var(--white);
    display: flex;
    flex-direction: column;
    padding: 28px 22px;
    overflow: hidden;
    border-right: 1px solid var(--line);
}
.sidebar::after { /* brand gradient hairline on the inner edge */
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 3px;
    background: var(--grad-brand);
}

.brand { display: block; margin-bottom: 40px; }
.brand__mark {
    font-family: var(--font-display);
    font-weight: 900;
    text-transform: uppercase;
    font-size: 1.7rem;
    letter-spacing: .02em;
    color: var(--white);
    line-height: 1;
}
.brand__mark b { color: var(--red); }
.brand__product {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-family: var(--font-body);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .28em;
    font-size: .7rem;
    color: rgba(255,255,255,.55);
}
.brand__product::before {
    content: "";
    width: 18px; height: 2px;
    background: var(--grad-brand);
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--r-sm);
    color: rgba(255,255,255,.72);
    font-weight: 700;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    text-decoration: none;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav a.is-active {
    background: rgba(255,255,255,.07);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--red), 0 0 26px -12px rgba(80,187,184,.6);
}
.nav a .dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: currentColor; opacity: .5;
}
.nav a.is-active .dot { background: var(--teal); opacity: 1; box-shadow: 0 0 8px rgba(80,187,184,.9); }

.sidebar__foot { margin-top: auto; padding-top: 24px; }
.sidebar__foot a {
    color: rgba(255,255,255,.5);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.sidebar__foot a:hover { color: #fff; text-decoration: none; }

/* ----------------------------------------------------------- Sub-nav (tabs) */
.subnav { display: flex; gap: 4px; border-bottom: 2px solid var(--line-strong); margin-bottom: 22px; }
.subnav a {
    padding: 10px 16px;
    font-weight: 700;
    font-size: .82rem;
    color: var(--gray-mid);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}
.subnav a:hover { color: var(--ink); text-decoration: none; }
.subnav a.is-active { color: var(--teal); border-bottom-color: var(--teal); }

/* ----------------------------------------------------------------- Content */

.content { min-width: 0; padding: 44px clamp(20px, 4vw, 56px); }
.content > *:last-child { margin-bottom: 0; }

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}
.page-head h1 {
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    color: var(--ink);
}
.page-head .eyebrow { margin-bottom: 10px; }

/* ------------------------------------------------------------------- Cards */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 26px 28px;
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.04);
    margin-bottom: 22px;
}
.card__title {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 4px;
    color: var(--ink);
}
.card__sub { color: var(--gray-mid); font-size: .9rem; margin: 0 0 18px; }

/* ------------------------------------------------------------------ Buttons */

.btn, button, input[type="submit"] {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    padding: 11px 20px;
    background: var(--red);
    color: #fff;
    transition: transform .08s ease, filter .15s ease, background .15s ease, box-shadow .15s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
}
.btn:hover, button:hover, input[type="submit"]:hover { filter: brightness(1.07); text-decoration: none; box-shadow: var(--glow-red); }
.btn:active, button:active { transform: translateY(1px); }
.btn:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid var(--teal);
    outline-offset: 2px;
}

a.btn { color: #fff; }
a.btn:hover { color: #fff; }

.btn--ghost, button.btn--ghost {
    background: transparent;
    color: var(--ink);
    border-color: var(--line-strong);
}
.btn--ghost:hover { background: var(--surface-2); filter: none; box-shadow: none; }

.btn--dark { background: var(--surface-2); border-color: var(--line-strong); }
.btn--dark:hover { box-shadow: none; }

.btn--sm { padding: 8px 14px; font-size: .72rem; }

.btn--danger { background: transparent; color: var(--red); border-color: transparent; padding-left: 6px; padding-right: 6px; }
.btn--danger:hover { background: rgba(225,35,58,.12); filter: none; box-shadow: none; }

/* -------------------------------------------------------------------- Links */

.linkrow { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
.backlink { font-weight: 700; color: var(--ink-soft); font-size: .85rem; }
.backlink:hover { color: var(--red); text-decoration: none; }

/* ------------------------------------------------------------ Action links (in tables) */

.actions { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.actions a, .action {
    font-weight: 700;
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--ink-soft);
    padding: 6px 10px;
    border-radius: 6px;
}
.actions a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.actions form { display: inline; }

/* -------------------------------------------------------------------- Forms */

label { display: block; font-weight: 700; font-size: .85rem; margin-bottom: 6px; color: var(--ink); }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="search"], select, textarea {
    width: 100%;
    font-family: var(--font-body);
    font-size: .95rem;
    color: var(--ink);
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    padding: 11px 13px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder, textarea::placeholder { color: var(--gray-mid); }
/* dark-styled native date picker + dropdown chrome */
input[type="date"] { color-scheme: dark; }
input:focus, select:focus, textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(80,187,184,.2), var(--glow-teal);
    outline: none;
}
textarea { min-height: 160px; resize: vertical; line-height: 1.5; }

/* Symfony form_row wraps each field in a bare <div> */
.form > div, form.stack > div { margin-bottom: 18px; }

input[type="checkbox"] {
    width: auto;
    accent-color: var(--red);
    transform: scale(1.15);
    margin-right: 8px;
}
/* checkbox rows read better inline */
.form > div:has(> input[type="checkbox"]) label,
form.stack > div:has(> input[type="checkbox"]) label { display: inline-block; margin: 0; }

.form, form.stack { max-width: 560px; }
.form button[type="submit"], form.stack button[type="submit"] { margin-top: 6px; }

/* validation errors (Symfony form_errors renders a bare <ul><li>) */
form.stack ul { list-style: none; margin: 7px 0 0; padding: 0; }
form.stack ul li { color: var(--red); font-size: .82rem; font-weight: 700; }
form.stack ul li::before { content: "! "; }

/* ------------------------------------------------------------------- Tables */

.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92rem; }
.table thead th {
    text-align: left;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .7rem;
    color: var(--gray-mid);
    padding: 0 16px 12px;
    border-bottom: 2px solid var(--line-strong);
    white-space: nowrap;
}
.table tbody td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.table .empty td { color: var(--gray-mid); text-align: center; padding: 30px; font-style: normal; }

/* wide table: horizontal scroll with frozen first column */
.table-scroll { overflow-x: auto; }
.table-scroll .table th:first-child,
.table-scroll .table td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.table-scroll .table thead th:first-child { z-index: 2; }
.table-scroll .table tbody tr:hover td:first-child { background: var(--surface-2); }

/* inline forms inside table cells (review assign/send) */
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form select { width: auto; min-width: 140px; padding: 8px 10px; font-size: .85rem; }
.inline-form button { padding: 8px 14px; font-size: .72rem; }
.muted { color: var(--gray-mid); font-style: normal; font-size: .85rem; }

/* key/value detail table (show pages) */
.detail { width: 100%; max-width: 620px; border-collapse: collapse; }
.detail th {
    text-align: left;
    width: 200px;
    padding: 13px 16px 13px 0;
    color: var(--gray-mid);
    font-weight: 700;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
}
.detail td { padding: 13px 0; border-bottom: 1px solid var(--line); }
.detail tr:last-child th, .detail tr:last-child td { border-bottom: none; }

/* ------------------------------------------------------------------ Badges */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 4px 10px;
    border-radius: 999px;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.badge--on  { background: rgba(80,187,184,.16); color: var(--teal); }
.badge--off { background: rgba(255,255,255,.08); color: var(--ink-soft); }
.badge--err { background: rgba(225,35,58,.16); color: #ff6b78; }
.badge--muted { background: rgba(255,255,255,.06); color: var(--gray-mid); text-decoration: line-through; }

/* ------------------------------------------------------------------ Flashes */

.flash {
    border-radius: var(--r-sm);
    padding: 13px 16px;
    margin-bottom: 16px;
    font-weight: 700;
    font-size: .9rem;
    display: flex;
    gap: 10px;
    align-items: center;
    border: 1px solid transparent;
}
.flash::before { font-weight: 900; }
.flash--ok  { background: rgba(80,187,184,.12); color: var(--teal); border-color: rgba(80,187,184,.28); }
.flash--ok::before  { content: "✓"; }
.flash--err { background: rgba(225,35,58,.1); color: #ff6b78; border-color: rgba(225,35,58,.3); }
.flash--err::before { content: "!"; }
.flash--warn { background: rgba(255,255,255,.06); color: var(--ink-soft); border-color: var(--line-strong); }
.flash--warn::before { content: "↻"; }

/* --------------------------------------------------------- Dashboard: hero */

.hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--r);
    background: var(--grad-dark);
    background-image: var(--plus), var(--grad-dark);
    background-size: 26px 26px, cover;
    color: var(--white);
    padding: 38px clamp(24px, 4vw, 48px);
    margin-bottom: 22px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--line);
}
.hero::before { /* teal glow bubble — blooms in on power-on */
    content: "";
    position: absolute;
    width: 400px; height: 400px;
    right: -120px; top: -180px;
    background: radial-gradient(circle, rgba(80,187,184,.4), transparent 62%);
    filter: blur(24px);
    pointer-events: none;
    animation: tacho-bloom 1.3s ease .1s backwards;
}
.hero::after { /* red glow bubble — blooms in slightly later */
    content: "";
    position: absolute;
    width: 340px; height: 340px;
    right: 120px; bottom: -210px;
    background: radial-gradient(circle, rgba(225,35,58,.32), transparent 62%);
    filter: blur(24px);
    pointer-events: none;
    animation: tacho-bloom 1.3s ease .3s backwards;
}
.hero__tiles {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: clamp(14px, 2vw, 26px);
}
.hero__tile {
    position: relative;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 12px;
    padding: 20px clamp(16px, 1.6vw, 24px);
    min-width: 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
    /* power-on: readouts rise + fade in, staggered left→right */
    animation: tacho-rise .6s cubic-bezier(.2,.7,.2,1) backwards;
}
.hero__tile:nth-child(1) { animation-delay: .08s; }
.hero__tile:nth-child(2) { animation-delay: .18s; }
.hero__tile:nth-child(3) { animation-delay: .28s; }
.hero__tile:hover { /* the instrument lights up */
    border-color: rgba(80,187,184,.45);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.09), var(--glow-teal);
    transform: translateY(-2px);
}
.hero__tile .eyebrow { color: rgba(255,255,255,.55); }
.hero__figure {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(1.7rem, 2.6vw, 2.6rem);
    line-height: .95;
    margin: 8px 0;
    font-variant-numeric: tabular-nums;
    /* backlit segment readout */
    text-shadow: 0 0 22px rgba(255,255,255,.14);
}
.hero__figure .cur { font-size: .42em; color: rgba(255,255,255,.55); margin-left: .15em; vertical-align: super; }
.hero__delta { font-weight: 700; font-size: .92rem; }
.hero__delta--met   { color: var(--teal); }
.hero__delta--below { color: #ff8a94; }
.hero__mini { position: relative; height: 8px; border-radius: 5px; background: rgba(255,255,255,.12); margin-top: 14px; overflow: hidden; }
.hero__mini i { display: block; height: 100%; border-radius: 5px; transform-origin: left center; animation: tacho-sweep .85s cubic-bezier(.2,.7,.2,1) .4s backwards; }
.hero__mini--met   { background: var(--teal); box-shadow: 0 0 12px rgba(80,187,184,.6); }
.hero__mini--below { background: var(--red); box-shadow: 0 0 12px rgba(225,35,58,.55); }
.hero__mini--over { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255,255,255,.5); border-radius: 5px 0 0 5px; }
.hero__tilefoot { margin-top: 8px; font-size: .78rem; color: rgba(255,255,255,.45); font-variant-numeric: tabular-nums; }
.hero__hint { margin-top: 10px; font-size: .84rem; color: rgba(255,255,255,.6); }
.hero__hint a { color: #fff; text-decoration: underline; }

/* chart card */
.chart-wrap { position: relative; height: 360px; }
.doughnut-wrap { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: center; }

/* Top-10 customer ranking charts */
.top-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 22px; }
.ranking-wrap { position: relative; height: 300px; }
@media (max-width: 860px) { .top-grid { grid-template-columns: 1fr; } }
.doughnut-canvas { position: relative; height: 280px; }
.doughnut-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.doughnut-legend li { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.doughnut-legend .dot { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.doughnut-legend .lbl { font-weight: 700; color: var(--ink); }
.doughnut-legend .amt { margin-left: auto; color: var(--gray-mid); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 720px) { .doughnut-wrap { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------- Auth screen */

body.auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background-color: var(--bg);
    background-image:
        var(--plus),
        radial-gradient(680px 420px at 50% 8%, rgba(80,187,184,.1), transparent 62%),
        var(--grad-dark);
    background-size: 26px 26px, cover, cover;
}
.auth-card {
    width: 100%;
    max-width: 380px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 40px 36px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}
.auth-card::before {
    content: "";
    position: absolute; top: 0; left: 0; right: 0;
    height: 5px;
    background: var(--grad-brand);
}
.auth-card .brand__mark { color: var(--ink); font-size: 1.9rem; }
.auth-card .brand__product { color: var(--gray-mid); }
.auth-card .brand__product::before { background: var(--grad-brand); }
.auth-card h1 { font-size: 1.15rem; margin: 26px 0 20px; color: var(--ink); }
.auth-card button { width: 100%; justify-content: center; margin-top: 8px; padding: 13px; }
.auth-card label { margin-top: 14px; }

/* ----------------------------------------------------------------- Utilities */

.stack-gap > * + * { margin-top: 14px; }
.text-net { font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---------------------------------------------------------------- Responsive */

@media (max-width: 860px) {
    body.app { grid-template-columns: 1fr; }
    .sidebar {
        position: static;
        height: auto;
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        gap: 10px 16px;
        padding: 16px 20px;
        border-right: none;
        border-bottom: 1px solid var(--line);
    }
    .sidebar::after { width: 100%; height: 3px; top: auto; bottom: 0; }
    .brand { margin-bottom: 0; margin-right: auto; }
    .brand__product { display: none; }
    .nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
    .nav a { padding: 8px 12px; font-size: .76rem; }
    .nav a .dot { display: none; }
    .sidebar__foot { margin: 0; padding: 0; }
    .hero__tiles { grid-template-columns: 1fr; }
}

/* ------------------------------------------------ Power-on (dashboard hero) */
@keyframes tacho-rise  { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes tacho-sweep { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes tacho-bloom { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* --------------------------------------------------- Confirm wizard (split) */

.wizard-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}
.wizard-pdf iframe {
    width: 100%;
    height: 78vh;
    min-height: 480px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: #fff;   /* PDF document surface stays white */
    box-shadow: var(--shadow);
}
.recognized {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    margin-bottom: 18px;
    background: var(--surface-2);
    border-left: 3px solid var(--teal);
    border-radius: var(--r-sm);
}
.recognized strong { font-size: 1.02rem; }

@media (max-width: 980px) {
    .wizard-split { grid-template-columns: 1fr; }
    .wizard-pdf iframe { height: 60vh; min-height: 360px; }
}

/* ----------------------------------------------------- Batch upload progress */

.batch-progress { margin-top: 18px; }
.batch-progress__bar {
    height: 8px;
    background: var(--surface-2);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 10px;
}
.batch-progress__bar span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--grad-brand);
    transition: width .25s ease;
}
.batch-progress__status { font-weight: 700; margin: 0 0 4px; }
.batch-progress .btn { margin-top: 12px; }

/* ------------------------------------------------------------------- Modal */
dialog.modal {
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 0;
    width: min(1100px, 92vw);
    max-width: 92vw;
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-lg);
}
dialog.modal::backdrop { background: rgba(6,6,8,.62); backdrop-filter: blur(5px); }
.modal__body { padding: 24px 26px; max-height: 88vh; overflow-y: auto; }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.modal__split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.modal__pdf iframe {
    width: 100%;
    height: 70vh;
    min-height: 420px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: #fff;   /* PDF document surface stays white */
}
.modal__info { margin: 0 0 18px; }
.modal__info > div { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.modal__info dt { color: var(--gray-mid); font-weight: 700; font-size: .82rem; }
.modal__info dd { margin: 0; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .modal__split { grid-template-columns: 1fr; } }

/* Rechnungstyp-Toggle (gestylte Radios, ein Wert aktiv) */
.type-toggle {
    display: inline-flex;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    overflow: hidden;
}
.type-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.type-toggle label {
    padding: 7px 16px;
    margin: 0;
    cursor: pointer;
    font-size: 14px;
    color: var(--ink-soft);
    background: var(--surface-2);
    user-select: none;
    transition: background .12s ease, color .12s ease;
}
.type-toggle label + input + label {
    border-left: 1px solid var(--line-strong);
}
.type-toggle input:checked + label {
    background: rgba(80,187,184,.16);
    color: var(--teal);
}
.type-toggle input:focus-visible + label {
    outline: 2px solid var(--teal);
    outline-offset: -2px;
}

/* Kleiner Typ-Indikator in der Rechnungsübersicht */
.badge--service {
    background: rgba(80,187,184,.16);
    color: var(--teal);
}
.type-tag {
    font-size: 12px;
    color: var(--gray-mid);
}

/* Dashboard: Jahres-Kennzahlen über dem Verlauf-Diagramm */
.year-stats {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    margin: 0 0 18px;
    padding: 0 2px;
}
.year-stat__figure {
    font-family: var(--font-display);
    font-size: 26px;
    color: var(--ink);
    line-height: 1.1;
    margin-top: 2px;
}
.year-stat__figure .cur {
    font-size: 16px;
    color: var(--ink-soft);
    margin-left: 2px;
}
.year-stat__split {
    font-size: 12px;
    color: var(--gray-mid);
    margin-top: 4px;
}

.outlook__bar {
    position: relative;
    display: flex;
    height: 10px;
    border-radius: 5px;
    background: rgba(255,255,255,.1);
    overflow: hidden;
    margin: 4px 0 18px;
}
.outlook__seg { display: block; height: 100%; }
.outlook__seg--realized { background: var(--teal); box-shadow: 0 0 12px rgba(80,187,184,.5); }
.outlook__seg--service {
    background: repeating-linear-gradient(
        45deg,
        var(--teal), var(--teal) 4px,
        rgba(255,255,255,.28) 4px, rgba(255,255,255,.28) 8px
    );
}
.outlook__seg--todo { background: transparent; }
.outlook__figures { display: flex; flex-direction: column; gap: 6px; }
.outlook__row { display: flex; justify-content: space-between; font-size: .95rem; }
.outlook__row--strong { font-weight: 700; }
.outlook__status--met { color: var(--teal); font-weight: 700; }
.outlook__status--todo { color: #ff8a94; font-weight: 700; }
