

@import url('https://fonts.googleapis.com/css2?family=Spectral:wght@400;500;600;700&family=Inter:wght@400;500;600;700&family=Tangerine:wght@400;700&display=swap');

:root {
    
    --bg-canvas: #f4f1ea;
    --bg-surface: #ffffff;
    --bg-elevated: #ffffff;
    --bg-deep: #0d1b2a;
    --bg-deep-2: #142638;
    --bg-deep-3: #1c3046;

    
    --text-primary: #0d1b2a;
    --text-secondary: #5b6876;
    --text-muted: #8a94a0;
    --text-inverse: #f4f1ea;
    --text-inverse-muted: #a6b2c1;

    
    --accent: #b8935a;
    --accent-hover: #a07d45;
    --accent-soft: rgba(184, 147, 90, 0.12);

    
    --success: #2d6a4f;
    --success-soft: #e6f0ea;
    --warn: #a15c00;
    --warn-soft: #fbefd9;
    --error: #912018;
    --error-soft: #fbeae8;

    
    --border: #e5dfd2;
    --border-soft: #efeae0;
    --border-strong: #2b3a4d;

    
    --shadow-sm: 0 1px 2px rgba(13, 27, 42, 0.05);
    --shadow-md: 0 2px 4px rgba(13, 27, 42, 0.04), 0 4px 12px rgba(13, 27, 42, 0.06);
    --shadow-lg: 0 4px 8px rgba(13, 27, 42, 0.06), 0 16px 32px rgba(13, 27, 42, 0.08);
    --shadow-xl: 0 8px 16px rgba(13, 27, 42, 0.08), 0 24px 48px rgba(13, 27, 42, 0.12);

    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Spectral', 'Times New Roman', Georgia, serif;

    
    --radius-sm: 4px;
    --radius: 6px;
    --radius-lg: 10px;
    --radius-xl: 14px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    background: var(--bg-canvas);
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(1200px 800px at 85% -10%, rgba(184, 147, 90, 0.06), transparent 60%),
        radial-gradient(900px 600px at -10% 110%, rgba(13, 27, 42, 0.04), transparent 60%);
}

a {
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease, color 0.15s ease;
}
a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 500;
    letter-spacing: -0.015em;
    color: var(--text-primary);
    margin: 0 0 16px;
    line-height: 1.2;
}
h1 { font-size: 32px; font-weight: 500; letter-spacing: -0.02em; }
h2 { font-size: 20px; font-weight: 500; }
h3 { font-size: 16px; font-weight: 600; font-family: var(--font-sans); letter-spacing: 0; }

p { margin: 0 0 14px; }

.muted { color: var(--text-secondary); font-size: 14px; }

.eyebrow {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
    display: inline-block;
    margin-bottom: 8px;
}

.topbar {
    display: flex;
    align-items: center;
    padding: 0 32px;
    background: var(--bg-deep);
    border-bottom: 1px solid var(--border-strong);
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 0 rgba(0,0,0,0.3);
}
.topbar::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent) 20%, var(--accent) 80%, transparent);
    opacity: 0.3;
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding-left: 24px;
    margin-right: 40px;
}
.brand a {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--text-inverse);
    font-size: 22px;
    letter-spacing: -0.01em;
    border-bottom: none;
}
.brand a:hover { color: var(--accent); border-bottom: none; }
.brand-sub {
    color: var(--text-inverse-muted);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 500;
}

.topnav {
    display: flex;
    gap: 28px;
    flex: 1;
    height: 100%;
    align-items: center;
}
.topnav a {
    color: var(--text-inverse-muted);
    font-size: 14px;
    font-weight: 500;
    padding: 22px 0;
    border-bottom: 2px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.topnav a:hover {
    color: var(--text-inverse);
    border-bottom-color: var(--accent);
}

.userbox {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-inverse-muted);
}
.userbox span {
    padding-right: 16px;
    border-right: 1px solid rgba(255,255,255,0.1);
}
.userbox a {
    color: var(--text-inverse-muted);
    font-weight: 500;
}
.userbox a:hover { color: var(--accent); border-bottom-color: transparent; }

.container {
    max-width: 1180px;
    margin: 40px auto;
    padding: 0 32px;
    min-height: calc(100vh - 200px);
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.page-header h1 { margin-bottom: 4px; }
.page-header .muted { margin: 0; }

.footer {
    text-align: center;
    padding: 40px 24px 32px;
    color: var(--text-muted);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-top: auto;
}

.card, .panel {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}
.panel { margin-top: 24px; }
.panel h2 {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    gap: 10px;
}
.panel h2::before {
    content: "";
    width: 3px;
    height: 16px;
    background: var(--accent);
    border-radius: 2px;
}

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.tile {
    position: relative;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    overflow: hidden;
    border-bottom: none;
}
.tile::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
    opacity: 0;
    transition: opacity 0.18s ease;
}
.tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border);
    color: var(--text-primary);
}
.tile:hover::before { opacity: 1; }
.tile-label {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 600;
}
.tile-count {
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: 500;
    line-height: 1;
    margin-top: 12px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}
.tile-sub { color: var(--text-secondary); font-size: 13px; margin-top: 6px; }
.tile-link .tile-sub { margin-top: 14px; font-size: 14px; color: var(--text-secondary); }

label {
    display: block;
    margin-bottom: 18px;
}
label > span {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
input[type=text], input[type=password], input[type=date], input[type=time],
input[type=number], input[type=file], input[type=email], textarea, select {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: inherit;
    background: var(--bg-surface);
    color: var(--text-primary);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: vertical; min-height: 80px; }

.row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-soft);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    letter-spacing: 0.01em;
}
.btn:hover {
    background: var(--bg-canvas);
    border-color: var(--text-muted);
    color: var(--text-primary);
    border-bottom-color: var(--text-muted);
}
.btn-spinner {
    display: inline-block;
    width: 12px; height: 12px;
    margin-right: 8px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
    opacity: 0.85;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
.btn-primary {
    background: var(--bg-deep);
    color: var(--text-inverse);
    border-color: var(--bg-deep);
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
    background: var(--bg-deep-2);
    border-color: var(--bg-deep-2);
    color: var(--text-inverse);
    box-shadow: var(--shadow-md);
}
.btn-accent {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn-accent:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}
.btn-danger {
    background: var(--error);
    color: var(--text-inverse);
    border-color: var(--error);
    box-shadow: var(--shadow-sm);
}
.btn-danger:hover {
    background: #6f140f;
    border-color: #6f140f;
    color: var(--text-inverse);
    box-shadow: var(--shadow-md);
}

.anon-shell {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg-canvas);
    overflow-y: auto;
}
.anon-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 36px 36px;
    box-shadow: var(--shadow-lg);
}
.anon-card h1 {
    font-size: 22px;
    margin-bottom: 20px;
    font-weight: 500;
    letter-spacing: -0.01em;
}
.anon-card button {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
    font-size: 14px;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.anon-brand {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-soft);
}
.anon-brand-logo {
    width: 46px;
    height: auto;
    display: block;
    margin: 2px auto 12px;
}
.anon-brand-mark {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 6px;
}
.anon-brand-sub {
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}

.anon-footer {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border-soft);
    text-align: center;
}
.anon-apply-link {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    padding-bottom: 1px;
}
.anon-apply-link:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.anon-hint {
    margin: 14px 0 0;
    font-size: 12px;
    text-align: center;
    letter-spacing: 0.03em;
}

.anon-confirm {
    text-align: center;
    padding: 16px 4px 8px;
}
.anon-confirm-mark {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--success-soft);
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}
.anon-confirm h1 {
    font-size: 22px;
    margin-bottom: 12px;
}
.anon-confirm p {
    font-size: 14px;
    line-height: 1.55;
    margin-bottom: 24px;
}
.anon-confirm .btn {
    width: 100%;
    padding: 11px;
    font-size: 14px;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.login-hero {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(1000px 700px at 20% 10%, rgba(184, 147, 90, 0.16), transparent 55%),
        radial-gradient(800px 600px at 90% 90%, rgba(184, 147, 90, 0.08), transparent 55%),
        linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-deep-2) 100%);
    color: var(--text-inverse);
    padding: 48px 64px 36px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-y: auto;
}
.login-hero::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 85%);
    pointer-events: none;
}
.hero-watermark {
    position: fixed;
    right: -100px;
    bottom: -120px;
    width: 520px;
    height: auto;
    opacity: 0.05;
    pointer-events: none;
    user-select: none;
}

.hero-center {
    position: relative;
    z-index: 1;
    margin: auto 0;
    text-align: center;
}
.hero-center-mark {
    width: 118px;
    height: auto;
    display: block;
    margin: 0 auto 30px;
}
.hero-center-name {
    font-family: var(--font-display);
    font-size: 52px;
    font-weight: 600;
    letter-spacing: 0.18em;
    padding-left: 0.18em;
    color: var(--text-inverse);
    line-height: 1;
    margin-bottom: 26px;
}
.hero-center-rule {
    width: 54px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
    margin: 0 auto 22px;
}
.hero-center-sub {
    font-size: 11px;
    letter-spacing: 0.26em;
    padding-left: 0.26em;
    text-transform: uppercase;
    color: var(--text-inverse-muted);
    font-weight: 500;
    line-height: 2;
}

.hero-login {
    width: 100%;
    max-width: 296px;
    margin: 72px auto 0;
    text-align: center;
}
.hero-login label {
    display: block;
    position: relative;
    padding-top: 15px;
    margin-bottom: 14px;
}
.hero-login label > span {
    position: absolute;
    left: 0;
    right: 0;
    top: 29px;
    margin: 0;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-indent: 0.22em;
    text-transform: uppercase;
    color: rgba(244, 241, 234, 0.4);
    pointer-events: none;
    transition: top 0.18s ease, font-size 0.18s ease, color 0.18s ease, letter-spacing 0.18s ease;
}
.hero-login input:focus + span,
.hero-login input:not(:placeholder-shown) + span,
.hero-login input:-webkit-autofill + span {
    top: 0;
    font-size: 9px;
    letter-spacing: 0.26em;
    text-indent: 0.26em;
    color: var(--accent);
}
.hero-login input {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    padding: 10px 12px;
    color: var(--text-inverse);
    font-size: 15px;
    letter-spacing: 0.02em;
    text-align: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.hero-login input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(184, 147, 90, 0.18);
}
.hero-login input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px var(--bg-deep-2) inset;
    -webkit-text-fill-color: var(--text-inverse);
    caret-color: var(--text-inverse);
}
.hero-login button {
    width: 100%;
    padding: 11px;
    margin-top: 12px;
    font-size: 12px;
    letter-spacing: 0.22em;
    text-indent: 0.22em;
    text-transform: uppercase;
    font-weight: 600;
    background: var(--text-inverse);
    border-color: var(--text-inverse);
    color: var(--bg-deep);
}
.hero-login button:hover {
    background: #ffffff;
    border-color: #ffffff;
    color: var(--bg-deep);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}
.hero-login-flash {
    margin-bottom: 22px;
    padding: 9px 12px;
    border-radius: 3px;
    border-left: 2px solid #d3564c;
    background: rgba(145, 32, 24, 0.26);
    color: #f3c0bb;
    font-size: 12px;
    letter-spacing: 0.02em;
}
.hero-login-meta {
    margin-top: 30px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    font-size: 11px;
    color: var(--text-inverse-muted);
    letter-spacing: 0.06em;
}
.hero-login-meta a {
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.18em;
}
.hero-login-meta a:hover {
    border-bottom-color: var(--accent);
}

.hero-foot {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    margin-top: 28px;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-inverse-muted);
    opacity: 0.7;
}
.hero-foot > span:last-child { text-align: right; }
.hero-foot-version {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    line-height: 1.15;
    text-transform: none;
    letter-spacing: 0.06em;
    font-variant-numeric: tabular-nums;
    color: var(--text-inverse-muted);
}
.hero-foot-version .hfv-v {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    opacity: 0.7;
}

@keyframes intro-mark {
    from { opacity: 0; transform: translateY(-10px) scale(0.95); }
}
@keyframes intro-name {
    from { opacity: 0; letter-spacing: 0.34em; }
}
@keyframes intro-rule {
    from { opacity: 0; transform: scaleX(0); }
}
@keyframes intro-fade {
    from { opacity: 0; }
}
@keyframes intro-fade-up {
    from { opacity: 0; transform: translateY(12px); }
}
.login-hero .hero-center-mark {
    animation: intro-mark 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.04s both;
}
.login-hero .hero-center-name {
    animation: intro-name 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.16s both;
}
.login-hero .hero-center-rule {
    transform-origin: center;
    animation: intro-rule 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
}
.login-hero .hero-center-sub {
    animation: intro-fade-up 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.38s both;
}
.login-hero .hero-center > .hero-login {
    animation: intro-fade-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.46s both;
}
.login-hero .hero-foot {
    animation: intro-fade 0.5s ease 0.56s both;
}
.login-hero .hero-watermark {
    animation: intro-fade 1.1s ease 0.1s both;
}
.login-hero.intro-skip *,
.login-hero.intro-skip {
    animation-duration: 0s !important;
    animation-delay: 0s !important;
}
/* Auth overlay -- branded loader while credentials verify, then the welcome. */
.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 34px;
    background:
        radial-gradient(900px 600px at 50% 42%, rgba(184, 147, 90, 0.14), transparent 60%),
        linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-deep-2) 100%);
}
.auth-overlay[hidden],
.auth-loader[hidden],
.auth-welcome[hidden] { display: none; }

.auth-loader {
    position: relative;
    width: 190px;
    height: 190px;
    display: grid;
    place-items: center;
}
.auth-core {
    width: 84px;
    height: 84px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(184, 147, 90, 0.22), transparent 70%);
    animation: auth-pulse 1.8s ease-in-out infinite;
}
.auth-core img {
    width: 56px;
    height: auto;
    filter: drop-shadow(0 0 12px rgba(184, 147, 90, 0.55));
}
.auth-orbit {
    position: absolute;
    inset: 0;
    margin: auto;
    border-radius: 50%;
    border: 1px solid transparent;
}
.auth-orbit::before {
    content: "";
    position: absolute;
    top: -3.5px;
    left: 50%;
    width: 7px;
    height: 7px;
    margin-left: -3.5px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px 1px rgba(184, 147, 90, 0.85);
}
.auth-orbit-1 {
    width: 104px;
    height: 104px;
    border-top-color: var(--accent);
    border-right-color: rgba(184, 147, 90, 0.45);
    animation: auth-spin 1.1s linear infinite;
}
.auth-orbit-2 {
    width: 146px;
    height: 146px;
    border-bottom-color: var(--accent);
    border-left-color: rgba(184, 147, 90, 0.3);
    animation: auth-spin 1.7s linear infinite reverse;
}
.auth-orbit-3 {
    width: 190px;
    height: 190px;
    border-top-color: rgba(244, 241, 234, 0.5);
    border-left-color: rgba(184, 147, 90, 0.18);
    animation: auth-spin 2.7s linear infinite;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }
@keyframes auth-pulse {
    0%, 100% { transform: scale(1); opacity: 0.85; }
    50% { transform: scale(1.09); opacity: 1; }
}
.auth-status {
    font-size: 11px;
    letter-spacing: 0.34em;
    padding-left: 0.34em;
    text-transform: uppercase;
    font-weight: 500;
    color: var(--text-inverse-muted);
    animation: auth-status 1.6s ease-in-out infinite;
}
@keyframes auth-status {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 0.9; }
}

.auth-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}
.auth-welcome-mark {
    width: 92px;
    height: auto;
    animation: splash-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.auth-welcome-text {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--text-inverse);
    animation: splash-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}
@keyframes splash-in {
    from { opacity: 0; transform: translateY(10px) scale(0.97); }
}
@media (max-width: 640px) {
    .auth-loader { width: 152px; height: 152px; }
    .auth-orbit-1 { width: 88px; height: 88px; }
    .auth-orbit-2 { width: 120px; height: 120px; }
    .auth-orbit-3 { width: 152px; height: 152px; }
    .auth-core { width: 70px; height: 70px; }
    .auth-core img { width: 46px; }
    .auth-welcome-mark { width: 76px; }
    .auth-welcome-text { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
    .login-hero *, .apply-modal-panel, .apply-modal-backdrop {
        animation-duration: 0s !important;
        animation-delay: 0s !important;
    }
}

.apply-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.apply-modal[hidden] { display: none; }
@keyframes modal-pop {
    from { opacity: 0; transform: translateY(14px) scale(0.97); }
}
.apply-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 9, 16, 0.7);
    backdrop-filter: blur(6px);
    animation: intro-fade 0.25s ease both;
}
.apply-modal-panel {
    position: relative;
    animation: modal-pop 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
    width: 100%;
    max-width: 384px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    background: linear-gradient(180deg, var(--bg-deep-2) 0%, var(--bg-deep) 100%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    padding: 38px 36px 32px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}
.apply-modal-panel::before {
    content: "";
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 54px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}
.apply-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-inverse-muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 6px;
    transition: color 0.15s ease;
}
.apply-modal-close:hover { color: var(--text-inverse); }
.apply-modal-head {
    text-align: center;
    margin-bottom: 6px;
}
.apply-modal-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--text-inverse);
    margin-bottom: 6px;
}
.apply-modal-sub {
    font-size: 10px;
    letter-spacing: 0.18em;
    text-indent: 0.18em;
    text-transform: uppercase;
    color: var(--text-inverse-muted);
    font-weight: 500;
}
.apply-flash {
    margin: 16px 0 0;
    white-space: pre-line;
    text-align: left;
}
.apply-form {
    margin: 24px auto 0;
    max-width: none;
}
.apply-form .row {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.apply-success {
    text-align: center;
    padding: 8px 0 4px;
}
.apply-success-mark {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid var(--accent);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 6px auto 20px;
}
.apply-success-copy {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-inverse-muted);
    margin: 0 0 24px;
}
.apply-success-btn,
.apply-modal .hero-login button,
.apply-modal .btn {
    width: 100%;
    padding: 11px;
    font-size: 12px;
    letter-spacing: 0.22em;
    text-indent: 0.22em;
    text-transform: uppercase;
    font-weight: 600;
    background: var(--text-inverse);
    border-color: var(--text-inverse);
    color: var(--bg-deep);
}
.apply-modal .btn:hover {
    background: #ffffff;
    border-color: #ffffff;
    color: var(--bg-deep);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}
