/* =============================================================
   Lechi PDR — Production Data Recorder
   Design system: deep navy + warm gold, refined typography
   ============================================================= */

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

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

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

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

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

    /* Borders */
    --border: #e5dfd2;
    --border-soft: #efeae0;
    --border-strong: #2b3a4d;

    /* Shadows */
    --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);

    /* Type */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Playfair Display', 'Times New Roman', Georgia, serif;

    /* Geometry */
    --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;
}

/* subtle paper-grain canvas */
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;
}

/* ========== TOP BAR ========== */
.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;
    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; }

/* ========== LAYOUT ========== */
.container {
    max-width: 1180px;
    margin: 40px auto;
    padding: 0 32px;
}

.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;
    border-top: 1px solid var(--border);
    margin-top: 60px;
}

/* ========== CARDS & PANELS ========== */
.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 ========== */
.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); }

/* ========== FORMS ========== */
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);
}

/* ========== BUTTONS ========== */
.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-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;
}

/* ========== ANONYMOUS SIGN-IN / SIGN-UP (no branding) ========== */
.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;
}

/* Brand mark above sign-in / signup forms */
.anon-brand {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-soft);
}
.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;
}

/* "Application submitted" confirmation card */
.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 (legacy branded hero -- kept for reference) ========== */
.login-shell {
    position: fixed;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    background: var(--bg-canvas);
    min-height: 100vh;
    overflow: hidden;
}
@media (max-width: 900px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-hero { display: none; }
}

.login-hero {
    position: relative;
    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: 64px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}
.login-hero::before {
    content: "";
    position: absolute;
    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;
}
.login-hero::after {
    content: "";
    position: absolute;
    top: 0; bottom: 0; right: 0;
    width: 1px;
    background: linear-gradient(180deg, transparent, var(--accent) 30%, var(--accent) 70%, transparent);
    opacity: 0.3;
}

.hero-mark {
    position: relative;
    display: flex;
    align-items: baseline;
    gap: 14px;
    z-index: 1;
}
.hero-mark-logo {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-inverse);
}
.hero-mark-tag {
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
    padding-left: 14px;
    border-left: 1px solid rgba(255,255,255,0.15);
}

.hero-body {
    position: relative;
    z-index: 1;
    max-width: 440px;
}
.hero-eyebrow {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 20px;
    padding: 4px 12px;
    border: 1px solid rgba(184, 147, 90, 0.35);
    border-radius: 100px;
    background: rgba(184, 147, 90, 0.08);
}
.hero-title {
    font-family: var(--font-display);
    font-size: 44px;
    line-height: 1.1;
    font-weight: 500;
    letter-spacing: -0.025em;
    color: var(--text-inverse);
    margin: 0 0 20px;
}
.hero-title em {
    font-style: italic;
    color: var(--accent);
    font-weight: 400;
}
.hero-copy {
    color: var(--text-inverse-muted);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 36px;
}

.hero-pillars {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 14px;
}
.hero-pillars li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    color: var(--text-inverse-muted);
    font-size: 14px;
    line-height: 1.5;
}
.hero-pillars li::before {
    content: "";
    margin-top: 9px;
    width: 18px;
    height: 1px;
    background: var(--accent);
    flex: 0 0 18px;
}
.hero-pillars strong {
    color: var(--text-inverse);
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hero-foot {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-inverse-muted);
    opacity: 0.7;
}

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background: var(--bg-canvas);
}
.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 44px;
    box-shadow: var(--shadow-xl);
    position: relative;
}
.login-card::before {
    content: "";
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}
.login-card .eyebrow {
    margin-bottom: 10px;
}
.login-card h1 {
    font-size: 30px;
    margin-bottom: 8px;
}
.login-card > p.muted { margin-bottom: 28px; font-size: 14px; }
.login-card button {
    width: 100%;
    padding: 13px;
    margin-top: 4px;
    font-size: 14px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 600;
}
.login-meta {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-soft);
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    letter-spacing: 0.04em;
}
.login-meta strong {
    color: var(--text-secondary);
    font-weight: 600;
}

/* ========== TABLES ========== */
.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 ========== */
.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); }

/* ========== TAGS ========== */
.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 PAGE ========== */
.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 PAGE ========== */
.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 ========== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 28px;
}

/* ========== ERROR ========== */
.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 ========== */
.actions { margin: 24px 0 32px; display: flex; gap: 12px; }

/* ========== FILE INPUT ========== */
.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 (upload) ========== */
.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: 180px 1fr;
    gap: 24px;
    align-items: center;
    width: 100%;
}
.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 (pending count on Admin menu) ========== */
.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 (approval review) ========== */
.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;
}

/* ========== NAV DROPDOWN ========== */
.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;
    min-width: 180px;
    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: none;
    flex-direction: column;
    padding: 6px 0;
    z-index: 60;
}
.topnav-dropdown:hover .topnav-dropdown-menu,
.topnav-dropdown:focus-within .topnav-dropdown-menu {
    display: flex;
}
.topnav-dropdown-menu a {
    padding: 10px 18px;
    color: var(--text-inverse-muted);
    font-size: 13px;
    font-weight: 500;
    border-bottom: none;
}
.topnav-dropdown-menu a:hover {
    background: var(--bg-deep-3);
    color: var(--accent);
    border-bottom: none;
}

/* ========== ADMIN: clickable user ID ========== */
.user-link {
    color: var(--text-primary);
    border-bottom: 1px solid transparent;
    padding: 2px 0;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.user-link:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.user-link strong {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    letter-spacing: 0.02em;
}

/* ========== TOGGLE SWITCH (iOS-style) ========== */
.toggle-form {
    display: inline-block;
    margin: 0;
    line-height: 1;
}
.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:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.toggle-switch-disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

/* ========== ADMIN: row actions ========== */
.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);
}

