@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&family=Tajawal:wght@400;500;700&family=Almarai:wght@400;700&family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=Noto+Kufi+Arabic:wght@400;500;600;700&family=Cinzel:wght@500;700&display=swap");

@view-transition { navigation: auto; }

:root {
    --font: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
    --ink: #17233b;
    --muted: #5f6c83;
    --line: #e6ebf3;
    --paper: #ffffff;
    --ground: #f2f4fb;
    --soft: #f6f8fc;
    --input: #f8fafd;
    --brand: #5b2c83;
    --brand-soft: #f1e9f8;
    --second: #8e52c2;
    --second-soft: #f3ebfb;
    --night: #1b0c2a;
    --night-mid: #34174f;
    --night-end: #552a7a;
    /* Gold from the logo, and a light tint of the brand for text on dark surfaces. */
    --glow: #e3b766;
    --lift: #d6bdf2;
    --chart-dark: #b98ae4;
    --accent: linear-gradient(120deg, var(--brand), var(--second));
    --chart: #6c3a9c;
    --tip: #17233b;
    --good: #0f8a5f;
    --good-soft: #e0f6ec;
    --bad: #cf3341;
    --bad-soft: #fde8ea;
    --warn: #a86a00;
    --warn-soft: #fdf2d8;
    --shadow-sm: 0 1px 2px rgba(23, 35, 59, .05);
    --shadow: 0 1px 2px rgba(23, 35, 59, .04), 0 10px 28px rgba(23, 35, 59, .07);
    --shadow-lift: 0 2px 4px rgba(23, 35, 59, .05), 0 18px 40px rgba(38, 44, 110, .14);
    --ease: cubic-bezier(.2, .75, .25, 1);
    --sidebar: 262px;
    --cell-y: 9px;
    --gap: 16px;
    --card-pad: 16px;

    --i-home: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='9' rx='1.5'/%3E%3Crect x='14' y='3' width='7' height='5' rx='1.5'/%3E%3Crect x='14' y='12' width='7' height='9' rx='1.5'/%3E%3Crect x='3' y='16' width='7' height='5' rx='1.5'/%3E%3C/svg%3E");
    --i-grid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1.5'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1.5'/%3E%3C/svg%3E");
    --i-panel: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='2.5'/%3E%3Cpath d='M15 4v16'/%3E%3C/svg%3E");
    --i-layers: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2 2 7l10 5 10-5-10-5z'/%3E%3Cpath d='m2 17 10 5 10-5'/%3E%3Cpath d='m2 12 10 5 10-5'/%3E%3C/svg%3E");
    --i-box: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 8 12 3 3 8v8l9 5 9-5z'/%3E%3Cpath d='m3 8 9 5 9-5'/%3E%3Cpath d='M12 13v8'/%3E%3C/svg%3E");
    --i-bed: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 4v16'/%3E%3Cpath d='M2 8h18a2 2 0 0 1 2 2v10'/%3E%3Cpath d='M2 17h20'/%3E%3Cpath d='M6 8v9'/%3E%3C/svg%3E");
    --i-factory: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 20h20'/%3E%3Cpath d='M4 20V10l6 4v-4l6 4V4h4v16'/%3E%3C/svg%3E");
    --i-chart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='m7 15 4-4 3 3 5-6'/%3E%3C/svg%3E");
    --i-download: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12'/%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3Cpath d='M4 21h16'/%3E%3C/svg%3E");
    --i-users: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='4'/%3E%3Cpath d='M2 21c0-4 3-7 7-7s7 3 7 7'/%3E%3Cpath d='M16 4a4 4 0 0 1 0 8'/%3E%3Cpath d='M22 21c0-3-2-5.5-5-6.5'/%3E%3C/svg%3E");
    --i-shield: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 4 6v6c0 5 3.4 8 8 9 4.6-1 8-4 8-9V6z'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E");
    --i-sliders: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h10'/%3E%3Cpath d='M18 6h2'/%3E%3Ccircle cx='16' cy='6' r='2'/%3E%3Cpath d='M4 12h2'/%3E%3Cpath d='M10 12h10'/%3E%3Ccircle cx='8' cy='12' r='2'/%3E%3Cpath d='M4 18h10'/%3E%3Cpath d='M18 18h2'/%3E%3Ccircle cx='16' cy='18' r='2'/%3E%3C/svg%3E");
    --i-wallet: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='6' width='20' height='14' rx='2.5'/%3E%3Cpath d='M2 10h20'/%3E%3Cpath d='M16 15h2'/%3E%3C/svg%3E");
    --i-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 2 20h20z'/%3E%3Cpath d='M12 10v5'/%3E%3Cpath d='M12 18h.01'/%3E%3C/svg%3E");
    --i-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 7 7 7 4-4 7 7'/%3E%3Cpath d='M21 12v5h-5'/%3E%3C/svg%3E");
    --i-eye: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
    --i-eye-off: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.9 5.2A10.4 10.4 0 0 1 12 5c6.4 0 10 7 10 7a17 17 0 0 1-2.2 3.2'/%3E%3Cpath d='M6.6 6.6C3.9 8.4 2 12 2 12s3.6 7 10 7c1.9 0 3.6-.6 5-1.5'/%3E%3Cpath d='M9.9 9.9a3 3 0 0 0 4.2 4.2'/%3E%3Cpath d='m2 2 20 20'/%3E%3C/svg%3E");
    --i-in: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v11'/%3E%3Cpath d='m8 10 4 4 4-4'/%3E%3Cpath d='M4 15v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4'/%3E%3C/svg%3E");
    --i-out: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 14V3'/%3E%3Cpath d='m8 7 4-4 4 4'/%3E%3Cpath d='M4 15v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4'/%3E%3C/svg%3E");
    --i-clipboard: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='4' width='14' height='17' rx='2'/%3E%3Cpath d='M9 4V3h6v1'/%3E%3Cpath d='m9 13 2 2 4-4'/%3E%3C/svg%3E");
    --i-palette: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a9 9 0 0 0 0 18c1.1 0 1.8-.8 1.8-1.8 0-.5-.2-.9-.5-1.2-.3-.3-.5-.7-.5-1.2 0-1 .8-1.8 1.8-1.8H17a4 4 0 0 0 4-4c0-4.4-4-8-9-8z'/%3E%3Ccircle cx='7.5' cy='11.5' r='1'/%3E%3Ccircle cx='10' cy='7.5' r='1'/%3E%3Ccircle cx='15' cy='7.5' r='1'/%3E%3C/svg%3E");
    --i-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
    --i-go: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5'/%3E%3Cpath d='m11 6-6 6 6 6'/%3E%3C/svg%3E");
    --i-scale: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v18'/%3E%3Cpath d='M7 21h10'/%3E%3Cpath d='M5 7h14'/%3E%3Cpath d='m5 7-3 7h6z'/%3E%3Cpath d='m19 7-3 7h6z'/%3E%3C/svg%3E");
}

html[data-font="tajawal"] { --font: "Tajawal", "Segoe UI", Tahoma, sans-serif; }
html[data-font="almarai"] { --font: "Almarai", "Segoe UI", Tahoma, sans-serif; }
html[data-font="plex"] { --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif; }
html[data-font="kufi"] { --font: "Noto Kufi Arabic", "Segoe UI", Tahoma, sans-serif; }

html { font-size: 15.5px; scroll-behavior: smooth; }
html[data-size="sm"] { font-size: 14px; }
html[data-size="lg"] { font-size: 17px; }
html[data-size="xl"] { font-size: 19px; }

html[data-density="compact"] { --cell-y: 5px; --gap: 12px; --card-pad: 12px; }
html[data-density="airy"] { --cell-y: 13px; --gap: 20px; --card-pad: 20px; }