.apply-modal .btn:disabled {
    opacity: 0.6;
    cursor: default;
}

@media (max-width: 640px) {
    .login-hero { padding: 36px 24px 26px; }
    .hero-center-mark { width: 96px; margin-bottom: 26px; }
    .hero-center-name { font-size: 42px; }
    .hero-login { margin-top: 48px; }
    .hero-foot { font-size: 9px; letter-spacing: 0.06em; gap: 8px; }
    .apply-modal { padding: 16px; }
    .apply-modal-panel { padding: 32px 24px 26px; }
}

.grid {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}
.grid th, .grid td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-soft);
}
.grid th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: var(--bg-canvas);
    border-bottom: 1px solid var(--border);
}
.grid th:first-child { border-top-left-radius: var(--radius); }
.grid th:last-child  { border-top-right-radius: var(--radius); }
.grid tbody tr:last-child td { border-bottom: none; }
.grid tbody tr:hover { background: rgba(184, 147, 90, 0.03); }
.grid a {
    color: var(--accent);
    font-weight: 500;
    border-bottom-color: transparent;
}
.grid a:hover { border-bottom-color: var(--accent); }

.flashes { margin-bottom: 24px; }
.flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    border-left: 3px solid var(--border);
    background: var(--bg-surface);
    margin-bottom: 8px;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
}
.flash-error { border-left-color: var(--error); background: var(--error-soft); color: var(--error); }
.flash-success { border-left-color: var(--success); background: var(--success-soft); color: var(--success); }

.tag {
    display: inline-block;
    padding: 3px 10px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: var(--bg-canvas);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.tag-success, .tag-high { background: var(--success-soft); color: var(--success); border-color: transparent; }
.tag-pending, .tag-medium { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag-failed, .tag-low { background: var(--error-soft); color: var(--error); border-color: transparent; }

.review-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}
@media (max-width: 900px) {
    .review-grid { grid-template-columns: 1fr; }
}
.review-image {
    position: sticky;
    top: 88px;
    align-self: flex-start;
}
.review-image img {
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    box-shadow: var(--shadow-md);
}
.review-form { align-self: start; }

.detail-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 24px;
}
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-image {
    max-width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; }
dt {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    font-weight: 600;
    align-self: center;
}
dd {
    margin: 0;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 28px;
}

.error-wrap {
    text-align: center;
    padding: 80px 20px;
}
.error-wrap h1 {
    font-family: var(--font-display);
    font-size: 96px;
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--text-muted);
    letter-spacing: -0.03em;
}
.error-wrap p { color: var(--text-secondary); margin-bottom: 28px; }

.actions { margin: 24px 0 32px; display: flex; gap: 12px; }

.file-field input[type=file] {
    padding: 24px 20px;
    border: 2px dashed var(--border);
    background: var(--bg-canvas);
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.file-field input[type=file]:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.dropzone {
    border: 2px dashed var(--border);
    background: var(--bg-canvas);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.08s ease;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
}
.dropzone:hover, .dropzone:focus {
    border-color: var(--accent);
    background: rgba(184, 147, 90, 0.04);
}
.dropzone.dragging {
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: scale(1.01);
}
.dropzone.has-file {
    cursor: default;
    padding: 24px;
    border-style: solid;
    border-color: var(--border);
    background: var(--bg-surface);
    text-align: left;
}
.dropzone-idle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    color: var(--text-secondary);
    pointer-events: none;
}
.dropzone-icon {
    color: var(--accent);
    opacity: 0.75;
}
.dropzone-primary {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--text-primary);
    font-weight: 500;
    letter-spacing: -0.01em;
}
.dropzone-secondary {
    font-size: 13px;
    color: var(--text-muted);
}
.dropzone-preview {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 28px;
    align-items: center;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
}
.dropzone-idle[hidden],
.dropzone-preview[hidden] { display: none !important; }
.dropzone-pdf-icon {
    line-height: 0;
    flex-shrink: 0;
}
.dropzone-pdf-icon svg { display: block; }
.dropzone-preview img {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-canvas);
}
.dropzone-filename {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
    word-break: break-all;
}
.dropzone-filemeta {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.nav-badge {
    display: inline-block;
    min-width: 18px;
    padding: 1px 6px;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-radius: 100px;
    text-align: center;
    margin-left: 4px;
    vertical-align: baseline;
    line-height: 1.4;
}
.nav-badge-menu {
    float: right;
}

.applicant-info {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 10px 20px;
    margin: 0;
}
.applicant-info dt {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 600;
    align-self: center;
    margin-top: 0;
}
.applicant-info dd {
    margin: 0;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}
.applicant-info code {
    background: var(--bg-deep);
    color: var(--text-inverse);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
}

.topnav-dropdown {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}
.topnav-dropdown-trigger {
    color: var(--text-inverse-muted);
    font-size: 14px;
    font-weight: 500;
    padding: 22px 0;
    border-bottom: 2px solid transparent;
}
.topnav-dropdown:hover .topnav-dropdown-trigger {
    color: var(--text-inverse);
    border-bottom-color: var(--accent);
}
.topnav-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    background: var(--bg-deep-2);
    border: 1px solid var(--border-strong);
    border-top: 1px solid var(--accent);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    padding: 6px 0;
    z-index: 60;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    min-width: 180px;
    transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}
/* centered under its trigger (Production, Inventory) */
.topnav-dropdown-menu-start {
    right: auto;
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
}
.topnav-dropdown:hover .topnav-dropdown-menu,
.topnav-dropdown:focus-within .topnav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity .18s ease, transform .18s ease;
}
.topnav-dropdown:hover .topnav-dropdown-menu-start,
.topnav-dropdown:focus-within .topnav-dropdown-menu-start {
    transform: translateX(-50%) translateY(0);
}
.topnav-dropdown-menu a {
    padding: 10px 18px;
    color: var(--text-inverse-muted);
    font-size: 14px;
    font-weight: 500;
    border-bottom: none;
    text-align: center;
}
.topnav-dropdown-menu a:hover {
    background: var(--bg-deep-3);
    color: var(--accent);
    border-bottom: none;
}

.spec-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.spec-section h2 {
    font-size: 15px;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    font-weight: 600;
}
.spec-section h2::before {
    content: "";
    width: 3px;
    height: 14px;
    background: var(--accent);
    border-radius: 2px;
}
.spec-aux {
    margin-top: -4px;
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-canvas);
    border-radius: var(--radius);
    min-height: 20px;
}
.spec-aux:empty { display: none; }
.spec-active-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    margin-bottom: 0;
    padding: 10px 12px;
    background: var(--bg-canvas);
    border-radius: var(--radius);
}
.spec-active-row input[type=checkbox] {
    width: auto;
    margin: 0;
    accent-color: var(--accent);
}
.spec-active-row span {
    margin: 0 !important;
    font-size: 13px;
    color: var(--text-primary);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

.spec-summary {
    background: var(--bg-deep);
    border-color: var(--bg-deep);
    color: var(--text-inverse);
}
.spec-summary h2 {
    color: var(--text-inverse-muted);
    border-bottom-color: rgba(255,255,255,0.08);
}
.spec-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}
.spec-stat {
    padding: 14px 16px;
    background: var(--bg-deep-2);
    border-radius: var(--radius);
}
.spec-stat-accent {
    background: rgba(184, 147, 90, 0.15);
    box-shadow: inset 3px 0 0 var(--accent);
}
.spec-stat-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-inverse-muted);
    font-weight: 600;
    margin-bottom: 6px;
}
.spec-stat-accent .spec-stat-label { color: var(--accent); }
.spec-stat-value {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 500;
    line-height: 1;
    color: var(--text-inverse);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.spec-stat-value .curr {
    font-size: 16px;
    color: var(--text-inverse-muted);
    font-weight: 400;
    margin-right: 1px;
    vertical-align: 3px;
}
.spec-stat-accent .spec-stat-value .curr { color: var(--accent); }
.spec-stat-value small {
    font-family: var(--font-sans);
    font-size: 11px;
    color: var(--text-inverse-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-left: 4px;
    font-weight: 400;
}
.spec-summary-note {
    margin: 0;
    color: var(--text-inverse-muted);
    font-size: 12px;
}

.catalog-grid th.num, .catalog-grid td.num {
    text-align: right;
    font-family: 'Consolas', 'Monaco', monospace;
    font-variant-numeric: tabular-nums;
}

.fillings-grid .name-col {
    width: 28%;
    text-align: left;
}
.fillings-grid .ctr {
    text-align: center;
}
.fillings-grid td.num-cell {
    font-variant-numeric: tabular-nums;
}
.fillings-grid .used-by-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.fillings-grid .used-by-cell .tag {
    font-size: 11px;
    padding: 2px 8px;
    white-space: nowrap;
}
.formula-code-mini {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 2px 8px;
    border-radius: 100px;
}

.subnav {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-canvas);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
    width: fit-content;
}
.subnav-link {
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-radius: calc(var(--radius) - 2px);
    border-bottom: none;
    transition: all 0.15s ease;
}
.subnav-link:hover {
    color: var(--text-primary);
    border-bottom: none;
}
.subnav-link.active {
    background: var(--bg-surface);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.formula-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.formula-row {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    overflow: hidden;
    position: relative;
}

.formula-row::before {
    content: "";
    position: absolute;
    top: 0; bottom: 0; left: 0;
    width: 3px;
    background: var(--accent);
    opacity: 0.18;
    transition: opacity 0.18s ease;
}
.formula-row:hover::before { opacity: 0.45; }
.formula-row.formula-row-open {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}
.formula-row.formula-row-open::before { opacity: 1; }

.formula-row-head {
    display: grid;
    
    grid-template-columns: 1fr 1px auto auto;
    align-items: center;
    gap: 28px;
    width: 100%;
    padding: 24px 26px 24px 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    color: var(--text-primary);
    transition: background 0.12s ease;
}
.formula-row-head:hover { background: rgba(184, 147, 90, 0.04); }
.formula-row-head:focus { outline: none; background: rgba(184, 147, 90, 0.04); }

.formula-row-vdivider {
    width: 1px;
    background: var(--accent);
    align-self: stretch;
    margin: 12px 0;
    opacity: 0.4;
}
.formula-row-stat-divider {
    width: 2px;
    background: var(--accent);
    align-self: stretch;
    margin: 12px 0;
    opacity: 0.55;
}

.formula-row-name { min-width: 0; }
.formula-row-headline {
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 0;
}
.formula-row-brand {
    margin: 0;
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1.1;
}

.formula-row-rule {
    width: 36px;
    height: 1px;
    background: var(--accent);
    opacity: 0.55;
    margin: 10px 0 8px;
}
.formula-row-variant {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 6px;
    line-height: 1.2;
}
.formula-row-subline {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.4;
    max-width: 52ch;
}

.formula-row-stats {
    display: flex;
    align-items: stretch;
    gap: 14px;
}
.formula-row-stat {
    display: flex;
    flex-direction: column;
    text-align: right;
    padding: 6px 16px;
    justify-content: center;
    min-width: 130px;
    position: relative;
}
.formula-row-stat-hero { min-width: 160px; }
.formula-row-stat-num {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
}
.formula-row-stat-unit {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 6px;
}

.formula-row-stat-sub {
    margin-top: 10px;
    line-height: 1.3;
    max-width: 26ch;
    margin-left: auto;
    text-align: right;
}
.formula-row-stat-sub .ssub-lead {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}
.formula-row-stat-sub .ssub-context {
    display: block;
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.3;
    letter-spacing: 0.01em;
    font-weight: 500;
}

.formula-row-stat-prod,
.formula-row-stat-rate,
.formula-row-stat-meta { padding-right: 16px; }

.formula-row-stat-hero {
    padding: 6px 16px;
    min-width: 180px;
}
.formula-row-stat-hero .formula-row-stat-num {
    font-size: 40px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}
.formula-row-stat-hero .formula-row-stat-unit {
    color: var(--text-secondary);
    font-weight: 700;
    margin-top: 8px;
    letter-spacing: 0.1em;
}

.formula-row-stat-muted .formula-row-stat-num {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 18px;
}
.formula-row-stat-muted { opacity: 0.85; }

.formula-row-chevron {
    color: var(--text-muted);
    font-size: 14px;
    transition: transform 0.2s ease;
    margin-left: 4px;
    align-self: center;
}
.formula-row-open .formula-row-chevron {
    transform: rotate(180deg);
    color: var(--accent);
}

@media (max-width: 1100px) {
    .formula-row-stats { gap: 10px; }
    .formula-row-stat { padding: 4px 12px; min-width: 110px; }
    .formula-row-stat-hero { min-width: 160px; padding: 4px 12px; }
    .formula-row-stat-hero .formula-row-stat-num { font-size: 32px; }
}
@media (max-width: 900px) {
    .formula-row-head {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 22px 22px 22px 26px;
    }
    .formula-row-vdivider,
    .formula-row-stat-divider { display: none; }
    .formula-row-stats {
        flex-wrap: wrap;
        gap: 12px;
    }
    .formula-row-stat {
        text-align: left;
        padding: 4px 0;
        flex: 1 1 40%;
        min-width: 0;
    }
    .formula-row-stat-hero {
        flex: 1 1 100%;
        padding: 18px 22px;
    }
    .formula-row-stat-hero .formula-row-stat-num { font-size: 34px; }
    .formula-row-stat-sub { display: block; margin-left: 0; max-width: none; }
    .formula-row-brand { font-size: 24px; }
}

.formula-row-body {
    padding: 0 24px 22px;
    border-top: 1px solid var(--border-soft);
    animation: slideDown 0.18s ease;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.config-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    padding: 22px 0 14px;
}
@media (max-width: 800px) { .config-grid { grid-template-columns: 1fr; } }

.config-section-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 12px;
}
.config-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}
@media (max-width: 700px) { .config-row { grid-template-columns: 1fr; } }
.config-row label { margin: 0; }
.config-row select {
    background: var(--bg-canvas);
}

.config-aux {
    padding: 12px 16px;
    background: var(--bg-canvas);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}

.config-aux strong {
    color: var(--text-primary);
    font-family: var(--font-display);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    text-transform: none;
    letter-spacing: 0;
    font-size: 16px;
    margin: 0 4px;
}
.config-aux .muted {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0 6px;
    font-weight: 400;
}

.config-result {
    background: var(--bg-deep);
    color: var(--text-inverse);
    border: 1px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow:
        inset 0 1px 0 rgba(184, 147, 90, 0.35),
        0 8px 22px -14px rgba(0, 0, 0, 0.45);
}

.config-result::before,
.config-result::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
}
.config-result::before { top: 0; }
.config-result::after  { bottom: 0; }
.config-result-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 12px;
}
.config-result-code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 36px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text-inverse);
    line-height: 1;
    margin-bottom: 10px;
    word-break: break-word;
}
.config-result-name {
    font-size: 12px;
    color: var(--text-inverse-muted);
    line-height: 1.4;
}
.config-result-name.muted { color: var(--text-inverse-muted); opacity: 0.6; }

.formula-row-foot {
    padding-top: 14px;
    border-top: 1px solid var(--border-soft);
    text-align: right;
}
.formula-row-detail-link {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.formula-row-detail-link:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.formula-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.formula-code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 4px 10px;
    border-radius: 100px;
}
.formula-card-name {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 500;
    letter-spacing: -0.01em;
    margin: 0 0 18px;
    color: var(--text-primary);
}
.formula-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 12px;
    margin: 0 0 18px;
}
.formula-stats > div {
    border-left: 2px solid var(--border-soft);
    padding-left: 10px;
}
.formula-stats dt {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 2px;
}
.formula-stats dd {
    margin: 0;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 500;
    line-height: 1;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}
.formula-stats small {
    font-family: var(--font-sans);
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.formula-stat-cost { color: var(--accent) !important; }
.formula-card-foot {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--border-soft);
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.formula-arrow {
    color: var(--accent);
    font-size: 14px;
    transition: transform 0.15s ease;
}
.formula-card:hover .formula-arrow { transform: translateX(3px); }

.formula-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.formula-kpi {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 22px;
    box-shadow: var(--shadow-sm);
}
.formula-kpi-accent {
    background: var(--bg-deep);
    color: var(--text-inverse);
    border-color: var(--bg-deep);
    position: relative;
    overflow: hidden;
}
.formula-kpi-accent::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: var(--accent);
}
.formula-kpi-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 6px;
}
.formula-kpi-accent .formula-kpi-label { color: var(--accent); }
.formula-kpi-value {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1;
}
.formula-kpi-curr {
    font-size: 18px;
    color: var(--text-muted);
    font-weight: 400;
    vertical-align: 4px;
    margin-right: 1px;
}
.formula-kpi-accent .formula-kpi-curr { color: var(--accent); }
.formula-kpi-unit {
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-left: 4px;
}
.formula-kpi-accent .formula-kpi-unit { color: var(--text-inverse-muted); }

.formula-table-panel { margin-bottom: 24px; }
.formula-table th.num,
.formula-table td.num {
    text-align: right;
    font-family: 'Consolas', 'Monaco', monospace;
    font-variant-numeric: tabular-nums;
}
.formula-row-num {
    width: 36px;
    color: var(--text-muted);
    font-family: 'Consolas', monospace;
    font-size: 12px;
    text-align: center;
}
.formula-ing-name {
    font-weight: 500;
    color: var(--text-primary);
}
.formula-vendor-tag {
    font-family: 'Consolas', monospace;
    font-size: 10px;
    background: var(--bg-canvas);
    color: var(--text-secondary);
}
.formula-cell-secondary { color: var(--text-muted); font-weight: 400; }
.formula-cell-cost {
    font-weight: 600;
    color: var(--text-primary);
}
.formula-share-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 160px;
}
.formula-share-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-canvas);
    border-radius: 100px;
    overflow: hidden;
}
.formula-share-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 100px;
    transition: width 0.3s ease;
}
.formula-share-pct {
    font-family: 'Consolas', monospace;
    font-size: 11px;
    color: var(--text-muted);
    width: 44px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.formula-foot-row td {
    background: var(--bg-canvas);
    border-top: 2px solid var(--accent);
    padding: 14px 14px;
    font-size: 14px;
}

.vendor-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.vendor-row {
    background: var(--bg-canvas);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
}
.vendor-row-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}
.vendor-name {
    font-family: 'Consolas', monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.vendor-amount {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 500;
    color: var(--accent);
}
.vendor-bar {
    height: 5px;
    background: var(--bg-surface);
    border-radius: 100px;
    overflow: hidden;
}
.vendor-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    border-radius: 100px;
}