/* ========== ADMIN: prompts editor ========== */
.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: top 2-col + bottom full-width ========== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    grid-template-areas:
        "schedule  graph"
        "sections  sections";
    gap: 20px;
    align-items: flex-start;
}
@media (max-width: 1000px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "schedule"
            "graph"
            "sections";
    }
}
.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; }

.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; }
.dashboard-col-head-wide h2 { font-size: 20px; margin: 2px 0 2px; }
.dashboard-col-head-wide p { margin: 0; }

/* ========== EMPTY-STATE (professional placeholder) ========== */
.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; }

/* ========== DASHBOARD: today's mix sheet (middle column) ========== */
.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);
}
.today-sheet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-bottom: 16px;
}
.today-sheet-table th, .today-sheet-table td {
    padding: 10px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-soft);
}
.today-sheet-table th {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
    padding: 6px 10px;
}
.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 code {
    background: var(--bg-deep);
    color: var(--text-inverse);
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 11px;
}
.today-sheet-meta-inline {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}
.today-sheet-actions {
    display: flex;
    gap: 10px;
    margin-top: 6px;
    padding-top: 14px;
    border-top: 1px solid var(--border-soft);
}
.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; }

/* ========== DASHBOARD: section navigation cards (bottom row, 4 across) ========== */
.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;  /* clear the check indicator */
}
.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;
}

/* Completion check in the top-right of each section card */
.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;
}

/* ========== DASHBOARD: 7-day chart (right column) ========== */
.chart-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow-sm);
}
.chart-wrap {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 170px;
    padding: 0 2px;
}
.chart-day {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
}
.chart-bars {
    position: relative;
    width: 100%;
    max-width: 36px;
    height: 110px;
    background: var(--bg-canvas);
    border-radius: 3px;
    overflow: hidden;
}
.chart-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 3px 3px 0 0;
    transition: height 0.3s ease;
    min-height: 2px;
}
.chart-bar-planned {
    background: var(--text-muted);
    opacity: 0.25;
}
.chart-bar-actual {
    background: var(--accent);
}
.chart-num {
    font-family: 'Consolas', monospace;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    min-height: 14px;
}
.chart-day-today .chart-num {
    color: var(--accent);
}
.chart-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}
.chart-daynum {
    font-size: 9px;
    color: var(--text-muted);
}
.chart-day-today .chart-label {
    color: var(--accent);
}
.chart-day-today .chart-bars {
    box-shadow: 0 0 0 2px var(--accent);
}
.chart-legend {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-soft);
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}
.chart-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.chart-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
}
.chart-swatch-actual { background: var(--accent); }
.chart-swatch-planned { background: var(--text-muted); opacity: 0.35; }
.chart-empty {
    text-align: center;
    padding: 32px 16px;
}
.chart-empty p { margin: 4px 0; }

/* ========== TAB SWITCHER (new record page) ========== */
.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;
}

/* ========== DASHBOARD quick actions ========== */
.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 ========== */
.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: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 (toolbar on page headers) ========== */
.page-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ========== NEW SCHEDULE PAGE ========== */
.new-schedule-card {
    max-width: 440px;
    margin: 40px auto 0;
}

/* ========== BACK LINK (top-left above page header) ========== */
.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;
}

/* ========== ACTION ROWS (buttons bracketing the editor) ========== */
.schedule-action-row {
    display: flex;
    justify-content: flex-end;
    margin: 14px 0 18px;
}
.schedule-action-row-print {
    margin: 24px 0 32px;
}

/* ========== SCHEDULE EDITOR ========== */
.schedule-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    align-items: flex-start;
}
@media (max-width: 900px) { .schedule-grid { grid-template-columns: 1fr; } }

.schedule-library h2 { font-size: 16px; margin-bottom: 6px; }
.product-list {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
    max-height: 600px;
    overflow-y: auto;
}
.product-list li { margin-bottom: 6px; }
.product-chip {
    display: block;
    width: 100%;
    text-align: left;
    background: var(--bg-canvas);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.1s ease;
}
.product-chip:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: translateX(2px);
}
.product-chip-code {
    display: inline-block;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 11px;
    background: var(--bg-deep);
    color: var(--text-inverse);
    padding: 2px 8px;
    border-radius: 3px;
    margin-right: 8px;
    font-weight: 600;
}
.product-chip-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}
.product-chip-meta {
    display: block;
    margin-top: 4px;
    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;
}
.picked-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 16px;
    align-items: center;
    padding: 12px 14px;
    background: var(--bg-canvas);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.picked-name { font-weight: 500; font-size: 14px; }
.picked-code {
    font-family: 'Consolas', monospace;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}
.picked-qty {
    display: flex;
    align-items: center;
    gap: 8px;
}
.qty-input {
    width: 72px;
    text-align: center;
    padding: 6px 8px;
    font-weight: 600;
    font-size: 15px;
}
.qty-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.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);
}

/* ========== PLANNED vs ACTUAL ========== */
.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); }

/* ========== ADMIN: user form (two-column identity + access) ========== */
.user-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: flex-start;
}
@media (max-width: 900px) {
    .user-form-grid { grid-template-columns: 1fr; }
}
.user-form-section {
    margin-bottom: 0;
}
.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;  /* single column inside the right panel */
}
.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;
}

/* ========== ADMIN: access matrix ========== */
.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;
}

.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;
}
/* Checked state: dark navy card, gold key, light description -- unmistakable */
.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: read-only cells ========== */
.calendar-cell-readonly {
    cursor: default;
}
.calendar-cell-readonly:hover {
    background: initial;
}

/* ========== ADMIN: provider cards ========== */
.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;
}
