/* Manor LIMS. Dark by default, with a light theme and eight game-inspired looks (Cristal, Terran, Nova, Zerg,
   Night Elf, Human, Blood Elf, High Elf) picked from the theme window, plus Barbie in theme-barbie.css; documents
   (fișe, buletine, labels) stay paper-white.
   Fonts: Inter, Space Grotesk and JetBrains Mono (SIL Open Font License, see fonts/). */

@font-face { font-family: "Inter Variable"; 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 Variable"; 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: "Space Grotesk Variable"; font-style: normal; font-display: swap; font-weight: 300 700;
    src: url(/fonts/space-grotesk-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: "Space Grotesk Variable"; font-style: normal; font-display: swap; font-weight: 300 700;
    src: url(/fonts/space-grotesk-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: "JetBrains Mono Variable"; font-style: normal; font-display: swap; font-weight: 100 800;
    src: url(/fonts/jetbrains-mono-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: "JetBrains Mono Variable"; font-style: normal; font-display: swap; font-weight: 100 800;
    src: url(/fonts/jetbrains-mono-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; }

/* Themes ----------------------------------------------------------------------------------------
   Every element carrying data-theme (the page itself, and the small previews in the theme window)
   starts from the dark values below, then takes its own theme's values. */
:root {
    --font: "Inter Variable", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    --font-mono: "JetBrains Mono Variable", ui-monospace, "Cascadia Mono", Consolas, monospace;
    --radius: 16px;
    --radius-sm: 10px;
    --sidebar-w: 296px;
}
:root, [data-theme] {
    --font-display: "Space Grotesk Variable", "Inter Variable", "Segoe UI", system-ui, sans-serif;
    --bg: #060a14;
    --bg-glow-1: rgba(99, 102, 241, .22);
    --bg-glow-2: rgba(34, 211, 238, .14);
    --grid-line: rgba(148, 163, 184, .055);
    --surface: rgba(14, 21, 38, .78);
    --surface-solid: #0c1322;
    --surface-2: rgba(30, 41, 66, .55);
    --surface-hover: rgba(56, 189, 248, .07);
    --chrome: rgba(8, 13, 26, .78);
    --input-bg: rgba(2, 6, 23, .55);
    --line: rgba(148, 163, 184, .14);
    --line-strong: rgba(148, 163, 184, .28);
    --ink: #e7eefa;
    --heading: #e7eefa;
    --ink-2: #b8c4d8;
    --muted: #8391ab;
    --accent: #22d3ee;
    --accent-soft: rgba(34, 211, 238, .12);
    --grad: linear-gradient(120deg, #0891b2 0%, #4f46e5 55%, #9333ea 100%);
    --grad-text: linear-gradient(90deg, #22d3ee 0%, #a78bfa 55%, #f472b6 100%);
    --danger: #fb7185;
    --warn: #fbbf24;
    --ok: #34d399;
    --info: #60a5fa;
    --shadow: inset 0 1px 0 rgba(255, 255, 255, .035), 0 24px 48px -30px rgba(0, 0, 0, .9);
    --glow: 0 0 0 1px rgba(34, 211, 238, .45), 0 10px 36px -10px rgba(34, 211, 238, .5);
    --t-cyan: #22d3ee; --t-violet: #a78bfa; --t-amber: #fbbf24; --t-green: #34d399;
    --t-pink: #f472b6; --t-indigo: #818cf8; --t-slate: #94a3b8;
    /* Used by the themed looks below and by the previews: trim colour, the glow, corners, the main button. */
    --trim: #22d3ee;
    --trim-rgb: 34 211 238;
    --trim-grad: linear-gradient(120deg, #0891b2 0%, #4f46e5 55%, #9333ea 100%);
    --trim-ink: #8391ab;
    --on-trim: #fff;
    --glow-rgb: 99 102 241;
    --primary-bg: linear-gradient(120deg, #0891b2 0%, #4f46e5 55%, #9333ea 100%);
    --on-primary: #fff;
    --hero-bg: linear-gradient(135deg, rgba(99, 102, 241, .18), rgba(34, 211, 238, .07) 55%, transparent);
    --cut: 16px;
    --cut-sm: 12px;
    --cut-hero: 22px;
    --logo-clip: none;
    --pattern: none;
    --pattern-size: 44px 44px;
    color-scheme: dark;
}
[data-theme=light] {
    --bg: #eef2f9;
    --bg-glow-1: rgba(99, 102, 241, .13);
    --bg-glow-2: rgba(6, 182, 212, .13);
    --grid-line: rgba(15, 23, 42, .045);
    --surface: rgba(255, 255, 255, .88);
    --surface-solid: #ffffff;
    --surface-2: #f2f5fa;
    --surface-hover: rgba(8, 145, 178, .06);
    --chrome: rgba(255, 255, 255, .8);
    --input-bg: #ffffff;
    --line: #e0e6ef;
    --line-strong: #c9d2df;
    --ink: #0b1324;
    --heading: #0b1324;
    --ink-2: #334155;
    --muted: #64748b;
    --accent: #0e7490;
    --accent-soft: rgba(8, 145, 178, .1);
    --grad-text: linear-gradient(90deg, #0891b2 0%, #6d28d9 55%, #db2777 100%);
    --danger: #e11d48;
    --warn: #b45309;
    --ok: #047857;
    --info: #2563eb;
    --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 14px 34px -22px rgba(15, 23, 42, .35);
    --glow: 0 0 0 1px rgba(8, 145, 178, .45), 0 10px 30px -12px rgba(79, 70, 229, .45);
    --t-cyan: #0891b2; --t-violet: #7c3aed; --t-amber: #d97706; --t-green: #059669;
    --t-pink: #db2777; --t-indigo: #4f46e5; --t-slate: #64748b;
    --trim: #0e7490;
    --trim-rgb: 14 116 144;
    color-scheme: light;
}

/* Cristal, inspired by the Protoss: deep blue, gold trim, a psionic glow. */
[data-theme=crystal] {
    --bg: #040817;
    --bg-glow-1: rgba(37, 99, 235, .30);
    --bg-glow-2: rgba(230, 185, 85, .13);
    --grid-line: rgba(230, 185, 85, .07);
    --surface: rgba(9, 18, 44, .8);
    --surface-solid: #0a1430;
    --surface-2: rgba(22, 40, 86, .55);
    --surface-hover: rgba(92, 214, 255, .08);
    --chrome: rgba(5, 11, 30, .86);
    --input-bg: rgba(2, 6, 22, .6);
    --line: rgba(230, 185, 85, .16);
    --line-strong: rgba(230, 185, 85, .34);
    --ink: #eef3ff;
    --ink-2: #c4d0ea;
    --muted: #8d9cc0;
    --heading: #f6e7be;
    --accent: #5cd6ff;
    --accent-soft: rgba(92, 214, 255, .13);
    --grad: linear-gradient(120deg, #0b3a9c 0%, #1f6fe5 50%, #38c8f5 100%);
    --grad-text: linear-gradient(90deg, #fff0c2 0%, #e6b955 45%, #c08a32 75%, #f7dc8a 100%);
    --danger: #ff7a85;
    --warn: #f2c14e;
    --ok: #4fe0b0;
    --info: #6aa8ff;
    --shadow: inset 0 1px 0 rgba(246, 222, 160, .07), 0 24px 48px -30px rgba(0, 0, 0, .95);
    --glow: 0 0 0 1px rgba(92, 214, 255, .5), 0 10px 36px -10px rgba(92, 214, 255, .6);
    --t-cyan: #5cd6ff; --t-violet: #a594ff; --t-amber: #e6b955; --t-green: #4fe0b0;
    --t-pink: #c89bff; --t-indigo: #6aa8ff; --t-slate: #a3b2d1;
    --trim: #e6b955;
    --trim-rgb: 230 185 85;
    --trim-grad: linear-gradient(160deg, #fff0c2 0%, #e6b955 45%, #9a6c22 100%);
    --trim-ink: #c9a95e;
    --on-trim: #0a1a44;
    --glow-rgb: 92 214 255;
    --primary-bg: linear-gradient(180deg, #2a7bf0 0%, #0f3fa8 55%, #0a2a78 100%);
    --on-primary: #fff8e1;
    --hero-bg: linear-gradient(135deg, rgba(31, 111, 229, .3), rgba(56, 200, 245, .08) 55%, transparent);
    --cut: 4px 22px 4px 22px;
    --cut-sm: 4px 14px 4px 14px;
    --cut-hero: 6px 30px 6px 30px;
    --logo-clip: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%);
    --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 56 100'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 100' fill='none' stroke='%23e6b955' stroke-opacity='.15'/%3E%3Cpath d='M28 0L28 34L0 50L0 84L28 100L56 84L56 50L28 34' fill='none' stroke='%235cd6ff' stroke-opacity='.05'/%3E%3C/svg%3E");
    --pattern-size: 56px 100px;
}

/* Terran: gunmetal plates, amber hazard markings, square military corners. */
[data-theme=terran] {
    --font-display: var(--font-mono);
    --bg: #090c10;
    --bg-glow-1: rgba(255, 140, 40, .14);
    --bg-glow-2: rgba(110, 140, 175, .16);
    --grid-line: rgba(255, 170, 60, .05);
    --surface: rgba(21, 26, 33, .88);
    --surface-solid: #151a21;
    --surface-2: rgba(42, 50, 62, .62);
    --surface-hover: rgba(255, 166, 48, .07);
    --chrome: rgba(11, 14, 19, .92);
    --input-bg: rgba(4, 6, 9, .72);
    --line: rgba(160, 175, 195, .16);
    --line-strong: rgba(255, 166, 48, .36);
    --ink: #e8ecf1;
    --ink-2: #bcc5d0;
    --muted: #8a95a3;
    --heading: #f4f6f9;
    --accent: #ffa630;
    --accent-soft: rgba(255, 166, 48, .13);
    --grad: linear-gradient(120deg, #5a1d10 0%, #b8401c 50%, #ff8a2a 100%);
    --grad-text: linear-gradient(90deg, #ffe0a8 0%, #ffa630 50%, #ff6a3a 100%);
    --danger: #ff5a4f;
    --warn: #ffc23d;
    --ok: #6ad38a;
    --info: #5ec8ff;
    --shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 24px 48px -30px rgba(0, 0, 0, .95);
    --glow: 0 0 0 1px rgba(255, 166, 48, .55), 0 10px 32px -10px rgba(255, 110, 40, .55);
    --t-cyan: #5ec8ff; --t-violet: #a9a1ff; --t-amber: #ffa630; --t-green: #7ddc6a;
    --t-pink: #ff7a6b; --t-indigo: #7fa4ff; --t-slate: #9aa6b5;
    --trim: #ffa630;
    --trim-rgb: 255 166 48;
    --trim-grad: linear-gradient(180deg, #ffd27a 0%, #ffa630 50%, #c46a10 100%);
    --trim-ink: #e0a050;
    --on-trim: #1a1206;
    --glow-rgb: 255 96 48;
    --primary-bg: linear-gradient(180deg, #46515e 0%, #2a323c 50%, #1b2128 100%);
    --on-primary: #ffd27a;
    --hero-bg: linear-gradient(135deg, rgba(110, 130, 155, .22), rgba(255, 140, 40, .07) 60%, transparent);
    --cut: 3px;
    --cut-sm: 2px;
    --cut-hero: 4px;
    --logo-clip: polygon(18% 0, 82% 0, 100% 18%, 100% 82%, 82% 100%, 18% 100%, 0 82%, 0 18%);
    --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='80' viewBox='0 0 120 80'%3E%3Cpath d='M0 .5H120M.5 0V80M60.5 0V40' stroke='%23a0afc3' stroke-opacity='.07' fill='none'/%3E%3Cg fill='%23ffa630' fill-opacity='.14'%3E%3Ccircle cx='5' cy='5' r='1.3'/%3E%3Ccircle cx='55' cy='5' r='1.3'/%3E%3Ccircle cx='65' cy='5' r='1.3'/%3E%3Ccircle cx='115' cy='5' r='1.3'/%3E%3C/g%3E%3C/svg%3E");
    --pattern-size: 120px 80px;
}

/* Nova: a covert operative's HUD, near black with a cold teal and a trace of psionic violet. */
[data-theme=nova] {
    --bg: #04060a;
    --bg-glow-1: rgba(40, 230, 210, .12);
    --bg-glow-2: rgba(150, 110, 255, .11);
    --grid-line: rgba(80, 240, 220, .045);
    --surface: rgba(10, 15, 22, .86);
    --surface-solid: #0a1017;
    --surface-2: rgba(24, 34, 46, .6);
    --surface-hover: rgba(62, 240, 214, .07);
    --chrome: rgba(4, 7, 11, .92);
    --input-bg: rgba(0, 3, 6, .72);
    --line: rgba(110, 230, 220, .13);
    --line-strong: rgba(110, 230, 220, .32);
    --ink: #e6fbfa;
    --ink-2: #b4cfd0;
    --muted: #7895a0;
    --heading: #f2ffff;
    --accent: #3ef0d6;
    --accent-soft: rgba(62, 240, 214, .12);
    --grad: linear-gradient(120deg, #063a3a 0%, #0f8f86 50%, #3ef0d6 100%);
    --grad-text: linear-gradient(90deg, #ffffff 0%, #9ffcf0 45%, #b69cff 100%);
    --danger: #ff6b81;
    --warn: #ffd166;
    --ok: #3ef0a0;
    --info: #7cc4ff;
    --shadow: inset 0 1px 0 rgba(159, 252, 240, .05), 0 24px 48px -30px rgba(0, 0, 0, .95);
    --glow: 0 0 0 1px rgba(62, 240, 214, .5), 0 10px 36px -10px rgba(62, 240, 214, .55);
    --t-cyan: #3ef0d6; --t-violet: #b69cff; --t-amber: #ffd166; --t-green: #3ef0a0;
    --t-pink: #ff8fd0; --t-indigo: #7cc4ff; --t-slate: #8fa9b3;
    --trim: #9ffcf0;
    --trim-rgb: 159 252 240;
    --trim-grad: linear-gradient(160deg, #ffffff 0%, #9ffcf0 45%, #1fb3a3 100%);
    --trim-ink: #7fdcd2;
    --on-trim: #021614;
    --glow-rgb: 62 240 214;
    --primary-bg: linear-gradient(180deg, #0f6f69 0%, #0a4a48 55%, #06302f 100%);
    --on-primary: #e6fffb;
    --hero-bg: linear-gradient(135deg, rgba(62, 240, 214, .12), rgba(150, 110, 255, .08) 55%, transparent);
    --cut: 0;
    --cut-sm: 2px;
    --cut-hero: 0;
    --logo-clip: polygon(0 0, 78% 0, 100% 22%, 100% 100%, 22% 100%, 0 78%);
    --pattern: repeating-linear-gradient(0deg, rgba(62, 240, 214, .035) 0 1px, transparent 1px 4px);
    --pattern-size: auto;
}

/* Zerg: living violet tissue, acid green, nothing quite straight. */
[data-theme=zerg] {
    --bg: #0b0510;
    --bg-glow-1: rgba(150, 40, 180, .28);
    --bg-glow-2: rgba(140, 230, 40, .10);
    --grid-line: rgba(190, 90, 220, .05);
    --surface: rgba(28, 12, 34, .84);
    --surface-solid: #1a0c21;
    --surface-2: rgba(54, 22, 64, .58);
    --surface-hover: rgba(166, 240, 58, .07);
    --chrome: rgba(14, 6, 18, .92);
    --input-bg: rgba(6, 2, 9, .66);
    --line: rgba(190, 90, 220, .18);
    --line-strong: rgba(190, 90, 220, .38);
    --ink: #f6ecf8;
    --ink-2: #d4bfdb;
    --muted: #a088a9;
    --heading: #eaffc9;
    --accent: #a6f03a;
    --accent-soft: rgba(166, 240, 58, .12);
    --grad: linear-gradient(120deg, #3d0a4f 0%, #8d1fa8 50%, #d43f8d 100%);
    --grad-text: linear-gradient(90deg, #d8ff8a 0%, #a6f03a 40%, #e07bff 100%);
    --danger: #ff5f8a;
    --warn: #ffcf4a;
    --ok: #a6f03a;
    --info: #b48cff;
    --shadow: inset 0 1px 0 rgba(242, 182, 255, .06), 0 24px 48px -30px rgba(0, 0, 0, .95);
    --glow: 0 0 0 1px rgba(166, 240, 58, .5), 0 10px 36px -10px rgba(166, 240, 58, .5);
    --t-cyan: #6fe3d0; --t-violet: #d07bff; --t-amber: #ffcf4a; --t-green: #a6f03a;
    --t-pink: #ff7ac0; --t-indigo: #b48cff; --t-slate: #b39bbb;
    --trim: #c24bea;
    --trim-rgb: 194 75 234;
    --trim-grad: radial-gradient(120% 140% at 30% 0%, #f2b6ff 0%, #c24bea 45%, #5e1677 100%);
    --trim-ink: #c98ad8;
    --on-trim: #1a0420;
    --glow-rgb: 166 240 58;
    --primary-bg: radial-gradient(120% 160% at 30% 0%, #b83ade 0%, #6a1488 55%, #3a0a4c 100%);
    --on-primary: #f2ffe0;
    --hero-bg: radial-gradient(90% 140% at 0% 0%, rgba(150, 40, 180, .32), transparent 60%), radial-gradient(60% 90% at 100% 100%, rgba(166, 240, 58, .08), transparent 70%);
    --cut: 26px 12px 30px 14px / 16px 28px 12px 24px;
    --cut-sm: 16px 8px 18px 9px / 10px 16px 8px 14px;
    --cut-hero: 44px 18px 50px 22px / 26px 46px 20px 40px;
    --logo-clip: none;
    --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='none' stroke='%23c24bea' stroke-opacity='.11'%3E%3Cpath d='M0 40C30 30 40 70 80 60S130 20 160 40'/%3E%3Cpath d='M0 120C35 135 55 95 90 110S140 140 160 120'/%3E%3Cpath d='M40 0C50 40 20 60 35 100S60 140 50 160'/%3E%3C/g%3E%3Cg fill='%23a6f03a' fill-opacity='.08'%3E%3Ccircle cx='80' cy='60' r='3'/%3E%3Ccircle cx='35' cy='100' r='2'/%3E%3Ccircle cx='120' cy='122' r='2.5'/%3E%3C/g%3E%3C/svg%3E");
    --pattern-size: 160px 160px;
}

/* Night Elf: a moonlit forest, silver light, violet dusk and wisp green. */
[data-theme=nightelf] {
    --bg: #07081a;
    --bg-glow-1: rgba(110, 80, 220, .30);
    --bg-glow-2: rgba(200, 211, 245, .12);
    --grid-line: rgba(170, 160, 255, .04);
    --surface: rgba(18, 17, 46, .82);
    --surface-solid: #121133;
    --surface-2: rgba(40, 36, 90, .56);
    --surface-hover: rgba(110, 232, 196, .07);
    --chrome: rgba(8, 8, 26, .9);
    --input-bg: rgba(3, 3, 16, .62);
    --line: rgba(170, 160, 255, .16);
    --line-strong: rgba(170, 160, 255, .34);
    --ink: #eeeefe;
    --ink-2: #c6c4ea;
    --muted: #918ebe;
    --heading: #e6f0ff;
    --accent: #6ee8c4;
    --accent-soft: rgba(110, 232, 196, .12);
    --grad: linear-gradient(120deg, #2a1a6e 0%, #5a3bc4 50%, #2fb8a0 100%);
    --grad-text: linear-gradient(90deg, #ffffff 0%, #c8d3f5 40%, #6ee8c4 100%);
    --danger: #ff7a9a;
    --warn: #f5cf6a;
    --ok: #6ee8c4;
    --info: #8ea8ff;
    --shadow: inset 0 1px 0 rgba(200, 211, 245, .06), 0 24px 48px -30px rgba(0, 0, 0, .95);
    --glow: 0 0 0 1px rgba(140, 120, 255, .5), 0 10px 36px -10px rgba(140, 120, 255, .6);
    --t-cyan: #6ee8c4; --t-violet: #a58cff; --t-amber: #f5cf6a; --t-green: #7fe39a;
    --t-pink: #e58cff; --t-indigo: #8ea8ff; --t-slate: #a6a4cc;
    --trim: #c8d3f5;
    --trim-rgb: 200 211 245;
    --trim-grad: linear-gradient(160deg, #ffffff 0%, #c8d3f5 45%, #6c6fb8 100%);
    --trim-ink: #aab3e6;
    --on-trim: #15143d;
    --glow-rgb: 140 120 255;
    --primary-bg: linear-gradient(180deg, #6a4fd8 0%, #43309c 55%, #2a1d6e 100%);
    --on-primary: #f2f0ff;
    --hero-bg: linear-gradient(135deg, rgba(90, 59, 196, .32), rgba(47, 184, 160, .08) 60%, transparent);
    --cut: 22px 4px 22px 4px;
    --cut-sm: 14px 3px 14px 3px;
    --cut-hero: 34px 6px 34px 6px;
    --logo-clip: none;
    --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='%23ffffff'%3E%3Ccircle cx='20' cy='30' r='.9' fill-opacity='.5'/%3E%3Ccircle cx='70' cy='12' r='.6' fill-opacity='.4'/%3E%3Ccircle cx='130' cy='45' r='1.1' fill-opacity='.55'/%3E%3Ccircle cx='160' cy='110' r='.7' fill-opacity='.35'/%3E%3Ccircle cx='95' cy='90' r='.6' fill-opacity='.3'/%3E%3Ccircle cx='40' cy='140' r='1' fill-opacity='.45'/%3E%3Ccircle cx='115' cy='160' r='.6' fill-opacity='.35'/%3E%3C/g%3E%3Ccircle cx='150' cy='150' r='1' fill='%236ee8c4' fill-opacity='.5'/%3E%3C/svg%3E");
    --pattern-size: 180px 180px;
}

/* Human: a parchment page, royal blue banners and brass. A light look. */
[data-theme=human] {
    --font-display: Georgia, Cambria, "Times New Roman", serif;
    --bg: #ebe2cd;
    --bg-glow-1: rgba(31, 79, 168, .12);
    --bg-glow-2: rgba(184, 137, 43, .18);
    --grid-line: rgba(90, 70, 40, .05);
    --surface: rgba(251, 247, 236, .94);
    --surface-solid: #fbf7ec;
    --surface-2: #f2ead6;
    --surface-hover: rgba(31, 79, 168, .06);
    --chrome: rgba(246, 239, 222, .94);
    --input-bg: #fffdf6;
    --line: #dccfb2;
    --line-strong: #c3b089;
    --ink: #2a2117;
    --ink-2: #4a3d2c;
    --muted: #7a6a52;
    --heading: #1b2d5c;
    --accent: #1f4fa8;
    --accent-soft: rgba(31, 79, 168, .1);
    --grad: linear-gradient(120deg, #13306e 0%, #1f4fa8 55%, #3a6fd0 100%);
    --grad-text: linear-gradient(90deg, #1b2d5c 0%, #1f4fa8 50%, #8a621a 100%);
    --danger: #b42318;
    --warn: #a15c07;
    --ok: #2f7a3a;
    --info: #1f4fa8;
    --shadow: 0 1px 2px rgba(60, 40, 10, .08), 0 14px 34px -22px rgba(60, 40, 10, .4);
    --glow: 0 0 0 1px rgba(31, 79, 168, .45), 0 10px 30px -12px rgba(31, 79, 168, .45);
    --t-cyan: #1d7a8c; --t-violet: #5b3fa0; --t-amber: #a8701a; --t-green: #2f7a3a;
    --t-pink: #a8325e; --t-indigo: #1f4fa8; --t-slate: #6b6150;
    --trim: #b8892b;
    --trim-rgb: 184 137 43;
    --trim-grad: linear-gradient(160deg, #f6dc8e 0%, #c99a35 45%, #8a621a 100%);
    --trim-ink: #8a621a;
    --on-trim: #2a1d06;
    --glow-rgb: 31 79 168;
    --primary-bg: linear-gradient(180deg, #2c5fbf 0%, #1f4fa8 50%, #163a80 100%);
    --on-primary: #fff8e6;
    --hero-bg: linear-gradient(135deg, rgba(31, 79, 168, .1), rgba(184, 137, 43, .08) 60%, transparent);
    --cut: 6px;
    --cut-sm: 6px;
    --cut-hero: 10px;
    --logo-clip: polygon(0 0, 100% 0, 100% 64%, 50% 100%, 0 64%);
    --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cpath d='M32 22l3 7 7 3-7 3-3 7-3-7-7-3 7-3z' fill='%23b8892b' fill-opacity='.07'/%3E%3C/svg%3E");
    --pattern-size: 64px 64px;
    color-scheme: light;
}

/* Blood Elf: crimson velvet, gold filigree and phoenix embers. */
[data-theme=bloodelf] {
    --bg: #120406;
    --bg-glow-1: rgba(200, 30, 40, .28);
    --bg-glow-2: rgba(240, 190, 80, .13);
    --grid-line: rgba(240, 190, 90, .05);
    --surface: rgba(34, 9, 13, .86);
    --surface-solid: #210a0e;
    --surface-2: rgba(66, 18, 24, .58);
    --surface-hover: rgba(240, 190, 80, .07);
    --chrome: rgba(18, 5, 8, .92);
    --input-bg: rgba(8, 2, 3, .66);
    --line: rgba(240, 190, 90, .16);
    --line-strong: rgba(240, 190, 90, .36);
    --ink: #fbefe8;
    --ink-2: #e2c6bd;
    --muted: #b08f88;
    --heading: #ffe6ad;
    --accent: #ff9248;
    --accent-soft: rgba(255, 146, 72, .13);
    --grad: linear-gradient(120deg, #5c0a12 0%, #a8141f 50%, #e0482a 100%);
    --grad-text: linear-gradient(90deg, #fff1c4 0%, #f0c05a 40%, #ff7a3d 100%);
    --danger: #ff6464;
    --warn: #ffc94d;
    --ok: #8be06a;
    --info: #ffb070;
    --shadow: inset 0 1px 0 rgba(255, 220, 160, .06), 0 24px 48px -30px rgba(0, 0, 0, .95);
    --glow: 0 0 0 1px rgba(255, 146, 72, .5), 0 10px 36px -10px rgba(255, 110, 50, .6);
    --t-cyan: #ffb070; --t-violet: #e08cff; --t-amber: #f0c05a; --t-green: #8be06a;
    --t-pink: #ff7a90; --t-indigo: #ff9248; --t-slate: #c4a29a;
    --trim: #f0c05a;
    --trim-rgb: 240 192 90;
    --trim-grad: linear-gradient(160deg, #fff1c4 0%, #f0c05a 45%, #a26a18 100%);
    --trim-ink: #d9a95a;
    --on-trim: #2a0a06;
    --glow-rgb: 255 110 50;
    --primary-bg: linear-gradient(180deg, #c62a2a 0%, #8c1219 55%, #5a0a10 100%);
    --on-primary: #fff1c4;
    --hero-bg: linear-gradient(135deg, rgba(168, 20, 31, .32), rgba(240, 192, 90, .07) 60%, transparent);
    --cut: 20px 20px 4px 4px;
    --cut-sm: 12px 12px 3px 3px;
    --cut-hero: 34px 34px 6px 6px;
    --logo-clip: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%);
    --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M24 2L46 24L24 46L2 24Z' fill='none' stroke='%23f0c05a' stroke-opacity='.08'/%3E%3Cpath d='M24 18l2 6-2 6-2-6z' fill='%23f0c05a' fill-opacity='.1'/%3E%3C/svg%3E");
    --pattern-size: 48px 48px;
}

/* High Elf: pearl white, sky blue and pale gold, a light and airy look. */
[data-theme=highelf] {
    --font-display: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
    --bg: #f2f4fb;
    --bg-glow-1: rgba(120, 170, 240, .24);
    --bg-glow-2: rgba(220, 185, 100, .2);
    --grid-line: rgba(60, 80, 140, .04);
    --surface: rgba(255, 255, 255, .9);
    --surface-solid: #ffffff;
    --surface-2: #eef2fa;
    --surface-hover: rgba(42, 116, 201, .06);
    --chrome: rgba(255, 255, 255, .88);
    --input-bg: #ffffff;
    --line: #dde3f0;
    --line-strong: #c6cfe3;
    --ink: #18213d;
    --ink-2: #3b4566;
    --muted: #6a7493;
    --heading: #14306b;
    --accent: #2a74c9;
    --accent-soft: rgba(42, 116, 201, .1);
    --grad: linear-gradient(120deg, #2a74c9 0%, #5aa0ea 55%, #9cc8f5 100%);
    --grad-text: linear-gradient(90deg, #14306b 0%, #2a74c9 50%, #b88a2a 100%);
    --danger: #c0264a;
    --warn: #a86a08;
    --ok: #1e7a5a;
    --info: #2a74c9;
    --shadow: 0 1px 2px rgba(20, 48, 107, .05), 0 16px 36px -24px rgba(20, 48, 107, .35);
    --glow: 0 0 0 1px rgba(42, 116, 201, .4), 0 10px 30px -12px rgba(200, 160, 70, .55);
    --t-cyan: #1f8fb0; --t-violet: #6a4fc0; --t-amber: #b8861f; --t-green: #1e7a5a;
    --t-pink: #c0407a; --t-indigo: #2a74c9; --t-slate: #6a7493;
    --trim: #c8a046;
    --trim-rgb: 200 160 70;
    --trim-grad: linear-gradient(160deg, #fff4cf 0%, #dcb45a 45%, #a07a24 100%);
    --trim-ink: #9a7424;
    --on-trim: #2a1f06;
    --glow-rgb: 90 160 240;
    --primary-bg: linear-gradient(180deg, #4a90e0 0%, #2a74c9 55%, #1d5aa6 100%);
    --on-primary: #ffffff;
    --hero-bg: linear-gradient(135deg, rgba(120, 170, 240, .16), rgba(220, 185, 100, .1) 60%, transparent);
    --cut: 18px;
    --cut-sm: 999px;
    --cut-hero: 28px;
    --logo-clip: polygon(50% 0, 64% 36%, 100% 50%, 64% 64%, 50% 100%, 36% 64%, 0 50%, 36% 36%);
    --pattern: repeating-conic-gradient(from 0deg at 50% -10%, rgba(200, 160, 70, .05) 0deg 3deg, transparent 3deg 12deg);
    --pattern-size: auto;
    color-scheme: light;
}

/* Base ------------------------------------------------------------------------------------------ */
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
    margin: 0; min-height: 100vh; overflow-wrap: break-word;
    font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink);
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
    background:
        radial-gradient(1100px 620px at 0% -12%, var(--bg-glow-1), transparent 62%),
        radial-gradient(900px 540px at 100% -4%, var(--bg-glow-2), transparent 60%),
        var(--bg);
    background-attachment: fixed;
}
body::before {
    content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 10%, transparent 80%);
    mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 10%, transparent 80%);
}
::selection { background: rgba(99, 102, 241, .4); color: #fff; }
h1, h2, h3 { font-family: var(--font-display); color: var(--heading, var(--ink)); }
h1 { font-size: clamp(1.55rem, 1.25rem + 1vw, 2rem); font-weight: 650; letter-spacing: -.025em; margin: 0 0 .6rem; line-height: 1.15; }
h2 { font-size: 1.14rem; font-weight: 600; letter-spacing: -.01em; margin: 0 0 .35rem; }
h3 { font-size: 1rem; font-weight: 600; margin: 1rem 0 .4rem; }
p { line-height: 1.55; margin: .4rem 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0 1rem; }
a { color: var(--accent); text-underline-offset: 3px; }
.icon { width: 1.32em; height: 1.32em; flex: none; vertical-align: -.2em; }

/* Shell: menu on the left, a drawer on phones ----------------------------------------------------- */
.shell { position: relative; z-index: 1; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
    position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; flex-direction: column; gap: .4rem;
    padding: 1.1rem .9rem 1rem; background: var(--chrome); border-right: 1px solid var(--line);
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); z-index: 40;
}
.main { min-width: 0; display: flex; flex-direction: column; }
.page { width: 100%; max-width: 1320px; margin: 0 auto; padding: 1.8rem 2.1rem 4rem; }
.topbar { display: none; }
.scrim { display: none; }

.brand { display: flex; align-items: center; gap: .7rem; color: var(--ink); text-decoration: none; padding: .2rem .35rem .8rem; }
.logo {
    position: relative; display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 12px;
    background: var(--grad); box-shadow: 0 8px 26px -8px rgba(99, 102, 241, .8), 0 0 0 1px rgba(255, 255, 255, .08) inset;
}
.logo::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(160deg, rgba(255, 255, 255, .35), transparent 45%); }
.logo span { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: #fff; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--font-display); font-size: 1.18rem; letter-spacing: -.01em; }
.brand-text small { color: var(--muted); font-size: .68rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }

/* The links scroll when they don't fit; the theme switch and the person stay in view below them. */
.nav {
    display: flex; flex-direction: column; gap: 3px; flex: 1; min-height: 0; overflow-y: auto;
    margin: 0 -.9rem; padding: 0 .9rem .4rem; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.nav-group { margin: .95rem .8rem .35rem; font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.nav-link {
    position: relative; display: flex; align-items: center; gap: .85rem; padding: .72rem .85rem; border-radius: 12px;
    color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 1.04rem; transition: background .15s, color .15s;
}
.nav-link .icon { width: 23px; height: 23px; opacity: .8; transition: color .15s, filter .15s; }
.nav-link:hover { background: var(--surface-hover); color: var(--ink); }
.nav-link[aria-current=page] { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.nav-link[aria-current=page] .icon { color: var(--accent); opacity: 1; filter: drop-shadow(0 0 6px var(--accent)); }
.nav-link[aria-current=page]::before {
    content: ""; position: absolute; left: -.9rem; top: 20%; bottom: 20%; width: 3px; border-radius: 0 4px 4px 0;
    background: var(--grad); box-shadow: 0 0 14px rgba(34, 211, 238, .8);
}
.badge {
    margin-left: auto; min-width: 1.65rem; padding: .1rem .5rem; border-radius: 999px; text-align: center;
    font-size: .82rem; font-weight: 700; color: #fff; background: var(--grad); box-shadow: 0 0 16px -3px rgba(99, 102, 241, .9);
}
.sidebar-foot { display: flex; flex-direction: column; gap: .6rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: .65rem; padding: .25rem .2rem; }
.me-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.me-text strong { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { color: var(--muted); font-size: .86rem; }
.icon-btn {
    display: inline-flex; align-items: center; gap: .6rem; padding: .56rem; border-radius: 12px;
    background: transparent; border: 1px solid var(--line); color: var(--ink-2); font-weight: 500; font-size: 1rem;
}
.icon-btn .icon { width: 21px; height: 21px; }

/* The theme button in the menu: a sample of the chosen look and its name; it opens the theme window. */
.theme-btn {
    display: flex; align-items: center; gap: .7rem; width: 100%; padding: .5rem .65rem; justify-content: flex-start;
    background: var(--input-bg); border: 1px solid var(--line-strong); color: var(--ink); font-weight: 500; text-align: left;
}
.theme-btn:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.theme-btn > .icon { margin-left: auto; color: var(--muted); width: 21px; height: 21px; }
.theme-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.theme-name small { font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.theme-name strong { font-size: .98rem; }
.theme-dot {
    flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-strong);
    background: conic-gradient(var(--bg) 0 50%, var(--accent) 50% 75%, var(--trim) 75% 100%);
    box-shadow: 0 0 0 2px var(--surface-solid), 0 0 12px -2px var(--accent);
}

/* Locations (București / Ploiești): the switch in the menu foot and the chooser on a new reception. */
.loc-switch { display: flex; flex-direction: column; gap: .35rem; }
.loc-switch > small {
    display: flex; align-items: center; gap: .35rem; font-size: .68rem; font-weight: 700; letter-spacing: .14em;
    text-transform: uppercase; color: var(--muted);
}
.loc-switch > small .icon { width: 16px; height: 16px; }
.loc-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.loc-chip {
    display: flex; align-items: center; gap: .4rem; padding: .35rem .6rem; border-radius: 999px;
    background: var(--input-bg); border: 1px solid var(--line-strong); color: var(--ink); font-size: .9rem;
}
.loc-chip b { font-weight: 800; }
.loc-chip:hover:not(:disabled) { border-color: var(--accent); }
.loc-chip.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent-soft); }
.loc-chip:disabled { opacity: 1; cursor: default; }
.loc-pick { display: flex; flex-direction: column; gap: .35rem; }

/* The theme window: every look drawn small in its own colours, grouped. */
.modal.theme-modal { width: min(940px, calc(100vw - 1.5rem)); }
.theme-modal > .row { justify-content: space-between; }
.theme-modal .section-title { margin: .3rem 0 0; }
.theme-modal .muted { margin: 0; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .8rem; }
.theme-card {
    position: relative; display: flex; flex-direction: column; align-items: stretch; gap: .55rem; padding: .55rem;
    border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); text-align: left; font-size: 1rem;
}
.theme-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 14px 30px -18px rgba(0, 0, 0, .8); }
.theme-card[aria-pressed=true] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), 0 0 24px -6px var(--accent); }
.theme-card[aria-pressed=true]::after {
    content: "✓"; position: absolute; top: .9rem; right: .9rem; display: grid; place-items: center; width: 24px; height: 24px;
    border-radius: 50%; background: var(--accent); color: var(--surface-solid); font-size: .85rem; font-weight: 800;
}
.theme-card-text { display: flex; flex-direction: column; gap: .1rem; padding: 0 .2rem .15rem; }
.theme-card-text strong { font-size: 1.02rem; }
.theme-card-text small { color: var(--muted); font-size: .8rem; font-weight: 500; line-height: 1.3; }
/* The small preview: a menu strip and a page with a title, text and the main button. */
.tp {
    position: relative; display: grid; grid-template-columns: 26% 1fr; height: 104px; overflow: hidden; border-radius: 10px;
    border: 1px solid var(--line-strong); color: var(--ink);
    background: var(--pattern), radial-gradient(160px 90px at 0% 0%, var(--bg-glow-1), transparent 70%),
        radial-gradient(140px 90px at 100% 0%, var(--bg-glow-2), transparent 70%), var(--bg);
    background-size: var(--pattern-size), auto, auto, auto;
}
.tp-side { display: flex; flex-direction: column; gap: 5px; padding: 9px 7px; background: var(--chrome); border-right: 1px solid var(--line); }
.tp-side i { display: block; height: 6px; border-radius: 3px; background: var(--line-strong); }
.tp-side i.on { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.tp-main {
    display: flex; flex-direction: column; gap: 6px; margin: 9px; padding: 8px 9px; border-radius: var(--cut);
    background: var(--surface); border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgb(var(--trim-rgb) / .35);
}
.tp-title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; line-height: 1; color: var(--heading, var(--ink)); }
.tp-line { display: block; height: 5px; width: 80%; border-radius: 3px; background: var(--muted); opacity: .5; }
.tp-line.short { width: 55%; }
.tp-row { display: flex; gap: 6px; margin-top: auto; }
.tp-btn { display: block; width: 46px; height: 14px; border-radius: var(--cut-sm); background: var(--primary-bg); border: 1px solid var(--trim); }
.tp-chip { display: block; width: 22px; height: 14px; border-radius: var(--cut-sm); background: var(--trim-grad); }
@media (max-width: 520px) { .theme-grid { grid-template-columns: 1fr 1fr; } .tp { height: 84px; } .theme-card-text small { display: none; } }
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); background: var(--surface-hover); }

.shell.signed-out { grid-template-columns: minmax(0, 1fr); }
.shell.signed-out .sidebar, .shell.signed-out .menu-btn { display: none; }
.shell.signed-out .topbar { display: flex; background: transparent; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }

@media (max-width: 1000px) {
    .shell { grid-template-columns: minmax(0, 1fr); }
    .sidebar {
        position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); height: 100%; background: var(--surface-solid);
        transform: translateX(-104%); transition: transform .24s cubic-bezier(.2, .8, .2, 1);
    }
    .shell.menu-open .sidebar { transform: none; box-shadow: 30px 0 60px -20px rgba(0, 0, 0, .6); }
    .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(2, 6, 23, .55); opacity: 0; pointer-events: none; transition: opacity .2s; }
    .shell.menu-open .scrim { opacity: 1; pointer-events: auto; }
    .topbar {
        display: flex; align-items: center; gap: .55rem; position: sticky; top: 0; z-index: 20; padding: .55rem .8rem;
        background: var(--chrome); border-bottom: 1px solid var(--line); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    }
    .topbar .brand { flex: 1; padding: 0; }
    .topbar .logo { width: 32px; height: 32px; border-radius: 10px; }
    .page { padding: 1.1rem .85rem 3rem; }
}
@media (max-width: 420px) { .topbar .brand-text small { display: none; } }

/* Surfaces ------------------------------------------------------------------------------------------ */
.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.3rem 1.4rem; margin-bottom: 1rem; box-shadow: var(--shadow);
}
.card > h2:first-child, .card > .row:first-child h2 { margin-bottom: .5rem; }
@media (max-width: 600px) { .card { padding: 1rem; border-radius: 14px; } }
.narrow { max-width: 480px; margin: 1.5rem auto; }
.stack { display: flex; flex-direction: column; gap: .9rem; }
.center { text-align: center; }
.muted { color: var(--muted); }
.label { font-weight: 600; margin-top: 1rem; }
.error { color: var(--danger); font-weight: 500; }
.warning { color: var(--warn); }
.ok { color: var(--ok); font-weight: 500; }
p.error, ul.error, p.ok, p.warning {
    padding: .6rem .85rem; border-radius: var(--radius-sm); border: 1px solid; border-left-width: 3px;
}
p.error, ul.error { background: color-mix(in srgb, var(--danger) 10%, transparent); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
ul.error { list-style: none; margin: .5rem 0; }
p.ok { background: color-mix(in srgb, var(--ok) 10%, transparent); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
p.warning { background: color-mix(in srgb, var(--warn) 10%, transparent); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
p.small.warning, p.small.error { padding: .35rem .6rem; }
p.error:empty, ul.error:empty, p.ok:empty, p.warning:empty { display: none; }
.attention { border-color: color-mix(in srgb, var(--warn) 55%, transparent); background: color-mix(in srgb, var(--warn) 7%, var(--surface)); }

/* Forms ----------------------------------------------------------------------------------------------- */
label { display: flex; flex-direction: column; gap: .35rem; font-weight: 500; font-size: .92rem; color: var(--ink-2); }
input[type=text], input[type=email], input[type=tel], input[type=search], input[type=date], input[type=datetime-local],
input[type=month], input[type=number], input[type=password], select, textarea {
    font: inherit; font-size: .95rem; color: var(--ink); width: 100%; padding: .62rem .8rem;
    border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--input-bg);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
select {
    appearance: none; -webkit-appearance: none; padding-right: 2.1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b9ab3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .6rem center; background-size: 1rem;
}
textarea { resize: vertical; }
textarea.name-box { resize: none; field-sizing: content; min-height: calc(2lh + 1.24rem + 2px); line-height: 1.35; overflow-wrap: anywhere; }
::placeholder { color: var(--muted); opacity: .75; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line-strong)); }
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft), 0 0 22px -8px var(--accent);
}
label.check { flex-direction: row; align-items: center; gap: .6rem; font-weight: 400; margin: .8rem 0; color: var(--ink); }
label.check input, input[type=checkbox], input[type=radio] { width: 20px; height: 20px; flex: none; accent-color: #6366f1; }

button, .button {
    font: inherit; font-weight: 600; font-size: 1.06rem; line-height: 1.2; border-radius: 12px; padding: .72rem 1.2rem;
    border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); cursor: pointer;
    text-align: center; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    transition: transform .12s, box-shadow .2s, background .2s, border-color .2s, color .2s, filter .2s;
}
button:active:not(:disabled), .button:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, .button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.primary {
    background: var(--grad); color: #fff; border-color: transparent;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 10px 26px -14px rgba(99, 102, 241, .9);
}
.primary:hover:not(:disabled) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), var(--glow); filter: brightness(1.08); }
.secondary { background: var(--surface-2); color: var(--ink); border-color: var(--line-strong); }
.secondary:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.danger { background: linear-gradient(120deg, #e11d48, #be123c); color: #fff; border-color: transparent; }
.danger:hover:not(:disabled) { box-shadow: 0 0 0 1px rgba(251, 113, 133, .5), 0 10px 30px -10px rgba(244, 63, 94, .7); }
.big { width: 100%; padding: 1.1rem 1.15rem; font-size: 1.2rem; margin: .8rem 0; border-radius: 12px; }
.link {
    background: none; border: 0; padding: .2rem 0; color: var(--accent); font-weight: 500;
    text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); text-underline-offset: 3px;
}
.link:hover { text-decoration-color: var(--accent); box-shadow: none; }
.small-btn { padding: .44rem .8rem; font-size: .98rem; }
.file { position: relative; overflow: hidden; }
.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
fieldset { border: 1px solid var(--line); border-radius: 12px; margin: .6rem 0; padding: .7rem 1rem; }
legend { font-weight: 600; padding: 0 .35rem; color: var(--ink); font-family: var(--font-display); }
label.inline { flex-direction: row; align-items: center; gap: .5rem; font-weight: 400; }
label.inline select { width: auto; padding: .42rem 2rem .42rem .6rem; }
details { margin: .8rem 0; }
summary { cursor: pointer; color: var(--accent); font-weight: 600; padding: .3rem 0; list-style: none; display: flex; align-items: center; gap: .4rem; }
summary::-webkit-details-marker { display: none; }
summary::before { content: ""; width: .5rem; height: .5rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin: 0 .2rem; }
details[open] > summary::before { transform: rotate(45deg); }

/* Onboarding ------------------------------------------------------------------------------------- */
.steps { display: flex; gap: .5rem; list-style: none; padding: 0; margin: 0 0 1.25rem; counter-reset: s; }
.steps li { flex: 1; text-align: center; font-size: .82rem; color: var(--muted); border-top: 3px solid var(--line); padding-top: .45rem; counter-increment: s; }
.steps li::before { content: counter(s) ". "; }
.steps li.done { border-color: var(--ok); color: var(--ok); }
.steps li.now { border-image: var(--grad) 1; color: var(--ink); font-weight: 600; }
.terms { white-space: pre-wrap; line-height: 1.6; max-height: 40vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .9rem; background: var(--input-bg); }
canvas.signature { width: 100%; aspect-ratio: 5 / 2; border: 2px dashed var(--line-strong); border-radius: 12px; background: #fff; touch-action: none; display: block; }
.signature-view { max-width: 100%; height: 110px; object-fit: contain; background: #fff; border-radius: 8px; border: 1px solid var(--line); }
.request-head { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: .5rem; }
.request-head > div { min-width: 0; overflow-wrap: anywhere; }
.request fieldset { margin: 1rem 0; }
.roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.roles label.check { margin: .35rem 0; }
.request > label { margin-bottom: 1rem; }

/* Home ------------------------------------------------------------------------------------------- */
.avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--surface-2); flex: none; }
.avatar.sm { width: 40px; height: 40px; }
.avatar-lg { width: 76px; height: 76px; box-shadow: 0 0 0 2px var(--surface-solid), 0 0 0 4px rgba(99, 102, 241, .6), 0 0 30px -4px rgba(34, 211, 238, .6); }
.avatar.empty { display: grid; place-items: center; color: var(--muted); font-weight: 700; font-size: .85rem; border: 1px solid var(--line-strong); }
.avatar-lg.empty .icon { width: 34px; height: 34px; }
.hero {
    position: relative; overflow: hidden; display: flex; align-items: center; gap: 1.3rem; margin-bottom: .6rem;
    padding: 1.7rem 1.9rem; border-radius: 22px; border: 1px solid var(--line); box-shadow: var(--shadow);
    background: linear-gradient(135deg, rgba(99, 102, 241, .18), rgba(34, 211, 238, .07) 55%, transparent), var(--surface);
}
.hero::after {
    content: ""; position: absolute; right: -90px; top: -110px; width: 320px; height: 320px; border-radius: 50%; pointer-events: none;
    background: radial-gradient(circle, rgba(168, 85, 247, .32), transparent 65%);
}
.hero-text { position: relative; z-index: 1; min-width: 0; }
.hero h1 { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.6rem); margin: .15rem 0 .1rem; }
.hero .muted { margin: 0; }
.grad { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { margin: 0; font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.section-title { margin: 1.7rem 0 .8rem; font-family: var(--font); font-size: .74rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 1rem; }
.stat {
    --tone: var(--t-cyan); position: relative; overflow: hidden; display: flex; align-items: flex-start; gap: .95rem;
    padding: 1.15rem 1.1rem; border-radius: 18px; border: 1px solid var(--line); background: var(--surface);
    color: var(--ink); text-decoration: none; box-shadow: var(--shadow); transition: transform .18s, border-color .18s, box-shadow .18s;
}
.stat::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(420px 150px at 0% 0%, color-mix(in srgb, var(--tone) 15%, transparent), transparent 70%); }
.stat:hover {
    transform: translateY(-2px); border-color: color-mix(in srgb, var(--tone) 55%, transparent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--tone) 30%, transparent), 0 20px 44px -22px color-mix(in srgb, var(--tone) 75%, transparent);
}
.stat-icon {
    position: relative; display: grid; place-items: center; width: 50px; height: 50px; flex: none; border-radius: 15px; color: var(--tone);
    background: color-mix(in srgb, var(--tone) 13%, transparent); border: 1px solid color-mix(in srgb, var(--tone) 32%, transparent);
    box-shadow: 0 0 24px -8px var(--tone);
}
.stat-icon .icon { width: 25px; height: 25px; }
.stat.tone-brand .stat-icon { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 10px 26px -10px rgba(99, 102, 241, .9); }
.stat-body { position: relative; display: flex; flex-direction: column; gap: .12rem; min-width: 0; flex: 1; }
.stat-num { font-family: var(--font-display); font-size: 2.05rem; font-weight: 700; line-height: 1.05; letter-spacing: -.03em; color: var(--ink-2); }
.stat-num.live { color: var(--tone); text-shadow: 0 0 26px color-mix(in srgb, var(--tone) 45%, transparent); }
.stat-title { font-weight: 600; }
.stat-detail { color: var(--muted); font-size: .85rem; }
.stat-go { position: relative; align-self: center; color: var(--muted); transition: transform .18s, color .18s; }
.stat:hover .stat-go { transform: translateX(3px); color: var(--tone); }
.stats.small { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.stats.small .stat { padding: .9rem 1rem; align-items: center; }
.stats.small .stat-icon { width: 44px; height: 44px; border-radius: 13px; }
.stats.small .stat-num { font-size: 1.5rem; }
.tone-cyan { --tone: var(--t-cyan); } .tone-violet { --tone: var(--t-violet); } .tone-amber { --tone: var(--t-amber); }
.tone-green { --tone: var(--t-green); } .tone-pink { --tone: var(--t-pink); } .tone-indigo { --tone: var(--t-indigo); }
.tone-slate { --tone: var(--t-slate); } .tone-brand { --tone: var(--t-indigo); }
@media (max-width: 600px) {
    .hero { padding: 1.1rem; gap: .9rem; border-radius: 18px; }
    .hero .muted { font-size: .82rem; }
    .avatar-lg { width: 54px; height: 54px; }
    .stats, .stats.small { grid-template-columns: 1fr 1fr; gap: .65rem; }
    .stat, .stats.small .stat { flex-direction: column; align-items: flex-start; gap: .55rem; padding: .9rem; border-radius: 16px; }
    .stat-go { display: none; }
    .stat-num { font-size: 1.6rem; }
    .stat-title { font-size: .92rem; line-height: 1.25; }
    .stat-detail { font-size: .78rem; }
    .stat-icon, .stats.small .stat-icon { width: 44px; height: 44px; border-radius: 13px; }
}
/* Older tiles, still used on a few pages. */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .8rem; margin-top: 1rem; }
.tile { display: flex; flex-direction: column; gap: .3rem; padding: 1.1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.tile span { color: var(--muted); font-size: .9rem; }
a.tile:hover { border-color: var(--accent); }
.hello { display: flex; align-items: center; gap: 1rem; }

/* Layout helpers ------------------------------------------------------------------------------------ */
.row { display: flex; align-items: center; gap: .6rem; }
.between { justify-content: space-between; }
.gap { gap: .6rem; }
.wrap { flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .8rem; }
.span2 { grid-column: span 2; }
@media (max-width: 520px) { .span2 { grid-column: auto; } }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--font-mono); letter-spacing: .01em; font-feature-settings: "zero" 1; }
.small { font-size: .85rem; }
.danger-text { color: var(--danger); }
.table-wrap { overflow-x: auto; }
.page > .row.between:first-child h1, .page > div > .row.between:first-child h1 { margin: 0; }
.page > .row.between:first-child, .page > div > .row.between:first-child { margin-bottom: .6rem; }

/* Tables and tags -------------------------------------------------------------------------------------- */
table.list { width: 100%; border-collapse: separate; border-spacing: 0; }
table.list th, table.list td { text-align: left; padding: .62rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th {
    font-size: .7rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
    background: var(--surface-2); white-space: nowrap;
}
table.list thead th:first-child { border-top-left-radius: 10px; }
table.list thead th:last-child { border-top-right-radius: 10px; }
table.list tbody tr { transition: background .12s; }
table.list tbody tr:hover { background: var(--surface-hover); }
table.list tbody tr:last-child td { border-bottom: 0; }
table.list tr.muted td { opacity: .55; }
table.list.compact td { padding: .32rem .45rem; }
table.list a { font-weight: 600; text-decoration: none; }
table.list a:hover { text-decoration: underline; }
table.list a .mono, table.list a.mono { text-shadow: 0 0 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.tag {
    display: inline-flex; align-items: center; gap: .38rem; margin: .1rem .25rem .1rem 0; padding: .16rem .6rem; border-radius: 999px;
    font-size: .72rem; font-weight: 600; letter-spacing: .01em; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line);
}
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.tag.good { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); border-color: color-mix(in srgb, var(--ok) 32%, transparent); }
.tag.bad { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: color-mix(in srgb, var(--danger) 32%, transparent); }
.tag.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); border-color: color-mix(in srgb, var(--warn) 32%, transparent); }
.tag.info { color: var(--info); background: color-mix(in srgb, var(--info) 12%, transparent); border-color: color-mix(in srgb, var(--info) 32%, transparent); }
.tag.good::before, .tag.bad::before, .tag.warn::before, .tag.info::before { box-shadow: 0 0 8px currentColor; }
.tabs {
    display: inline-flex; flex-wrap: wrap; gap: .25rem; max-width: 100%; margin: .4rem 0 1.1rem; padding: .3rem;
    border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line);
}
.tab { background: transparent; border: 0; color: var(--ink-2); padding: .6rem 1.1rem; border-radius: 11px; font-weight: 600; font-size: 1.01rem; }
.tab:hover { color: var(--ink); background: var(--surface-hover); }
.tab.active {
    color: var(--ink); background: var(--surface-solid);
    box-shadow: inset 0 -2px 0 var(--accent), 0 0 0 1px var(--line-strong), 0 8px 20px -12px rgba(0, 0, 0, .7);
}
form.search, input.search { flex: 1; min-width: 220px; margin: .6rem 0; }
input.search, form.search input[type=search], form.search input[type=text] {
    padding-left: 2.3rem; background-repeat: no-repeat; background-position: .75rem center; background-size: 1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b9ab3' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m21 21-4.34-4.34'/%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3C/svg%3E");
}
ul.messages, ul.notes, ul.codes, ul.checks, ul.picker { list-style: none; padding: 0; margin: .5rem 0; }
ul.messages li { padding: .3rem 0; }
ul.notes li { color: var(--warn); font-size: .9rem; }
ul.notes li::before { content: "⚠ "; }
ul.codes li { padding: .35rem 0; border-bottom: 1px solid var(--line); }
.actions { display: flex; flex-direction: column; gap: .5rem; padding: .8rem 0; }
.actions.sticky {
    position: sticky; bottom: 0; z-index: 5; padding: .8rem 0 1rem; border-top: 1px solid var(--line);
    background: linear-gradient(to top, var(--bg) 70%, transparent);
}
dl.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .6rem 1rem; margin: .5rem 0 0; }
dl.facts dt { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
dl.facts dd { margin: .1rem 0 0; font-weight: 500; }

/* Reception ------------------------------------------------------------------------------------------- */
.client-picker .picker { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--input-bg); }
.pick { display: block; width: 100%; text-align: left; background: transparent; color: var(--ink); border: 0; border-bottom: 1px solid var(--line); border-radius: 0; font-weight: 400; padding: .6rem .8rem; }
.pick:hover { background: var(--surface-hover); }
.inline-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .6rem; align-items: end; padding: .8rem; border: 1px dashed var(--line-strong); border-radius: 12px; }
.sample { position: relative; }
.sample::before { content: ""; position: absolute; left: -1px; top: 16px; bottom: 16px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); box-shadow: 0 0 14px rgba(34, 211, 238, .5); }
.sample-body { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1rem; align-items: start; }
.sample-body .grid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: .6rem; }
.sample-body input[type=text], .sample-body input[type=date], .sample-body input[type=number], .sample-body select { padding: .5rem .6rem; }
.sample-body select { padding-right: 2rem; }
.sample-body fieldset.analyses { grid-template-columns: 1fr; margin: 0; max-height: 34rem; overflow: auto; }
.sample-body label.check { margin: .3rem 0; }
.subcontract { padding: .7rem; border: 1px dashed color-mix(in srgb, var(--warn) 60%, transparent); border-radius: 12px; }
.registru input[type=month] { width: auto; padding: .6rem; }
@media (max-width: 1000px) { .sample-body { grid-template-columns: 1fr; } }
fieldset.analyses { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .2rem .9rem; }
fieldset.analyses legend { grid-column: 1 / -1; }
.analysis { display: flex; align-items: center; gap: .5rem; padding: .2rem 0; }
.analysis label.check { margin: 0; flex: 1; }
input.units { width: 4.2rem; padding: .35rem; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--input-bg); color: var(--ink); }
.attachments { display: flex; flex-wrap: wrap; gap: .6rem; margin: .6rem 0; }
.thumb { display: flex; flex-direction: column; align-items: center; gap: .25rem; font-size: .8rem; text-decoration: none; }
.thumb img { width: 120px; height: 90px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); transition: box-shadow .15s; }
.thumb:hover img { box-shadow: var(--glow); }
.phone { max-width: 560px; margin: 0 auto; }
.pv-preview { width: 100%; max-height: 260px; object-fit: contain; border-radius: 12px; border: 1px solid var(--line); }
p.site-saved { margin: .2rem 0 0; }
table.results-grid th { min-width: 8rem; text-transform: none; letter-spacing: 0; font-size: .82rem; color: var(--ink-2); white-space: normal; }
table.results-grid td:not(:first-child) { font-size: 1.02rem; }
input.result-input { font-family: var(--font-mono); font-size: .95rem; padding: .45rem .55rem; min-width: 6rem; }
.sub-result { display: inline-flex; flex-direction: row; align-items: center; gap: .3rem; }
.sub-result input { width: 7rem; }

/* Labels --------------------------------------------------------------------------------------------- */
.label-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .5rem; margin: .6rem 0; }
.label-grid .label { margin: 0; font-weight: 400; background: #fff; color: #000; border: 1px solid #c8ced6; border-radius: 6px; padding: .45rem .55rem; font-size: .78rem; min-height: 90px; box-shadow: 0 10px 24px -16px rgba(0, 0, 0, .8); }
.label-grid .label p { margin: 0; line-height: 1.25; }
.label-code { display: block; font-family: var(--font-mono); font-size: .95rem; }
.label-grid .label.big p { font-size: 1.35rem; font-weight: 700; line-height: 1.15; }
/* Labels drawn at the printer's sizes: 62 x 21 mm = 496 x 168 dots, --dot pixels per dot, 10-dot border. */
.label-grid:has(.label.fitted) { grid-template-columns: repeat(auto-fill, minmax(calc(var(--dot) * 496 + 2px), 1fr)); }
.label-grid { --dot: .6px; --type-scale: .82; }
.label-grid .label.fitted { width: calc(var(--dot) * 496); height: calc(var(--dot) * 168); min-height: 0; padding: calc(var(--dot) * 8) calc(var(--dot) * 10); overflow: hidden; font-family: "Roboto Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif; font-stretch: condensed; font-weight: 700; }
.label-grid .label.fitted .label-bar { height: calc(var(--dot) * 50); margin-bottom: calc(var(--dot) * 4); max-width: 100%; }
.label-grid .label.fitted .label-bar .barcode, .label-grid .label.fitted .label-bar svg { width: 100%; height: 100%; display: block; }
.label-grid .label.fitted .label-code { font-family: inherit; line-height: 1; white-space: nowrap; overflow: hidden; margin-bottom: calc(var(--dot) * 2); }
.label-grid .label.fitted p, .label-grid .label.fitted.big p { line-height: 1; font-weight: 700; overflow-wrap: anywhere; }
.barcode svg { width: 100%; height: 40px; display: block; }

/* Scan-in --------------------------------------------------------------------------------------------- */
form.scan { display: flex; gap: .6rem; margin: 1rem 0; }
form.scan input {
    font-size: 1.45rem; padding: .95rem 1.1rem; font-family: var(--font-mono); letter-spacing: .04em;
    border-width: 1.5px; box-shadow: 0 0 0 1px rgba(34, 211, 238, .15), 0 0 40px -18px var(--accent);
}
form.scan input::placeholder { font-family: var(--font); letter-spacing: 0; font-size: 1.15rem; }
form.scan.nac input { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(240, 68, 56, .25), 0 0 40px -14px var(--danger); }
.scan-log { list-style: none; padding: 0; margin: 0; }
.scan-row {
    display: grid; grid-template-columns: minmax(150px, auto) 1fr auto; gap: 1rem; align-items: center; padding: .75rem .95rem; margin-bottom: .45rem;
    border-radius: 12px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line-strong);
}
.scan-row.good { border-left-color: var(--ok); box-shadow: -8px 0 24px -16px var(--ok); }
.scan-row.info { border-left-color: var(--info); box-shadow: -8px 0 24px -16px var(--info); }
.scan-row.bad { border-left-color: var(--danger); box-shadow: -8px 0 24px -16px var(--danger); }
.big-code { font-size: 1.3rem; font-weight: 700; font-family: var(--font-mono); }
.nac-bar { margin: -.4rem 0 .6rem; }
.nac-bar .grow { flex: 1; min-width: 220px; }
.scan-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .5rem; }
.scan-tile {
    display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; text-align: left; padding: .65rem .75rem; border-radius: 12px;
    border: 1px solid var(--line); border-left: 4px solid var(--t-amber); background: var(--surface-2); color: inherit; cursor: pointer; font-weight: 500;
}
.scan-tile.partial { border-left-color: var(--info); }
.scan-tile:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
/* On-screen barcodes to scan off the lab TV: black on white with a quiet zone, whatever the theme. */
.scan-bar { display: block; align-self: stretch; background: #fff; padding: .5rem 1rem; border-radius: 6px; margin-bottom: .3rem; }
.scan-bar .barcode svg { height: 64px; }
.nac-screen { display: flex; flex-direction: column; align-items: center; gap: .1rem; width: 260px; margin: 0; color: #000; border: 2px solid var(--line); }
.nac-screen .barcode { align-self: stretch; }
.nac-screen.active { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(240, 68, 56, .25); color: var(--danger); font-weight: 700; }
.nac-label { max-width: 260px; background: #fff; color: #000; border: 1px solid #c8ced6; border-radius: 6px; padding: .5rem; margin: .5rem 0; }

/* Worksheets ------------------------------------------------------------------------------------------ */
.ws-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: .8rem 0; }
.ws-head h2 { font-weight: 500; }
.equipment { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .5rem; }
.equipment label.check { margin: .25rem 0; font-size: .9rem; }
table.ws-rows td { vertical-align: middle; }
input.plate { width: 5rem; text-align: right; padding: .45rem .5rem; }
table.ws-rows input[type=text], table.ws-rows select { padding: .45rem .5rem; }
td.result { font-size: 1.02rem; min-width: 8rem; }
.signature-block { border-style: dashed; }
.signature-placeholder { border: 2px dashed var(--line-strong); border-radius: 12px; padding: 1.4rem 1rem; text-align: center; color: var(--muted); font-style: italic; }
.ws-title { margin: .4rem 0 0; font-size: 1.1rem; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .5rem 1rem; margin: .6rem 0; }
label.doc-field { font-weight: 500; font-size: .85rem; gap: .2rem; margin: .3rem 0; }
.doc-label { font-weight: 600; margin: .6rem 0 .2rem; }
.ws-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.sig-box { border: 1px solid #c8ced6; border-radius: 4px; padding: .6rem .8rem; min-height: 120px; }
.form-footer { border-top: 1px solid #000; margin-top: 1rem; padding-top: .3rem; text-align: right; }
@media (max-width: 720px) { .ws-signatures { grid-template-columns: 1fr; } }

/* Paper: the fișă, the buletin and the labels stay black on white whatever the theme. */
.sheet, .label-grid .label, .nac-label {
    --heading: #0b1324; --ink: #0b1324; --ink-2: #334155; --muted: #5b6b82; --line: #d0d5dd; --line-strong: #b8c0cc;
    --surface: #ffffff; --surface-solid: #ffffff; --surface-2: #f2f4f7; --surface-hover: #f4f8fc; --input-bg: #ffffff;
    --accent: #0e7490; --accent-soft: rgba(14, 116, 144, .12); color-scheme: light;
}
.sheet {
    position: relative; background: #fff; color: #000; border: 1px solid #d0d5dd; border-radius: 6px; padding: 1.6rem 1.8rem; margin-bottom: 1rem;
    font-family: "Times New Roman", Times, serif; font-size: 11pt; box-shadow: 0 30px 70px -36px rgba(0, 0, 0, .85), 0 0 0 1px rgba(255, 255, 255, .03);
}
.sheet h1, .sheet h2, .sheet h3 { color: #000; }
.ws-sheet { font-family: var(--font); font-size: .95rem; }
.ws-sheet h3 { margin: 1rem 0 .4rem; font-size: .95rem; text-transform: uppercase; letter-spacing: .02em; }
.ws-sheet input, .ws-sheet select, .ws-sheet textarea { background-color: #fff; color: #000; border-color: #c8ced6; padding: .35rem .5rem; }
.ws-sheet select { padding-right: 2rem; }
.ws-sheet table.doc td input { width: 100%; }
.ws-sheet .equipment label.check, .ws-sheet label { color: #000; }
.ws-sheet table.list th { background: #f2f4f7; color: #333; }
/* Readings per eșantion: one narrow column per stage observation or weighing. */
table.ws-readings th { text-align: center; font-size: .78rem; font-weight: 600; text-transform: none; letter-spacing: 0; white-space: normal; }
table.ws-readings td { text-align: center; vertical-align: middle; }
table.ws-readings input.reading { width: 5.5rem; text-align: right; }
table.ws-readings select.reading { width: 4.2rem; padding-right: 1.6rem; background-position: right .3rem center; }
.ws-procedure, .ws-calculation { margin: .4rem 0; }
.ws-sheet { color: var(--ws-text, #000); }
.ws-sheet .ws-title { color: var(--ws-title, #000); }
.ws-sheet h3 { color: var(--ws-heading, #000); }
/* A font chosen in the fișe editor applies to the titles too. */
.ws-sheet[style*="font-family"] h2, .ws-sheet[style*="font-family"] h3 { font-family: inherit; }
.ws-sheet input, .ws-sheet select, .ws-sheet textarea { font-family: inherit; }
.ws-blocks { margin: .6rem 0; }
.ws-block-title { margin: .9rem 0 .3rem; }
.ws-block-text { margin: .35rem 0; white-space: pre-line; }
label.ws-block-field { max-width: 32rem; }
label.check.ws-block-check { margin: .4rem 0; }
.ws-sheet .invalid, .ws-sheet input.invalid, .ws-sheet select.invalid { border-color: #b42318 !important; background-color: #fff1f0 !important; }
table.ws-readings input.reading-check { margin: 0 auto; }

/* Fișe editor -------------------------------------------------------------------------------------- */
.editor-pick label { min-width: 12rem; }
.editor-pick .end, .editor-actions .end { align-items: flex-end; }
.editor-head { margin-top: 1rem; align-items: flex-start; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .5rem 1rem; margin: .5rem 0; }
.form-grid .span2 { grid-column: span 2; }
.color-field input[type=color] { width: 3.2rem; height: 2.4rem; padding: .15rem; cursor: pointer; }
.editor-actions .grow { flex: 1; min-width: 14rem; }
.editor-versions ul { margin: .4rem 0; padding-left: 1.2rem; }
.editor-versions li { margin: .25rem 0; }
@media (max-width: 520px) { .form-grid .span2 { grid-column: auto; } }
/* The designer: toolbox | wide fișă that scrolls sideways | properties of what is picked. */
/* The editor uses the whole window: the fișă needs the width. */
.page:has(> .sheet-editor) { max-width: none; padding-left: 1.2rem; padding-right: 1.2rem; }
.page.sheet-editor { max-width: none; padding: 0; }
.designer {
    --tools-w: 11.5rem; --props-w: 19rem;
    display: grid; grid-template-columns: var(--tools-w) minmax(0, 1fr) var(--props-w); gap: 1rem; align-items: start; margin-top: 1rem;
}
/* Adjustable: a slim toolbox (icons only), the properties floating over the fișă, the whole window. */
.designer.slim-tools { --tools-w: 3.6rem; }
.designer.slim-tools .toolbox { padding: .5rem .35rem; }
.designer.slim-tools .toolbox > p, .designer.slim-tools .tool > span:not(.tool-glyph), .designer.slim-tools .tool-list { display: none; }
.designer.slim-tools .tool { justify-content: center; padding: .35rem 0; }
.designer.slim-tools .tool-glyph { flex: none; }
.panel-toggle { display: block; margin: 0 0 .3rem auto; }
.designer.float-props { grid-template-columns: var(--tools-w) minmax(0, 1fr); }
.designer.float-props .props {
    position: fixed; right: 1.2rem; top: auto; bottom: 7.5rem; width: 21rem; max-height: calc(100vh - 16rem); z-index: 40;
    background: var(--surface-solid); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .7);
}
.designer.float-props .props.empty { display: none; }
.designer.full {
    position: fixed; inset: 0; z-index: 60; margin: 0; padding: .8rem 1rem; background: var(--bg, #0b1020); overflow: hidden;
}
.designer.full .toolbox, .designer.full:not(.float-props) .props { max-height: calc(100vh - 1.6rem); }
.designer.full.float-props .props { bottom: 1rem; max-height: calc(100vh - 6rem); }
.designer.full .canvas-wrap { max-height: calc(100vh - 5.5rem); height: calc(100vh - 5.5rem); }
.canvas-view { align-items: center; }
/* A date default counted from the day the fișă is opened. */
.day-offset { margin: .3rem 0 .5rem; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 10px; }
.day-offset .row button { min-width: 2.8rem; }
.day-offset button.active { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.canvas-view label.check { display: inline-flex; gap: .35rem; align-items: center; margin: 0; }
/* The width of the fișă in the canvas. */
.designer[data-width=wide] .canvas .sheet { width: 1500px; }
.designer[data-width=xwide] .canvas .sheet { width: 1900px; }
.designer[data-width=fit] .canvas { width: auto; }
/* All the room there is, never narrower than the normal page. */
.designer[data-width=fit] .canvas .sheet { width: auto; min-width: 1180px; }
.toolbox, .props {
    position: sticky; top: 1rem; max-height: calc(100vh - 14rem); overflow: auto; background: var(--surface); border: 1px solid var(--line);
    border-radius: 14px; padding: .8rem;
}
.toolbox { padding: .7rem .6rem; }
.toolbox-group { margin: .7rem 0 .3rem; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tool-grid { display: flex; flex-direction: column; gap: .3rem; }
.tool {
    display: flex; align-items: center; gap: .5rem; padding: .35rem .5rem; min-height: 2.3rem; font-size: .82rem; line-height: 1.15;
    text-align: left; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 9px; cursor: grab;
}
.tool:hover { border-color: var(--accent); background: var(--surface-hover); }
.tool:active { cursor: grabbing; }
.tool-glyph { flex: 0 0 1.7rem; text-align: center; font-size: 1rem; font-weight: 700; color: var(--accent); font-family: Georgia, serif; }
.tool-list { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; }
.tool-list .link.active { font-weight: 700; text-decoration: underline; }
.canvas-col { min-width: 0; }
.canvas-bar { margin-bottom: .5rem; align-items: center; }
.canvas-bar select { width: auto; }
.canvas-hint { margin: 0 0 .5rem; }
.canvas-wrap {
    overflow: auto; max-height: calc(100vh - 15rem); min-height: 24rem; padding: 1rem; border-radius: 14px; border: 1px solid var(--line);
    background: repeating-linear-gradient(45deg, var(--surface-2) 0 10px, transparent 10px 20px);
}
/* Wide like a landscape page, so the readings table has room; the wrapper scrolls sideways when the window is narrower. */
.canvas { width: max-content; min-width: 100%; }
.canvas .sheet { width: 1180px; margin: 0 auto; }
.canvas [data-sel] { cursor: pointer; }
.canvas [data-sel]:hover { outline: 1px dashed #0e7490; outline-offset: 2px; }
.canvas [draggable=true] { cursor: grab; }
.canvas .ws-block { padding: .1rem .3rem; border-radius: 4px; }
.canvas .ws-blocks[data-drop] { min-height: 1.6rem; border-radius: 6px; }
.drop-zone, .drop-hint {
    margin: .5rem 0; padding: .7rem .9rem; border: 2px dashed #b8c0cc; border-radius: 8px; color: #5b6b82; font-size: .85rem; text-align: center;
}
.drop-hint { padding: .4rem .6rem; }
/* While an element is dragged, the places that take it light up. */
.canvas[data-dragging=blocks] .ws-blocks[data-drop],
.canvas[data-dragging=readings] [data-drop=readings],
.canvas[data-dragging=controls] [data-drop=controls],
.canvas[data-dragging=stages] [data-drop=stages] { outline: 2px dashed #0e7490; outline-offset: 3px; }
.canvas[data-dragging=blocks] .drop-hint, .canvas[data-dragging] .drop-zone { border-color: #0e7490; color: #0e7490; }
.props .prop-body label { display: block; margin: .45rem 0; }
.props .prop-body label.check { display: flex; }
.prop-tools { margin: .3rem 0 .6rem; }
.prop-tools .icon-btn { width: 2.2rem; height: 2.2rem; display: inline-grid; place-items: center; }
.prop-tools .danger:hover:not(:disabled) { color: #f97066; border-color: #f97066; }
@media (max-width: 1400px) { .designer:not(.slim-tools) { --tools-w: 10.5rem; } .designer { --props-w: 16.5rem; } }
@media (max-width: 1050px) {
    .designer:not(.float-props) { grid-template-columns: var(--tools-w) minmax(0, 1fr); }
    .designer:not(.float-props) .props { grid-column: 1 / -1; position: static; max-height: none; }
}
@media (max-width: 800px) {
    .designer { grid-template-columns: 1fr; }
    .toolbox { position: static; max-height: none; }
}
@media (max-width: 720px) { .sheet { padding: 1rem; } }

/* Buletin review --------------------------------------------------------------------------------------- */
.review { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1rem; align-items: start; }
@media (max-width: 1100px) { .review { grid-template-columns: 1fr; } }
.review-side { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; }
li.check { padding: .6rem 0; border-bottom: 1px solid var(--line); }
li.check.done { opacity: .7; }
.check-actions { display: flex; flex-direction: column; gap: .4rem; margin-top: .4rem; }
.check-actions select { width: auto; flex: 1; padding: .4rem 2rem .4rem .5rem; font-size: .85rem; }
.check-actions input { padding: .45rem .6rem; }
.correction summary { color: var(--ink); }
input.short { width: 7.5rem; padding: .35rem .5rem; }
.buletin { color: #000; }
.buletin.draft .sheet::before { content: "CIORNĂ"; position: absolute; inset: 35% 0 auto; text-align: center; font-size: 5rem; font-weight: 800; color: rgba(180, 35, 24, .09); transform: rotate(-18deg); pointer-events: none; }
.letterhead { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 2px solid #10233f; padding-bottom: .5rem; margin-bottom: 1rem; }
.letterhead p { margin: 0; }
.draft-mark { color: #b42318; font-weight: 700; letter-spacing: .1em; }
table.doc { width: 100%; border-collapse: collapse; margin: .6rem 0; }
table.doc th, table.doc td { border: 1px solid #000; padding: .3rem .45rem; text-align: left; vertical-align: top; color: #000; }
table.doc th { background: #f2f4f7; font-weight: 600; }
table.doc.fields th { width: 26%; }
table.doc.results { table-layout: fixed; }
table.doc.results th { text-align: center; font-size: 9pt; overflow-wrap: anywhere; }
table.doc.results th.code-col { width: 7.5em; }
table.doc.results td { text-align: center; }
table.doc.results td:first-child { text-align: left; }
.method { font-weight: 400; color: #333; }
.limits { padding-left: 1.1rem; margin: .3rem 0 .8rem; }
.verdict { display: inline-block; margin-left: .4rem; font-family: var(--font); font-size: .75rem; padding: 0 .4rem; border-radius: 6px; background: #f2f4f7; }
.signatures { display: flex; justify-content: flex-end; margin: 1.2rem 0; }
.sig { display: inline-flex; flex-direction: column; align-items: center; min-width: 180px; }
.sig img { height: 60px; max-width: 200px; object-fit: contain; }
.disclaimer { border-top: 1px solid #000; padding-top: .4rem; margin-top: 1rem; }
.dosar-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; }
.dosar-photos img { width: 100%; border: 1px solid #ccc; border-radius: 4px; }
.dosar-photos figure { margin: 0; }
.dosar-photos + h3 { margin-top: 1rem; }
.dosar-history td { font-size: .85rem; vertical-align: top; }
.dosar-history td.nowrap { white-space: nowrap; }

/* Facturare: the table for SAGA --------------------------------------------------------------------- */
.period { align-items: end; margin: .6rem 0; }
.period input[type=date] { width: auto; padding: .5rem .6rem; }
table.saga td { font-size: .85rem; }
/* Istoric SAGA, Pe ani: ten columns that fit the page; numbers right-aligned on one line, headers may wrap. */
table.list.saga-years th { white-space: normal; text-align: right; vertical-align: bottom; line-height: 1.3; letter-spacing: .05em; padding: .55rem .5rem; }
table.list.saga-years td { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; padding: .55rem .5rem; }
table.list.saga-years th:first-child, table.list.saga-years td:first-child { text-align: left; padding-left: .8rem; }
table.list.saga-years .sub { display: block; font-size: .74rem; color: var(--muted); }
table.list.saga-years .year-tags { display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; margin-top: .2rem; }
table.list.saga-years .year-tags .tag { margin: 0; padding: .02rem .45rem; font-size: .66rem; white-space: nowrap; }

/* Import ------------------------------------------------------------------------------------------------ */
.import-report ul { margin: .4rem 0; }
.import-progress { margin: .7rem 0; }
.import-progress p { margin: .35rem 0; }
progress { -webkit-appearance: none; appearance: none; width: 100%; height: .75rem; border: 0; border-radius: 999px; overflow: hidden; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--grad); border-radius: 999px; box-shadow: 0 0 14px rgba(34, 211, 238, .7); transition: width .4s; }
progress::-moz-progress-bar { background: var(--grad); border-radius: 999px; }
progress:not([value]) { background: linear-gradient(90deg, transparent, var(--accent), transparent) no-repeat, var(--surface-2); background-size: 35% 100%, auto; animation: indeterminate 1.3s linear infinite; }
progress:not([value])::-webkit-progress-bar { background: transparent; }
@keyframes indeterminate { from { background-position: -40% 0, 0 0; } to { background-position: 140% 0, 0 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* Tickets (F6) -------------------------------------------------------------------------------------------- */
.feedback-btn { justify-content: flex-start; width: 100%; padding: .62rem .9rem; font-size: 1rem; color: var(--ink-2); }
.feedback-btn .icon { width: 21px; height: 21px; color: var(--accent); }
.feedback-btn:hover { border-color: var(--accent); color: var(--ink); box-shadow: 0 0 0 3px var(--accent-soft); }
kbd {
    margin-left: auto; padding: .1rem .45rem; border-radius: 6px; font-family: var(--font-mono); font-size: .78rem; font-weight: 600;
    color: var(--ink-2); background: var(--input-bg); border: 1px solid var(--line-strong); box-shadow: inset 0 -2px 0 var(--line-strong);
}
.modal-backdrop {
    position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 1rem;
    background: rgba(2, 6, 23, .55); backdrop-filter: blur(6px); animation: fade-in .15s ease-out;
}
.modal-backdrop.capturing { visibility: hidden; }
.modal {
    width: min(680px, 100%); max-height: calc(100vh - 2rem); overflow: auto; padding: 1.3rem 1.4rem;
    border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface-solid);
    box-shadow: 0 0 0 1px var(--accent-soft), 0 30px 80px -20px rgba(0, 0, 0, .8); animation: pop-in .18s ease-out;
}
.modal h2 { display: flex; align-items: center; gap: .5rem; margin: 0; }
.modal h2 .icon { color: var(--accent); }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.channels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin-top: .9rem; }
@media (max-width: 600px) { .channels { grid-template-columns: 1fr; } }
.channels button {
    --tone: var(--t-cyan); flex-direction: column; align-items: flex-start; gap: .25rem; padding: .85rem .9rem; text-align: left;
    background: color-mix(in srgb, var(--tone) 6%, var(--surface-2));
}
.channels button .icon { width: 24px; height: 24px; color: var(--tone); }
.channels button strong, .channels button small { white-space: normal; overflow-wrap: anywhere; }
.channels button small { font-weight: 400; font-size: .82rem; line-height: 1.3; color: var(--muted); }
.channels button:hover { border-color: color-mix(in srgb, var(--tone) 60%, transparent); }
.channels button.active {
    border-color: var(--tone); outline: 2px solid var(--tone); outline-offset: -1px;
    background: color-mix(in srgb, var(--tone) 18%, var(--surface-2));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone) 22%, transparent), 0 0 26px -8px var(--tone);
}
.channel { --tone: var(--t-cyan); display: inline-flex; align-items: center; gap: .35rem; color: var(--tone); font-weight: 600; white-space: nowrap; }
.channel .icon { width: 1.1em; height: 1.1em; }
.channel.bugs, .channels .bugs { --tone: var(--t-pink); }
.channel.soft, .channels .soft { --tone: var(--t-violet); }
.channel.proba, .channels .proba { --tone: var(--t-green); }
.page-ref { align-self: end; overflow-wrap: anywhere; padding-bottom: .4rem; }
.shot { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; margin-top: .8rem; }
.shot img { max-width: 100%; max-height: 260px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
ul.thread { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-direction: column; gap: .6rem; }
ul.thread li { padding: .8rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); }
ul.thread p { margin: .35rem 0 0; }
label.button { flex-direction: row; color: var(--ink); }
label.check.compact { margin: .2rem 0; font-size: .9rem; }
table.access td { min-width: 140px; }

/* The game-inspired looks (every theme but dark and light) share one layer driven by their variables:
   trim colour, glow, corner shapes, the main button and a background pattern. Each one then adds its
   own touches below. Original styling only: no game art, logos or fonts. ------------------------------ */
:root:not([data-theme=dark], [data-theme=light]) body {
    background:
        radial-gradient(1100px 620px at 0% -12%, var(--bg-glow-1), transparent 62%),
        radial-gradient(900px 540px at 100% -4%, var(--bg-glow-2), transparent 60%),
        radial-gradient(1000px 600px at 50% 125%, rgb(var(--glow-rgb) / .1), transparent 70%),
        var(--bg);
    background-attachment: fixed;
}
:root:not([data-theme=dark], [data-theme=light]) body::before { background-image: var(--pattern); background-size: var(--pattern-size); }
:root:not([data-theme=dark], [data-theme=light]) ::selection { background: rgb(var(--trim-rgb) / .45); color: #fff; }
:root:not([data-theme=dark], [data-theme=light]) h1 { letter-spacing: .005em; }
:root:not([data-theme=dark], [data-theme=light]) .eyebrow { color: var(--trim-ink); }
:root:not([data-theme=dark], [data-theme=light]) .sidebar { border-right-color: rgb(var(--trim-rgb) / .24); box-shadow: 1px 0 30px -12px rgb(var(--glow-rgb) / .35); }
:root:not([data-theme=dark], [data-theme=light]) .sidebar-foot { border-top-color: rgb(var(--trim-rgb) / .24); }
:root:not([data-theme=dark], [data-theme=light]) .logo { background: var(--trim-grad); border-radius: var(--cut-sm); box-shadow: none; clip-path: var(--logo-clip); }
:root:not([data-theme=dark], [data-theme=light]) .logo::after { border-radius: inherit; }
:root:not([data-theme=dark], [data-theme=light]) .logo span { color: var(--on-trim); }
:root:not([data-theme=dark], [data-theme=light]) .nav-group { color: var(--trim-ink); }
:root:not([data-theme=dark], [data-theme=light]) .nav-link { border-radius: var(--cut-sm); }
:root:not([data-theme=dark], [data-theme=light]) .nav-link[aria-current=page] {
    color: var(--heading); background: linear-gradient(90deg, rgb(var(--glow-rgb) / .2), rgb(var(--glow-rgb) / .06) 60%, transparent);
    box-shadow: inset 0 0 0 1px rgb(var(--trim-rgb) / .3);
}
:root:not([data-theme=dark], [data-theme=light]) .nav-link[aria-current=page]::before { background: var(--trim-grad); box-shadow: 0 0 14px rgb(var(--trim-rgb) / .9); }
:root:not([data-theme=dark], [data-theme=light]) .badge { background: var(--trim-grad); color: var(--on-trim); box-shadow: 0 0 14px -2px rgb(var(--trim-rgb) / .9); }
:root:not([data-theme=dark], [data-theme=light]) :is(.card, .stat, .tile, .scan-row) {
    border-radius: var(--cut);
    background-image: linear-gradient(90deg, transparent, rgb(var(--trim-rgb) / .6), transparent);
    background-size: 70% 1px; background-repeat: no-repeat; background-position: 50% 0;
}
:root:not([data-theme=dark], [data-theme=light]) .stat-icon { border-radius: var(--cut-sm); }
:root:not([data-theme=dark], [data-theme=light]) .stat.tone-brand .stat-icon { background: var(--trim-grad); color: var(--on-trim); box-shadow: 0 0 22px -6px rgb(var(--trim-rgb) / .9); }
:root:not([data-theme=dark], [data-theme=light]) .stat:hover { border-color: rgb(var(--trim-rgb) / .55); }
:root:not([data-theme=dark], [data-theme=light]) .hero {
    border-color: rgb(var(--trim-rgb) / .35); border-radius: var(--cut-hero);
    background: var(--hero-bg), var(--surface);
    box-shadow: var(--shadow), 0 0 70px -34px rgb(var(--glow-rgb) / .7);
}
:root:not([data-theme=dark], [data-theme=light]) .hero::after { background: radial-gradient(circle, rgb(var(--glow-rgb) / .35), transparent 65%); }
:root:not([data-theme=dark], [data-theme=light]) .hero::before {
    content: ""; position: absolute; left: 8%; right: 8%; bottom: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--trim) 30%, #fff 50%, var(--trim) 70%, transparent) 0 0 / 200% 100%;
    box-shadow: 0 0 14px rgb(var(--trim-rgb) / .8); animation: psi-flow 6s linear infinite;
}
@keyframes psi-flow { from { background-position: 100% 0; } to { background-position: -100% 0; } }
:root:not([data-theme=dark], [data-theme=light]) .avatar-lg { box-shadow: 0 0 0 2px var(--surface-solid), 0 0 0 4px rgb(var(--trim-rgb) / .75), 0 0 30px -4px rgb(var(--glow-rgb) / .7); }
:root:not([data-theme=dark], [data-theme=light]) :is(button, .button):not(.theme-card, .link, .pick, .scan-tile) { border-radius: var(--cut-sm); }
:root:not([data-theme=dark], [data-theme=light]) .theme-card, :root:not([data-theme=dark], [data-theme=light]) .theme-dot { border-color: rgb(var(--trim-rgb) / .4); }
:root:not([data-theme=dark], [data-theme=light]) .primary {
    background: var(--primary-bg); color: var(--on-primary); border: 1px solid var(--trim);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), inset 0 0 16px rgb(var(--glow-rgb) / .3), 0 0 22px -8px rgb(var(--glow-rgb) / .7);
    text-shadow: 0 0 10px rgb(var(--glow-rgb) / .6);
}
:root:not([data-theme=dark], [data-theme=light]) .primary:hover:not(:disabled) {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), inset 0 0 20px rgb(var(--glow-rgb) / .45), 0 0 0 1px rgb(var(--trim-rgb) / .6), 0 0 30px -6px rgb(var(--glow-rgb) / .9);
    filter: brightness(1.12);
}
:root:not([data-theme=dark], [data-theme=light]) .secondary:hover:not(:disabled) { border-color: var(--trim); color: var(--heading); box-shadow: 0 0 0 3px rgb(var(--trim-rgb) / .15); }
:root:not([data-theme=dark], [data-theme=light]) .tab.active { color: var(--heading); box-shadow: inset 0 -2px 0 var(--trim), 0 0 0 1px var(--line-strong), 0 8px 20px -12px rgba(0, 0, 0, .7); }
:root:not([data-theme=dark], [data-theme=light]) table.list th { color: var(--trim-ink); background: rgb(var(--trim-rgb) / .06); }
:root:not([data-theme=dark], [data-theme=light]) :is(input[type=checkbox], input[type=radio]) { accent-color: var(--trim); }
:root:not([data-theme=dark], [data-theme=light]) .modal { border-color: rgb(var(--trim-rgb) / .4); border-radius: var(--cut); }
:root:not([data-theme=dark], [data-theme=light]) :is(.modal h2 .icon, .feedback-btn .icon) { color: var(--trim); }
:root:not([data-theme=dark], [data-theme=light]) .stat.tone-brand .stat-icon .icon { color: var(--on-trim); }
:root:not([data-theme=dark], [data-theme=light]) .hero-badge { background: var(--trim-grad); color: var(--on-trim); border-radius: var(--cut-sm); }

/* Terran: plates and rivets, a yellow-and-black hazard strip, stencilled headings. */
:root[data-theme=terran] h1 { text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
:root[data-theme=terran] h2 { text-transform: uppercase; letter-spacing: .05em; font-size: 1.04rem; }
:root[data-theme=terran] .hero::before {
    left: 0; right: 0; height: 7px; box-shadow: none; animation: none;
    background: repeating-linear-gradient(-45deg, #ffa630 0 12px, #14181e 12px 24px);
}
:root[data-theme=terran] .hero::after { border-radius: 0; background: radial-gradient(circle, rgba(255, 96, 48, .22), transparent 65%); }
:root[data-theme=terran] :is(.card, .stat, .tile, .scan-row) {
    background-image: linear-gradient(#ffa630, #ffa630), linear-gradient(#ffa630, #ffa630), linear-gradient(#ffa630, #ffa630), linear-gradient(#ffa630, #ffa630);
    background-size: 14px 2px, 2px 14px, 14px 2px, 2px 14px;
    background-position: 0 0, 0 0, 100% 100%, 100% 100%;
    background-repeat: no-repeat;
}
:root[data-theme=terran] .primary { text-transform: uppercase; letter-spacing: .06em; font-size: .98rem; text-shadow: none; }
:root[data-theme=terran] .nav-link[aria-current=page]::before { width: 4px; border-radius: 0; }

/* Nova: targeting brackets on every panel and a slow scan line across the banner. */
:root[data-theme=nova] :is(.card, .stat, .tile, .scan-row, .modal) {
    background-image:
        linear-gradient(var(--trim), var(--trim)), linear-gradient(var(--trim), var(--trim)),
        linear-gradient(var(--trim), var(--trim)), linear-gradient(var(--trim), var(--trim)),
        linear-gradient(var(--trim), var(--trim)), linear-gradient(var(--trim), var(--trim)),
        linear-gradient(var(--trim), var(--trim)), linear-gradient(var(--trim), var(--trim));
    background-size: 12px 1px, 1px 12px, 12px 1px, 1px 12px, 12px 1px, 1px 12px, 12px 1px, 1px 12px;
    background-position: 0 0, 0 0, 100% 0, 100% 0, 0 100%, 0 100%, 100% 100%, 100% 100%;
    background-repeat: no-repeat;
}
:root[data-theme=nova] .hero::before {
    left: 0; right: 0; top: 0; bottom: auto; height: 1px; box-shadow: 0 0 18px 2px rgba(62, 240, 214, .6);
    background: linear-gradient(90deg, transparent, #9ffcf0, transparent); animation: nova-scan 5s ease-in-out infinite alternate;
}
@keyframes nova-scan { from { transform: translateY(0); opacity: .2; } 50% { opacity: 1; } to { transform: translateY(150px); opacity: .2; } }
:root[data-theme=nova] h1 { letter-spacing: .02em; text-shadow: 0 0 24px rgba(62, 240, 214, .35); }
:root[data-theme=nova] .eyebrow::before { content: "▸ "; }
:root[data-theme=nova] .primary { text-transform: uppercase; letter-spacing: .08em; font-size: .96rem; }

/* Zerg: rounded, uneven shapes that slowly breathe. */
:root[data-theme=zerg] .hero::after { animation: zerg-pulse 5s ease-in-out infinite; background: radial-gradient(circle, rgba(166, 240, 58, .2), rgba(194, 75, 234, .25) 40%, transparent 68%); }
@keyframes zerg-pulse { 50% { transform: scale(1.18); opacity: .7; } }
:root[data-theme=zerg] .hero::before { background: linear-gradient(90deg, transparent, #a6f03a 30%, #eaffc9 50%, #a6f03a 70%, transparent) 0 0 / 200% 100%; box-shadow: 0 0 14px rgba(166, 240, 58, .7); }
:root[data-theme=zerg] .logo { border-radius: 58% 42% 55% 45% / 45% 58% 42% 55%; }
:root[data-theme=zerg] .nav-link[aria-current=page]::before { background: #a6f03a; box-shadow: 0 0 14px rgba(166, 240, 58, .9); border-radius: 4px; }
:root[data-theme=zerg] .stat:hover { border-color: rgba(166, 240, 58, .5); }

/* Night Elf: a crescent moon over the banner, leaf-shaped corners. */
:root[data-theme=nightelf] .hero::after {
    right: 56px; top: 26px; width: 96px; height: 96px; background: none;
    box-shadow: inset -20px 8px 0 0 #e4ebff; filter: drop-shadow(0 0 18px rgba(200, 211, 245, .7)); opacity: .85;
}
:root[data-theme=nightelf] .hero::before { background: linear-gradient(90deg, transparent, #6ee8c4 30%, #fff 50%, #c8d3f5 70%, transparent) 0 0 / 200% 100%; box-shadow: 0 0 14px rgba(110, 232, 196, .6); }
:root[data-theme=nightelf] h1 { text-shadow: 0 0 30px rgba(140, 120, 255, .45); }
@media (max-width: 720px) { :root[data-theme=nightelf] .hero::after { width: 64px; height: 64px; right: 18px; top: 14px; box-shadow: inset -14px 6px 0 0 #e4ebff; } }

/* Human: a double rule round every panel, like a printed page, and a royal blue pennant on the banner. */
:root[data-theme=human] body::before { -webkit-mask-image: none; mask-image: none; }
:root[data-theme=human] :is(.card, .stat, .tile, .scan-row) {
    background-image: none; box-shadow: inset 0 0 0 3px var(--surface-solid), inset 0 0 0 4px rgba(184, 137, 43, .35), var(--shadow);
}
:root[data-theme=human] .hero::after {
    right: 44px; top: -2px; width: 64px; height: 118px; border-radius: 0; opacity: 1;
    background: linear-gradient(180deg, #2c5fbf, #163a80); box-shadow: inset 0 0 0 3px #c99a35;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
}
:root[data-theme=human] .hero::before { animation: none; background: linear-gradient(90deg, transparent, #b8892b 20%, #b8892b 80%, transparent); box-shadow: none; height: 3px; }
:root[data-theme=human] .primary { text-shadow: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 6px 16px -8px rgba(22, 58, 128, .7); }
:root[data-theme=human] h1 { font-weight: 700; letter-spacing: 0; }
:root[data-theme=human] ::selection { color: #2a2117; }
@media (max-width: 720px) { :root[data-theme=human] .hero::after { width: 40px; height: 74px; right: 16px; } }

/* Blood Elf: arched panel tops, gold filigree and embers rising from the banner. */
:root[data-theme=bloodelf] .hero::after { background: radial-gradient(circle, rgba(255, 110, 50, .4), rgba(200, 30, 40, .2) 40%, transparent 66%); animation: ember 7s ease-in-out infinite; }
@keyframes ember { 50% { transform: translateY(-14px) scale(1.06); opacity: .8; } }
:root[data-theme=bloodelf] h1 { text-shadow: 0 0 26px rgba(255, 110, 50, .35); }
:root[data-theme=bloodelf] .card { border-top-color: rgba(240, 192, 90, .45); }

/* High Elf: soft light, thin gold lines and a sun halo. */
:root[data-theme=highelf] body::before { -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 10%, transparent 75%); mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 10%, transparent 75%); }
:root[data-theme=highelf] .hero::after { background: radial-gradient(circle, rgba(255, 236, 170, .75), rgba(200, 160, 70, .18) 45%, transparent 68%); }
:root[data-theme=highelf] .primary { text-shadow: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 8px 22px -10px rgba(42, 116, 201, .7); }
:root[data-theme=highelf] h1 { font-weight: 600; letter-spacing: .01em; }
:root[data-theme=highelf] ::selection { color: #14306b; }
:root[data-theme=highelf] .nav-link[aria-current=page] { background: linear-gradient(90deg, rgba(42, 116, 201, .12), rgba(200, 160, 70, .06) 60%, transparent); }

/* Consum medii: calculator, recipe book and media -------------------------------------------------------- */
.consum-hero { margin-bottom: .2rem; }
.hero-badge {
    position: relative; z-index: 1; display: grid; place-items: center; flex: none; width: 64px; height: 64px; border-radius: 20px;
    background: var(--grad); color: #fff; box-shadow: 0 14px 34px -14px rgba(99, 102, 241, .95), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.hero-badge .icon { width: 32px; height: 32px; }
label.button { flex-direction: row; color: var(--ink); font-size: 1.06rem; }
a.tab { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; }
.tab .icon { width: 19px; height: 19px; opacity: .8; }
.tab.active .icon { color: var(--accent); opacity: 1; }
.swatch {
    display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 4px; vertical-align: -1px;
    background: var(--tone, var(--accent)); box-shadow: 0 0 10px -1px var(--tone, var(--accent));
}
.big-swatch { width: 34px; height: 34px; border-radius: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: .35rem 0 0; }
.chip {
    display: inline-flex; align-items: center; gap: .4rem; padding: .22rem .6rem; border-radius: 999px; font-size: .84rem;
    color: var(--ink-2); background: color-mix(in srgb, var(--tone, var(--accent)) 10%, var(--surface-2));
    border: 1px solid color-mix(in srgb, var(--tone, var(--accent)) 30%, var(--line));
}
.chip b { color: var(--ink); }
.chip.removable { padding-right: .25rem; }
.chip.removable button { padding: .1rem; border: 0; background: transparent; color: var(--muted); border-radius: 999px; }
.chip.removable button:hover { color: var(--danger); }
.chip .icon { width: 15px; height: 15px; }

.consum-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(330px, 1fr); gap: 1rem; align-items: start; }
.summary-card { position: sticky; top: 1rem; }
@media (max-width: 1100px) { .consum-grid { grid-template-columns: minmax(0, 1fr); } .summary-card { position: static; } }
.calc-card h2, .summary-card h2 { margin: 0; }
.calc-lines { display: flex; flex-direction: column; gap: .55rem; margin: .9rem 0 .4rem; }
.calc-line {
    display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(90px, .32fr) auto; gap: .6rem; align-items: start;
    padding: .7rem; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2);
    transition: border-color .15s, box-shadow .15s;
}
.calc-line:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 3px var(--accent-soft); }
.calc-line select { font-weight: 600; }
.calc-line .icon-btn.remove { padding: .45rem; }
@media (max-width: 640px) {
    .calc-line { grid-template-columns: auto minmax(0, 1fr) auto; }
    .calc-line .line-main { grid-column: 1 / -1; }
}
.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; background: var(--input-bg); }
.stepper button { padding: .45rem .6rem; border: 0; border-radius: 0; background: transparent; color: var(--ink-2); }
.stepper button:hover { background: var(--surface-hover); color: var(--accent); }
.stepper .icon { width: 18px; height: 18px; }
.stepper input[type=number] {
    width: 3.6rem; padding: .45rem .2rem; border: 0; border-radius: 0; text-align: center; font-weight: 700; font-size: 1.08rem;
    background: transparent; box-shadow: none; -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
details.from-samples {
    margin: .8rem 0 0; padding: .6rem .8rem; border-radius: 12px; border: 1px dashed var(--line-strong);
    background: color-mix(in srgb, var(--accent) 4%, transparent);
}
details.from-samples > summary { display: flex; align-items: center; gap: .5rem; cursor: pointer; font-weight: 600; color: var(--ink-2); }
details.from-samples > summary .icon { width: 19px; height: 19px; color: var(--accent); }
details.from-samples[open] > summary { margin-bottom: .4rem; }
.unmatched ul { margin: .3rem 0 .5rem 1.2rem; font-size: .9rem; }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: .8rem 0; }
.kpi { display: flex; flex-direction: column; padding: .7rem .8rem; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.kpi-num { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; line-height: 1.05; letter-spacing: -.03em; }
.kpi-label { color: var(--muted); font-size: .82rem; }
.empty-note { padding: 1.2rem .4rem; text-align: center; }
ul.media-totals { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
ul.media-totals li {
    padding: .65rem .8rem; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--tone) 25%, var(--line));
    background: linear-gradient(100deg, color-mix(in srgb, var(--tone) 9%, transparent), transparent 70%), var(--surface-2);
}
.mt-head { display: flex; align-items: center; gap: .5rem; }
.mt-name { flex: 1; min-width: 0; font-size: 1.02rem; }
.saga-code { font-family: var(--font-mono); font-size: .78rem; color: var(--ink-2); padding: .1rem .45rem; border-radius: 6px; border: 1px solid var(--line-strong); }
.mt-bar, .rm-bar { display: block; height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; }
.mt-bar { margin: .45rem 0 .4rem; }
.mt-bar span, .rm-bar span { display: block; height: 100%; border-radius: inherit; background: var(--tone); box-shadow: 0 0 12px var(--tone); }
.mt-figures { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .92rem; color: var(--ink-2); }
.mt-figures b { font-family: var(--font-display); font-size: 1.12rem; color: var(--ink); }
.mt-grams b { color: var(--tone); }
.mt-packs { padding: 0 .45rem; border-radius: 8px; background: color-mix(in srgb, var(--warn) 14%, transparent); }

.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .9rem; margin-top: .6rem; }
.recipe-card {
    position: relative; display: flex; flex-direction: column; gap: .55rem; padding: 1rem 1.1rem; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden;
}
.recipe-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--tone); box-shadow: 0 0 18px var(--tone); }
.recipe-card.inactive { opacity: .55; }
.recipe-card header { display: flex; align-items: start; justify-content: space-between; gap: .5rem; }
.recipe-card h3 { margin: 0; font-size: 1.08rem; letter-spacing: -.01em; }
.recipe-card .icon-btn { padding: .4rem; }
.recipe-card .links { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
ul.recipe-media { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
ul.recipe-media li { display: grid; grid-template-columns: auto minmax(0, 1fr) 70px auto 4.6rem; gap: .5rem; align-items: center; font-size: .93rem; }
.rm-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-ml { text-align: right; white-space: nowrap; }
.rm-g { text-align: right; font-size: .82rem; white-space: nowrap; }
.recipe-card footer { margin-top: auto; padding-top: .4rem; border-top: 1px solid var(--line); }
.empty-state { text-align: center; padding: 2.2rem 1rem; }
.empty-state > .icon { width: 44px; height: 44px; color: var(--accent); }
.empty-state h2 { margin: .5rem 0 .2rem; }

.modal-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(2, 6, 23, .6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.modal {
    position: fixed; z-index: 61; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(760px, calc(100vw - 1.5rem));
    max-height: calc(100vh - 2rem); overflow-y: auto; margin: 0; background: var(--surface-solid); display: flex; flex-direction: column; gap: .8rem;
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .85), 0 0 0 1px var(--line-strong);
}
.modal h2 { margin: 0; }
.modal > .link, .calc-card > .link { align-self: flex-start; justify-content: flex-start; }
.modal .section-title { margin: .6rem 0 0; }
.modal-actions { border-top: 1px solid var(--line); padding-top: .8rem; margin-top: .2rem; }
.item-rows { display: flex; flex-direction: column; gap: .45rem; }
.item-row { display: grid; grid-template-columns: minmax(0, 1fr) 7.5rem 8.5rem auto; gap: .5rem; align-items: center; }
@media (max-width: 600px) { .item-row { grid-template-columns: minmax(0, 1fr) 6.5rem auto; } .item-row .grams { display: none; } }
.ml-input { flex-direction: row; align-items: center; gap: .35rem; }
.ml-input input { text-align: right; }
.preview { padding: .7rem .8rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
input.tiny, input[type=number].tiny { width: 4.5rem; padding: .35rem .5rem; }
.pickers { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.pickers .label { margin: 0 0 .2rem; }
.pickers select { margin-top: .45rem; }
@media (max-width: 600px) { .pickers { grid-template-columns: 1fr; } }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .8rem; }
input[type=color] { width: 46px; height: 38px; padding: 2px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--input-bg); cursor: pointer; }
.card.flush { padding: 0; overflow: hidden; }
.media-table td { vertical-align: middle; }

/* Situație: the consumption of the samples received in a period. */
.situation-bar { margin-bottom: 1rem; }
.period-tabs { margin: 0; }
.situation-title { margin: .9rem 0 .1rem; font-size: 1.45rem; }
.situation-title::first-letter { text-transform: uppercase; }
.kpis-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 640px) { .kpis-4 { grid-template-columns: repeat(2, 1fr); } }
.situation-media ul.media-totals li { padding: .85rem 1rem; }
.situation-media .mt-figures { font-size: 1rem; }
.situation-media .mt-figures b { font-size: 1.35rem; }
.situation-side { display: flex; flex-direction: column; gap: 1rem; }
.situation-side h2 { margin: 0 0 .6rem; }
ul.situation-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
ul.situation-bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .15rem .6rem; align-items: baseline; --tone: var(--accent); }
ul.situation-bars .mt-bar { grid-column: 1 / -1; margin: 0; }
.sb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.sb-num { font-family: var(--font-display); font-weight: 700; white-space: nowrap; }
ul.situation-bars.days .sb-num { font-family: inherit; font-weight: 500; font-size: .88rem; color: var(--ink-2); }

/* Situație: long lists scroll in their own box; "Consumat" and its log. */
ul.situation-bars, .situation-side .unmatched ul { max-height: 24rem; overflow-y: auto; padding-right: .4rem; }
button.kpi-btn { text-align: left; cursor: pointer; font: inherit; color: inherit; transition: border-color .15s, box-shadow .15s; }
button.kpi-btn:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 3px var(--accent-soft); }
button.kpi-btn .kpi-label { color: var(--accent); }
.consume-btn { margin-left: .2rem; padding: .3rem .6rem; }
.consume-btn .icon { width: 15px; height: 15px; }
.mt-grams.negative b { color: var(--danger); }
.mt-used { margin: .35rem 0 0; color: var(--ink-2); }
.consume-modal { width: min(520px, calc(100vw - 1.5rem)); }
.consume-modal h2 { display: flex; align-items: center; gap: .4rem; }
.big-qty input { font-size: 1.5rem; font-weight: 700; width: 11rem; text-align: right; }
.modal-actions.end { justify-content: flex-end; }
ul.usage-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; max-height: 22rem; overflow-y: auto; }
ul.usage-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .55rem; align-items: center; padding: .45rem .55rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.types-table td.num, .types-table th.num { text-align: right; white-space: nowrap; }
.types-table tfoot td { border-top: 1px solid var(--line-strong); font-weight: 600; }

/* Print: only the document, black on white. ---------------------------------------------------------- */
@media print {
    :root, :root[data-theme] {
        --heading: #000; --ink: #000; --ink-2: #222; --muted: #444; --line: #bbb; --line-strong: #999; --surface: #fff; --surface-solid: #fff;
        --surface-2: #fff; --input-bg: #fff; --accent: #000; color-scheme: light;
    }
    html, body { background: #fff !important; color: #000; }
    body::before, .sidebar, .topbar, .scrim, .nav, .modal-backdrop, .no-print, .actions, .tabs, details > summary { display: none !important; }
    .shell { display: block; }
    .page { max-width: none; padding: 0; }
    .card { border: 0; padding: .4rem 0; background: #fff; color: #000; box-shadow: none; }
    .card, .stat, .hero { background-image: none !important; border-radius: 0 !important; }
    .sheet { border: 0; padding: 0; margin: 0; font-size: 9.5pt; box-shadow: none; }
    table.doc th, table.doc td { padding: .12rem .3rem; }
    .letterhead { margin-bottom: .5rem; }
    .signatures { margin: .5rem 0; }
    .review { display: block; }
    .page-break { break-before: page; }
    .table-wrap { overflow: visible; }
    table.doc tr { break-inside: avoid; }
    input, select, textarea { border: 0 !important; background: transparent !important; color: #000 !important; padding: 0 !important; appearance: none; box-shadow: none !important; }
    table.list th { background: #fff; color: #000; }
    a { color: #000; text-decoration: none; }
    .worksheet { color: #000; }
    /* The NAC card prints its label alone. */
    body:has(.nac-card[open]) * { visibility: hidden; }
    body:has(.nac-card[open]) .nac-card[open] .nac-label, body:has(.nac-card[open]) .nac-card[open] .nac-label * { visibility: visible; }
    .nac-card[open] .nac-label { position: absolute; left: 0; top: 0; }
    .consum-grid { display: block; }
    .calc-line { border: 0; border-bottom: 1px solid #bbb; border-radius: 0; background: #fff; grid-template-columns: 1fr auto 1fr; }
    .stepper { border: 0; }
    .stepper button, .hero-badge, .modal, .modal-backdrop { display: none !important; }
    ul.media-totals li, .kpi { background: #fff; break-inside: avoid; }
    ul.situation-bars, ul.usage-list, .situation-side .unmatched ul { max-height: none; overflow: visible; }
}

/* Pontaj ------------------------------------------------------------------------------------------------- */
.pj-controls { align-items: flex-end; margin: .4rem 0 1rem; }
.pj-month { display: inline-flex; align-items: center; gap: .5rem; padding: .3rem; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.pj-month strong { min-width: 10.5rem; text-align: center; font-family: var(--font-display); font-size: 1.12rem; text-transform: capitalize; }
.pj-month .icon-btn { font-size: 1.5rem; line-height: 1; }
.pj-idle select { min-width: 11rem; }
.pj-stats { margin-bottom: 1rem; }
.pj-grid-card { padding: .5rem; }
table.pj-grid { border-collapse: separate; border-spacing: 2px; width: 100%; }
.pj-grid th, .pj-grid td { padding: 0; text-align: center; }
.pj-grid thead th { font-size: .7rem; color: var(--muted); font-weight: 700; }
.pj-grid th.pj-name { text-align: left; padding: .3rem .7rem .3rem .3rem; min-width: 11rem; position: sticky; left: 0; z-index: 1; background: var(--surface-solid); }
.pj-name strong { display: block; font-size: .92rem; white-space: nowrap; }
.pj-name small { font-size: .72rem; }
.pj-head, .pj-hours { width: 100%; border: 1px solid transparent; border-radius: 8px; background: transparent; color: inherit; padding: .25rem 0; cursor: pointer; font: inherit; }
.pj-head { display: flex; flex-direction: column; align-items: center; min-width: 2.35rem; }
.pj-head span { font-size: .9rem; color: var(--ink-2); }
.pj-head small { font-size: .62rem; letter-spacing: .04em; }
.pj-day.weekend .pj-head span, .pj-day.weekend .pj-head small { color: var(--danger); opacity: .85; }
.pj-day.today .pj-head { border-color: var(--accent); }
.pj-head:hover, .pj-hours:hover { background: var(--surface-hover); }
.pj-hours { min-width: 2.35rem; height: 2.3rem; font-family: var(--font-mono); font-size: .74rem; font-weight: 600; background: var(--surface-2); }
.pj-cell.weekend .pj-hours { background: color-mix(in srgb, var(--danger) 6%, var(--surface-2)); }
.pj-cell .pj-hours.on {
    color: var(--ink); border-color: color-mix(in srgb, var(--accent) calc(20% + var(--lvl) * 50%), transparent);
    background: color-mix(in srgb, var(--accent) calc(10% + var(--lvl) * 45%), transparent);
    box-shadow: 0 0 calc(var(--lvl) * 16px) -4px color-mix(in srgb, var(--accent) 70%, transparent);
}
.pj-hours.clock { border-style: dashed; border-color: var(--line-strong); }
.pj-hours.picked, .pj-head.picked { outline: 2px solid var(--accent); outline-offset: 1px; }
.pj-total { padding: 0 .6rem !important; font-weight: 700; white-space: nowrap; color: var(--ink-2); }
.pj-detail { margin-top: 1rem; }
.pj-detail h3 { margin-top: 1.4rem; }
.pj-timeline {
    position: relative; height: 2.2rem; margin: 1.5rem 0 .6rem; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line);
    background-image: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px calc(100% / 8));
}
.pj-tick { position: absolute; top: -1.3rem; transform: translateX(-50%); font-size: .68rem; color: var(--muted); font-family: var(--font-mono); }
.pj-tick:first-child { transform: none; }
.pj-tick.last { transform: translateX(-100%); }
.pj-span {
    position: absolute; top: 4px; bottom: 4px; border-radius: 6px; background: var(--grad);
    box-shadow: 0 0 14px -3px color-mix(in srgb, var(--accent) 75%, transparent);
}
.pj-clock { position: absolute; top: 1px; bottom: 1px; border-radius: 8px; border: 2px dashed var(--ok); }
.pj-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: .6rem; margin: .8rem 0 0; }
.pj-facts div { padding: .6rem .8rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.pj-facts dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.pj-facts dd { margin: .15rem 0 0; font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.pj-team { display: flex; flex-direction: column; gap: .2rem; }
.pj-team-row { display: grid; grid-template-columns: 13rem 1fr; gap: 1rem; align-items: center; }
.pj-team-row .pj-timeline { margin: 1.2rem 0 .2rem; }
.pj-team-row + .pj-team-row .pj-tick { display: none; }
.pj-team-row + .pj-team-row .pj-timeline { margin-top: .2rem; }
.pj-team-name { display: flex; flex-direction: column; }
.pj-journal tr.pj-session td { color: var(--accent); }
.pj-cell .pj-hours.leave { color: var(--ok); font-weight: 700; border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.pj-hours.invoire { position: relative; }
.pj-hours.invoire::after { content: ""; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.pj-detail > p.tag { display: inline-flex; margin: .2rem 0 0; }
/* Concedii și învoiri */
.leave-form, .leave-list { margin-bottom: 1rem; }
.leave-fields { align-items: flex-end; margin: .6rem 0; }
.leave-days { padding-bottom: .55rem; }
.leave-form textarea { width: 100%; }
.leave-note { min-width: 10rem; width: 100%; }
.leave-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
@media (max-width: 640px) {
    .pj-team-row { grid-template-columns: 1fr; gap: 0; }
    .pj-month strong { min-width: 8.5rem; }
}
:root:not([data-theme=dark], [data-theme=light]) .pj-span { background: var(--trim-grad); }

/* Beta Live and Beta: the same loud strip in every theme, so nobody takes them for Live. */
.build-banner {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .8rem; padding: .45rem 1rem;
    color: #fff; font-size: .9rem; position: sticky; top: 0; z-index: 30;
}
.build-banner strong { font-family: var(--font-display); letter-spacing: .08em; text-transform: uppercase; }
.build-banner small { margin-left: auto; opacity: .85; font-family: var(--font-mono); }
.build-banner.beta-live { background: repeating-linear-gradient(135deg, #b45309 0 18px, #c2410c 18px 36px); }
.build-banner.beta { background: repeating-linear-gradient(135deg, #6d28d9 0 18px, #7c3aed 18px 36px); }
@media print { .build-banner { display: none; } }

/* Recepție: an analysis of a subcontracted sample, clicked to move it between our lab and the partner. */
button.tag { cursor: pointer; font-family: inherit; font-size: .72rem; min-height: 0; padding: .16rem .6rem; box-shadow: none; text-transform: none; border-radius: 999px !important; }
button.tag:hover { border-color: var(--accent, currentColor); }
.tag.sent { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); border-color: color-mix(in srgb, var(--warn) 32%, transparent); }

/* Recepție / Comenzi: the box an order .xlsx is dropped on. */
.order-drop {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; text-align: center;
    padding: 1.6rem 1.2rem; margin: .8rem 0; border: 2px dashed color-mix(in srgb, var(--accent) 55%, var(--line-strong));
    border-radius: 16px; background: color-mix(in srgb, var(--accent) 6%, var(--surface)); cursor: pointer; color: var(--ink);
    transition: background .2s, border-color .2s, box-shadow .2s;
}
.order-drop .big { font-size: 1.3rem; font-weight: 700; color: var(--accent); }
.order-drop input[type=file] { display: none; }
.order-drop:hover, .order-drop.over {
    background: color-mix(in srgb, var(--accent) 14%, var(--surface)); border-color: var(--accent);
    box-shadow: 0 0 26px -10px var(--accent);
}
.order-drop.busy { opacity: .7; cursor: progress; }
.order-waiting { margin: 0 0 .8rem; font-weight: 600; }

/* Comenzi către laboratoarele partenere: picking the lab and samples, the order made, and its editor. */
.lab-chips { margin-top: .3rem; }
.chip-btn {
    display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .9rem; border-radius: 999px; font-size: .98rem;
    background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-strong);
}
.chip-btn:hover { border-color: var(--accent); }
.chip-btn.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface-2)); }
.lab-orders tr.muted td { opacity: .65; }
.order-result .row.gap.wrap { margin: .6rem 0; }
.email-preview { margin: .6rem 0; }
.email-preview pre.email-body { white-space: pre-wrap; font-family: inherit; background: var(--surface-2); padding: .7rem .9rem; border-radius: 10px; }
.order-paper { overflow: auto; max-height: 70vh; padding: 1rem; border-radius: 12px; background: #d9dde3; }
.lab-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 30rem), 1fr)); gap: 1rem; margin-bottom: 1rem; }
.lab-card .grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0 .8rem; }
.lab-card label { display: block; }
/* The editor: the order on a white A4 page. */
.order-canvas .order-doc { margin: 0 auto; }
.order-canvas .order-doc { width: 210mm; max-width: none; min-height: 297mm; box-shadow: 0 2px 14px rgba(0,0,0,.25); }
.order-canvas .order-doc [data-sel] { padding: .1rem .2rem; border-radius: 3px; }
.order-canvas .od-var { background: #e0f2fe; color: #075985; border-radius: 3px; padding: 0 .15em; }
.order-canvas .od-var.od-bad { background: #fee2e2; color: #b91c1c; }
.order-canvas .od-end { min-height: 2.2rem; border: 2px dashed transparent; border-radius: 6px; }
.order-canvas[data-dragging] .od-end { border-color: #0e7490; }
.order-canvas[data-dragging] .order-doc [data-sel] { outline: 1px dashed #94a3b8; }
.var-group { margin: .5rem 0 .25rem; font-weight: 600; color: var(--ink-2); }
.var-chips { display: flex; flex-wrap: wrap; gap: .25rem; }
.var-chip {
    font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: .74rem; padding: .2rem .4rem; border-radius: 6px; cursor: grab;
    background: color-mix(in srgb, var(--accent) 12%, var(--surface-2)); color: var(--ink); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
}
.var-chip:hover { border-color: var(--accent); }
.props fieldset.prop-row { border: 1px solid var(--line); border-radius: 10px; padding: .3rem .6rem .5rem; margin: .5rem 0; }
.props fieldset.prop-row legend { font-size: .8rem; color: var(--muted); padding: 0 .3rem; }
.props div.prop-row { align-items: center; margin: .3rem 0; }
.props div.prop-row input[type=text] { min-width: 0; }
.designer.order-designer .props .row label { flex: 1; }

/* Grips between the editors' panels and the page: drag to widen a panel (kept per browser). They sit in the
   middle of the grid gap. */
.designer { position: relative; --pad-x: 0px; }
.designer.full { --pad-x: 1rem; }
.panel-grip { position: absolute; top: 0; bottom: 0; width: 14px; cursor: col-resize; z-index: 5; touch-action: none; }
.panel-grip::after {
    content: ''; position: absolute; left: 6px; top: 0; bottom: 0; width: 2px; border-radius: 2px; background: var(--line);
    transition: background .15s, width .15s, left .15s;
}
.panel-grip:hover::after, .panel-grip:active::after { background: var(--accent); width: 4px; left: 5px; }
.tools-grip { left: calc(var(--pad-x) + var(--tools-w) + .5rem - 7px); }
.props-grip { right: calc(var(--pad-x) + var(--props-w) + .5rem - 7px); }
.designer.full .panel-grip { top: .8rem; bottom: .8rem; }
.designer.slim-tools .tools-grip, .designer.float-props .props-grip { display: none; }
@media (max-width: 1050px) { .props-grip { display: none; } }
@media (max-width: 800px) { .panel-grip { display: none; } }

/* Lucru: one row per sample, its analyses listed in the last cell. */
.lucru-search { width: 100%; max-width: 40rem; margin: .4rem 0 .6rem; }
.sample-analyses { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.sample-analyses li { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.sample-analyses li .grow { flex: 1 1 12rem; }
.pick-bar { position: sticky; top: 0; z-index: 5; background: var(--panel, var(--bg)); padding: .5rem 0; }
/* Scanare: AC / NAC card. */
.ac-nac-analyses { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 0 1rem; max-height: 18rem; overflow: auto; }
.ac-nac-analyses label.check { margin: .2rem 0; }
.nac-list { list-style: none; padding: 0; margin: .3rem 0; }
.nac-list li { padding: .2rem 0; }

/* SearchSelect (ui/search_select.rs): a dropdown you can type into. */
.search-select { position: relative; }
.search-select input { width: 100%; }
.search-select-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin: 2px 0 0; padding: 0.25rem 0;
  list-style: none; max-height: 18rem; overflow-y: auto; background: var(--surface-solid); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 6px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}
.search-select-list li { padding: 0.35rem 0.6rem; cursor: pointer; font-weight: normal; }
.search-select-list li.active { background: var(--accent-soft); }
.search-select-list li.chosen { font-weight: 600; }
.editor-pick .pick-analysis { min-width: 18rem; }
.editor-pick .pick-category { min-width: 16rem; }

/* Buletin: the check QR in the top right of every sheet. */
.verify-qr { float: right; width: 22mm; margin: 0 0 .3rem .6rem; text-align: center; font-size: 6.5pt; color: #000; }
.verify-qr svg { width: 22mm; height: 22mm; display: block; }

/* The printed buletin (letterhead CSS comes from manor_api::LETTERHEAD_CSS): "pag. x/y" in the page margin. */
.buletin { page: buletin; }
@page buletin {
    @bottom-right { content: "pag. " counter(page) "/" counter(pages); font: 8pt Arial, sans-serif; color: #000; }
}
.logo-preview { max-height: 40mm; max-width: 60mm; background: #fff; padding: .4rem; border-radius: .4rem; }
/* A category that already has its own fișă (fișe editor picker). */
.search-select-list li.marked { color: var(--ok); }
.search-select-list li.marked::after { content: " ✓ fișă proprie"; font-size: .8em; }
.search-select.marked input { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok); color: var(--ok); }

/* Planificare rute (/rute): map on the left, routes on the right (pages/route_plan/, static/route-map.js). */
.rp-head { align-items: center; margin-bottom: .5rem; }
.rp-head h1 { margin: 0 1rem 0 0; }
.rp-layout { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 1rem; align-items: start; margin-top: .75rem; }
.rp-map-wrap { position: sticky; top: .75rem; }
.rp-map { height: calc(100vh - 210px); min-height: 420px; border-radius: 14px; border: 1px solid var(--line-strong); overflow: hidden; }
.rp-side { max-height: calc(100vh - 170px); overflow-y: auto; padding-right: .25rem; }
.rp-tools-bar, .rp-map-wrap > .rp-tools { margin: 0 0 .4rem; align-items: center; }
.rp-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: .25rem; margin-bottom: .6rem; padding: .25rem; border-radius: 12px; border: 1px solid var(--line-strong); }
.rp-tab { border: 0; background: transparent; padding: .45rem; border-radius: 9px; font-weight: 600; color: inherit; cursor: pointer; }
.rp-tab.on { background: var(--accent); color: #fff; }
.rp-bar { position: sticky; top: 0; z-index: 2; padding: .5rem; border-radius: 10px; border: 1px solid var(--accent); background: var(--surface-solid); }
.rp-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.rp-row { display: flex; gap: .5rem; align-items: flex-start; padding: .45rem .25rem; border-bottom: 1px solid var(--line-strong); }
.rp-row > input { margin-top: .25rem; }
.rp-row-title { display: inline-flex; gap: .35rem; align-items: center; justify-content: flex-start; align-self: flex-start; text-align: left; padding: 0; }
.stack-tight { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.rp-extra { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 330px; }
.rp-day { margin: .6rem 0 .1rem; font-size: .95rem; }
.rp-route-card { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; width: 100%; text-align: left; padding: .5rem .6rem; border-radius: 10px; border: 1px solid var(--line-strong); background: transparent; color: inherit; cursor: pointer; }
.rp-route-head { padding-left: .5rem; }
.rp-route-head h3 { margin: 0; }
.rp-totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: .3rem; }
.rp-totals > div { display: flex; flex-direction: column; padding: .35rem; border-radius: 8px; border: 1px solid var(--line-strong); }
.rp-totals span { font-size: .68rem; text-transform: uppercase; opacity: .7; }
.rp-totals strong { font-size: .95rem; }
.rp-num { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; font-size: .75rem; font-weight: 700; }
.rp-num.depot { background: #111; border-radius: 6px; }
.rp-hint { display: flex; gap: .6rem; align-items: center; margin: 0 0 .4rem; color: var(--accent); font-weight: 600; }
.rp-pin { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; font: 600 12px/1 Inter, sans-serif; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .45); cursor: grab; }
.rp-pin.sel { outline: 3px solid #111; outline-offset: 1px; transform: scale(1.2); }
.rp-pin.depot { background: #111 !important; border-radius: 6px; }
.rp-route, .rp-free { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: .25rem; }
.rp-stop { display: flex; align-items: flex-start; gap: .5rem; padding: .4rem .35rem; border-bottom: 1px solid var(--line-strong); }
.rp-stop.sel { background: var(--accent-soft); }
.rp-tools { margin-left: auto; display: flex; gap: .2rem; }
.rp-tools .icon-btn { width: 26px; height: 26px; padding: 0; }
.rp-free li { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.rp-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.rp-details th { text-align: left; padding-right: .6rem; color: var(--muted); font-weight: 500; vertical-align: top; }
@media (max-width: 1000px) {
    .rp-layout { grid-template-columns: 1fr; }
    .rp-map-wrap { position: static; }
    .rp-map { height: 60vh; }
    .rp-side { max-height: none; }
}
@media print { .rp-map-wrap { display: none; } }

.thumb select { max-width: 120px; font-size: .8rem; }
.rp-copy { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
/* Planificare rute: the columns step (as in Zeo) and the days with a list. */
.rp-columns { overflow-x: auto; max-width: 100%; }
.rp-columns table { min-width: 100%; }
.rp-columns th { vertical-align: top; min-width: 150px; }
.rp-columns td { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-columns select.rp-col-on { border-color: var(--accent); font-weight: 600; }
.rp-columns select.rp-col-off { opacity: .6; }
.rp-days { align-items: center; margin: .25rem 0; }

/* Șofer (/sofer): tabs, the day's routes, store cards with Luat / De luat (pages/driver/) */
.driver-tabs { display: flex; width: 100%; }
.driver-tabs .tab { flex: 1; padding: .6rem .4rem; }
.driver-day { align-items: center; margin-bottom: .6rem; }
.driver-day .grow, .driver-stop .grow, .driver-route .grow { flex: 1; min-width: 0; }
.driver-stops { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .6rem; }
.driver-stop { padding: .7rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.driver-stop .rp-num { background: var(--accent); }
.driver-stop.done { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--surface-2)); }
.driver-stop.done .rp-num { background: var(--ok); }
.driver-stop.later { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, var(--surface-2)); }
.driver-stop.later .rp-num { background: var(--warn); }
.driver-marks { margin-top: .5rem; }
.driver-marks button { flex: 1; padding: .7rem .4rem; font-size: 1.02rem; }
.driver-marks button.warning-btn { background: var(--warn); background-image: none; color: #111; border: 0; font-weight: 700; opacity: 1; }
.rp-mark { font-size: .78rem; }