.user-link {
    display: inline-block;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    padding: 6px 2px;
    border-bottom: 1px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.user-link:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 100px;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s ease, border-color 0.2s ease;
    vertical-align: middle;
}
.toggle-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.toggle-switch:hover:not(.toggle-switch-disabled) {
    background: var(--text-muted);
}
.toggle-switch.toggle-on {
    background: var(--accent);
    border-color: var(--accent);
}
.toggle-switch.toggle-on:hover:not(.toggle-switch-disabled) {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}
.toggle-switch.toggle-on::after {
    transform: translateX(18px);
}
.toggle-switch-disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.toggle-switch-wrap {
    position: relative;
    display: inline-block;
    line-height: 0;
    cursor: pointer;
}
.toggle-switch-wrap .toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}
.toggle-switch-wrap .toggle-input:focus + .toggle-switch {
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.table-save-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    margin-top: 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.table-save-status {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}
.table-save-status-dirty {
    color: var(--accent);
}

.row-actions {
    white-space: nowrap;
    text-align: right;
}
.row-actions a, .row-actions .inline-link {
    margin-left: 14px;
    font-size: 13px;
    color: var(--accent);
    font-weight: 500;
}
.inline-link {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    border-bottom: 1px solid transparent;
}
.inline-link:hover {
    border-bottom-color: var(--accent);
}

.prompts-wrap {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
    align-items: flex-start;
}
@media (max-width: 900px) { .prompts-wrap { grid-template-columns: 1fr; } }
.prompts-nav h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 14px;
}
.prompts-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.prompts-list li { margin-bottom: 10px; }
.prompts-list a {
    display: block;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    background: var(--bg-surface);
    transition: all 0.15s ease;
    border-bottom: 1px solid var(--border);
}
.prompts-list a:hover {
    border-color: var(--accent);
    background: rgba(184, 147, 90, 0.04);
}
.prompts-list a.active {
    border-color: var(--accent);
    background: var(--accent-soft);
}
.prompts-list-label {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 500;
    display: inline-block;
    margin-right: 8px;
}
.prompts-list-meta {
    float: right;
    margin-top: 3px;
}
.prompts-list-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    clear: both;
    line-height: 1.4;
}
.prompts-main textarea {
    font-family: 'JetBrains Mono', 'Consolas', 'SF Mono', Monaco, monospace;
    font-size: 13px;
    line-height: 1.6;
    background: var(--bg-canvas);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    grid-template-areas:
        "schedule  graph"
        "sections  sections"
        "modules   modules";
    gap: 20px;
    align-items: stretch;
}
@media (max-width: 1000px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "schedule"
            "graph"
            "sections"
            "modules";
    }
}
.dash-schedule  { grid-area: schedule; display: flex; flex-direction: column; gap: 12px; }
.dash-chart     { grid-area: graph;    display: flex; flex-direction: column; gap: 12px; }
.dash-sections  { grid-area: sections; display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.dash-modules   { grid-area: modules;  display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }

.module-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.module-nav-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    min-width: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.module-nav-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}
.module-nav-icon {
    flex-shrink: 0;
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-page);
    border-radius: var(--radius-md);
    color: var(--accent);
}
.module-nav-body { flex: 1; }
.module-nav-body h3 { margin: 0; font-size: 15px; font-weight: 600; }
.module-nav-desc { margin: 2px 0 0; font-size: 13px; color: var(--text-muted); }
.module-nav-arrow {
    flex-shrink: 0;
    font-size: 18px;
    color: var(--text-muted);
    transition: transform 0.15s ease, color 0.15s ease;
}
.module-nav-card:hover .module-nav-arrow { transform: translateX(3px); color: var(--accent); }

.dashboard-col-head {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.dashboard-col-head-wide {
    border-bottom: 1px solid var(--border);
    padding-bottom: 14px;
}
.dashboard-col-head .eyebrow { margin-bottom: 4px; }
.dashboard-col-head h2 {
    margin: 0;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.dashboard-col-head-wide h2 { font-size: 20px; margin: 2px 0 2px; }
.dashboard-col-head-wide p { margin: 0; }

.empty-state {
    text-align: center;
    padding: 48px 24px;
}
.empty-state-compact { padding: 32px 16px; }
.empty-state-mark {
    display: inline-block;
    width: 36px;
    height: 2px;
    background: var(--accent);
    margin: 0 auto 20px;
    opacity: 0.75;
}
.empty-state-compact .empty-state-mark {
    margin-bottom: 14px;
}
.empty-state-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin: 0 0 8px;
}
.empty-state-compact .empty-state-title { font-size: 16px; }
.empty-state-desc {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 0 0 22px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
    padding: 0 12px;
}
.empty-state-compact .empty-state-desc { margin-bottom: 0; }

.today-sheet-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    flex: 1;                        
}

.today-sheet-card .empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    margin: 0;
}
.today-sheet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 16px;
    table-layout: fixed;
}
.today-sheet-table th, .today-sheet-table td {
    padding: 8px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.today-sheet-table th {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
    padding: 6px 8px;
}
.today-sheet-table th:nth-child(1),
.today-sheet-table td:nth-child(1) { width: 14%; }
.today-sheet-table th:nth-child(2),
.today-sheet-table td:nth-child(2) { width: auto; }
.today-sheet-table th:nth-child(3),
.today-sheet-table td:nth-child(3) { width: 12%; }
.today-sheet-table th:nth-child(4),
.today-sheet-table td:nth-child(4) { width: 10%; }
.today-sheet-table th:nth-child(5),
.today-sheet-table td:nth-child(5) { width: 10%; }
.today-sheet-table th:nth-child(6),
.today-sheet-table td:nth-child(6) { width: 13%; }
.today-sheet-table th:nth-child(7),
.today-sheet-table td:nth-child(7) { width: 15%; }
.today-sheet-table th.num,
.today-sheet-table td.num {
    text-align: right;
    font-family: 'Consolas', 'Monaco', monospace;
    font-weight: 600;
    color: var(--accent);
}
.today-sheet-table th.center,
.today-sheet-table td.center {
    text-align: center;
}
.today-sheet-table td.today-sheet-expected {
    color: var(--text-muted);
    font-size: 16px;
}
.today-sheet-code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}
.today-sheet-meta-inline {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.expected-boxes-card {
    flex: 0 0 auto;
    margin-top: auto;
    align-self: flex-end;
    width: auto;
    min-width: 140px;
    background: var(--bg-canvas);
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    
    box-shadow: inset 0 0 0 1px var(--bg-canvas),
                inset 0 0 0 2px var(--accent-soft);
    padding: 7px 22px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.expected-boxes-label {
    font-family: var(--font-sans);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    line-height: 1;
    margin-bottom: 4px;
}
.expected-boxes-num {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 26px;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}
.expected-boxes-unit {
    margin-top: 1px;
    font-family: var(--font-sans);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    line-height: 1;
}

.today-sheet-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;        
    padding-top: 14px;
    border-top: 1px solid var(--border-soft);
}
.today-sheet-expected {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}
.today-sheet-expected-unit {
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-left: 2px;
}
.today-sheet-actions-right {
    margin-left: auto;
    display: flex;
    gap: 8px;
}
.today-sheet-meta {
    margin: 10px 0 0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.today-sheet-empty {
    text-align: center;
    padding: 28px 12px;
}
.today-sheet-empty p { margin-bottom: 14px; }

.section-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}
.section-nav-row {
    grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 900px) {
    .section-nav-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
    .section-nav-row { grid-template-columns: 1fr; }
}
.section-nav-card {
    padding: 22px 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    overflow: hidden;
}
.section-nav-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
    opacity: 0;
    transition: opacity 0.15s ease;
}
.section-nav-card:hover {
    transform: translateY(-2px);
    border-color: var(--border);
    box-shadow: var(--shadow-md);
}
.section-nav-card:hover::before { opacity: 1; }
.section-nav-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 8px;
    padding-right: 32px;  
}
.section-nav-head h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.section-check {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--bg-canvas);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: all 0.2s ease;
    z-index: 2;
}
.section-nav-card:hover .section-check {
    border-color: var(--text-muted);
}
.section-check svg { display: block; }
.section-check-done {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 2px 6px rgba(184, 147, 90, 0.3);
}
.section-nav-card:hover .section-check-done {
    border-color: var(--accent);
}
.section-nav-number {
    font-family: 'Consolas', monospace;
    font-size: 10px;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.08em;
}
.section-nav-desc {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 0 0 16px;
    line-height: 1.5;
    min-height: 40px;
}
.section-nav-actions {
    display: flex;
    gap: 8px;
}
.section-nav-actions .btn {
    font-size: 13px;
    padding: 7px 14px;
    flex: 1;
    text-align: center;
}

.dday-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.dday-half {
    padding: 12px 14px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.dday-half .dday-cards {
    flex: 1;
    justify-content: center;   
}
.dday-divider {
    height: 1px;
    background: var(--border);
    margin: 0;
}
.dday-half-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 8px;
}
.dday-half-label {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
}
.dday-half-link {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    border: none;
}
.dday-half-link:hover { color: var(--accent); }

.dday-cards {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dday-card {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-canvas);
    transition: border-color 0.15s ease, background 0.15s ease;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
}
.dday-card-primary {
    padding: 12px 14px;
    grid-template-columns: auto 1fr auto;
}
.dday-card-secondary {
    padding: 6px 12px;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
}

.dday-num {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1;
}
.dday-card-primary .dday-num   { font-size: 32px; min-width: 76px; }
.dday-card-secondary .dday-num { font-size: 18px; min-width: 48px; }
.dday-num-empty {
    color: var(--text-muted);
    opacity: 0.45;
}

.dday-meta { min-width: 0; }
.dday-title {
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dday-card-primary .dday-title   { font-size: 14px; margin-bottom: 1px; }
.dday-card-secondary .dday-title { font-size: 12px; }
.dday-title-empty {
    font-style: italic;
    color: var(--text-muted);
    font-size: 12px;
}
.dday-card-secondary .dday-title-empty { font-size: 11px; }
.dday-date {
    font-size: 11px;
    color: var(--text-secondary);
}
.dday-card-secondary .dday-date { font-size: 10px; }
.dday-sub {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: capitalize;
    margin-top: 1px;
}

.dday-ready-form { margin: 0; }
.dday-ready-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 5px 9px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.12s ease;
    white-space: nowrap;
}
.dday-ready-btn:hover {
    border-color: var(--success);
    color: var(--success);
}
.dday-card-secondary .dday-ready-btn {
    padding: 3px 7px;
    font-size: 9px;
}

.dday-card-soon {
    background: var(--error-soft);
    border-color: var(--error);
}
.dday-card-soon .dday-num,
.dday-card-soon .dday-title {
    color: var(--error);
}
.dday-card-soon .dday-date {
    color: var(--error);
    opacity: 0.85;
}
.dday-card-soon .dday-ready-btn {
    border-color: var(--error);
    color: var(--error);
    background: var(--bg-surface);
}
.dday-card-soon .dday-ready-btn:hover {
    background: var(--error);
    color: var(--text-inverse);
}

.dday-card-ready {
    background: var(--success-soft);
    border-color: var(--success);
}
.dday-card-ready .dday-num,
.dday-card-ready .dday-title {
    color: var(--success);
}
.dday-card-ready .dday-date {
    color: var(--success);
    opacity: 0.85;
}
.dday-card-ready .dday-ready-btn {
    border-color: var(--success);
    color: var(--success);
    background: var(--bg-surface);
}
.dday-card-ready .dday-ready-btn:hover {
    background: var(--success);
    color: var(--text-inverse);
}

.dday-card-empty {
    background: var(--bg-canvas);
    border-style: dashed;
    border-color: var(--border);
    opacity: 0.7;
}

.dday-card-no-action {
    grid-template-columns: auto 1fr;
}

.ready-summary {
    padding: 22px 26px;
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: 28px;
    align-items: stretch;
}
.ready-summary-left {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.ready-summary-headline {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-soft);   
}
.ready-summary-headline .eyebrow {
    display: block;
    margin-bottom: 4px;
}
.ready-summary-customer {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 24px;
    letter-spacing: -0.015em;
    line-height: 1.1;
    color: var(--text-primary);
}
.ready-summary-meta {
    margin: 12px 0 0;
    display: grid;
    grid-template-columns: 110px 1fr;
    column-gap: 16px;
    row-gap: 8px;
    align-items: baseline;
}
.ready-summary-meta dt {
    margin: 0;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}
.ready-summary-meta dd {
    margin: 0;
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.3;
}

.ready-summary-dday {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    padding: 0 4px;
}
.ready-summary-dday-num {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 48px;
    line-height: 1;
    letter-spacing: -0.025em;
    color: var(--text-primary);
}
.ready-summary-dday-soon {
    color: var(--error);
}
.ready-summary-dday-today {
    color: var(--accent);
}
.ready-summary-dday-past {
    color: var(--text-muted);
}

.ready-form { padding: 28px; }
.ready-form h2 {
    font-size: 18px;
    margin-bottom: 4px;
}

.ready-checklist {
    list-style: none;
    margin: 16px 0 24px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.ready-check {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 16px;        
    min-height: 56px;
    margin: 0;
    line-height: 1;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-surface);
    cursor: pointer;
    transition: border-color 0.12s ease, background 0.12s ease;
}
.ready-check:hover {
    border-color: var(--accent);
    background: rgba(184, 147, 90, 0.04);
}
.ready-check input[type="checkbox"] {
    
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}
.ready-check-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    margin-left: auto;          
    border: 1.5px solid var(--border-strong);
    border-radius: 4px;
    background: var(--bg-surface);
    color: transparent;
    transition: all 0.12s ease;
}
.ready-check-box svg { display: block; }
.ready-check input:checked ~ .ready-check-box {
    background: var(--bg-deep);          
    border-color: var(--bg-deep);
    color: var(--text-inverse);
}
.ready-check input:checked ~ .ready-check-text {
    color: var(--text-primary);
}
.ready-check input:focus-visible ~ .ready-check-box {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.ready-check-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1;
}

.ready-extra {
    margin-top: 18px;
    padding-top: 20px;
    border-top: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ready-signature {
    margin: 24px 0 0 auto;     
    width: 320px;
    max-width: 100%;
    padding: 14px 18px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-canvas);
}
.ready-signature h3 {
    margin: 0 0 8px;
    font-size: 12px;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    font-weight: 700;
}
.signature-display {
    font-family: 'Tangerine', cursive;
    font-weight: 700;
    font-size: 56px;
    line-height: 1;
    height: 64px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: flex-end;
}
.signature-line {
    height: 0;
    border-bottom: 1.5px solid var(--text-primary);
    margin: 0 0 6px;
}
.signature-meta {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: right;
}
.signature-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 12px 0;
}
.signature-typer {
    width: 100%;
    padding: 8px 10px;
    margin: 0 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text-primary);
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.signature-typer:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.signature-typer-locked {
    background: var(--bg-canvas);
    color: var(--text-muted);
    cursor: not-allowed;
}
.signature-sign-btn {
    display: block;
    margin-left: auto;          
    padding: 5px 14px;
    background: var(--bg-deep);
    color: var(--text-inverse);
    border: 1px solid var(--bg-deep);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: all 0.12s ease;
}
.signature-sign-btn:hover:not(:disabled) {
    background: var(--bg-deep-2);
}
.signature-sign-btn:disabled {
    background: var(--bg-canvas);
    color: var(--text-muted);
    border-color: var(--border);
    cursor: not-allowed;
}
.signature-sign-btn-edit {
    background: var(--bg-surface);
    color: var(--text-secondary);
    border-color: var(--border);
}
.signature-sign-btn-edit:hover:not(:disabled) {
    background: var(--bg-canvas);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.btn-primary:disabled,
.btn-primary[disabled] {
    background: var(--border);
    color: var(--text-muted);
    border-color: var(--border);
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
}
.btn-primary:disabled:hover {
    background: var(--border);
    color: var(--text-muted);
}

.ready-actions {
    display: flex;
    align-items: stretch;
    justify-content: space-between;   
    gap: 16px;
    margin-top: 24px;
    padding: 0;
}
.ready-actions .btn {
    height: 44px;            
    padding: 0 22px;
    font-size: 14px;
    line-height: 1;
}

.dday-tag {
    display: inline-block;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-canvas);
    color: var(--text-primary);
    letter-spacing: -0.01em;
}
.dday-tag-soon {
    background: var(--error-soft);
    border-color: var(--error);
    color: var(--error);
}
.dday-tag-ready {
    background: var(--success-soft);
    border-color: var(--success);
    color: var(--success);
}
.dday-tag-today {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}
.dday-tag-past {
    color: var(--text-muted);
    background: var(--bg-canvas);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid var(--border);
}
.status-pill small {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    opacity: 0.75;
}
.status-pill-ready {
    color: var(--success);
    background: var(--success-soft);
    border-color: var(--success);
}
.status-pill-pending {
    color: var(--text-secondary);
    background: var(--bg-canvas);
}

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
}

.report-nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