/* The logo theme (the default): text and greys carry a touch of its purple. */
html[data-accent="night"] { --ink: #221a33; --muted: #675e7a; --line: #ebe6f2; --ground: #f5f2f9; --soft: #f8f6fb; --input: #faf8fc; --tip: #2a1f3d; }
html[data-accent="royal"] { --brand: #2447c7; --brand-soft: #e6ebfb; --second: #7c3aed; --second-soft: #efe8fd; --night: #0f1a4a; --night-mid: #1e2f86; --night-end: #4b2aa8; --chart: #2447c7; --glow: #38bdf8; --lift: #bcd2ec; --chart-dark: #4f97ea; }
html[data-accent="emerald"] { --brand: #0f766e; --brand-soft: #dff3f0; --second: #0e9f6e; --second-soft: #def5ea; --night: #06231f; --night-mid: #0b3f39; --night-end: #0f5c55; --chart: #0f766e; --glow: #38bdf8; --lift: #bcd2ec; --chart-dark: #4f97ea; }
html[data-accent="rose"] { --brand: #be185d; --brand-soft: #fce7f1; --second: #7c3aed; --second-soft: #efe8fd; --night: #2a0a22; --night-mid: #4c1040; --night-end: #6b1560; --chart: #be185d; --glow: #38bdf8; --lift: #bcd2ec; --chart-dark: #4f97ea; }
html[data-accent="amber"] { --brand: #b45309; --brand-soft: #fdf0dc; --second: #dc2626; --second-soft: #fde6e6; --night: #2a1506; --night-mid: #4a250c; --night-end: #6b3410; --chart: #b45309; --glow: #38bdf8; --lift: #bcd2ec; --chart-dark: #4f97ea; }
html[data-accent="slate"] { --brand: #334155; --brand-soft: #e7ebf1; --second: #0284c7; --second-soft: #dff1fa; --night: #0f172a; --night-mid: #1e293b; --night-end: #334155; --chart: #475569; --glow: #38bdf8; --lift: #bcd2ec; --chart-dark: #4f97ea; }

html[data-dark="1"] {
    color-scheme: dark;
    --ink: #e7ecf6;
    --muted: #a0adc4;
    --line: #2a3550;
    --paper: #151d31;
    --ground: #0c1222;
    --soft: #1b2439;
    --input: #101829;
    --brand-soft: color-mix(in srgb, var(--lift) 16%, transparent);
    --second-soft: rgba(130, 110, 230, .18);
    --chart: var(--chart-dark);
    --tip: #2a3550;
    --good: #3fce96;
    --good-soft: rgba(63, 206, 150, .14);
    --bad: #ff7f88;
    --bad-soft: rgba(255, 127, 136, .14);
    --warn: #f0b64e;
    --warn-soft: rgba(240, 182, 78, .14);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .3);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .3), 0 18px 40px rgba(0, 0, 0, .45);
}

/* In the logo theme the night surfaces lean to its purple instead of navy. */
html[data-dark="1"][data-accent="night"] {
    --ink: #ece6f5;
    --muted: #b1a6c6;
    --line: #352a4b;
    --paper: #1c1528;
    --ground: #120c1b;
    --soft: #251c35;
    --input: #170f22;
    --tip: #352a4b;
}

html[data-dark="1"] .step { background: var(--soft); }
html[data-dark="1"] .btn.light, html[data-dark="1"] button.light { color: var(--lift); }

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(900px 420px at 12% -8%, color-mix(in srgb, var(--second) 10%, transparent), transparent 70%),
        radial-gradient(800px 380px at 95% -10%, color-mix(in srgb, var(--brand) 10%, transparent), transparent 70%),
        var(--ground);
    background-attachment: fixed;
    color: var(--ink);
    font: 1rem/1.65 var(--font);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; transition: color .2s; }
a:hover { color: var(--second); }
html[data-dark="1"] a:not(.btn):not(.tile):not(.step):not(.report-card) { color: var(--lift); }
html[data-dark="1"] .topbar a { color: inherit; }

h1 { font-size: 1.7rem; font-weight: 700; line-height: 1.3; margin: 0; }

h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.08rem;
    font-weight: 600;
    margin: 0 0 12px;
}

h2::before {
    content: "";
    flex: none;
    width: 5px;
    height: 20px;
    border-radius: 3px;
    background: var(--accent);
}

/* Any icon */
.ic {
    display: inline-block;
    flex: none;
    width: 1.25em;
    height: 1.25em;
    background: currentColor;
    mask: var(--icon) center / contain no-repeat;
    -webkit-mask: var(--icon) center / contain no-repeat;
}

[data-i="home"] { --icon: var(--i-home); }
[data-i="grid"] { --icon: var(--i-grid); }
[data-i="panel"] { --icon: var(--i-panel); }
[data-i="layers"] { --icon: var(--i-layers); }
[data-i="box"] { --icon: var(--i-box); }
[data-i="bed"] { --icon: var(--i-bed); }
[data-i="factory"] { --icon: var(--i-factory); }
[data-i="chart"] { --icon: var(--i-chart); }
[data-i="download"] { --icon: var(--i-download); }
[data-i="users"] { --icon: var(--i-users); }
[data-i="shield"] { --icon: var(--i-shield); }
[data-i="sliders"] { --icon: var(--i-sliders); }
[data-i="palette"] { --icon: var(--i-palette); }
[data-i="search"] { --icon: var(--i-search); }
[data-i="go"] { --icon: var(--i-go); }
[data-i="wallet"] { --icon: var(--i-wallet); }
[data-i="alert"] { --icon: var(--i-alert); }
[data-i="down"] { --icon: var(--i-down); }
[data-i="in"] { --icon: var(--i-in); }
[data-i="eye"] { --icon: var(--i-eye); }
[data-i="eye-off"] { --icon: var(--i-eye-off); }
[data-i="out"] { --icon: var(--i-out); }
[data-i="clipboard"] { --icon: var(--i-clipboard); }
[data-i="scale"] { --icon: var(--i-scale); }

/* Page loading line */
body::after {
    content: "";
    position: fixed;
    inset: 0 0 auto;
    height: 3px;
    z-index: 60;
    background: linear-gradient(90deg, var(--second), var(--glow), var(--second));
    background-size: 200% 100%;
    transform: scaleX(0);
    transform-origin: right;
    pointer-events: none;
}

body.leaving::after { animation: load 1.4s var(--ease) forwards, slide 1s linear infinite; }

/* Navigation: sidebar, collapsed sidebar, or top bar with the card screen */
body:has(.topbar) { padding-inline-start: var(--sidebar); transition: padding .3s var(--ease); }
html[data-nav="mini"] { --sidebar: 76px; }
html[data-nav="cards"] { --sidebar: 0px; }

.topbar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: var(--sidebar);
    padding: 16px 12px 12px;
    overflow: hidden auto;
    color: #dbe3f6;
    background:
        radial-gradient(260px 200px at 85% 8%, rgba(120, 99, 235, .35), transparent 70%),
        radial-gradient(240px 260px at 10% 92%, color-mix(in srgb, var(--glow) 14%, transparent), transparent 70%),
        linear-gradient(172deg, var(--night), var(--night-mid) 58%, var(--night-end));
    box-shadow: -6px 0 28px rgba(11, 23, 54, .18);
    transition: width .3s var(--ease);
    view-transition-name: sidebar;
}

.topbar::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(1.2px 1.2px at 20px 30px, #fff, transparent),
        radial-gradient(1px 1px at 80px 120px, #fff, transparent),
        radial-gradient(1.4px 1.4px at 160px 60px, #fff, transparent),
        radial-gradient(1px 1px at 210px 190px, #fff, transparent),
        radial-gradient(1px 1px at 120px 240px, #fff, transparent),
        radial-gradient(1.2px 1.2px at 40px 320px, #fff, transparent);
    background-size: 266px 360px;
    opacity: .5;
    animation: twinkle 5s ease-in-out infinite;
}

.topbar > * { position: relative; }

.bar-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid rgba(255, 255, 255, .1); }

.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; font-size: 1.25rem; font-weight: 700; color: var(--brand); }
.topbar .brand, .topbar .brand:hover { color: #fff; white-space: nowrap; }
/* The name in the Roman capitals of the logo. */
.brand-name { font-family: "Cinzel", Georgia, serif; font-size: 1.12rem; letter-spacing: .06em; }

.logo { flex: none; width: 46px; height: 46px; object-fit: contain; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255, 255, 255, .22), 0 6px 18px rgba(0, 0, 0, .35); transition: transform .5s var(--ease); }
.brand:hover .logo { transform: rotate(-6deg) scale(1.06); }

.bar-btn { flex: none; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 10px; color: #cfd9f0; background: rgba(255, 255, 255, .08); box-shadow: none; }
.bar-btn:hover { color: #fff; background: rgba(255, 255, 255, .18); box-shadow: none; }

.all-screens { display: none; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 11px; color: #fff; font-weight: 600; background: rgba(255, 255, 255, .14); transition: background .2s; }
.all-screens:hover { color: #fff; background: rgba(255, 255, 255, .24); }

.topbar nav { display: flex; flex: 1; flex-direction: column; gap: 2px; padding-top: 6px; }

.topbar nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 12px;
    color: rgba(226, 233, 248, .8);
    font-weight: 500;
    white-space: nowrap;
    transition: background .25s, color .25s, transform .25s var(--ease);
}

.topbar nav a::before {
    content: "";
    flex: none;
    width: 21px;
    height: 21px;
    background: currentColor;
    mask: var(--icon) center / contain no-repeat;
    -webkit-mask: var(--icon) center / contain no-repeat;
    transition: transform .3s var(--ease);
}

.topbar nav a[href="/"] { --icon: var(--i-home); }
.topbar nav a[href="/Materials"] { --icon: var(--i-layers); }
.topbar nav a[href="/Stock/Documents"] { --icon: var(--i-box); }
.topbar nav a[href="/Products"] { --icon: var(--i-bed); }
.topbar nav a[href="/Production"] { --icon: var(--i-factory); }
.topbar nav a[href="/Reports"] { --icon: var(--i-chart); }
.topbar nav a[href="/Export"] { --icon: var(--i-download); }
.topbar nav a[href="/Users"] { --icon: var(--i-users); }
.topbar nav a[href="/Roles"] { --icon: var(--i-shield); }
.topbar nav a[href="/Settings"] { --icon: var(--i-sliders); }
.topbar nav a[href="/Identity"] { --icon: var(--i-palette); }

.topbar nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); transform: translateX(-4px); }
.topbar nav a:hover::before { transform: scale(1.14); }

.topbar nav a.active {
    color: #fff;
    background: linear-gradient(120deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .07));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 8px 20px rgba(0, 0, 0, .18);
}

.topbar nav a.active::after {
    content: "";
    position: absolute;
    inset-block: 9px;
    inset-inline-start: -12px;
    width: 4px;
    border-radius: 4px 0 0 4px;
    background: linear-gradient(#b9a4ff, var(--glow));
}

.who { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 12px; background: rgba(255, 255, 255, .07); }
.who a { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: center; min-width: 0; color: #fff; }
.who a b, .who a small { grid-column: 2; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.avatar { display: grid; grid-row: span 2; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--night); font-weight: 700; background: linear-gradient(135deg, #fff, var(--glow)); box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); }
.bar-title, .bar-icon { display: none; }
.who b { display: block; font-weight: 600; line-height: 1.3; }
.who small { display: block; color: #aebbdc; font-size: .8rem; }
.who form { margin: 0; }
.who button.link { color: #b9c5e4; }
.who button.link:hover { color: #fff; transform: none; }

html[data-nav="mini"] .brand span, html[data-nav="mini"] .topbar nav span, html[data-nav="mini"] .who a { display: none; }
html[data-nav="mini"] .bar-head { flex-direction: column; }
html[data-nav="mini"] .topbar { align-items: stretch; padding-inline: 10px; }
html[data-nav="mini"] .topbar nav a { justify-content: center; padding: 11px 0; }
html[data-nav="mini"] .topbar nav a:hover { transform: none; }
html[data-nav="mini"] .who { justify-content: center; padding: 8px 2px; font-size: .78rem; }

/* The card layout: one bar across the top, like a till. Name and home on one side, where you are in the middle,
   settings and the person on the other. */
html[data-nav="cards"] .topbar {
    position: sticky;
    inset: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    width: auto;
    min-height: 66px;
    padding: 10px max(18px, calc((100% - 1800px) / 2 + 22px));
    overflow: visible;
    box-shadow: 0 10px 30px color-mix(in srgb, var(--night) 35%, transparent);
}

html[data-nav="cards"] .topbar nav { display: none; }
html[data-nav="cards"] .bar-head { padding: 0; border: 0; }
html[data-nav="cards"] .bar-btn { display: none; }
html[data-nav="cards"] .all-screens { display: inline-flex; }
html[data-nav="cards"] .all-screens.on { color: var(--night); background: var(--glow); }
body:has(.launch-hero) .bar-title { visibility: hidden; }
html[data-nav="cards"] .bar-title { display: block; flex: 1; overflow: hidden; color: rgba(255, 255, 255, .92); font-size: 1.05rem; font-weight: 600; text-align: center; white-space: nowrap; text-overflow: ellipsis; }
html[data-nav="cards"] .bar-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; color: #fff; font-size: 1.1rem; background: rgba(255, 255, 255, .1); transition: background .2s, transform .25s var(--ease); }
html[data-nav="cards"] .bar-icon:hover { color: #fff; background: rgba(255, 255, 255, .2); transform: rotate(-8deg); }
html[data-nav="cards"] .who { flex: none; padding: 5px 6px 5px 12px; border-radius: 30px; background: rgba(255, 255, 255, .08); }

/* Content */
main { max-width: 1800px; margin: 0 auto; padding: 20px 22px 40px; }

main > * { animation: rise .55s var(--ease) backwards; }
main > :nth-child(2) { animation-delay: .05s; }
main > :nth-child(3) { animation-delay: .1s; }
main > :nth-child(4) { animation-delay: .15s; }
main > :nth-child(5) { animation-delay: .2s; }
main > :nth-child(n + 6) { animation-delay: .25s; }

.head, .launcher-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: var(--gap); }
.head .sub, .launcher-head .sub { color: var(--muted); font-size: .92rem; margin-top: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.card {
    background: var(--paper);
    border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
    border-radius: 18px;
    padding: var(--card-pad) calc(var(--card-pad) + 2px);
    margin-bottom: var(--gap);
    box-shadow: var(--shadow);
    transition: box-shadow .35s;
}

.card:hover { box-shadow: var(--shadow-lift); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: var(--gap); margin-bottom: var(--gap); animation: none; }

/* Rows stay even: six cards as 3 + 3 (or one row on a wide screen), four as one row or 2 + 2, never one card left alone. */
@media (min-width: 721px) {
    .stats:has(> .stat:nth-child(6):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .stats:has(> .stat:nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1700px) {
    .stats:has(> .stat:nth-child(6):last-child) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (min-width: 721px) and (max-width: 1150px) {
    .stats:has(> .stat:nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.stat {
    --tone: var(--brand);
    --tint: var(--brand-soft);
    position: relative;
    overflow: hidden;
    padding: 15px 18px;
    border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
    border-radius: 18px;
    background: var(--paper);
    box-shadow: var(--shadow);
    animation: rise .6s var(--ease) backwards;
    transition: transform .35s var(--ease), box-shadow .35s;
}

/* The brand purple is too dark to read on a night card, so the first card takes its light tint there. */
html[data-dark="1"] .stat:nth-child(1) { --tone: var(--lift); --tint: color-mix(in srgb, var(--lift) 14%, transparent); }
.stat:nth-child(2) { --tone: var(--second); --tint: var(--second-soft); animation-delay: .07s; }
.stat:nth-child(3) { --tone: var(--good); --tint: var(--good-soft); animation-delay: .14s; }
.stat:nth-child(4) { --tone: #2a78d6; --tint: color-mix(in srgb, #2a78d6 14%, transparent); animation-delay: .21s; }
.stat:nth-child(5) { --tone: var(--warn); --tint: var(--warn-soft); animation-delay: .28s; }
.stat:nth-child(6) { --tone: var(--bad); --tint: var(--bad-soft); animation-delay: .35s; }

.stat::after {
    content: "";
    position: absolute;
    inset-block-start: -46px;
    inset-inline-end: -46px;
    width: 124px;
    height: 124px;
    border-radius: 50%;
    background: var(--tint);
    opacity: .8;
    transition: transform .6s var(--ease);
}

.stat:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.stat:hover::after { transform: scale(1.35); }
.stat .label { position: relative; z-index: 1; color: var(--muted); font-size: .88rem; font-weight: 500; }
.stat[data-i] .label { padding-inline-end: 32px; }
.stat .value { position: relative; z-index: 1; margin-top: 4px; font-size: 1.7rem; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.stat.danger .value { color: var(--bad); }

.stat[data-i]::before {
    content: "";
    position: absolute;
    z-index: 1;
    inset-block-start: 14px;
    inset-inline-end: 14px;
    width: 25px;
    height: 25px;
    background: var(--tone);
    mask: var(--icon) center / contain no-repeat;
    -webkit-mask: var(--icon) center / contain no-repeat;
}

/* Tables */
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { padding: var(--cell-y) 11px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: .86rem; font-weight: 600; background: var(--soft); border-bottom: 0; }
th:first-child { border-start-start-radius: 10px; border-end-start-radius: 10px; }
th:last-child { border-start-end-radius: 10px; border-end-end-radius: 10px; }
th a { display: inline-block; color: inherit; }
th a:hover { color: var(--second); }

tbody tr { animation: row .45s var(--ease) backwards; transition: background .2s; }
tbody tr:nth-child(2) { animation-delay: .04s; }
tbody tr:nth-child(3) { animation-delay: .08s; }
tbody tr:nth-child(4) { animation-delay: .12s; }
tbody tr:nth-child(5) { animation-delay: .16s; }
tbody tr:nth-child(n + 6) { animation-delay: .2s; }
tbody tr:hover { background: var(--soft); }
tbody tr:last-child td { border-bottom: 0; }
table.striped tbody tr:nth-child(even) { background: var(--soft); }
tr.search-off { display: none !important; }
.col-off { display: none !important; }

td.wrap, th.wrap { white-space: normal; min-width: 170px; }
td.num, th.num { text-align: left; direction: ltr; font-variant-numeric: tabular-nums; }
tr.total td { font-weight: 700; background: var(--soft); }
td.ltr { text-align: right; }

/* A table shown as cards: on phones always, on wider screens by choice */
table.as-cards thead { display: none; }
table.as-cards, table.as-cards tbody { display: block; }
table.as-cards tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }

table.as-cards tr {
    display: block;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--paper);
    transition: transform .25s var(--ease), box-shadow .25s;
}

table.as-cards tr:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

table.as-cards td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 32px;
    padding: 4px 2px;
    white-space: normal;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

table.as-cards td:last-child { border-bottom: 0; }
table.as-cards td::before { content: attr(data-label); flex: none; max-width: 48%; color: var(--muted); font-size: .84rem; font-weight: 500; text-align: right; }
table.as-cards td[data-label=""]::before { display: none; }
table.as-cards td:empty { display: none; }
table.as-cards td.num { direction: rtl; }
table.as-cards td.row-actions { width: auto; justify-content: flex-end; }
table.as-cards tr.total td { background: none; }
table.as-cards td > input, table.as-cards td > select, table.as-cards td > .combo { flex: 1; min-width: 0; }
.filter-toggle { display: none; }

/* Tools above every table */
.tbl-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.tbl-tools input[type="search"] { flex: 1 1 200px; max-width: 320px; padding-block: 6px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--soft); }
.seg button { padding: 3px 12px; border-radius: 8px; color: var(--muted); font-size: .86rem; font-weight: 500; background: none; box-shadow: none; }
.seg button::after { display: none; }
.seg button:hover { color: var(--brand); background: var(--brand-soft); transform: none; box-shadow: none; }
.seg button.on { color: #fff; background: var(--accent); }
.tool-btn { display: inline-block; padding: 5px 13px; border-radius: 9px; color: var(--brand); font-size: .86rem; font-weight: 600; background: var(--brand-soft); box-shadow: none; cursor: pointer; list-style: none; transition: filter .2s; }
.tool-btn::-webkit-details-marker { display: none; }
.tool-btn::after { display: none; }
.tool-btn:hover { color: var(--brand); filter: brightness(.96); transform: none; box-shadow: none; }
html[data-dark="1"] .tool-btn { color: var(--lift); }
.cols .menu-list { max-height: 300px; overflow-y: auto; }
.cols .check { padding: 5px 8px; margin: 0; font-size: .9rem; cursor: pointer; }

/* Charts */
.chart-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: var(--gap); animation: none; }
.chart-card { margin-bottom: var(--gap); animation: rise .6s var(--ease) backwards; }
.chart-box { position: relative; height: 260px; }

/* Badges and notices */
.up { color: var(--bad); font-weight: 500; }
.down { color: var(--good); font-weight: 500; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

.badge { display: inline-block; padding: 1px 10px; border-radius: 20px; font-size: .78rem; font-weight: 500; background: var(--soft); color: var(--muted); }
a.badge { margin: 0 0 6px 4px; transition: background .2s, color .2s; }
a.badge:hover { background: var(--brand-soft); color: var(--brand); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.good { background: var(--good-soft); color: var(--good); }

.notice { padding: 10px 16px; border-radius: 12px; border-inline-start: 4px solid transparent; margin: 0 0 var(--gap); font-weight: 500; transition: opacity .4s, transform .4s var(--ease), max-height .4s, margin .4s, padding .4s; }
.notice.ok { background: var(--good-soft); color: var(--good); border-color: var(--good); }
.notice.bad { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
.notice.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.notice.gone { opacity: 0; transform: translateY(-8px); max-height: 0; margin: 0; padding-block: 0; overflow: hidden; }
.notice ul { margin: 4px 0 0; padding-inline-start: 18px; font-weight: 400; }

/* Forms */
label { display: block; font-size: .88rem; font-weight: 500; color: var(--muted); margin-bottom: 5px; }

input, select, textarea {
    width: 100%;
    padding: 8px 12px;
    font: inherit;
    color: var(--ink);
    background: var(--input);
    border: 1px solid var(--line);
    border-radius: 10px;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--muted) 45%, transparent); }
input:focus, select:focus, textarea:focus { outline: 0; background: var(--paper); border-color: var(--second); box-shadow: 0 0 0 4px color-mix(in srgb, var(--second) 16%, transparent); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--second); }
input[type="file"] { padding: 7px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 14px; }
.check { display: flex; align-items: center; gap: 9px; color: var(--ink); font-size: .92rem; }

button, .btn {
    position: relative;
    display: inline-block;
    overflow: hidden;
    padding: 8px 18px;
    font: inherit;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border: 0;
    border-radius: 11px;
    cursor: pointer;
    box-shadow: 0 8px 18px color-mix(in srgb, var(--second) 24%, transparent);
    transition: transform .22s var(--ease), box-shadow .22s, filter .22s;
}

button::after, .btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .38) 50%, transparent 70%);
    transform: translateX(120%);
    transition: transform .65s var(--ease);
}

button:hover, .btn:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 12px 24px color-mix(in srgb, var(--second) 30%, transparent); }
button:hover::after, .btn:hover::after { transform: translateX(-120%); }
button:active, .btn:active { transform: translateY(0) scale(.98); }
button:disabled { opacity: .65; cursor: progress; transform: none; }

.btn.light, button.light { color: var(--brand); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.btn.light:hover, button.light:hover { color: var(--second); background: var(--second-soft); box-shadow: inset 0 0 0 1px var(--second); }
.btn.light.current { color: #fff; background: var(--accent); }
.btn.danger, button.danger { color: var(--bad); background: var(--paper); box-shadow: inset 0 0 0 1px var(--bad); }
.btn.danger:hover, button.danger:hover { color: #fff; background: var(--bad); }
button.link { background: none; border: 0; box-shadow: none; color: var(--brand); padding: 0; font-weight: 500; overflow: visible; }
button.link::after { display: none; }
button.mini, .btn.mini { padding: 3px 12px; font-size: .86rem; font-weight: 500; border-radius: 8px; }

.lines td { padding: 7px 6px; }
.lines input, .lines select { min-width: 100px; }
.live-total { display: inline-block; padding: 5px 14px; border-radius: 10px; color: var(--brand); font-weight: 600; background: var(--brand-soft); }

/* Layout pieces */
.columns { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(300px, 1fr); gap: var(--gap); align-items: start; }
.columns.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.more { display: inline-block; margin-top: 10px; font-weight: 500; }
.empty { margin: 4px 0; padding: 18px 14px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; }

.tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--soft); }
.tabs a { padding: 3px 14px; border-radius: 8px; color: var(--muted); font-size: .88rem; font-weight: 500; transition: background .2s, color .2s; }
.tabs a.on, html[data-dark="1"] .tabs a.on { color: #fff; background: var(--accent); }

.list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 6px; border-bottom: 1px solid var(--line); transition: background .2s; }
.list li:last-child { border-bottom: 0; }
.list li:hover { background: var(--soft); }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.step { display: block; padding: 18px; border-radius: 16px; color: var(--ink); background: linear-gradient(160deg, #f7f8fe, #f1f3fd); border: 1px solid var(--line); transition: transform .3s var(--ease), box-shadow .3s; }
.step:hover { color: var(--ink); transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.step b { display: block; margin-bottom: 3px; font-weight: 600; }
.step span { color: var(--muted); font-size: .92rem; }
.step i { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 10px; border-radius: 11px; color: #fff; font-style: normal; font-weight: 700; background: var(--accent); }

/* Filters and paging */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 11px 14px; margin-bottom: 14px; border: 1px solid color-mix(in srgb, var(--line) 80%, transparent); border-radius: 14px; background: var(--paper); box-shadow: var(--shadow-sm); }
.filters.flat { padding: 0; margin-bottom: 12px; border: 0; background: none; box-shadow: none; }
.filters > div { flex: 0 1 150px; min-width: 120px; }
.filters > .grow { flex: 1 1 240px; }
.filters > .presets { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 6px; }
.filters label { margin-bottom: 3px; font-size: .8rem; }
.filters input, .filters select { padding-block: 6px; }
.filters button, .filters .btn { padding-block: 7px; }
button.chip { padding: 2px 12px; border-radius: 16px; color: var(--muted); font-size: .82rem; font-weight: 500; background: var(--soft); box-shadow: none; }
button.chip::after { display: none; }
button.chip:hover { color: var(--brand); background: var(--brand-soft); transform: none; box-shadow: none; }

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: .88rem; }
.sizes, .pages { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.sizes a, .pages a { min-width: 32px; padding: 3px 9px; border-radius: 8px; color: var(--muted); text-align: center; transition: background .2s, color .2s; }
.sizes a:hover, .pages a:hover { background: var(--soft); color: var(--brand); }
.sizes a.on, .pages a.on, html[data-dark="1"] .sizes a.on, html[data-dark="1"] .pages a.on { color: #fff; background: var(--accent); }

/* Menus */
td.row-actions { width: 44px; padding-block: 3px; text-align: center; }
.menu { position: relative; display: inline-block; }
.menu > summary:not(.tool-btn) { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: var(--muted); font-size: 1.2rem; font-weight: 700; line-height: 1; list-style: none; cursor: pointer; transition: background .2s, color .2s; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover, .menu[open] > summary { background: var(--brand-soft); color: var(--brand); }
.menu-list { position: fixed; z-index: 50; min-width: 190px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: var(--shadow-lift); text-align: right; animation: rise .2s var(--ease) backwards; }
.menu-list a, .menu-list .plain { display: block; width: 100%; padding: 7px 11px; border-radius: 8px; color: var(--ink); font: inherit; font-size: .92rem; font-weight: 400; text-align: right; background: none; box-shadow: none; }
.menu-list a:hover, .menu-list .plain:hover { color: var(--brand); background: var(--brand-soft); transform: none; box-shadow: none; }
.menu-list .plain::after { display: none; }
.menu-list a.danger { color: var(--bad); }
.menu-list a.danger:hover { background: var(--bad-soft); color: var(--bad); }
.menu-list form { margin: 0; }

/* The card screen */
.group-title { margin: 18px 0 10px; }
.group-title:first-of-type { margin-top: 0; }
.group-title small { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin-inline-start: 6px; border-radius: 11px; color: var(--muted); font-size: .75rem; font-weight: 600; background: var(--soft); vertical-align: middle; }

.launch-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 520px);
    align-items: center;
    gap: 18px 28px;
    padding: 24px 28px;
    margin-bottom: 10px;
    overflow: hidden;
    border-radius: 24px;
    color: #fff;
    background:
        radial-gradient(420px 220px at 12% 0%, color-mix(in srgb, var(--glow) 28%, transparent), transparent 70%),
        radial-gradient(520px 260px at 95% 110%, color-mix(in srgb, var(--second) 45%, transparent), transparent 70%),
        linear-gradient(120deg, var(--night), var(--night-mid) 55%, var(--night-end));
    box-shadow: var(--shadow-lift);
}
.launch-hero h1 { margin: 0; color: #fff; font-size: 1.75rem; }
.launch-hero p { margin: 4px 0 0; color: rgba(255, 255, 255, .78); }
.launch-alerts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.launch-alert { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 20px; color: #fff; font-size: .88rem; font-weight: 600; background: rgba(255, 255, 255, .12); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); transition: background .2s, transform .25s var(--ease); }
.launch-alert:hover { color: #fff; background: rgba(255, 255, 255, .22); transform: translateY(-2px); }
.launch-alert.warn .ic { color: var(--glow); }
.launch-side { display: grid; gap: 12px; justify-items: stretch; }
.launch-search { position: relative; margin: 0; }
.launch-search .ic { position: absolute; top: 50%; inset-inline-start: 16px; color: rgba(255, 255, 255, .7); font-size: 1.15rem; transform: translateY(-50%); pointer-events: none; }
.launch-search input { height: 52px; padding-inline: 46px 16px; border: 1px solid rgba(255, 255, 255, .22); border-radius: 16px; color: #fff; font-size: 1.02rem; background: rgba(255, 255, 255, .1); }
.launch-search input::placeholder { color: rgba(255, 255, 255, .62); }
.launch-search input:focus { border-color: var(--glow); background: rgba(255, 255, 255, .16); box-shadow: 0 0 0 4px color-mix(in srgb, var(--glow) 25%, transparent); }
.launch-side .nav-switch { justify-self: end; background: rgba(255, 255, 255, .1); }
.launch-side .nav-switch a { color: rgba(255, 255, 255, .85); }
.launch-side .nav-switch a.on { color: var(--night); background: #fff; }
.launch-empty { padding: 30px; text-align: center; }

/* Every row of cards fills the width, the last one too (its cards grow), so no screen size shows a gap. */
.tiles { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 8px; animation: none; }
.tiles > .tile { flex: 1 1 210px; }

.tile {
    --tone-a: var(--brand);
    --tone-b: var(--second);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 150px;
    padding: 16px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
    border-radius: 20px;
    color: var(--ink);
    background: var(--paper);
    box-shadow: var(--shadow);
    animation: pop .55s var(--ease) backwards;
    transition: transform .3s var(--ease), box-shadow .3s;
}

.tile:nth-child(2) { animation-delay: .05s; }
.tile:nth-child(3) { animation-delay: .1s; }
.tile:nth-child(4) { animation-delay: .15s; }
.tile:nth-child(5) { animation-delay: .2s; }
.tile.tone-2 { --tone-a: #0f8a7d; --tone-b: #2a78d6; }
.tile.tone-3 { --tone-a: #d9722a; --tone-b: #cf3341; }
.tile.tone-4 { --tone-a: #6250d6; --tone-b: #c0449a; }
.tile.tone-5 { --tone-a: #1f7fa8; --tone-b: #1baf7a; }

.tile::after { content: ""; position: absolute; inset-block-end: -40px; inset-inline-end: -40px; width: 120px; height: 120px; border-radius: 50%; background: linear-gradient(135deg, var(--tone-a), var(--tone-b)); opacity: .09; transition: transform .6s var(--ease), opacity .4s; }
/* A large faint copy of the icon fills the far side of a wide card. */
.tile::before { content: ""; position: absolute; inset-block-start: 50%; inset-inline-end: 40px; width: 96px; height: 96px; background: linear-gradient(135deg, var(--tone-a), var(--tone-b)); opacity: .08; transform: translateY(-50%) rotate(-8deg); mask: var(--icon) center / contain no-repeat; -webkit-mask: var(--icon) center / contain no-repeat; transition: transform .5s var(--ease), opacity .4s; }
.tile:hover::before { opacity: .14; transform: translateY(-50%) rotate(0) scale(1.08); }
.tile-go { position: absolute; z-index: 1; inset-block-end: 16px; inset-inline-end: 16px; color: var(--tone-a); font-size: 1.1rem; opacity: 0; transform: translateX(8px); transition: opacity .3s, transform .3s var(--ease); }
.tile:hover .tile-go, .tile:focus-visible .tile-go { opacity: 1; transform: none; }
.tile:hover { color: var(--ink); transform: translateY(-6px) scale(1.015); box-shadow: var(--shadow-lift); }
.tile:hover::after { transform: scale(2.2); opacity: .14; }
.tile:active { transform: scale(.98); }
.tile b { position: relative; z-index: 1; margin-top: 10px; font-size: 1.1rem; font-weight: 700; }
.tile span { position: relative; z-index: 1; color: var(--muted); font-size: .86rem; }
.tile em { position: absolute; z-index: 1; inset-block-start: 14px; inset-inline-end: 14px; padding: 1px 9px; border-radius: 12px; color: var(--warn); font-size: .76rem; font-style: normal; font-weight: 600; background: var(--warn-soft); }
.tile-icon { position: relative; z-index: 1; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; color: #fff; font-size: 1.35rem; background: linear-gradient(135deg, var(--tone-a), var(--tone-b)); box-shadow: 0 10px 22px color-mix(in srgb, var(--tone-a) 35%, transparent); transition: transform .4s var(--ease); }
.tile:hover .tile-icon { transform: rotate(-6deg) scale(1.1); }

/* Reports and roles */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; margin-bottom: 8px; }
.report-card, .role-card { display: block; padding: 15px 17px; border: 1px solid color-mix(in srgb, var(--line) 80%, transparent); border-radius: 16px; color: var(--ink); background: var(--paper); box-shadow: var(--shadow); animation: rise .5s var(--ease) backwards; transition: transform .3s var(--ease), box-shadow .3s; }
.report-card:hover { color: var(--ink); transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.report-card { display: grid; grid-template-columns: auto 1fr; gap: 0 12px; align-items: start; }
.report-card .report-icon { grid-row: span 2; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: #fff; background: var(--accent); transition: transform .35s var(--ease); }
.report-card:hover .report-icon { transform: rotate(-6deg) scale(1.08); }
.report-card b { display: block; margin-bottom: 3px; font-weight: 600; }
.report-card span { color: var(--muted); font-size: .9rem; }
.role-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 1.05rem; }
.role-head b { font-weight: 600; }
.role-card p { min-height: 46px; margin: 4px 0 8px; font-size: .9rem; }
.role-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.role-actions .btn, .role-actions button { padding: 4px 13px; font-size: .88rem; }
.role-actions form { margin: 0; }
.meter { height: 6px; margin-bottom: 4px; overflow: hidden; border-radius: 4px; background: var(--soft); }
.meter i { display: block; width: var(--w); height: 100%; background: var(--accent); animation: grow .9s var(--ease) backwards; transform-origin: right; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; margin-bottom: 14px; }
.perm-group { display: grid; gap: 7px; align-content: start; min-width: 0; margin: 0; padding: 14px 16px; }
.perm-group legend { float: left; width: 100%; padding: 0 0 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.perm-group legend .check { font-size: .98rem; font-weight: 600; }
.perm-group .check { margin: 0; cursor: pointer; }

/* Display settings */
.settings { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: var(--gap); align-items: start; }
.settings .card { margin: 0; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; margin: 0; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice > span { display: flex; align-items: center; gap: 8px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); font-size: .92rem; background: var(--soft); transition: border-color .2s, background .2s, transform .2s var(--ease); }
.choice small { color: var(--muted); }
.choice:hover > span { transform: translateY(-2px); }
.choice input:checked + span { border-color: var(--second); background: var(--second-soft); box-shadow: inset 0 0 0 1px var(--second); font-weight: 600; }
.choice input:focus-visible + span { outline: 2px solid var(--second); outline-offset: 2px; }
.font-cairo > span { font-family: "Cairo", sans-serif; }
.font-tajawal > span { font-family: "Tajawal", sans-serif; }
.font-almarai > span { font-family: "Almarai", sans-serif; }
.font-plex > span { font-family: "IBM Plex Sans Arabic", sans-serif; }
.font-kufi > span { font-family: "Noto Kufi Arabic", sans-serif; }
.swatch { display: inline-block; width: 16px; height: 16px; border-radius: 50%; }
.swatch-night { background: linear-gradient(135deg, #5b2c83 45%, #e3b766); }
.swatch-royal { background: linear-gradient(135deg, #2447c7, #7c3aed); }
.swatch-emerald { background: linear-gradient(135deg, #0f766e, #0e9f6e); }
.swatch-rose { background: linear-gradient(135deg, #be185d, #7c3aed); }
.swatch-amber { background: linear-gradient(135deg, #b45309, #dc2626); }
.swatch-slate { background: linear-gradient(135deg, #334155, #0284c7); }

/* Toasts, dialogs, and small helpers */
.toasts { position: fixed; z-index: 70; inset-block-start: 16px; inset-inline-end: 50%; transform: translateX(50%); display: grid; gap: 8px; pointer-events: none; }
.toast { padding: 9px 20px; border-radius: 12px; color: #fff; font-weight: 600; background: var(--good); box-shadow: var(--shadow-lift); animation: pop .35s var(--ease) backwards; transition: opacity .4s, transform .4s var(--ease); }
html[data-dark="1"] .toast { color: #0c1222; }
.toast.bad { background: var(--bad); }
.toast.gone { opacity: 0; transform: translateY(-10px); }

dialog.confirm { max-width: 400px; padding: 22px 24px; border: 0; border-radius: 18px; color: var(--ink); background: var(--paper); box-shadow: var(--shadow-lift); animation: pop .3s var(--ease) backwards; }
dialog.confirm::backdrop { background: rgba(11, 23, 54, .5); backdrop-filter: blur(3px); }
dialog.confirm p { margin: 0 0 16px; font-size: 1.05rem; font-weight: 600; }

/* The password reads left to right, so the eye sits at its physical end, clear of the text. */
.secret { position: relative; }
.secret input { padding-left: 46px; padding-right: 12px; text-align: left; }
.secret .eye { position: absolute; top: 50%; left: 6px; display: grid; place-items: center; width: 34px; height: 30px; padding: 0; border-radius: 8px; color: var(--muted); font-size: 1rem; background: none; box-shadow: none; transform: translateY(-50%); }
.secret .eye::after { display: none; }
.secret .eye:hover, .secret .eye:focus-visible { color: var(--brand); background: var(--brand-soft); box-shadow: none; transform: translateY(-50%); }
.secret .eye:active { transform: translateY(-50%) scale(.92); }

/* Every list is a search box with a chevron at its end, so it still reads as a list. */
.combo { position: relative; }
.combo select { display: none; }
.combo-input { padding-left: 34px; text-overflow: ellipsis; cursor: pointer; }
.combo-input:focus { cursor: text; }
.combo-input:disabled { cursor: not-allowed; opacity: .6; }
.combo::after { content: ""; position: absolute; top: 50%; left: 14px; width: 7px; height: 7px; border-bottom: 2px solid var(--muted); border-left: 2px solid var(--muted); border-radius: 1px; pointer-events: none; transform: translateY(-70%) rotate(-45deg); transition: transform .2s var(--ease), border-color .2s; }
.combo:has(.combo-input[aria-expanded="true"])::after { border-color: var(--second); transform: translateY(-25%) rotate(135deg); }
.combo-list { position: fixed; z-index: 55; max-height: 280px; padding: 5px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: var(--shadow-lift); animation: rise .18s var(--ease) backwards; }
.combo-list button { display: block; width: 100%; padding: 8px 10px; overflow: hidden; border-radius: 8px; color: var(--ink); font-size: .92rem; font-weight: 400; line-height: 1.5; text-align: right; text-overflow: ellipsis; white-space: nowrap; background: none; box-shadow: none; }
.combo-list button::after { display: none; }
.combo-list button:hover, .combo-list button.hover, .combo-list button.on { color: var(--brand); background: var(--brand-soft); transform: none; box-shadow: none; }
.combo-list button.on { font-weight: 600; }
html[data-dark="1"] .combo-list button:hover, html[data-dark="1"] .combo-list button.hover, html[data-dark="1"] .combo-list button.on { color: var(--lift); }
.combo-list span { display: block; padding: 8px 10px; }

button.busy { color: transparent !important; }
button.busy::before { content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
button.light.busy::before { border-color: var(--line); border-top-color: var(--brand); }

label:has(+ input[required])::after, label:has(+ .secret input[required])::after { content: " *"; color: var(--bad); }
:focus-visible { outline: 2px solid var(--second); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 0; }

.status-card { max-width: 460px; margin: 8vh auto 0; padding: 30px; text-align: center; }
.status-card .tile-icon { margin: 0 auto 12px; background: var(--accent); }
.status-card h1 { margin-bottom: 6px; }
main.center .status-card { margin-top: 0; }

.print-head { display: none; }

/* Sign-in: a night sky around the card */
body:not(:has(.topbar)) {
    background:
        radial-gradient(520px 520px at 82% 14%, rgba(126, 105, 240, .5), transparent 70%),
        radial-gradient(620px 460px at 12% 88%, color-mix(in srgb, var(--glow) 22%, transparent), transparent 70%),
        linear-gradient(160deg, var(--night), var(--night-mid) 55%, var(--night-end));
}

body:not(:has(.topbar))::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(1.6px 1.6px at 40px 60px, #fff, transparent),
        radial-gradient(1.2px 1.2px at 130px 180px, #fff, transparent),
        radial-gradient(1.8px 1.8px at 260px 90px, #fff, transparent),
        radial-gradient(1px 1px at 330px 260px, #fff, transparent),
        radial-gradient(1.4px 1.4px at 420px 150px, #fff, transparent),
        radial-gradient(1.2px 1.2px at 520px 300px, #fff, transparent),
        radial-gradient(1.6px 1.6px at 90px 330px, #fff, transparent);
    background-size: 560px 380px;
    animation: twinkle 4.5s ease-in-out infinite;
}

main.center { position: relative; z-index: 1; display: grid; align-content: center; max-width: 430px; min-height: 100vh; padding: 24px 16px; }
main.center > * { animation: pop .75s var(--ease) backwards; }
main.center .card { margin: 0; padding: 30px 30px 32px; border: 1px solid rgba(255, 255, 255, .5); border-radius: 24px; background: rgba(255, 255, 255, .96); box-shadow: 0 30px 80px rgba(5, 10, 40, .5); backdrop-filter: blur(10px); }
main.center button { width: 100%; padding-block: 11px; }
.login-logo { display: block; width: min(250px, 100%); height: auto; margin: 0 auto 2px; animation: float 6s ease-in-out infinite; }
.tagline { margin: 0 0 4px; color: #3b2457; font-family: "Cinzel", Georgia, serif; font-size: .74rem; font-weight: 500; letter-spacing: .26em; text-align: center; text-transform: uppercase; }
.login-logo + .brand { display: none; }
h1.brand { display: block; font-size: 1.6rem; color: var(--brand); }

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes row { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes twinkle { 0%, 100% { opacity: .85; } 50% { opacity: .35; } }
@keyframes load { from { transform: scaleX(0); } to { transform: scaleX(.92); } }
@keyframes slide { to { background-position: -200% 0; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }

html[data-motion="off"] *, html[data-motion="off"] *::before, html[data-motion="off"] *::after { animation: none !important; transition: none !important; }

@media (max-width: 1280px) {
    .chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .chart-card.wide { grid-column: 1 / -1; }
}

@media (max-width: 1180px) {
    .columns, .columns.even { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
    html { --sidebar: 0px !important; }
    body:has(.topbar) { padding-inline-start: 0; padding-bottom: 72px; }
    html[data-nav="cards"] body:has(.topbar) { padding-bottom: 0; }

    .topbar, html[data-nav="mini"] .topbar {
        position: sticky;
        inset: 0 0 auto;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: auto;
        padding: 8px 14px;
        overflow: visible;
    }

    .bar-head, html[data-nav="mini"] .bar-head { flex-direction: row; padding: 0; border: 0; }
    .bar-btn { display: none; }
    .brand { font-size: 1.05rem; }
    .logo { width: 36px; height: 36px; }
    html[data-nav="mini"] .brand span { display: inline; }
    html[data-nav="mini"] .who a, .who a { display: grid; }
    .who, html[data-nav="mini"] .who { padding: 0; background: none; font-size: .88rem; }
    .who small { display: none; }

    .topbar nav, html[data-nav="mini"] .topbar nav {
        position: fixed;
        inset: auto 0 0;
        z-index: 40;
        flex-direction: row;
        gap: 2px;
        padding: 6px 8px;
        overflow-x: auto;
        scrollbar-width: none;
        background: linear-gradient(120deg, var(--night), var(--night-end));
        box-shadow: 0 -6px 20px rgba(11, 23, 54, .25);
    }

    .topbar nav a, html[data-nav="mini"] .topbar nav a { flex: none; flex-direction: column; gap: 2px; min-width: 74px; padding: 6px 8px; font-size: .74rem; }
    html[data-nav="mini"] .topbar nav span { display: inline; }
    .topbar nav a:hover { transform: none; }
    .topbar nav a.active::after { display: none; }

    main { padding: 14px 14px 24px; }
    h1 { font-size: 1.4rem; }
    .head .actions { width: 100%; }
    .head .actions .btn, .head .actions button { flex: 1 1 auto; text-align: center; }
    .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
    .stat { padding: 12px 14px; }
    .stat .value { font-size: 1.28rem; }
    .stat[data-i]::before { width: 20px; height: 20px; inset-block-start: 10px; inset-inline-end: 10px; }
    .card { padding: 13px; border-radius: 16px; }
    .chart-grid { grid-template-columns: minmax(0, 1fr); }
    .settings { grid-template-columns: minmax(0, 1fr); }
    .tiles { gap: 10px; }
    .tiles > .tile { flex-basis: calc(50% - 5px); }
    .tile { min-height: 130px; padding: 13px; }
    .tile::before { width: 64px; height: 64px; inset-inline-end: 14px; }
    .tile-icon { width: 46px; height: 46px; }
    .launch-hero { grid-template-columns: minmax(0, 1fr); padding: 18px; border-radius: 20px; }
    .launch-hero h1 { font-size: 1.4rem; }
    .launch-side .nav-switch { justify-self: start; }
    html[data-nav="cards"] .topbar { min-height: 0; padding: 8px 12px; gap: 8px; }
    html[data-nav="cards"] .bar-title { display: none; }
    html[data-nav="cards"] .all-screens { margin-inline-start: auto; padding: 8px 10px; }
    html[data-nav="cards"] .all-screens span { display: none; }
    html[data-nav="cards"] .bar-icon { width: 36px; height: 36px; }
    html[data-nav="cards"] .who { padding: 3px; }
    html[data-nav="cards"] .who a b { display: none; }
    .avatar { width: 32px; height: 32px; }
}

@media (max-width: 720px) {
    .pager { justify-content: center; text-align: center; }
    table.as-cards tbody { grid-template-columns: minmax(0, 1fr); }
    .tbl-tools input[type="search"] { max-width: none; flex-basis: 100%; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filters > div, .filters > .grow { flex: 1 1 100%; }
    .filters button, .filters .btn { flex: 1 1 40%; text-align: center; }
    .filter-toggle { display: inline-block; flex: 1 1 40%; }
    .filters.folded > *:not(.filter-toggle):not(.grow:first-child) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
    body:has(.topbar) { padding: 0; background: #fff; }
    .topbar, .actions, .filters, .pager, .row-actions, .tbl-tools, form, .chart-card { display: none !important; }
    main { padding: 0; max-width: none; }
    .print-head { display: flex !important; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 10px; margin-bottom: 14px; border-bottom: 2px solid var(--brand); }
    .print-head img { width: 110px; height: 60px; object-fit: contain; }
    .print-head div { flex: 1; }
    .print-head b { display: block; font-size: 1.2rem; }
    .toasts { display: none; }
    .card, .stat { box-shadow: none; border: 0; }
    main > *, tbody tr { animation: none !important; }
    table.as-cards thead { display: table-header-group; }
    table.as-cards, table.as-cards tbody { display: table; width: 100%; }
    table.as-cards tr { display: table-row; }
    table.as-cards td { display: table-cell; }
    table.as-cards td::before { display: none; }
}

/* Brand studio */
.small { font-size: .85rem; }
.preview-bar { position: sticky; top: 8px; z-index: 25; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 16px; margin-bottom: var(--gap); border-radius: 14px; color: #fff; background: linear-gradient(120deg, var(--night-mid), var(--night-end)); box-shadow: var(--shadow-lift); }
.preview-bar span { flex: 1; min-width: 200px; }
.preview-bar b { display: inline-block; padding: 1px 10px; margin-inline-end: 6px; border-radius: 20px; color: var(--night); background: var(--glow); }
.preview-bar form { margin: 0; }

.id-live { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 22px; }
.id-live-art { display: flex; align-items: center; gap: 16px; }
.id-seal { width: 84px; height: 84px; border-radius: 50%; box-shadow: var(--shadow); }
.id-logo { max-width: 210px; max-height: 110px; object-fit: contain; }
.id-live-text h2 { margin-bottom: 2px; }
.id-live-text p { margin: 2px 0; }
/* A Latin name keeps its own reading order but sits on the right like the rest of the page. */
.id-live-text p[dir="auto"] { text-align: right; }
.id-name { font-size: 1.3rem; font-weight: 700; color: var(--brand); }
.id-swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); }
.id-chip { display: inline-block; flex: none; width: 22px; height: 22px; padding: 0; border-radius: 50%; background: var(--chip); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.id-chip::after { display: none; }
.id-chip.pick { width: 30px; height: 30px; cursor: pointer; transition: transform .2s var(--ease); }
.id-chip.pick:hover { transform: scale(1.15); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12), 0 4px 12px color-mix(in srgb, var(--chip) 50%, transparent); }
.id-start { display: grid; gap: 10px; justify-items: stretch; }
.id-start form { margin: 0; }
.id-drop { position: relative; display: grid; justify-items: center; gap: 2px; min-width: 230px; padding: 16px 18px; margin: 0; border: 2px dashed color-mix(in srgb, var(--second) 45%, transparent); border-radius: 16px; color: var(--ink); text-align: center; background: var(--second-soft); cursor: pointer; transition: border-color .2s, transform .25s var(--ease); }
.id-drop:hover { border-color: var(--second); transform: translateY(-2px); }
.id-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.id-drop .ic { font-size: 1.5rem; color: var(--second); }
.id-drop span { color: var(--muted); font-size: .82rem; font-weight: 400; }
.id-drop.small { justify-items: start; grid-template-columns: auto 1fr; column-gap: 12px; text-align: start; margin-bottom: 16px; }
.id-drop.small .ic { grid-row: span 2; }

.id-studio { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: var(--gap); align-items: start; margin-bottom: var(--gap); }
.id-studio .id-decide { grid-column: 1 / -1; }
.id-form h3 { margin: 18px 0 8px; font-size: 1rem; }
.id-colors { display: grid; gap: 14px; }
.id-color-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.id-color-row input[type="color"] { width: 54px; height: 38px; padding: 3px; cursor: pointer; }
.id-seal-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.id-seal-live { flex: none; width: 150px; height: 150px; border-radius: 50%; background: #fff no-repeat; box-shadow: inset 0 0 0 7px var(--ring), var(--shadow); }
.id-sliders { display: grid; flex: 1; min-width: 200px; gap: 10px; }
.id-sliders label { margin: 0; }
.id-sliders input { padding: 0; accent-color: var(--second); }

.id-preview { --accent: linear-gradient(120deg, var(--brand), var(--second)); position: sticky; top: 12px; padding: var(--card-pad); border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); }
.id-mocks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.id-mock { position: relative; overflow: hidden; min-height: 150px; padding: 14px 14px 30px; border-radius: 14px; background: var(--soft); }
.id-mock-label { position: absolute; inset-inline-start: 12px; bottom: 8px; color: var(--muted); font-size: .76rem; }
.id-login { display: grid; place-items: center; background: linear-gradient(160deg, var(--night), var(--night-mid) 55%, var(--night-end)); }
.id-login .id-mock-label { color: rgba(255, 255, 255, .7); }
.id-login-card { display: grid; justify-items: center; gap: 4px; width: 100%; max-width: 230px; padding: 14px; border-radius: 14px; background: #fff; }
.id-login-card img { max-width: 150px; max-height: 70px; object-fit: contain; }
.id-login-card .tagline { margin: 0; font-size: .58rem; }
.id-login-card p { margin: 0; color: #5f6c83; }
.id-fake-input { width: 100%; height: 18px; border-radius: 6px; background: #f3f4f8; box-shadow: inset 0 0 0 1px #e6ebf3; }
.id-fake-btn { display: inline-block; padding: 4px 14px; border-radius: 8px; color: #fff; font-size: .8rem; font-weight: 600; text-align: center; background: var(--accent); }
.id-login-card .id-fake-btn { width: 100%; }
.id-fake-btn.light { color: var(--brand); background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.id-menu { display: grid; align-content: start; gap: 4px; color: #fff; background: linear-gradient(172deg, var(--night), var(--night-mid) 58%, var(--night-end)); }
.id-menu .id-mock-label { color: rgba(255, 255, 255, .7); }
.id-menu-head { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.id-menu-head img { width: 34px; height: 34px; border-radius: 50%; }
.id-menu-head .brand-name { font-size: .95rem; }
.id-menu-item { position: relative; padding: 5px 10px; border-radius: 9px; color: rgba(255, 255, 255, .78); font-size: .85rem; }
.id-menu-item.on { color: #fff; background: rgba(255, 255, 255, .14); }
.id-menu-item.on::after { content: ""; position: absolute; inset-block: 6px; inset-inline-start: -14px; width: 4px; border-radius: 4px 0 0 4px; background: linear-gradient(#b9a4ff, var(--glow)); }
.id-tabs { display: grid; align-content: start; gap: 8px; }
.id-tab { display: flex; align-items: center; gap: 8px; max-width: 220px; padding: 7px 12px; border-radius: 10px 10px 0 0; font-size: .8rem; }
.id-tab.light { color: #202124; background: #fff; box-shadow: 0 1px 0 #dadce0; }
.id-tab.dark { color: #e8eaed; background: #35363a; }
.id-tab img { width: 16px; height: 16px; }
.id-tab span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.id-phone { display: inline-grid; justify-items: center; gap: 4px; width: 78px; padding-top: 4px; font-size: .72rem; color: var(--muted); }
.id-phone img { width: 52px; height: 52px; border-radius: 13px; box-shadow: var(--shadow); }
.id-phone span { max-width: 78px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.id-parts { display: grid; align-content: start; gap: 12px; }
.id-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.id-bars { display: flex; align-items: end; gap: 6px; height: 64px; }
.id-bars i { flex: 1; height: var(--h); border-radius: 4px 4px 0 0; background: var(--bar); }
.id-logos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 10px 30px; }
.id-logos div { display: grid; place-items: center; min-height: 100px; padding: 10px; border-radius: 10px; }
.id-logos .light { background: #fff; }
.id-logos .dark { background: var(--night); }
.id-logos img { max-width: 100%; max-height: 80px; object-fit: contain; }
.id-decide p { margin: 0 0 10px; }
.id-decide form { margin: 0; }
.id-row { display: inline-flex; align-items: center; gap: 10px; }
.id-row img { width: 32px; height: 32px; border-radius: 50%; }
.id-row .badge { margin-inline-start: 4px; }

@media (max-width: 1100px) {
    .id-studio { grid-template-columns: 1fr; }
    .id-preview { position: static; }
}

@media (max-width: 720px) {
    .id-live { grid-template-columns: 1fr; justify-items: start; }
    .id-start { width: 100%; }
    .id-mocks { grid-template-columns: 1fr; }
    .preview-bar { top: 64px; }
}
.id-print { grid-template-columns: auto 1fr; gap: 8px; border-bottom: 2px solid var(--brand); border-radius: 10px 10px 0 0; }
.id-print img { max-height: 38px; }
.id-print span { display: grid; font-size: .72rem; color: #5f6c83; }
.id-print b { color: #17233b; font-size: .8rem; }
.preview-bar button:not(.light) { color: var(--night); background: var(--glow); box-shadow: none; }
.preview-bar .btn.light, .preview-bar button.light { color: #fff; background: rgba(255, 255, 255, .12); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
/* The full logo is made for light paper, so on night cards it sits on its own light plate. */
html[data-dark="1"] .id-logo { padding: 8px 12px; border-radius: 12px; background: #fff; }
html[data-dark="1"] .id-name { color: var(--lift); }
html[data-dark="1"] .id-chip { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28); }
.tile[hidden], .tile-group[hidden] { display: none; }
/* Tabs in a page head switch between sister screens, sized like the buttons beside them. */
.head > .tabs { flex-wrap: wrap; padding: 4px; border-radius: 12px; }
.head > .tabs a { padding: 7px 16px; font-size: .95rem; }