.report-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    padding: 0;
    overflow: hidden;
}
@media (max-width: 720px) {
    .report-summary { grid-template-columns: repeat(2, 1fr); }
}
.report-stat {
    padding: 22px 24px;
    border-right: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.report-stat:last-child { border-right: none; }
@media (max-width: 720px) {
    .report-stat:nth-child(2) { border-right: none; }
    .report-stat:nth-child(-n+2) { border-bottom: 1px solid var(--border-soft); }
}
.report-stat-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 600;
}
.report-stat-num {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 32px;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.pct-ok    { color: var(--success); }
.pct-mild  { color: var(--warn); }
.pct-warn  { color: #c25b00; }
.pct-bad   { color: var(--error); }
.pct-na    { color: var(--text-muted); }

.report-charts {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 18px;
    margin-top: 18px;
}
@media (max-width: 900px) {
    .report-charts { grid-template-columns: 1fr; }
}
.report-chart-card {
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
}
.report-chart-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 12px;
}
.report-chart-head h3 {
    margin: 0;
    font-size: 14px;
    font-family: var(--font-sans);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
}
.report-chart-wrap {
    position: relative;
    height: 240px;
    width: 100%;
}

.report-donut-wrap { display: flex; align-items: center; justify-content: center; }
.report-donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.report-donut-pct {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 40px;
    line-height: 1;
    letter-spacing: -0.02em;
}
.report-donut-sub {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 6px;
}

.report-trend-card {
    margin-top: 18px;
}
.report-trend-card .report-chart-wrap { height: 220px; }

.report-table-card { margin-top: 18px; }
.report-table-head {
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--border-soft);
}
.report-table-head h3 {
    font-size: 14px;
    font-family: var(--font-sans);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin: 0;
}
.report-table .report-code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    font-weight: 600;
}
.report-actual-input {
    width: 86px;
    padding: 6px 8px;
    text-align: right;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
}
.report-actual-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.report-actual-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.report-actual-input::-webkit-outer-spin-button,
.report-actual-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.report-actual-input { -moz-appearance: textfield; }

.report-table-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 22px;
    border-top: 1px solid var(--border-soft);
    gap: 12px;
}

.maintenance-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 0;
    min-height: 50vh;
}
.maintenance-card {
    max-width: 480px;
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    text-align: center;
    box-shadow: var(--shadow-md);
}
.maintenance-icon {
    color: var(--accent);
    margin-bottom: 20px;
    animation: maintenance-spin 12s linear infinite;
    display: inline-block;
}
@keyframes maintenance-spin {
    to { transform: rotate(360deg); }
}
.maintenance-eyebrow {
    display: block;
    margin-bottom: 8px;
}
.maintenance-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 12px;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}
.maintenance-desc {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.55;
    max-width: 360px;
    margin: 0 auto 24px;
}
.maintenance-btn {
    margin-top: 4px;
}

.tab-switcher {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}
@media (max-width: 600px) { .tab-switcher { grid-template-columns: 1fr; } }
.tab-btn {
    padding: 16px 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: all 0.15s ease;
    position: relative;
}
.tab-btn:hover {
    border-color: var(--accent);
    background: rgba(184, 147, 90, 0.03);
}
.tab-btn.active {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 0 3px rgba(184, 147, 90, 0.12);
}
.tab-btn.active::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    background: var(--accent-soft);
    border-right: 1px solid var(--accent);
    border-bottom: 1px solid var(--accent);
    transform: translateX(-50%) rotate(45deg);
}
.tab-btn-title {
    display: block;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.tab-btn-sub {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}
.tab-panel {
    display: none;
}
.tab-panel.active {
    display: block;
}

.record-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-bottom: none;
    margin: -4px 0 14px;
    transition: color 0.15s ease;
}
.record-back-link:hover {
    color: var(--bg-deep);
    border-bottom: none;
}

.record-hero {
    margin: 0 -4px 20px;
    padding: 18px 28px;
    background: linear-gradient(135deg, var(--bg-deep) 0%, var(--bg-deep-2) 100%);
    border-radius: var(--radius-xl);
    color: var(--text-inverse);
    position: relative;
    overflow: hidden;
}
.record-hero::before {
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 50%;
    background:
        radial-gradient(circle at 75% 30%, rgba(184, 147, 90, 0.18), transparent 60%),
        radial-gradient(circle at 90% 90%, rgba(184, 147, 90, 0.10), transparent 50%);
    pointer-events: none;
}
.record-hero-inner {
    position: relative;
    z-index: 1;
}
.record-hero h1 {
    color: var(--text-inverse);
    margin: 0;
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.hero-progress-block {
    max-width: 760px;
    margin: -8px auto 28px;
}
.hero-progress-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 0 2px;
}
.hero-progress-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.45s ease;
}
.hero-progress-label.active {
    color: var(--accent);
}
.hero-progress-label.completed {
    color: var(--bg-deep);
}
.hero-progress {
    height: 6px;
    background: var(--border-soft);
    border-radius: 100px;
    overflow: hidden;
    position: relative;
}
.hero-progress-fill {
    position: relative;
    height: 100%;
    width: 25%;
    border-radius: 100px;
    background: linear-gradient(90deg, var(--accent) 0%, #d4a875 100%);
    box-shadow: 0 0 10px rgba(184, 147, 90, 0.45);
    transition: width 0.7s cubic-bezier(0.65, 0, 0.35, 1);
}
.hero-progress-fill::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 32px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5));
    animation: progressShimmer 1.8s ease-in-out infinite;
}
@keyframes progressShimmer {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 1; }
}

.tab-btn { display: flex; align-items: center; gap: 14px; }
.tab-btn-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: var(--bg-canvas);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.tab-btn.active .tab-btn-icon {
    background: var(--accent);
    color: #fff;
}
.tab-btn-text {
    display: flex;
    flex-direction: column;
    text-align: left;
    flex: 1;
}

.upload-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 24px;
    align-items: start;
}
@media (max-width: 900px) {
    .upload-grid { grid-template-columns: 1fr; }
}

.upload-dropzone-card { padding: 28px; }

.upload-single {
    max-width: 760px;
    margin: 0 auto;
}
.upload-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.dropzone-large,
.dropzone-xl {
    position: relative;
    min-height: 280px;
    padding: 40px 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.6),
        0 1px 2px rgba(13, 27, 42, 0.04),
        0 12px 32px -16px rgba(13, 27, 42, 0.10);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.dropzone-xl {
    min-height: 320px;
    padding: 56px 32px;
}

.dropzone-large::before,
.dropzone-xl::before {
    content: "";
    position: absolute;
    inset: 8px;
    border: 1px solid var(--border-soft);
    border-radius: calc(var(--radius-lg) - 4px);
    pointer-events: none;
    transition: border-color 0.2s ease;
}

.dropzone-large::after,
.dropzone-xl::after {
    --c: var(--bg-deep);
    --s: 28px;
    --t: 1.5px;
    --o: 18px;
    content: "";
    position: absolute;
    inset: var(--o);
    pointer-events: none;
    background:
        linear-gradient(to right,  var(--c), var(--c)) top    left  / var(--s) var(--t) no-repeat,
        linear-gradient(to bottom, var(--c), var(--c)) top    left  / var(--t) var(--s) no-repeat,
        linear-gradient(to left,   var(--c), var(--c)) top    right / var(--s) var(--t) no-repeat,
        linear-gradient(to bottom, var(--c), var(--c)) top    right / var(--t) var(--s) no-repeat,
        linear-gradient(to right,  var(--c), var(--c)) bottom left  / var(--s) var(--t) no-repeat,
        linear-gradient(to top,    var(--c), var(--c)) bottom left  / var(--t) var(--s) no-repeat,
        linear-gradient(to left,   var(--c), var(--c)) bottom right / var(--s) var(--t) no-repeat,
        linear-gradient(to top,    var(--c), var(--c)) bottom right / var(--t) var(--s) no-repeat;
    transition: --c 0.2s ease;
}

.dropzone-large:hover,
.dropzone-xl:hover,
.dropzone-large:focus,
.dropzone-xl:focus {
    border-color: var(--border);
    background: var(--bg-surface);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.6),
        0 1px 2px rgba(13, 27, 42, 0.05),
        0 24px 48px -20px rgba(13, 27, 42, 0.18);
}
.dropzone-large.dragging,
.dropzone-xl.dragging {
    border-color: var(--accent);
    transform: none;
    box-shadow:
        inset 0 0 0 1px var(--accent-soft),
        0 1px 2px rgba(13, 27, 42, 0.04),
        0 24px 56px -20px rgba(184, 147, 90, 0.30);
}
.dropzone-large.dragging::before,
.dropzone-xl.dragging::before {
    border-color: var(--accent);
}
.dropzone-large.has-file,
.dropzone-xl.has-file {
    padding: 14px;
    min-height: 0;
}
.dropzone-illustration {
    color: var(--bg-deep);
    opacity: 0.9;
    margin-bottom: 22px;
    line-height: 0;
}

.dropzone-multi {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 28px;
    width: 100%;
    margin: 0 auto;
    padding: 8px 4px;
}
.dropzone-multi[hidden] { display: none !important; }

.dz-nav {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.15s ease;
}
.dz-nav:hover:not(:disabled) {
    border-color: var(--bg-deep);
    color: var(--bg-deep);
    transform: scale(1.04);
    box-shadow: var(--shadow-md);
}
.dz-nav:disabled { opacity: 0.3; cursor: not-allowed; }
.dz-nav svg { width: 28px; height: 28px; stroke: currentColor; }

.dz-stage {
    text-align: center;
    position: relative;
}
.dz-stage-frame {
    position: relative;
    display: inline-block;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 1px 2px rgba(13, 27, 42, 0.06), 0 12px 28px -12px rgba(13, 27, 42, 0.20);
    line-height: 0;
    margin-bottom: 14px;
}
.dz-stage-frame img {
    display: block;
    max-width: 100%;
    max-height: 540px;
    width: auto;
    height: auto;
    border-radius: calc(var(--radius-sm) - 1px);
}
.dz-stage-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    min-height: 240px;
    background: var(--bg-canvas);
}
.dz-stage-loader[hidden] { display: none; }
.dz-stage-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--bg-deep);
    border-radius: 50%;
    animation: spinnerRotate 0.75s linear infinite;
}
.dz-stage-remove {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: var(--bg-deep);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: background 0.15s ease, transform 0.15s ease;
    z-index: 2;
}
.dz-stage-remove svg { width: 16px; height: 16px; stroke: currentColor; }
.dz-stage-remove:hover {
    background: var(--error);
    transform: scale(1.08);
}
.dz-stage-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-all;
    max-width: 320px;
    margin: 0 auto;
    line-height: 1.4;
}
.dz-stage-counter {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 6px;
}

.upload-hint {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 10px;
    letter-spacing: 0.02em;
}
.upload-hint[hidden] { display: none; }

.extraction-image-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
}
.ext-nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.ext-nav-btn:hover:not(:disabled) {
    border-color: var(--bg-deep);
    color: var(--bg-deep);
}
.ext-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.ext-nav-counter {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
}
.dropzone-large .dropzone-primary {
    font-size: 24px;
    margin-bottom: 4px;
}
.dropzone-large .dropzone-secondary {
    font-size: 14px;
    margin-bottom: 16px;
}
.dropzone-formats {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 100px;
    background: var(--bg-surface);
}

.upload-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.upload-howto-card,
.upload-tips-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    box-shadow: var(--shadow-sm);
}
.upload-howto-eyebrow,
.upload-tips-eyebrow {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
}

.upload-howto-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.upload-howto-list li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.upload-howto-num {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}
.upload-howto-list strong {
    display: block;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 2px;
}
.upload-howto-list p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.upload-tips-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.upload-tips-list li {
    font-size: 13px;
    color: var(--text-secondary);
    padding-left: 18px;
    position: relative;
    line-height: 1.5;
}
.upload-tips-list li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 8px;
    width: 5px;
    height: 5px;
    background: var(--accent);
    border-radius: 50%;
}

.btn-lg {
    padding: 13px 22px !important;
    font-size: 14px !important;
}
.btn-xl {
    padding: 18px 36px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    min-width: 280px;
    border-radius: var(--radius) !important;
}
.btn-sm {
    padding: 5px 10px !important;
    font-size: 12px !important;
}

.upload-actions {
    display: flex;
    justify-content: center;
    margin-top: 28px;
}

.upload-step {
    display: none;
}
.upload-step.active {
    display: block;
    animation: extractionFadeIn 0.35s ease;
}
@keyframes extractionFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.extraction-layout {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 24px;
    align-items: start;
}
@media (max-width: 900px) {
    .extraction-layout { grid-template-columns: 1fr; }
    .extraction-image-panel { position: static !important; }
}

.extraction-image-panel {
    position: sticky;
    top: 88px;
}
.extraction-image-panel img {
    width: 100%;
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    box-shadow: var(--shadow-md);
    transition: box-shadow 0.2s ease;
}
.extraction-image-panel a {
    display: block;
    border-bottom: none;
}
.extraction-image-panel a:hover {
    border-bottom: none;
}
.extraction-image-panel a:hover img {
    box-shadow: var(--shadow-lg);
}
.extraction-image-hint {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    letter-spacing: 0.02em;
}

.processing-stage {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 64px 24px;
    text-align: center;
    max-width: 520px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.processing-pdf-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    background: var(--bg-canvas);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 32px;
    max-width: 380px;
}
.processing-pdf-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-all;
    text-align: left;
}

.processing-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    text-align: left;
}
.processing-elapsed {
    margin: 16px auto 0;
    max-width: 520px;
    text-align: center;
    font-size: 12.5px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
.processing-step {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    color: var(--text-muted);
    opacity: 0.5;
    transition: opacity 0.4s ease, color 0.4s ease;
}
.processing-step.active,
.processing-step.done {
    opacity: 1;
    color: var(--text-primary);
}
.processing-step-icon {
    flex-shrink: 0;
    position: relative;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--bg-canvas);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: background 0.35s ease, border-color 0.35s ease, color 0.35s ease;
}
.processing-step-check-svg {
    width: 13px;
    height: 13px;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.processing-step.active .processing-step-icon {
    border-color: var(--accent-soft);
    background: var(--bg-surface);
}
.processing-step.active .processing-step-icon::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--accent);
    border-right-color: var(--accent);
    animation: spinnerRotate 0.7s linear infinite;
}
.processing-step.done .processing-step-icon {
    background: var(--bg-deep);
    border-color: var(--bg-deep);
    color: #fff;
}
.processing-step.done .processing-step-check-svg {
    opacity: 1;
    transform: scale(1);
}

.extraction-processing-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    text-align: center;
    min-height: 340px;
}
.processing-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spinnerRotate 0.75s linear infinite;
    margin-bottom: 28px;
}
@keyframes spinnerRotate {
    to { transform: rotate(360deg); }
}
.processing-text {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    margin-bottom: 6px;
}
.processing-sub {
    font-size: 13px;
    color: var(--text-muted);
}

.extraction-data-panel {
    padding: 14px 18px;
}
.extraction-data-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-soft);
}
.extraction-data-header h3 {
    margin: 0;
    font-size: 16px;
}

.extraction-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 14px;
    gap: 14px;
    flex-wrap: wrap;
}
.ext-meta-field { flex: 0 1 220px; min-width: 160px; }
.ext-meta-field-right { margin-left: auto; }
.ext-meta-field-right input { text-align: right; }

.extraction-table-caption {
    display: flex;
    align-items: flex-end;
    margin-bottom: 6px;
}
.extraction-table-caption .extraction-batch-count {
    margin: 0;
    padding: 0;
}

.extraction-table-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 4px;
}
.extraction-table-actions .btn-add-row { margin-bottom: 0; }

.ext-sig-typer {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}
.ext-sig-input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    font: inherit;
    font-size: 14px;
}
.ext-sig-input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-soft);
}
.ext-sig-btn {
    flex-shrink: 0;
    border: 1px solid var(--bg-deep);
    background: var(--bg-deep);
    color: #fff;
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s ease;
}
.ext-sig-btn:hover { background: var(--bg-deep-2); }

.form-actions-center {
    justify-content: center;
}

.extraction-signature {
    text-align: center;
    margin: 22px auto 14px;
    max-width: 280px;
}
.extraction-signature-name {
    font-family: 'Tangerine', cursive;
    font-size: 38px;
    line-height: 1;
    color: var(--text-primary);
    padding-bottom: 4px;
}
.extraction-signature-line {
    height: 1px;
    background: var(--text-primary);
    margin: 0 24px;
}
.extraction-signature-label {
    margin-top: 6px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-muted);
    font-weight: 600;
}
.extraction-meta-row label {
    flex: 1;
    max-width: 220px;
}
.extraction-batch-count {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding-bottom: 10px;
}

.batch-table-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 12px;
}
.batch-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.batch-table th {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
    padding: 10px 8px;
    background: var(--bg-canvas);
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.batch-table td {
    padding: 2px;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: middle;
}
.batch-table tr:last-child td {
    border-bottom: none;
}
.batch-table .bt-no {
    width: 40px;
    text-align: center;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    padding: 0 4px;
}
.batch-table .bt-time { width: 130px; }
.batch-table .bt-op   { width: 120px; }
.batch-table .bt-act  { width: 36px; padding: 0; }

.batch-table input {
    width: 100%;
    border: 1px solid transparent;
    background: transparent;
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 14px;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.batch-table input:hover {
    border-color: var(--border);
    background: var(--bg-canvas);
}
.batch-table input:focus {
    border-color: var(--accent);
    background: var(--bg-surface);
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-soft);
}
.batch-table input:required:invalid:not(:placeholder-shown):not(:focus) {
    border-color: var(--error);
    background: var(--error-soft);
}

.batch-table .bt-cart  { width: 76px; }
.batch-table .bt-dough { width: 104px; }
.batch-table .bt-trays { width: 72px; }
.batch-table .bt-check { width: 48px; text-align: center; }

/* Proofing review: two line tables side by side, like the paper form */
.extraction-layout-proofing { grid-template-columns: 0.72fr 1.5fr; }
.cart-lines {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
    margin-bottom: 12px;
}
@media (max-width: 1280px) {
    .cart-lines { grid-template-columns: 1fr; }
}
.cart-line-head {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.cart-line .batch-table-wrap { margin-bottom: 8px; }
.cart-table { font-size: 13px; }
.cart-table th { padding: 8px 6px; }
.cart-table .bt-cart  { width: 62px; }
.cart-table .bt-time  { width: 96px; }
.cart-table .bt-dough { width: 88px; }
.cart-table input, .cart-table select { font-size: 13px; padding: 4px 6px; }
.cart-no {
    display: flex;
    align-items: center;
    padding-left: 6px;
}
.bake-table .bt-cart { width: 92px; }
.bake-table .bt-oven { width: 56px; }
.bake-table .bt-temp { width: 78px; }
.bake-table .bt-time { width: 96px; }
.bake-table input, .bake-table select { font-size: 13px; }
.bake-line-input { max-width: 26px; text-align: right; }
.chill-table .bt-cart { width: 84px; }
.chill-table .bt-temp { width: 64px; }
.chill-table .bt-time { width: 90px; }
.chill-table th { padding: 7px 5px; }
.chill-table td { padding: 6px 3px; }
.chill-table input { font-size: 12.5px; padding: 4px 3px; }
.chill-table thead tr:first-child th { text-align: center; border-bottom: none; }
.chill-table input[type="number"]::-webkit-outer-spin-button,
.chill-table input[type="number"]::-webkit-inner-spin-button,
.bake-table input[type="number"]::-webkit-outer-spin-button,
.bake-table input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.chill-table input[type="number"],
.bake-table input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.cart-no-prefix {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12.5px;
}
.cart-no input { padding: 4px 2px; }
.cart-no input::-webkit-outer-spin-button,
.cart-no input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cart-no input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.batch-table select {
    width: 100%;
    border: 1px solid transparent;
    background: transparent;
    padding: 5px 6px;
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.batch-table select:hover {
    border-color: var(--border);
    background: var(--bg-canvas);
}
.batch-table select:focus {
    border-color: var(--accent);
    background: var(--bg-surface);
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-soft);
}
.batch-table td.bt-check input {
    width: 16px;
    height: 16px;
    padding: 0;
    accent-color: var(--accent);
    cursor: pointer;
    vertical-align: middle;
}

.btn-row-delete {
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: color 0.15s ease, background 0.15s ease;
}
.btn-row-delete:hover {
    color: var(--error);
    background: var(--error-soft);
}

.btn-add-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px dashed var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius);
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
    margin-bottom: 24px;
}
.btn-add-row:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}
.btn-add-row svg { stroke: currentColor; }
.btn-add-row { margin-bottom: 10px; padding: 6px 14px; }

.extraction-notes-label {
    margin-bottom: 10px;
    display: block;
}
.extraction-notes-label textarea { min-height: 0; }

.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spinnerRotate 0.6s linear infinite;
    vertical-align: -2px;
    margin-right: 6px;
}

.bay { max-width: 1120px; margin: 0 auto; padding: 8px 4px 48px; }
.bay-hdr { text-align: center; margin-bottom: 24px; }
.bay-hdr h1 { margin: 0; font-size: 48px; font-weight: 500; letter-spacing: -0.04em; line-height: 1; color: var(--text-primary); }
.bay-hdr p { margin: 8px 0 0; font-size: 14px; letter-spacing: 0.04em; }

.bay-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    padding: 44px 24px;
    background:
        radial-gradient(600px 280px at 50% 16%, rgba(184,147,90,0.025), transparent 70%),
        radial-gradient(ellipse 900px 500px at 50% 50%, #0e141d, #050910);
    border: 1px solid #131c28;
    border-radius: 20px;
}

.bay-beams {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
}

.bay-hub {
    order: 2;
    z-index: 2; text-align: center;
    pointer-events: none;
}
.bay-hub-cvs { display: block; width: 280px; height: 280px; max-width: 100%; }
.bay-hub-tag { margin-top: -4px; }
.bay-hub-name { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: 0.08em; color: #b8935a; }
.bay-hub-sub { display: block; font-family: 'Courier New', monospace; font-size: 9px; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(184,147,90,0.35); margin-top: -1px; }

.bay-node {
    position: relative; z-index: 3;
    pointer-events: auto;
    appearance: none; -webkit-appearance: none;
    background: rgba(255,255,255,0.008);
    border: 1px solid rgba(255,255,255,0.025);
    border-radius: 14px;
    padding: 6px 6px 14px;
    font: inherit; color: inherit; cursor: pointer;
    display: flex; flex-direction: column; align-items: center;
    transition: transform 0.3s, border-color 0.5s, box-shadow 0.5s;
}
.bay-node:hover:not(.is-disabled):not(.is-on) { transform: translateY(-3px); border-color: rgba(255,255,255,0.06); }
.bay-node.is-disabled { cursor: not-allowed; opacity: 0.2; }
.bay-node[data-provider="openai"]    { --c: #10b981; --cr: 16,185,129; }
.bay-node[data-provider="anthropic"] { --c: #f59e0b; --cr: 245,158,11; }
.bay-node.is-on { border-color: rgba(var(--cr),0.2); box-shadow: 0 0 28px rgba(var(--cr),0.08); }
.bay-node-cvs { display: block; width: 200px; height: 200px; max-width: 100%; }

.bay-at-l { order: 1; }
.bay-at-r { order: 3; }

.bay-meta { text-align: center; width: 100%; }
.bay-eng-name { display: block; font-family: var(--font-display); font-size: 18px; font-weight: 500; color: var(--text-muted); transition: color 0.5s; }
.bay-node.is-on .bay-eng-name { color: var(--text-primary); }
.bay-eng-model { display: block; font-family: 'Courier New', monospace; font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.bay-model-input {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    width: 150px;
    margin: 2px auto 0;
    padding: 2px 6px;
    text-align: center;
    cursor: text;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.bay-model-input:hover { border-color: rgba(255, 255, 255, 0.14); }
.bay-model-input:focus {
    outline: none;
    border-color: rgba(184, 147, 90, 0.55);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-inverse);
}
.bay-model-input.is-saved {
    border-color: rgba(45, 106, 79, 0.9);
    color: #7fd6a4;
}
.bay-eng-stat { display: inline-flex; align-items: center; margin-top: 6px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; font-weight: 600; color: var(--text-muted); }
.bay-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #2a3848; margin-right: 7px; font-style: normal; transition: background 0.5s, box-shadow 0.5s; }
.bay-node.is-on .bay-dot { background: var(--c); box-shadow: 0 0 0 3px rgba(var(--cr),0.2); animation: bayDotPulse 1.8s ease-in-out infinite; }
.bay-node.is-disabled .bay-dot { background: var(--error); }

.bay-modal {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s;
}
.bay-modal[hidden] { display: none; }
.bay-modal.is-open { opacity: 1; }
.bay-modal-bg {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.62);
    backdrop-filter: blur(3px);
}
.bay-modal-box {
    position: relative;
    background: linear-gradient(180deg, #131c28, #0a1018);
    border: 1px solid #222e3c;
    border-radius: 16px;
    padding: 32px 40px 28px;
    max-width: 400px; width: 92%;
    text-align: center;
    transform: scale(0.92) translateY(8px);
    transition: transform 0.22s;
}
.bay-modal.is-open .bay-modal-box { transform: scale(1) translateY(0); }
.bay-modal-icon {
    color: #4a5c70;
    margin-bottom: 14px;
}
.bay-modal-title {
    font-family: var(--font-display);
    font-size: 20px; font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 20px;
}
.bay-modal-route {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 18px;
    padding: 14px 0;
    border-top: 1px solid #1a2535;
    border-bottom: 1px solid #1a2535;
}
.bay-modal-from, .bay-modal-to {
    font-family: var(--font-display);
    font-size: 18px; font-weight: 600;
    letter-spacing: -0.01em;
}
.bay-modal-arrow {
    font-size: 18px;
    color: #3a4a5c;
}
.bay-modal-note {
    color: var(--text-muted);
    font-size: 13px;
    margin: 0 0 24px;
    line-height: 1.45;
}
.bay-modal-btns {
    display: flex; gap: 10px;
    justify-content: stretch;
}
.bay-btn {
    flex: 1;
    padding: 11px 0;
    border-radius: 8px;
    font: inherit; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.2s; line-height: 1;
    text-align: center;
}
.bay-btn-cancel {
    background: transparent;
    border: 1px solid #2e3e50;
    color: var(--text-muted);
}
.bay-btn-cancel:hover { border-color: #4a5a6c; color: var(--text-primary); }
.bay-btn-go {
    background: var(--accent);
    border: 1px solid transparent;
    color: #fff;
}
.bay-btn-go:hover { filter: brightness(1.12); }

@keyframes bayDotPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.3); } }

@media (max-width: 820px) {
    .bay-stage { flex-direction: column; gap: 12px; padding: 24px 12px 32px; }
    .bay-hub { order: 0; }
    .bay-beams { display: none; }
    .bay-hub-cvs { width: 200px; height: 200px; }
    .bay-node-cvs { width: 160px; height: 160px; }
    .bay-hdr h1 { font-size: 36px; }
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}
.quick-action {
    display: block;
    padding: 20px 22px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    transition: all 0.15s ease;
    border-bottom: 1px solid var(--border);
}
.quick-action:hover {
    border-color: var(--accent);
    color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.quick-action-primary {
    background: var(--bg-deep);
    color: var(--text-inverse);
    border-color: var(--bg-deep);
}
.quick-action-primary:hover {
    background: var(--bg-deep-2);
    color: var(--text-inverse);
    border-color: var(--accent);
    border-bottom-color: var(--accent);
}
.quick-action-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
}
.quick-action-sub {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.quick-action-primary .quick-action-sub {
    color: var(--accent);
}

.calendar {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.calendar-head {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--bg-canvas);
    border-bottom: 1px solid var(--border);
}
.calendar-head-cell {
    padding: 10px 6px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: 96px;
}
.calendar-cell {
    border-right: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
    padding: 8px 10px;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: background 0.1s ease;
    border-bottom: 1px solid var(--border-soft);
    position: relative;
}
.calendar-cell:nth-child(7n) { border-right: none; }
.calendar-cell-weekend { background: rgba(13, 27, 42, 0.04); }
.calendar-head-cell:first-child,
.calendar-head-cell:last-child { background: rgba(13, 27, 42, 0.04); }
.calendar-cell:hover {
    background: rgba(184, 147, 90, 0.04);
    color: var(--text-primary);
}
.calendar-cell-muted { background: var(--bg-canvas); color: var(--text-muted); }
.calendar-cell-today {
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 2px var(--accent);
}
.calendar-cell-scheduled .calendar-day::after {
    content: "";
    display: inline-block;
    width: 6px; height: 6px;
    background: var(--accent);
    border-radius: 50%;
    margin-left: 6px;
    vertical-align: middle;
}
.calendar-day {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 500;
}
.calendar-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    background: var(--bg-deep);
    color: var(--text-inverse);
    border-radius: 100px;
    align-self: flex-start;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.calendar-cell-muted .calendar-badge {
    opacity: 0.5;
}

.page-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.schedule-back {
    margin-bottom: 18px;
}
.back-link {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px 6px 10px;
    font-size: 13px;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-weight: 500;
    transition: all 0.15s ease;
    border-bottom: 1px solid transparent;
}
.back-link:hover {
    color: var(--accent);
    background: var(--accent-soft);
    border-color: transparent;
}

.schedule-action-row {
    display: flex;
    justify-content: flex-end;
    margin: 14px 0 18px;
}
.schedule-action-row-print {
    margin: 24px 0 32px;
}

.schedule-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    align-items: stretch;
    height: 580px;              
}
.schedule-library, .schedule-picked {
    display: flex;
    flex-direction: column;
    min-height: 0;              
}
.schedule-library .product-list {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
}
@media (max-width: 900px) { .schedule-grid { grid-template-columns: 1fr; } }

.schedule-library h2 { font-size: 16px; margin-bottom: 6px; }

.sched-recs {
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-soft);
}
.sched-recs h2 {
    color: var(--accent);
}
.sched-recs-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.product-list {
    margin: 14px 0 0;
    padding: 0 8px 0 0;
    max-height: 600px;
    overflow-y: auto;
}
.product-group + .product-group { margin-top: 8px; }

.library-search {
    position: relative;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.library-search-input {
    width: 100%;
    padding: 9px 12px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.library-search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.library-search-input::placeholder {
    color: var(--text-muted);
    font-style: italic;
}
.library-search-results {
    position: absolute;
    bottom: calc(100% - 6px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 20;
    padding: 4px;
}
.library-search-result {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 7px 8px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: background 0.1s ease;
}
.library-search-result:hover,
.library-search-result:focus {
    background: var(--accent-soft);
    outline: none;
}
.library-search-result-code {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    height: 26px;
    padding: 0 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    background: var(--bg-deep);
    color: var(--text-inverse);
    border-radius: var(--radius-sm);
}
.library-search-result-name {
    font-size: 13px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.library-search-empty {
    padding: 14px 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    font-style: italic;
}

.product-group-head {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 4px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-soft);
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.12s ease, border-color 0.12s ease;
}
.product-group-head:hover { color: var(--text-primary); }
.product-group[data-open="true"] .product-group-head {
    color: var(--text-primary);
    border-bottom-color: var(--accent);
}
.product-group-name { flex: 1; text-align: left; }
.product-group-count {
    font-family: 'Consolas', monospace;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-canvas);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 1px 8px;
    letter-spacing: 0;
}
.product-group-chevron {
    color: var(--text-muted);
    font-size: 11px;
    transition: transform 0.18s ease;
}
.product-group[data-open="true"] .product-group-chevron {
    transform: rotate(-180deg);
    color: var(--accent);
}

.product-group-items {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.2s ease, padding 0.2s ease;
}
.product-group[data-open="true"] .product-group-items {
    max-height: 4000px;          
    padding: 10px 0 4px;
}
.product-group-items li { margin-bottom: 7px; }
.product-group-items li:last-child { margin-bottom: 0; }
.product-chip {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    background: var(--bg-canvas);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 7px 10px;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: background 0.1s ease, border-color 0.1s ease;
}
.product-chip:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}
.product-chip-code {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 32px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    background: var(--bg-deep);
    color: var(--text-inverse);
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.03em;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.product-chip-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    flex: 1;
    min-width: 0;
}
.product-chip-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.25;
}
.product-chip-size {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.schedule-picked-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border-soft);
}
.schedule-total {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.schedule-total-num {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 500;
    color: var(--accent);
    line-height: 1;
}
.schedule-total-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.picked-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;                  
    min-height: 0;
    overflow-y: auto;
}
.picked-list[hidden] { display: none !important; }
.picked-empty {
    flex: 1;                  
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}
.picked-empty[hidden] { display: none !important; }
.picked-row {
    display: grid;
    grid-template-columns: auto auto 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-canvas);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: background 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
}

.picked-handle {
    cursor: grab;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1;
    letter-spacing: -2px;     
    user-select: none;
    padding: 0 2px;
}
.picked-handle:active { cursor: grabbing; }

.picked-code {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    height: 32px;
    padding: 0 10px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    background: var(--bg-deep);
    color: var(--text-inverse);
    border-radius: var(--radius-sm);
    letter-spacing: 0.02em;
}

.picked-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
    overflow: hidden;
}
.picked-brand {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.picked-size {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.picked-qty {
    display: flex;
    align-items: stretch;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    overflow: hidden;
}
.qty-btn {
    width: 30px;
    background: var(--bg-surface);
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.1s ease, color 0.1s ease;
}
.qty-btn:hover {
    background: var(--bg-canvas);
    color: var(--text-primary);
}
.qty-btn:active {
    background: var(--accent-soft);
}
.qty-input {
    width: 48px;
    border: none;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    background: var(--bg-surface);
    text-align: center;
    padding: 6px 0;
    font-weight: 600;
    font-size: 15px;
    border-radius: 0;
    -moz-appearance: textfield;
}
.qty-input:focus {
    outline: none;
    background: var(--accent-soft);
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.picked-remove {
    background: none;
    border: 1px solid var(--border);
    width: 28px; height: 28px;
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.15s ease;
}
.picked-remove:hover {
    border-color: var(--error);
    color: var(--error);
    background: var(--error-soft);
}
.picked-empty {
    padding: 28px;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    font-size: 13px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.picked-row[draggable="true"] { cursor: default; }
.picked-row-dragging {
    opacity: 0.4;
    border-color: var(--accent);
    background: var(--accent-soft);
}

.schedule-save-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
}
.schedule-save-row .btn {
    height: 48px;
    padding: 0 32px;
    font-size: 15px;
    min-width: 200px;
}

.redist-backdrop {
    position: fixed; inset: 0; z-index: 900;
    background: rgba(13, 27, 42, 0.35); backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center;
}
.redist-modal {
    background: var(--bg-surface); border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl); width: 520px; max-width: 92vw;
    padding: 28px 32px 24px;
    font-family: var(--font-sans);
}
.redist-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 8px;
}
.redist-head h3 {
    font-family: var(--font-display); font-size: 20px; font-weight: 600;
    margin: 0;
}
.redist-close {
    width: 32px; height: 32px; border: none; background: none;
    font-size: 22px; color: var(--text-muted); cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
}
.redist-close:hover { background: var(--bg-canvas); color: var(--text-primary); }
.redist-desc {
    font-size: 14px; color: var(--text-secondary); line-height: 1.5;
    margin: 0 0 20px;
}
.redist-options {
    display: flex; flex-direction: column; gap: 8px;
    margin-bottom: 16px;
}
.redist-option {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border: 1px solid var(--border);
    border-radius: var(--radius); background: var(--bg-surface);
    cursor: pointer; text-align: left;
    transition: all 0.12s;
}
.redist-option-left {
    display: flex; flex-direction: column; gap: 2px;
}
.redist-option:hover {
    border-color: var(--accent); background: var(--accent-soft);
}
.redist-option-label {
    font-size: 14px; font-weight: 600; color: var(--text-primary);
}
.redist-option-desc {
    font-size: 12px; color: var(--text-muted);
}
.redist-option-count {
    font-size: 14px; color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.redist-option-count strong { color: var(--accent); font-size: 15px; }
.redist-foot {
    padding-top: 12px; border-top: 1px solid var(--border-soft);
    display: flex; justify-content: flex-end;
}
.redist-foot .btn {
    font-size: 13px; color: var(--error);
    border-color: var(--error);
}
.redist-foot .btn:hover {
    background: var(--error-soft); color: var(--error);
}

.plan-vs-actual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 32px;
}
@media (max-width: 900px) { .plan-vs-actual { grid-template-columns: 1fr; } }
.pva-col {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}
.pva-col-head {
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-soft);
}
.pva-col-head h2 {
    margin: 2px 0 4px;
    font-size: 18px;
}
.pva-empty {
    text-align: center;
    padding: 32px 12px;
    font-style: italic;
    font-size: 13px;
}
.snapshot-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.snapshot-item {
    padding: 14px 16px;
    background: var(--bg-canvas);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.snapshot-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13px;
}
.snapshot-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.snapshot-table th, .snapshot-table td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border-soft);
}
.snapshot-table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
}
.snapshot-table tbody tr:last-child td { border-bottom: none; }
.snapshot-table td.num {
    text-align: right;
    font-family: 'Consolas', monospace;
    font-weight: 600;
    width: 50px;
    color: var(--accent);
}
.snapshot-table code {
    background: var(--bg-deep);
    color: var(--text-inverse);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
}
.pva-actual-summary {
    text-align: center;
    padding: 20px 0 24px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-soft);
}
.pva-big-num {
    font-family: var(--font-display);
    font-size: 48px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1;
}
.pva-delta {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: 100px;
}
.pva-delta-zero { background: var(--success-soft); color: var(--success); }
.pva-delta-over { background: var(--warn-soft); color: var(--warn); }
.pva-delta-under { background: var(--error-soft); color: var(--error); }

.user-form-grid,
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: stretch;  
}
@media (max-width: 900px) {
    .user-form-grid,
    .profile-grid { grid-template-columns: 1fr; }
}
.user-form-section {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

.user-form-secondary {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.user-form-secondary-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.user-form-secondary-sub {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}
.user-form-section h2 {
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-soft);
    font-size: 17px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-form-section h2::before {
    content: "";
    width: 3px; height: 16px;
    background: var(--accent);
    border-radius: 2px;
}
.user-form-perms {
    grid-template-columns: 1fr;  
}
.user-form-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
    padding-top: 20px;
}

.access-admin-card {
    border-left: 3px solid var(--accent);
}
.access-admin-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
}
.access-admin-list li {
    padding: 4px 12px;
    background: var(--bg-canvas);
    border-radius: var(--radius);
    font-size: 14px;
}

.access-user-card {
    margin-top: 16px;
    transition: border-color 0.15s ease;
}
.access-user-card.access-user-inactive {
    opacity: 0.6;
}
.access-user-head {
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-soft);
}
.access-user-name {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 500;
}
.access-user-meta {
    margin-top: 4px;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.perm-accordion-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.perm-accordion {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.perm-accordion-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 14px;
    border: none;
    background: #0d1b2a;
    color: #b8935a;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}
.perm-accordion-btn:hover {
    background: #132d46;
}
.perm-accordion-count {
    margin-left: auto;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
}
.perm-accordion-arrow {
    transition: transform 0.2s;
    flex-shrink: 0;
    color: #b8935a88;
}
.perm-accordion.open .perm-accordion-arrow {
    transform: rotate(180deg);
}
.perm-accordion-body {
    display: none;
    padding: 8px 10px 10px;
    background: var(--bg-surface);
    gap: 6px;
}
.perm-accordion.open .perm-accordion-body {
    display: flex;
    flex-direction: column;
}
.perm-toggle {
    display: flex;
    align-items: center;
    flex-direction: row-reverse;
    gap: 10px;
    padding: 8px 12px;
    margin-bottom: 0;
    cursor: pointer;
    background: var(--bg-canvas);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.15s ease;
}
.perm-toggle:hover {
    border-color: var(--accent);
    background: rgba(184, 147, 90, 0.04);
}
.perm-toggle input[type=checkbox] {
    margin: 0;
    accent-color: var(--accent);
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    align-self: center;
}
.perm-toggle:has(input:checked) {
    background: #0d1b2a;
    border-color: #0d1b2a;
    box-shadow: 0 2px 6px rgba(13, 27, 42, 0.15);
}
.perm-toggle:has(input:checked):hover {
    background: #132d46;
    border-color: #132d46;
}
.perm-toggle:has(input:checked) .perm-toggle-label {
    color: #b8935a;
}
.perm-toggle:has(input:checked) .perm-toggle-desc {
    color: rgba(255, 255, 255, 0.5);
}
.perm-toggle-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}
.perm-toggle > span,
.perm-toggle-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: none;
    letter-spacing: 0;
    margin-bottom: 0;
}
.perm-toggle-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

.hr-perm-divider {
    margin-top: auto;
    padding-top: 20px;
    border: none;
    border-top: 1px dashed var(--border);
}
.hr-perm-section {
    display: flex;
    justify-content: flex-end;
}
.hr-perm-section-box {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: #0d1b2a;
    border-radius: var(--radius);
}
.hr-perm-section-label {
    font-size: 13px;
    font-weight: 600;
    color: #b8935a;
}
.hr-lock-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 1px solid #b8935a44;
    background: transparent;
    color: #b8935a;
    cursor: pointer;
    transition: all 0.15s;
}
.hr-lock-btn:hover {
    border-color: #b8935a;
    background: #b8935a18;
}

.hr-unlock-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s;
}
.hr-unlock-overlay.open {
    display: flex;
    opacity: 1;
}
.hr-unlock-modal {
    background: #0d1b2a;
    border: 1px solid #b8935a33;
    border-radius: var(--radius-lg);
    padding: 36px 32px 28px;
    width: 340px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.hr-unlock-icon {
    color: #b8935a;
    margin-bottom: 16px;
}
.hr-unlock-modal h3 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}
.hr-unlock-modal .muted {
    color: rgba(255, 255, 255, 0.45);
    font-size: 13px;
    margin: 0 0 20px;
}
.hr-unlock-field {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #b8935a44;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 14px;
    text-align: center;
    letter-spacing: 0.1em;
    outline: none;
    transition: border-color 0.15s;
}
.hr-unlock-field:focus {
    border-color: #b8935a;
}
.hr-unlock-field::placeholder {
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 0;
}
.hr-unlock-error {
    color: #e74c3c;
    font-size: 12px;
    font-weight: 500;
    margin: 8px 0 0;
    min-height: 18px;
}
.hr-unlock-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.hra-cockpit {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    align-items: start;
}
@media (max-width: 860px) {
    .hra-cockpit {
        grid-template-columns: 1fr;
    }
}

.hra-matrix-panel {
    overflow: hidden;
}
.hra-matrix-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.hra-matrix-head h2 { margin: 0; }
.hra-toolbar-group {
    display: flex;
    gap: 6px;
}

.hra-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.hra-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}
.hra-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding: 8px 6px;
    border-bottom: 2px solid var(--border);
    background: var(--bg-canvas);
}
.hra-th-level {
    text-align: center !important;
    width: 60px;
}

.hra-dept-row td {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #b8935a;
    background: #0d1b2a;
    padding: 7px 10px;
}

.hra-emp-tr {
    transition: background 0.1s;
}
.hra-emp-tr:hover {
    background: rgba(184, 147, 90, 0.04);
}
.hra-emp-tr td {
    padding: 8px 6px;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: middle;
}
.hra-emp-inactive {
    opacity: 0.45;
}
.hra-emp-cell {
    min-width: 0;
}
.hra-emp-cell strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}
.hra-emp-cell span {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

.hra-radio-cell {
    text-align: center;
    width: 60px;
}
.hra-radio-cell input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #b8935a;
    margin: 0;
}

.hra-emp-tr:has(input[value="view"]:checked) {
    border-left: 3px solid #5ba4cf;
}
.hra-emp-tr:has(input[value="manage"]:checked) {
    border-left: 3px solid #b8935a;
}
.hra-emp-tr:has(input[value="full"]:checked) {
    border-left: 3px solid #e74c3c;
}

.hra-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 20px;
}
.hra-side-card {
    padding: 16px;
}
.hra-side-card h2 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 0 0 12px;
}

.hra-status-split {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 10px;
}
.hra-status-total {
    flex-shrink: 0;
    text-align: center;
    padding: 0 18px 0 4px;
    border-right: 1px solid var(--border-soft);
}
.hra-gauge-num {
    font-size: 32px;
    font-weight: 800;
    color: #b8935a;
    line-height: 1;
}
.hra-gauge-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}
.hra-status-tbl {
    flex: 1;
    border-collapse: collapse;
    margin-left: 14px;
}
.hra-status-tbl td {
    padding: 3px 0;
}
.hra-status-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: 0;
}
.hra-status-val {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: right;
    padding-left: 12px;
}
.hra-gauge-bar {
    height: 4px;
    background: var(--bg-deep);
    border-radius: 2px;
    overflow: hidden;
}
.hra-gauge-fill {
    height: 100%;
    background: #b8935a;
    border-radius: 2px;
    transition: width 0.25s ease;
}

.hra-ref-table {
    width: 100%;
    border-collapse: collapse;
}
.hra-ref-table td {
    padding: 6px 0;
    vertical-align: baseline;
    border-bottom: 1px solid var(--border-soft);
}
.hra-ref-table tr:last-child td {
    border-bottom: none;
}
.hra-ref-level {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    padding-right: 16px;
    width: 70px;
}
.hra-ref-none {
    color: var(--text-muted);
}
.hra-ref-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

.access-perm-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
}
.access-perm-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-canvas);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 0;
}
.access-perm-row:hover {
    border-color: var(--accent);
    background: rgba(184, 147, 90, 0.04);
}
.access-perm-row input[type=checkbox] {
    margin-top: 3px;
    width: auto;
    accent-color: var(--accent);
    cursor: pointer;
}

.access-perm-row:has(input[type=checkbox]:checked) {
    background: var(--bg-deep);
    border-color: var(--bg-deep);
    box-shadow: 0 2px 6px rgba(13, 27, 42, 0.15);
}
.access-perm-row:has(input[type=checkbox]:checked) .access-perm-key {
    color: var(--accent);
}
.access-perm-row:has(input[type=checkbox]:checked) .access-perm-desc {
    color: var(--text-inverse-muted);
}
.access-perm-row:has(input[type=checkbox]:checked):hover {
    background: var(--bg-deep-2);
    border-color: var(--bg-deep-2);
}
.access-perm-key {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.access-perm-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.calendar-cell-readonly {
    cursor: default;
}
.calendar-cell-readonly:hover {
    background: initial;
}

.provider-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 680px) { .provider-grid { grid-template-columns: 1fr; } }
.provider-card {
    display: block;
    position: relative;
    padding: 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 0;
}
.provider-card input[type=radio] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.provider-card:hover:not(.disabled) {
    border-color: var(--accent);
    background: rgba(184, 147, 90, 0.03);
}
.provider-card.selected {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 0 3px rgba(184, 147, 90, 0.15);
}
.provider-card.disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.provider-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 500;
    margin-bottom: 6px;
}
.provider-model {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}
.provider-model code {
    background: var(--bg-canvas);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

.inv-filters {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.inv-filter {
    padding: 8px 18px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s ease;
}
.inv-filter:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}
.inv-filter.active {
    background: var(--bg-deep);
    color: var(--text-inverse);
    border-color: var(--bg-deep);
    box-shadow: var(--shadow-sm);
}
.inv-filter-spacer { flex: 1; }
.inv-search {
    padding: 8px 14px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-surface);
    color: var(--text-primary);
    width: 220px;
    transition: border-color 0.15s ease;
}
.inv-search:focus {
    outline: none;
    border-color: var(--accent);
}

.inv-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}
.inv-board:has(.inv-column[data-section='other']) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 1024px) { .inv-board, .inv-board:has(.inv-column[data-section='other']) { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px)  { .inv-board, .inv-board:has(.inv-column[data-section='other']) { grid-template-columns: 1fr; } }

.inv-board.inv-board-single { grid-template-columns: 1fr; }

.inv-column {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.inv-column-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    background: var(--bg-canvas);
    border-bottom: 1px solid var(--border);
}
.inv-column-title {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 500;
    letter-spacing: -0.005em;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}
.inv-column-stats {
    display: flex;
    align-items: center;
    gap: 6px;
}
.inv-column-count {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: 100px;
    background: var(--bg-surface);
    min-width: 24px;
    text-align: center;
}

.inv-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 100px;
    line-height: 1.4;
}
.inv-stat-critical { background: var(--error-soft); color: var(--error); }
.inv-stat-low      { background: var(--warn-soft);  color: var(--warn); }
.inv-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}

.inv-column-list {
    display: flex;
    flex-direction: column;
}
.inv-column-empty {
    padding: 20px 16px;
    text-align: center;
    font-size: 13px;
}

.inv-row-card {
    all: unset;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 14px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-soft);
    background: var(--bg-surface);
    cursor: pointer;
    transition: background 0.12s ease;
    text-align: left;
}
.inv-row-card:last-child { border-bottom: none; }
.inv-row-card:hover { background: rgba(184, 147, 90, 0.06); }
.inv-row-card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}
.inv-row-card-inactive { opacity: 0.5; }

.inv-row-status {
    display: block;
    width: 4px;
    height: 28px;
    border-radius: 100px;
    background: var(--success);
}
.inv-row-status-ok       .inv-row-status { background: var(--success); }
.inv-row-status-low      .inv-row-status { background: var(--warn); }
.inv-row-status-critical .inv-row-status { background: var(--error); }

.inv-row-status-low {
    background: linear-gradient(90deg, var(--warn-soft) 0%, var(--bg-surface) 60%);
}
.inv-row-status-low:hover {
    background: linear-gradient(90deg, #f8e8c4 0%, rgba(184, 147, 90, 0.06) 60%);
}
.inv-row-status-critical {
    background: linear-gradient(90deg, var(--error-soft) 0%, var(--bg-surface) 60%);
}
.inv-row-status-critical:hover {
    background: linear-gradient(90deg, #f6d8d4 0%, rgba(184, 147, 90, 0.06) 60%);
}

.inv-row-card-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.inv-row-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.inv-row-card-sub {
    font-size: 11px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inv-row-card-qty {
    display: flex;
    align-items: baseline;
    gap: 3px;
    white-space: nowrap;
    text-align: right;
}
.inv-qty {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1;
}
.inv-row-status-low      .inv-qty { color: var(--warn); }
.inv-row-status-critical .inv-qty { color: var(--error); }
.inv-qty-unit {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: lowercase;
}

.inv-modal-link {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}
.inv-modal-link:hover { color: var(--accent); border-bottom-color: var(--accent); }
.inv-modal-foot-spacer { flex: 1; }

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
}
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-ghost:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.inv-overlay {
    position: fixed;
    inset: 0;
    background: rgba(13, 27, 42, 0.45);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}
.inv-overlay[hidden] { display: none; }
.inv-modal {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 420px;
    max-width: 92vw;
}
.inv-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 12px;
    border-bottom: 1px solid var(--border-soft);
}
.inv-modal-head h3 {
    margin: 0;
    font-size: 16px;
}
.inv-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.inv-modal-close:hover { color: var(--text-primary); }
.inv-modal-body {
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.inv-modal-body label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.inv-modal-body label span {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}
.inv-modal-body select,
.inv-modal-body input {
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-surface);
    color: var(--text-primary);
}
.inv-modal-body select:focus,
.inv-modal-body input:focus {
    outline: none;
    border-color: var(--accent);
}
.inv-modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 22px 18px;
}
.page-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.container:has(.hr-layout) {
    max-width: 1600px;
    padding-left: 16px;
}
.hr-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 40px;
    min-height: calc(100vh - 80px);
    padding-top: 12px;
}
@media (max-width: 860px) {
    .hr-layout {
        grid-template-columns: 1fr;
    }
}

.hr-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 0 12px;
    align-self: start;
    position: sticky;
    top: 24px;
    margin-top: 120px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.hr-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 18px 18px;
    border-bottom: 1px solid var(--border-soft);
}

.hr-sidebar-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--bg-deep);
    color: var(--accent);
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.hr-sidebar-brand-text {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.hr-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 10px 0;
}

.hr-sidebar-divider {
    height: 1px;
    background: var(--border-soft);
    margin: 6px 4px;
}

.hr-sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}
.hr-sidebar-link svg {
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity 0.15s;
}
.hr-sidebar-link:hover {
    background: var(--accent-soft);
    color: var(--text-primary);
}
.hr-sidebar-link:hover svg {
    opacity: 0.8;
}
.hr-sidebar-link.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}
.hr-sidebar-link.active svg {
    opacity: 1;
    color: var(--accent);
}

.hr-sidebar-link-restricted {
    color: var(--error);
    opacity: 0.7;
}
.hr-sidebar-link-restricted svg {
    color: var(--error);
}
.hr-sidebar-link-restricted:hover {
    background: var(--error-soft);
    color: var(--error);
    opacity: 1;
}
.hr-sidebar-link-restricted.active {
    background: var(--error-soft);
    color: var(--error);
    font-weight: 600;
    opacity: 1;
}

.hr-main {
    min-width: 0;
}

.hr-inbox {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 32px 36px;
    margin-bottom: 40px;
    min-height: 220px;
}

.hr-inbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-soft);
}
.hr-inbox-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.hr-inbox-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.hr-inbox-icon {
    color: var(--accent);
    flex-shrink: 0;
}
.hr-inbox-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.01em;
}
.hr-inbox-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin: 2px 0 0;
}
.hr-inbox-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 8px;
    border-radius: 13px;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}
.hr-inbox-clear-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.hr-inbox-clear-btn:hover {
    background: var(--bg-canvas);
    color: var(--text-primary);
}

.hr-inbox-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.hr-inbox-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-soft);
    transition: background 0.12s;
}
.hr-inbox-item:last-child {
    border-bottom: none;
    padding-bottom: 4px;
}

.hr-inbox-item-icon {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}
.hr-inbox-leave_approval .hr-inbox-item-icon {
    background: var(--warn-soft);
    color: var(--warn);
}
.hr-inbox-signature_request .hr-inbox-item-icon {
    background: rgba(45, 106, 79, 0.10);
    color: var(--success);
}
.hr-inbox-review_assigned .hr-inbox-item-icon {
    background: var(--error-soft);
    color: var(--error);
}
.hr-inbox-general .hr-inbox-item-icon {
    background: var(--accent-soft);
    color: var(--accent);
}

.hr-inbox-item-body {
    flex: 1;
    min-width: 0;
}
.hr-inbox-item-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}
.hr-inbox-item-type {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}
.hr-inbox-item-time {
    font-size: 12px;
    color: var(--text-muted);
    opacity: 0.7;
}
.hr-inbox-item-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.35;
}
.hr-inbox-item-summary {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 3px 0 0;
    line-height: 1.45;
}

.hr-inbox-item-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-top: 6px;
}
.hr-inbox-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s, color 0.15s, transform 0.1s;
    text-decoration: none;
}
.hr-inbox-btn:active {
    transform: scale(0.96);
}
.hr-inbox-btn-view {
    padding: 6px 14px;
    background: var(--accent-soft);
    color: var(--accent-hover);
}
.hr-inbox-btn-view:hover {
    background: var(--accent);
    color: #fff;
}
.hr-inbox-btn-dismiss {
    width: 30px;
    height: 30px;
    padding: 0;
    background: transparent;
    color: var(--text-muted);
    opacity: 0.4;
}
.hr-inbox-btn-dismiss:hover {
    opacity: 1;
    background: var(--error-soft);
    color: var(--error);
}

.hr-inbox-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 140px;
}
.hr-inbox-empty p {
    color: var(--text-muted);
    font-size: 15px;
    margin: 0;
}

.hr-section-divider {
    margin: 16px 0 40px;
    height: 3px;
    border: none;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--border) 0%, var(--accent) 50%, var(--border) 100%);
    opacity: 0.45;
}

.hr-dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.hr-dash-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 28px 28px 24px;
    min-height: 190px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    overflow: hidden;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    border: 1px solid var(--border);
    background: var(--bg-surface);
}
.hr-dash-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 12px 12px 0 0;
}
.hr-dash-card:hover {
    transform: translateY(-4px);
    color: var(--text-primary);
    border-bottom-color: var(--border);
}

.hr-dash-navy::before  { background: linear-gradient(90deg, #0d1b2a, #1c3046); }
.hr-dash-amber::before { background: linear-gradient(90deg, #b8935a, #d4a95a); }
.hr-dash-green::before { background: linear-gradient(90deg, #2d6a4f, #52b788); }
.hr-dash-plum::before  { background: linear-gradient(90deg, #6b2fa0, #a855f7); }
.hr-dash-red::before   { background: linear-gradient(90deg, #912018, #dc2626); }

.hr-dash-navy:hover  { box-shadow: 0 12px 32px rgba(13, 27, 42, 0.18); }
.hr-dash-amber:hover { box-shadow: 0 12px 32px rgba(184, 147, 90, 0.22); }
.hr-dash-green:hover { box-shadow: 0 12px 32px rgba(45, 106, 79, 0.20); }
.hr-dash-plum:hover  { box-shadow: 0 12px 32px rgba(107, 47, 160, 0.20); }
.hr-dash-red:hover   { box-shadow: 0 12px 32px rgba(145, 32, 24, 0.20); }

.hr-dash-navy  .hr-dash-icon { color: #0d1b2a; background: rgba(13, 27, 42, 0.08); }
.hr-dash-amber .hr-dash-icon { color: #a07d45; background: rgba(184, 147, 90, 0.12); }
.hr-dash-green .hr-dash-icon { color: #2d6a4f; background: rgba(45, 106, 79, 0.10); }
.hr-dash-plum  .hr-dash-icon { color: #6b2fa0; background: rgba(107, 47, 160, 0.10); }
.hr-dash-red   .hr-dash-icon { color: #912018; background: rgba(145, 32, 24, 0.10); }

.hr-dash-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.hr-dash-value {
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 6px;
}

.hr-dash-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: auto;
}

.hr-dash-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 16px;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.2s, transform 0.2s;
}
.hr-dash-card:hover .hr-dash-hint {
    opacity: 1;
    transform: translateX(0);
}

.hr-form-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 36px 40px;
    box-shadow: var(--shadow-sm);
    max-width: 100%;
}
.hr-form-section {
    margin-bottom: 4px;
}
.hr-form-section-title {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-soft);
    letter-spacing: -0.01em;
}
.hr-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
@media (max-width: 600px) {
    .hr-form-row { grid-template-columns: 1fr; }
}
.hr-form-field {
    margin-bottom: 16px;
}
.hr-form-field > span {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.hr-form-divider {
    height: 1px;
    background: var(--border-soft);
    margin: 20px 0 24px;
}
.hr-form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.hr-form-card input[type=text],
.hr-form-card input[type=date],
.hr-form-card input[type=time],
.hr-form-card input[type=email],
.hr-form-card input[type=number],
.hr-form-card textarea,
.hr-form-card select {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--text-primary);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.hr-form-card input:focus,
.hr-form-card textarea:focus,
.hr-form-card select:focus {
    background: #fff;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.hr-form-card select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238a94a0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
    cursor: pointer;
}
.hr-form-card select:hover {
    border-color: var(--text-muted);
}
.hr-form-card select option:disabled {
    color: var(--text-muted);
    font-style: italic;
}
.hr-form-card input[type=date] {
    cursor: pointer;
}
.hr-form-card input::placeholder,
.hr-form-card textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.hr-icon-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    color: var(--text-muted);
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    vertical-align: middle;
    margin-left: 4px;
}
.hr-icon-btn-done:hover {
    background: var(--success-soft);
    color: var(--success);
    border-color: var(--success);
}
.hr-icon-btn-remove:hover {
    background: var(--error-soft);
    color: var(--error);
    border-color: var(--error);
}

.hr-main .grid td {
    padding-top: 16px;
    padding-bottom: 16px;
    font-size: 15px;
    text-align: center;
}
.hr-main .grid th {
    padding-top: 14px;
    padding-bottom: 14px;
    text-align: center;
}
.hr-main .grid td:first-child,
.hr-main .grid th:first-child {
    text-align: left;
}
.hr-main .grid td:last-child,
.hr-main .grid th:last-child {
    text-align: right;
}

.hr-iv2-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.hr-iv2-card {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.18s, transform 0.18s;
}
.hr-iv2-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.hr-iv2-muted { opacity: 0.5; }

.hr-iv2-date-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80px;
    flex-shrink: 0;
    padding: 18px 0;
    background: var(--bg-deep);
    color: var(--text-inverse);
    align-self: stretch;
}
.hr-iv2-date-month {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
}
.hr-iv2-date-day {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
}
.hr-iv2-date-time {
    font-size: 11px;
    color: var(--text-inverse-muted);
    margin-top: 2px;
}

.hr-iv2-content {
    flex: 1;
    padding: 16px 24px;
    min-width: 0;
}
.hr-iv2-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}
.hr-iv2-name {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}
.hr-iv2-pill {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}
.hr-iv2-pill-scheduled { background: var(--accent-soft); color: var(--accent-hover); }
.hr-iv2-pill-completed { background: var(--success-soft); color: var(--success); }
.hr-iv2-pill-cancelled { background: var(--bg-canvas); color: var(--text-muted); }

.hr-iv2-role {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 6px;
}
.hr-iv2-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}
.hr-iv2-meta span::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--border);
    vertical-align: middle;
    margin-right: 6px;
}
.hr-iv2-notes {
    font-size: 13px;
    color: var(--text-muted);
    margin: 6px 0 0;
    font-style: italic;
}

.hr-iv2-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 18px;
    flex-shrink: 0;
}
.hr-iv2-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    color: var(--text-muted);
    transition: background 0.12s, color 0.12s;
}
.hr-iv2-btn:hover { background: var(--bg-canvas); }
.hr-iv2-btn-done:hover { background: var(--success-soft); color: var(--success); }
.hr-iv2-btn-cancel:hover { background: var(--error-soft); color: var(--error); }
.hr-iv2-btn-remove:hover { background: var(--bg-canvas); color: var(--text-secondary); }

.hr-time-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
    gap: 5px;
}
.hr-time-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    padding: 24px 0;
}
.hr-time-slot {
    padding: 5px 2px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, transform 0.1s;
}
.hr-time-slot:hover:not(:disabled) {
    border-color: var(--accent);
    background: var(--accent-soft);
}
.hr-time-slot:active:not(:disabled) {
    transform: scale(0.96);
}
.hr-time-selected {
    background: var(--accent) !important;
    color: #fff !important;
    border-color: var(--accent) !important;
}
.hr-time-taken {
    background: var(--bg-canvas);
    color: var(--text-muted);
    opacity: 0.45;
    cursor: not-allowed;
    text-decoration: line-through;
}

.hr-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 24px;
}
@media (max-width: 800px) {
    .hr-grid { grid-template-columns: 1fr; }
}

.hr-filter {
    display: inline-flex;
    gap: 4px;
}

.hr-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 24px;
}
@media (max-width: 800px) {
    .hr-detail-grid { grid-template-columns: 1fr; }
}

.hr-detail-fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.hr-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hr-field-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.hr-progress-bar {
    height: 8px;
    background: var(--border-soft);
    border-radius: 4px;
    overflow: hidden;
}

.hr-progress-fill {
    height: 100%;
    background: var(--success);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.hr-task-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hr-task-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-soft);
    font-size: 14px;
}

.hr-task-list li:last-child {
    border-bottom: none;
}

.hr-task-done {
    color: var(--text-muted);
    text-decoration: line-through;
}

.hr-task-check {
    width: 20px;
    text-align: center;
    font-weight: bold;
    color: var(--success);
    font-size: 14px;
}

.hr-row-done td {
    opacity: 0.55;
}

.hr-scores-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 24px;
}
@media (max-width: 640px) {
    .hr-scores-grid { grid-template-columns: 1fr; }
}

.hr-score-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hr-score-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.hr-score-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hr-range {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--border-soft);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}
.hr-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-surface);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}
.hr-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-surface);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.hr-score-value {
    min-width: 24px;
    text-align: center;
    font-weight: 700;
    font-size: 15px;
    color: var(--accent);
}

.hr-review-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 24px;
}
@media (max-width: 860px) {
    .hr-review-grid { grid-template-columns: 1fr; }
}

.hr-radar-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hr-radar-wrap {
    width: 100%;
    max-width: 440px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hr-score-bar-bg {
    height: 8px;
    background: var(--border-soft);
    border-radius: 4px;
    overflow: hidden;
}

.hr-score-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.cogs-summary-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.cogs-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cogs-card-label {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.cogs-card-value {
    font-family: var(--font-serif);
    font-size: 26px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.cogs-card-sub {
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--text-secondary);
}

.cogs-positive { color: var(--success); }
.cogs-negative { color: var(--error); }

.an-section {
    margin-bottom: 40px;
}

.an-row {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

.an-row-charts {
    grid-template-columns: 5fr 3fr;
}

.an-row-ranks {
    grid-template-columns: 1fr 1fr;
}

.an-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.an-panel-wide { grid-column: 1; }

.an-panel-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 18px 24px 0;
}

.an-panel-head h3 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.an-panel-sub {
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--text-muted);
}

.an-chart-area {
    position: relative;
    padding: 12px 20px 16px;
}

.an-chart-tall { height: 290px; }
.an-chart-donut { height: 260px; }

.an-rank-list {
    padding: 14px 20px 18px;
}

.an-rank-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-soft);
}

.an-rank-item:last-child { border-bottom: none; }

.an-rank-num {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    color: var(--border);
    min-width: 24px;
    text-align: center;
    line-height: 1;
    padding-top: 2px;
}

.an-rank-body {
    flex: 1;
    min-width: 0;
}

.an-rank-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.an-rank-name {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.an-rank-rev {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    flex-shrink: 0;
    margin-left: 12px;
}

.an-rank-bar-track {
    height: 5px;
    background: var(--border-soft);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.an-rank-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, rgba(184,147,90,0.5) 100%);
    border-radius: 3px;
    transition: width 0.6s ease;
}

.an-rank-bottom {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--text-muted);
}

.an-rank-margin { font-weight: 500; }
.an-rank-margin small { font-weight: 400; }
.an-rank-pos { color: var(--success); }
.an-rank-neg { color: var(--error); }

.an-rank-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    padding: 24px 0;
}

@media (max-width: 800px) {
    .an-row-charts,
    .an-row-ranks { grid-template-columns: 1fr; }
    .an-panel-wide { grid-column: 1; }
    .an-chart-tall { height: 240px; }
}

.cogs-section {
    margin-bottom: 40px;
}

.cogs-section h2 {
    font-family: var(--font-serif);
    font-size: 20px;
    margin-bottom: 16px;
}

.inline-filter {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 20px;
}

.inline-filter .field-inline {
    margin-bottom: 0;
}

.inline-filter .field-label {
    font-size: 11px;
    margin-bottom: 4px;
}

.field-hint {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.bp-section {
    margin-top: 48px;
}

.bp-header {
    margin-bottom: 0;
    padding: 28px 32px 20px;
    background: var(--bg-deep);
    border-radius: 12px 12px 0 0;
}

.bp-tag {
    display: inline-block;
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(184, 147, 90, 0.15);
    padding: 3px 10px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.bp-title {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 600;
    color: var(--text-inverse);
    margin: 4px 0 6px;
}

.bp-sub {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-inverse-muted);
}

.bp-canvas {
    background: var(--bg-deep-2);
    border: 1px solid rgba(255,255,255,0.06);
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 28px 32px 32px;
}

.bp-bar-wrap { margin-bottom: 32px; }

.bp-bar {
    display: flex;
    height: 28px;
    border-radius: 6px;
    overflow: hidden;
    gap: 2px;
}

.bp-bar-seg {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    min-width: 32px;
    transition: width 0.4s ease;
}

.bp-bar-ingredient { background: #4a90d9; }
.bp-bar-labor      { background: #e8a838; }
.bp-bar-overhead   { background: #7c6bc4; }
.bp-bar-shipping   { background: #5bbf8e; }

.bp-bar-legend {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    font-family: var(--font-sans);
    font-size: 11px;
    color: var(--text-inverse-muted);
}

.bp-legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    margin-right: 4px;
    vertical-align: middle;
}

.bp-legend-ingredient { background: #4a90d9; }
.bp-legend-labor      { background: #e8a838; }
.bp-legend-overhead   { background: #7c6bc4; }
.bp-legend-shipping   { background: #5bbf8e; }

.bp-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.bp-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 720px;
}

.bp-row-single { justify-content: center; }

.bp-connector {
    font-family: var(--font-mono, monospace);
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}

.bp-node {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 18px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.08);
    background: var(--bg-deep-3);
    min-width: 140px;
    flex: 1;
}

.bp-node-label {
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-inverse-muted);
}

.bp-node-value {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-inverse);
    line-height: 1.2;
}

.bp-node-sub {
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--text-inverse-muted);
}

.bp-node-cost {
    font-family: var(--font-mono, monospace);
    font-size: 12px;
    color: var(--accent);
    margin-top: 2px;
}

.bp-node-total {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.bp-node-result { border-left: 3px solid; }
.bp-node-ingredient { border-left-color: #4a90d9; }
.bp-node-labor      { border-left-color: #e8a838; }
.bp-node-overhead   { border-left-color: #7c6bc4; }
.bp-node-shipping   { border-left-color: #5bbf8e; }

.bp-node-final {
    border: 2px solid var(--accent);
    background: rgba(184, 147, 90, 0.1);
    text-align: center;
    padding: 20px 32px;
    min-width: 220px;
    flex: 0;
}

.bp-node-final .bp-node-total {
    font-size: 28px;
    color: var(--accent);
}

.bp-day-tag {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px 0 4px;
    padding: 0 4px;
    max-width: 720px;
    width: 100%;
}

.bp-day-date {
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    background: rgba(184, 147, 90, 0.15);
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.04em;
}

.bp-day-pct {
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    color: var(--text-inverse-muted);
}

.bp-flow-line {
    width: 2px;
    height: 20px;
    background: rgba(255,255,255,0.12);
    margin: 0 auto;
}

.bp-flow-line-sm {
    height: 12px;
}

.bp-flow-line-final {
    height: 28px;
    background: var(--accent);
    opacity: 0.5;
}

.bp-verdict {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.bp-verdict-item {
    text-align: center;
    padding: 12px 24px;
    border-radius: 8px;
    background: var(--bg-deep-3);
    border: 1px solid rgba(255,255,255,0.06);
}

.bp-verdict-label {
    display: block;
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-inverse-muted);
    margin-bottom: 4px;
}

.bp-verdict-value {
    display: block;
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-inverse);
}

.bp-verdict-pct {
    display: block;
    font-family: var(--font-mono, monospace);
    font-size: 12px;
    margin-top: 2px;
}

.bp-verdict-op {
    font-family: var(--font-mono, monospace);
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
}

.bp-verdict-result {
    border: 2px solid;
}

.bp-verdict-positive {
    border-color: var(--success);
}

.bp-verdict-positive .bp-verdict-value,
.bp-verdict-positive .bp-verdict-pct { color: var(--success); }

.bp-verdict-negative {
    border-color: var(--error);
}

.bp-verdict-negative .bp-verdict-value,
.bp-verdict-negative .bp-verdict-pct { color: var(--error); }

.ord-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 20px;
    align-items: start;
}
@media (max-width: 900px) {
    .ord-layout { grid-template-columns: 1fr; }
}

.ord-table-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-width: 0;
}

.ord-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.ord-table thead th {
    padding: 13px 16px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    background: var(--bg-canvas);
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}
.ord-table thead th { text-align: center; }
.ord-table thead th:nth-child(2) { text-align: left; } 

.ord-table tbody tr {
    border-bottom: 1px solid var(--border-soft);
    transition: background 0.1s;
}
.ord-table tbody tr:last-child { border-bottom: none; }
.ord-row-link { cursor: pointer; transition: background 0.12s, box-shadow 0.12s; }
.ord-row-link:hover { background: rgba(184, 147, 90, 0.08); box-shadow: inset 3px 0 0 var(--accent); }

.ord-table td {
    padding: 12px 16px;
    vertical-align: middle;
    white-space: nowrap;
}
.ord-table td { text-align: center; }
.ord-table td:nth-child(2) { text-align: left; } 

.ord-date {
    color: var(--text-secondary);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    font-family: inherit;
    font-weight: 400;
}
.ord-customer {
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
.ord-product {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-canvas);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}
.ord-mono {
    font-variant-numeric: tabular-nums;
    font-size: 13px;
}
.ord-total {
    font-weight: 600;
    color: var(--text-primary);
}
.ord-mixes {
    font-weight: 600;
    color: var(--accent);
}
.ord-actions { text-align: center; }
.ord-edit-link {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: none !important;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    transition: background 0.12s, color 0.12s;
}
.ord-edit-link:hover {
    background: var(--bg-canvas);
    color: var(--accent);
}

@media (max-width: 700px) {
    .ord-table td, .ord-table thead th { padding: 10px 12px; }
}

.ord-donut-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.ord-donut-head {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 16px;
    align-self: flex-start;
}
.ord-donut-wrap {
    width: 180px;
    height: 180px;
    margin-bottom: 16px;
}
.ord-donut-legend {
    width: 100%;
}
.ord-leg-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid var(--border-soft);
    font-size: 12px;
}
.ord-leg-row:last-child { border-bottom: none; }
.ord-leg-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.ord-leg-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ord-leg-pct {
    font-weight: 700;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    font-size: 11px;
}
.ord-leg-val {
    font-weight: 700;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    font-size: 12px;
}

.ord-logic-link {
    display: block;
    text-align: center;
    margin-top: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-inverse);
    letter-spacing: 0.03em;
    padding: 10px 16px;
    background: var(--bg-deep);
    border: 1px solid var(--bg-deep);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: background 0.12s, box-shadow 0.12s;
    grid-column: 2;
}
.ord-logic-link:hover {
    background: var(--bg-deep-2);
    border-color: var(--bg-deep-2);
    color: var(--text-inverse);
    box-shadow: var(--shadow-md);
}

.ml-margin-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}
.ml-margin-banner {
    background: var(--bg-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
}
.ml-margin-num {
    font-family: 'Inter', sans-serif;
    font-size: 56px;
    font-weight: 800;
    color: var(--accent-light, #d4a95e);
    line-height: 1;
    text-align: center;
}
.ml-margin-label {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-primary);
    margin-top: 12px;
}

.ml-top-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
}
@media (max-width: 900px) { .ml-top-row-2col { grid-template-columns: 1fr; } }

.ml-formula-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    min-height: 0;
    overflow: hidden;
}
.ml-formula-card canvas {
    max-height: 240px;
}
.ml-formula-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.ml-formula-eq {
    font-size: 14px;
    color: var(--text-primary);
    font-family: 'Consolas', 'Monaco', monospace;
    line-height: 1.6;
}
.ml-formula-ceil {
    color: var(--accent);
    font-weight: 700;
}
.ml-formula-note {
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.ml-body { position: relative; }

.ml-sidebar {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px 6px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 120px;
}
@media (max-width: 1200px) { .ml-sidebar { display: none; } }

.ml-sidebar-link {
    display: block;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: background 0.12s, color 0.12s;
    text-decoration: none;
    white-space: nowrap;
    text-align: center;
}
.ml-sidebar-link:hover {
    background: rgba(184, 147, 90, 0.15);
    color: var(--accent);
}
.ml-sidebar-link.ml-sidebar-active,
.ml-sidebar-link.ml-sidebar-active:hover {
    background: var(--bg-deep);
    color: var(--text-inverse);
}

.ml-main { min-width: 0; }

.ml-dough-section { margin-bottom: 40px; scroll-margin-top: 80px; }
.ml-dough-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}
.ml-dough-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.ml-batch-size {
    font-size: 13px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.ml-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
}
@media (max-width: 900px) { .ml-grid { grid-template-columns: 1fr; } }

.ml-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
}
.ml-card-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.ml-card-split {
    display: grid;
    grid-template-columns: 1fr 160px;
    gap: 16px;
    align-items: start;
}
.ml-donut-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ml-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.ml-table-compact { font-size: 12px; }
.ml-table-compact td,
.ml-table-compact th { padding: 5px 8px; }
.ml-table thead th {
    padding: 8px 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    text-align: left;
}
.ml-table thead th.num { text-align: right; }
.ml-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: middle;
}
.ml-table td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.ml-table tbody tr:last-child td { border-bottom: none; }
.ml-table tfoot td {
    padding: 10px 12px;
    border-top: 2px solid var(--border);
}
.ml-code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    color: var(--text-secondary);
}
.ml-bar-wrap {
    margin-top: 16px;
    height: 140px;
}

.oe-layout {
    max-width: 560px;
}
.oe-layout.oe-has-po {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    max-width: 1100px;
}
@media (max-width: 900px) {
    .oe-layout.oe-has-po { grid-template-columns: 1fr; }
}

.oe-left {
    display: flex;
    flex-direction: column;
}

.oe-form {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.oe-section {
    padding: 14px 24px;
    border-bottom: 1px solid var(--border-soft);
}
.oe-section-last {
    border-bottom: none;
}
.oe-has-po .oe-section-grow {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.oe-has-po .oe-notes-field {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.oe-has-po .oe-notes-field textarea {
    flex: 1;
    min-height: 60px;
    resize: none;
}
.oe-section-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}
.oe-form label > span {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.oe-grid {
    display: grid;
    gap: 4px 14px;
}
.oe-grid + .oe-grid { margin-top: 4px; }
.oe-grid-2  { grid-template-columns: 1fr 1fr; }
.oe-grid-3  { grid-template-columns: 1fr 1fr 1fr; }
.oe-grid-34 { grid-template-columns: 3fr 1fr; }
.oe-span2   { grid-column: span 2; }
@media (max-width: 560px) {
    .oe-grid-3, .oe-grid-34 { grid-template-columns: 1fr; }
    .oe-span2 { grid-column: span 1; }
    .oe-section { padding: 16px 20px; }
}

.oe-input-prefix {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-surface);
}
.oe-input-prefix > span {
    padding: 0 0 0 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: none !important;
    letter-spacing: 0 !important;
}
.oe-input-prefix > input {
    border: none !important;
    flex: 1;
    min-width: 0;
    padding-left: 4px;
}

.oe-ship-dates { margin-top: 8px; }
.oe-ship-dates-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.oe-ship-dates-header > span {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.oe-add-date-btn {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    background: none;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 3px 10px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.oe-add-date-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}
.oe-add-date-btn-block {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 7px 10px;
    text-align: center;
}
.oe-ship-date-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.oe-ship-date-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.oe-ship-date-row input[type="date"] { flex: 1; }
input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; }
.oe-ship-date-remove {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: color .15s, border-color .15s;
}
.oe-ship-date-remove:hover {
    color: var(--error);
    border-color: var(--error);
}

.oe-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-top: 28px;
}
.oe-sign-block .ready-signature {
    margin: 0 auto;
    width: 340px;
    max-width: 100%;
    text-align: center;
    border: 2px solid transparent;
    background-image: linear-gradient(var(--bg-canvas), var(--bg-canvas)), linear-gradient(160deg, #cfb56b, #8c6e2e, #cfb56b, #7a5f22, #bfa24e);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: 0 2px 10px rgba(140, 110, 46, 0.12), inset 0 1px 0 rgba(207, 181, 107, 0.15);
    padding: 18px 22px;
}
.oe-sign-block .ready-signature h3 {
    text-align: center;
}
.oe-sign-block .signature-sign-btn {
    margin: 0 auto;
    padding: 8px 28px;
    font-size: 12px;
}
.oe-sign-block .signature-typer {
    text-align: center;
}
.oe-sign-block .signature-display {
    justify-content: center;
}
.oe-sign-block .signature-meta {
    text-align: center;
}
.oe-actions-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

#oeSubmitBtn {
    padding: 16px 48px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

#oeDelBtn {
    font-size: 12px;
    padding: 8px 24px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
#oeDelBtn:disabled {
    opacity: 0.35;
    pointer-events: none;
}

.confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(13, 27, 42, 0.5);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity .2s ease;
}
.confirm-overlay.open { opacity: 1; }
.confirm-modal {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 36px;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    text-align: center;
}
.confirm-modal h3 {
    margin: 0 0 10px;
    font-size: 18px;
}
.confirm-modal p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0 0 24px;
    line-height: 1.5;
}
.confirm-modal-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.oe-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(13, 27, 42, 0.5);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.oe-confirm-overlay[hidden] { display: none; }
.oe-confirm-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 36px;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    text-align: center;
}
.oe-confirm-card h3 {
    margin: 0 0 10px;
    font-size: 18px;
}
.oe-confirm-card p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0 0 24px;
    line-height: 1.5;
}
.oe-confirm-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.al-table .al-row {
    cursor: pointer;
    transition: background 0.12s ease;
}
.al-table .al-row:hover { background: rgba(184, 147, 90, 0.05); }
.al-row-open { background: rgba(184, 147, 90, 0.04) !important; }
.al-chevron {
    color: var(--text-muted);
    font-size: 11px;
    text-align: center;
    transition: transform 0.2s ease;
}
.al-row-open .al-chevron { transform: rotate(180deg); color: var(--accent); }
.al-detail td {
    padding: 0 !important;
    border-bottom: 1px solid var(--border-soft);
}
.al-detail[hidden] { display: none; }
.al-detail-inner {
    padding: 16px 20px 20px;
    background: var(--bg-canvas);
    animation: slideDown 0.15s ease;
}
.al-detail-cols {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}
.al-detail-cols > div:first-child,
.al-detail-cols > div:last-child { flex: 1; }
.al-detail-arrow {
    color: var(--text-muted);
    font-size: 20px;
    padding-top: 22px;
    flex-shrink: 0;
}
.al-detail-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 8px;
}
.al-dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 4px 16px;
    margin: 0;
    font-size: 13px;
}
.al-dl dt {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.al-dl dd {
    margin: 0;
    font-weight: 500;
    color: var(--text-primary);
}

.oe-projection {
    margin-top: auto;
    background: var(--bg-page, #f8f7f5);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.oe-proj-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px 24px;
}
.oe-proj-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2px;
}
.oe-proj-val {
    font-family: 'Spectral', serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}
.oe-proj-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.oe-proj-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    margin-bottom: 10px;
}
.oe-proj-arrow {
    color: var(--text-muted);
    transition: transform .2s ease;
}
.oe-projection.open .oe-proj-arrow {
    transform: rotate(180deg);
}

.oe-proj-formula {
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
}
.oe-projection.open .oe-proj-formula {
    max-height: 500px;
}
.oe-proj-override-btn {
    display: block; width: fit-content; margin: 14px auto 0;
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.04em; color: var(--text-secondary);
    background: none; border: 1px solid var(--border-soft);
    border-radius: var(--radius); padding: 5px 12px;
    cursor: pointer;
}
.oe-proj-override-btn:hover { color: var(--text-primary); border-color: var(--border); }
.oe-proj-override-btn.hidden, .oe-proj-override.hidden { display: none; }
.oe-proj-override {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    width: fit-content; margin: 14px auto 0;
}
.oe-proj-override-row {
    display: flex; align-items: baseline; gap: 6px;
    padding: 5px 10px;
    background: var(--bg-surface); border: 1px solid var(--border-soft);
    border-radius: var(--radius);
}
.oe-proj-apply-btn {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--accent); background: var(--accent-soft);
    border: 1px solid var(--accent); border-radius: var(--radius);
    padding: 5px 18px; cursor: pointer;
    transition: background .15s, color .15s;
}
.oe-proj-apply-btn:hover { background: var(--accent); color: #fff; }
.oe-proj-override-label {
    font-size: 11px; color: var(--text-muted);
}
.oe-proj-override-unit {
    font-size: 11px; color: var(--text-muted);
}
.oe-proj-mixes-input {
    width: 48px; text-align: center;
    font-size: 13px; font-weight: 600;
    border: none; border-bottom: 1.5px solid var(--border);
    background: transparent; padding: 0 0 1px;
}
.oe-proj-mixes-input:focus {
    border-color: var(--primary); outline: none;
}
.oe-proj-formula-table {
    width: 100%;
    margin-top: 14px;
    border-top: 1px solid var(--border-soft);
    padding-top: 12px;
    border-collapse: collapse;
}
.oe-proj-formula-table tr.oe-pf-sep td {
    padding: 6px 0;
}
.oe-proj-formula-table td {
    padding: 5px 0;
    font-size: 12px;
    vertical-align: baseline;
}
.oe-pf-label {
    color: var(--text-secondary);
    width: 120px;
    padding-right: 20px;
}
.oe-pf-val {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    width: 80px;
    padding-right: 24px;
}
.oe-pf-note {
    color: var(--text-muted);
    font-size: 11px;
    padding-left: 12px;
}

.oe-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    margin-bottom: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    text-align: center;
    padding: 32px;
    gap: 8px;
}
.oe-upload:hover,
.oe-upload.oe-upload-drag {
    border-color: var(--accent);
    background: rgba(184, 147, 90, 0.04);
}
.oe-upload.oe-upload-has-file {
    border-color: var(--accent);
}
.oe-upload-icon {
    color: var(--text-muted);
    margin-bottom: 4px;
}
.oe-upload:hover .oe-upload-icon,
.oe-upload.oe-upload-drag .oe-upload-icon {
    color: var(--accent);
}
.oe-upload-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.oe-upload-hint {
    font-size: 11px;
    color: var(--text-muted);
}
.oe-upload-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    margin-top: 4px;
}
.oe-upload-name:empty { display: none; }

.oe-upload-idle { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.oe-upload-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    overflow: hidden;
}
.oe-upload-preview canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius);
}
.oe-upload-preview img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    object-fit: contain;
}
.oe-upload-change {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 10px;
    letter-spacing: 0.04em;
}
.oe-upload.oe-upload-has-file {
    padding: 0;
    overflow: hidden;
}
.oe-upload.oe-upload-has-file .oe-upload-preview {
    padding: 0;
}
.oe-upload.oe-upload-has-file .oe-upload-change {
    padding: 8px 0 10px;
}

.oe-upload-status {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 6px 14px;
    text-align: center;
    width: 100%;
}
.oe-upload-status:empty { display: none; }
.oe-status-loading {
    color: var(--text-muted);
    animation: oe-pulse 1.2s ease-in-out infinite;
}
@keyframes oe-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}
.oe-status-high  { color: var(--success); }
.oe-status-medium { color: var(--warn); }
.oe-status-low   { color: var(--error); }
.oe-status-error { color: var(--error); }

.oe-layout.oe-has-po { position: relative; }
.oe-lock {
    position: absolute;
    inset: 0;
    z-index: 20;
    background: rgba(244, 241, 234, 0.75);
    backdrop-filter: blur(2px);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}
.oe-lock[hidden] { display: none; }
.oe-lock-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 32px 40px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
.oe-lock-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: oe-spin 0.7s linear infinite;
}
@keyframes oe-spin { to { transform: rotate(360deg); } }
.oe-lock-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.oe-po {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.oe-po-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}
.oe-po-thumb {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    flex: 1;
}
.oe-po-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='17' cy='17' r='10'/%3E%3Cline x1='24' y1='24' x2='35' y2='35'/%3E%3Cline x1='14' y1='17' x2='20' y2='17'/%3E%3Cline x1='17' y1='14' x2='17' y2='20'/%3E%3C/svg%3E") center center no-repeat;
    opacity: 0;
    transition: all 0.2s;
    border-radius: inherit;
}
.oe-po-thumb:hover::after {
    background-color: rgba(0,0,0,0.45);
    opacity: 1;
}
.oe-po-thumb canvas {
    display: block;
    width: 100%;
    height: auto;
}

.oe-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999;
}
.oe-lightbox.oe-lb-open { display: flex; }
.oe-lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
}
.oe-lb-body {
    position: relative;
    margin: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    z-index: 1;
}
.oe-lb-close {
    position: absolute;
    top: -8px;
    right: -8px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg-surface);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    font-size: 20px;
    line-height: 1;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.oe-lb-close:hover { background: var(--bg-muted, #f0f0f0); }
.oe-lb-viewer {
    flex: 1;
    background: transparent;
    overflow: hidden;
    position: relative;
    cursor: default;
}
.oe-lb-viewer canvas {
    display: block;
    transform-origin: 0 0;
    border-radius: 6px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.1);
}

.po-processing {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px 24px;
    margin-bottom: 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.po-processing-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}
.po-spinner {
    width: 22px;
    height: 22px;
    border: 2.5px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: po-spin 0.7s linear infinite;
}
@keyframes po-spin { to { transform: rotate(360deg); } }

.po-rev-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin-bottom: 18px;
}

.po-rev-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}
.po-rev-bar h3 {
    margin: 0;
    font-size: 16px;
}
.po-rev-via {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.po-rev-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 11px;
    background: var(--bg-deep);
    color: var(--text-inverse);
    font-size: 11px;
    font-weight: 700;
}

.po-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.po-badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
}
.po-badge-high {
    background: var(--success-soft);
    color: var(--success);
}
.po-badge-high::before { background: var(--success); }
.po-badge-medium {
    background: var(--warn-soft);
    color: var(--warn);
}
.po-badge-medium::before { background: var(--warn); }
.po-badge-low {
    background: var(--error-soft);
    color: var(--error);
}
.po-badge-low::before { background: var(--error); }

.po-rev-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px 20px;
}
.po-rev-span2 { grid-column: span 2; }
@media (max-width: 700px) {
    .po-rev-grid { grid-template-columns: 1fr 1fr; }
    .po-rev-span2 { grid-column: span 1; }
}
@media (max-width: 480px) {
    .po-rev-grid { grid-template-columns: 1fr; }
}

.po-line {
    display: flex;
    gap: 16px;
    padding: 18px 0;
}
.po-line-border {
    border-bottom: 1px solid var(--border-soft);
}
.po-line-check {
    padding-top: 2px;
    flex-shrink: 0;
}
.po-line-check input[type=checkbox] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.po-line-body {
    flex: 1;
    min-width: 0;
}
.po-line-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 14px;
    line-height: 1.4;
}
.po-line-code {
    flex-shrink: 0;
    font-family: var(--font-mono, monospace);
    font-size: 12px;
    font-weight: 600;
    padding: 2px 7px;
    background: var(--bg-canvas);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}
.po-line-desc {
    font-weight: 500;
    color: var(--text-primary);
}

.po-line-fields {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px 14px;
    margin-bottom: 10px;
}
.po-line-fields label span {
    font-size: 10px;
}
.po-line-fields input {
    padding: 8px 10px;
    font-size: 14px;
}
.po-line-ro {
    background: var(--bg-canvas) !important;
    color: var(--text-secondary) !important;
    border-style: dashed !important;
}
@media (max-width: 600px) {
    .po-line-fields { grid-template-columns: 1fr 1fr; }
}

.po-line-product {
    max-width: 360px;
}
.po-line-product span {
    font-size: 10px;
}
.po-line-product select {
    padding: 8px 10px;
    font-size: 13px;
}

.po-rev-total {
    text-align: right;
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    padding-right: 4px;
}
.po-rev-total strong {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}
.po-rev-notes {
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-canvas);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 18px;
}

