/* =====================================================================
   نظام الموارد البشرية — المطبعة
   Visual identity borrowed from the press room: uncoated stock, ink
   black, and the CMYK registration bar printed on the edge of a sheet.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
    --ink:        #12161b;
    --ink-2:      #1c222a;
    --ink-3:      #2b333d;
    --paper:      #edeeea;
    --card:       #ffffff;
    --line:       #d5d8d1;
    --line-soft:  #e6e8e3;
    --text:       #12161b;
    --muted:      #5c6570;

    --cyan:       #0093c4;
    --magenta:    #c8005e;
    --yellow:     #e8a100;
    --green:      #1a8a4a;
    --red:        #c0392b;

    --sidebar-w:  248px;
    --radius:     4px;

    --sans: 'IBM Plex Sans Arabic', system-ui, sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--sans);
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--text);
    background: var(--paper);
    direction: rtl;
}

a { color: inherit; text-decoration: none; }

:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
}

/* --- The signature: CMYK registration bar --------------------------- */
.reg-bar {
    display: flex;
    height: 3px;
    width: 100%;
}
.reg-bar i { flex: 1; display: block; }
.reg-bar i:nth-child(1) { background: var(--cyan); }
.reg-bar i:nth-child(2) { background: var(--magenta); }
.reg-bar i:nth-child(3) { background: var(--yellow); }
.reg-bar i:nth-child(4) { background: var(--ink); }

/* --- Layout --------------------------------------------------------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--ink);
    color: #c9d0d8;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.brand {
    padding: 22px 20px 18px;
    border-bottom: 1px solid var(--ink-3);
}
.brand-mark {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}
.brand-mark svg { flex-shrink: 0; }
.brand-name {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.brand-sub {
    font-family: var(--mono);
    font-size: 10.5px;
    color: #6b7682;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav { padding: 12px 0; flex: 1; }
.nav-label {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    color: #5a6472;
    padding: 14px 20px 6px;
    text-transform: uppercase;
}
.nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 20px;
    color: #b3bcc6;
    font-size: 14px;
    border-right: 3px solid transparent;
    transition: background .12s, color .12s;
}
.nav a:hover { background: var(--ink-2); color: #fff; }
.nav a.active {
    background: var(--ink-2);
    color: #fff;
    border-right-color: var(--cyan);
    font-weight: 500;
}
.nav a svg { opacity: .8; flex-shrink: 0; }

.sidebar-foot {
    padding: 14px 20px;
    border-top: 1px solid var(--ink-3);
    font-size: 12.5px;
}
.sidebar-foot .who { color: #fff; font-weight: 500; }
.sidebar-foot .role {
    font-family: var(--mono);
    font-size: 10.5px;
    color: #6b7682;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.sidebar-foot a { color: var(--magenta); font-size: 12.5px; }
.sidebar-foot a:hover { text-decoration: underline; }

.main { flex: 1; min-width: 0; }

.topbar {
    background: var(--card);
    border-bottom: 1px solid var(--line);
    padding: 0 28px;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 20;
}
.page-title { font-size: 18px; font-weight: 600; letter-spacing: -0.015em; }
.page-title small {
    display: block;
    font-family: var(--mono);
    font-size: 10.5px;
    font-weight: 400;
    color: var(--muted);
    letter-spacing: .07em;
    text-transform: uppercase;
}
.topbar-date {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
}

.content { padding: 24px 28px 60px; max-width: 1500px; }

.menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 6px 9px;
    cursor: pointer;
}

/* --- Cards ---------------------------------------------------------- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
}
.card-head {
    padding: 14px 18px;
    border-bottom: 1px solid var(--line-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}
.card-head h2 { font-size: 15px; font-weight: 600; }
.card-head .hint { font-size: 12.5px; color: var(--muted); }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }

/* --- Stat tiles ----------------------------------------------------- */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.stat {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0;
    overflow: hidden;
}
.stat-inner { padding: 14px 16px 16px; }
.stat-label {
    font-size: 12.5px;
    color: var(--muted);
    margin-bottom: 6px;
}
.stat-value {
    font-family: var(--mono);
    font-size: 27px;
    font-weight: 500;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}
.stat-value .unit { font-size: 13px; color: var(--muted); margin-right: 3px; }
.stat-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat-rule { height: 3px; }
.stat-rule.c { background: var(--cyan); }
.stat-rule.m { background: var(--magenta); }
.stat-rule.y { background: var(--yellow); }
.stat-rule.k { background: var(--ink); }
.stat-rule.g { background: var(--green); }
.stat-rule.r { background: var(--red); }

/* --- Tables --------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
table.data th {
    text-align: right;
    font-weight: 500;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--muted);
    background: #f6f7f4;
    padding: 9px 14px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
table.data td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
}
table.data tbody tr:hover { background: #fafbf8; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data .num {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
table.data tfoot td {
    background: #f6f7f4;
    font-weight: 600;
    border-top: 2px solid var(--ink);
    padding: 11px 14px;
}

.empty {
    padding: 44px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}
.empty strong { display: block; color: var(--text); margin-bottom: 5px; font-size: 15px; }

/* --- Employee cell -------------------------------------------------- */
.emp-cell { display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--ink-2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}
.avatar.lg { width: 76px; height: 76px; font-size: 27px; }
.emp-name { font-weight: 500; }
.emp-code {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
}

/* --- Badges --------------------------------------------------------- */
.badge {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 3px;
    border: 1px solid;
    white-space: nowrap;
}
.badge.ok      { color: var(--green);   border-color: #b6dcc4; background: #eef8f2; }
.badge.warn    { color: #97690a;        border-color: #f0dda8; background: #fdf7e7; }
.badge.bad     { color: var(--red);     border-color: #eec0ba; background: #fdf0ee; }
.badge.info    { color: var(--cyan);    border-color: #b2ddec; background: #eef8fc; }
.badge.neutral { color: var(--muted);   border-color: var(--line); background: #f5f6f3; }

/* --- Score bar ------------------------------------------------------ */
.score { display: flex; align-items: center; gap: 8px; min-width: 118px; }
.score-track {
    flex: 1;
    height: 5px;
    background: var(--line-soft);
    border-radius: 3px;
    overflow: hidden;
}
.score-fill { height: 100%; border-radius: 3px; }
.score-num {
    font-family: var(--mono);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    min-width: 34px;
    text-align: left;
}

/* --- Buttons -------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--sans);
    font-size: 13.5px;
    font-weight: 500;
    padding: 8px 15px;
    border-radius: var(--radius);
    border: 1px solid var(--ink);
    background: var(--ink);
    color: #fff;
    cursor: pointer;
    transition: opacity .12s, background .12s;
    white-space: nowrap;
}
.btn:hover { opacity: .87; }
.btn.ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--line);
}
.btn.ghost:hover { background: #f4f5f2; opacity: 1; }
.btn.danger { background: var(--red); border-color: var(--red); }
.btn.sm { padding: 5px 11px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-row { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }

/* --- Forms ---------------------------------------------------------- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 15px;
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field.wide { grid-column: 1 / -1; }
.field label {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--muted);
}
.field input, .field select, .field textarea {
    font-family: var(--sans);
    font-size: 14px;
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--text);
    width: 100%;
}
.field input[type="number"], .field input[type="date"], .field input[type="time"] {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0,147,196,.12);
}
.field textarea { resize: vertical; min-height: 76px; }
.field .note { font-size: 11.5px; color: var(--muted); }

fieldset {
    border: none;
    border-top: 1px solid var(--line-soft);
    padding-top: 18px;
    margin-top: 22px;
}
fieldset:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
fieldset legend {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    padding-bottom: 12px;
}

.filters {
    display: flex;
    gap: 11px;
    flex-wrap: wrap;
    align-items: flex-end;
}
.filters .field { min-width: 148px; }

/* --- Rating input (evaluations) ------------------------------------- */
.rate-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line-soft);
    flex-wrap: wrap;
}
.rate-row:last-child { border-bottom: none; }
.rate-label { font-weight: 500; font-size: 14px; }
.rate-label small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.rate-opts { display: flex; gap: 5px; }
.rate-opts input { position: absolute; opacity: 0; width: 0; height: 0; }
.rate-opts label {
    width: 36px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-family: var(--mono);
    font-size: 13px;
    cursor: pointer;
    background: #fff;
    transition: all .1s;
}
.rate-opts label:hover { border-color: var(--ink-3); }
.rate-opts input:checked + label {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
}
.rate-opts input:focus-visible + label { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* --- Flash ---------------------------------------------------------- */
.flash {
    padding: 11px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
    border: 1px solid;
}
.flash.ok  { background: #eef8f2; border-color: #b6dcc4; color: #14663a; }
.flash.err { background: #fdf0ee; border-color: #eec0ba; color: #93291e; }

/* --- Login ---------------------------------------------------------- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--ink);
}
.login-box {
    width: 100%;
    max-width: 372px;
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
}
.login-head { padding: 30px 30px 22px; text-align: center; }
.login-head h1 { font-size: 20px; font-weight: 600; margin-top: 14px; }
.login-head p {
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--muted);
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-top: 3px;
}
.login-body { padding: 0 30px 30px; }
.login-body .field { margin-bottom: 14px; }
.login-body .btn { width: 100%; justify-content: center; padding: 10px; }

/* --- Bar chart ------------------------------------------------------ */
.bars {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 132px;
    padding-top: 8px;
}
.bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    height: 100%;
    min-width: 0;
}
.bar {
    width: 100%;
    max-width: 30px;
    background: var(--cyan);
    border-radius: 2px 2px 0 0;
    min-height: 2px;
    transition: opacity .12s;
}
.bar-col:hover .bar { opacity: .75; }
.bar-x {
    font-family: var(--mono);
    font-size: 9.5px;
    color: var(--muted);
    white-space: nowrap;
}

/* --- Detail list ---------------------------------------------------- */
.dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 15px 22px; }
.dl div { min-width: 0; }
.dl dt { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.dl dd { font-size: 14px; font-weight: 500; overflow-wrap: break-word; }
.dl dd.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* --- Utilities ------------------------------------------------------ */
.row-split { display: flex; gap: 20px; flex-wrap: wrap; }
.row-split > * { flex: 1; min-width: 300px; }
.text-muted { color: var(--muted); }
.text-c { color: var(--cyan); }
.text-m { color: var(--magenta); }
.text-g { color: var(--green); }
.text-r { color: var(--red); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.mb-0 { margin-bottom: 0; }
.nowrap { white-space: nowrap; }
.tal { text-align: left; }

/* --- Responsive ----------------------------------------------------- */
@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        right: 0;
        transform: translateX(100%);
        z-index: 100;
        transition: transform .2s;
        box-shadow: -4px 0 24px rgba(0,0,0,.2);
    }
    .sidebar.open { transform: translateX(0); }
    .menu-toggle { display: block; }
    .content { padding: 18px 16px 50px; }
    .topbar { padding: 0 16px; }
    .page-title { font-size: 16px; }
    .topbar-date { display: none; }
}

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

/* --- Print ---------------------------------------------------------- */
@media print {
    .sidebar, .topbar, .btn, .filters, .no-print { display: none !important; }
    body { background: #fff; }
    .card { border: 1px solid #ccc; break-inside: avoid; }
    .content { padding: 0; }
}

/* --- Language switch ------------------------------------------------ */
.lang-switch { display: flex; gap: 0; }
.lang-switch a {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .04em;
    padding: 4px 9px;
    border: 1px solid var(--line);
    color: var(--muted);
    background: var(--card);
}
/* Logical radii so the pair reads as one control in both directions. */
.lang-switch a:first-child {
    border-start-start-radius: 3px;
    border-end-start-radius: 3px;
}
.lang-switch a:last-child {
    border-start-end-radius: 3px;
    border-end-end-radius: 3px;
    border-inline-start: none;
}
.lang-switch a.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.lang-switch a:hover:not(.on) { background: var(--line-soft); }

/* --- Statutory calculation output ----------------------------------- */
.calc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.calc-table td { padding: 9px 14px; border-bottom: 1px solid var(--line-soft); }
.calc-table td:last-child {
    text-align: end;
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.calc-table tr.sub td { color: var(--muted); font-size: 13px; padding-inline-start: 30px; }
.calc-table tr.total td {
    border-top: 2px solid var(--ink);
    border-bottom: none;
    font-weight: 600;
    font-size: 16px;
    padding-top: 13px;
}
.calc-table tr.minus td:last-child { color: var(--red); }

.law-ref {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .06em;
    color: var(--muted);
    text-transform: uppercase;
}
.law-note {
    background: var(--line-soft);
    border-inline-start: 3px solid var(--cyan);
    padding: 12px 15px;
    font-size: 13px;
    line-height: 1.65;
    margin-top: 16px;
    border-start-end-radius: 3px;
    border-end-end-radius: 3px;
}
.law-note strong { display: block; margin-bottom: 4px; }

/* Card headings that carry both a hint and a statutory reference. */
.head-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* --- Purchase module ------------------------------------------------ */
.line-hint {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
    min-height: 14px;
}

.thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.thumb {
    display: block;
    width: 108px;
    height: 108px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--paper);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb:hover { border-color: var(--cyan); }
.thumb-pdf {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: .08em;
    color: var(--muted);
}
.promote { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; }
.promote select { font-size: 12px; padding: 3px 6px; }
.line-hint.warn { color: var(--yellow); }

/* --- Lightbox ------------------------------------------------------- */
body.lb-lock { overflow: hidden; }

.lb {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .14s ease;
}
.lb.lb-on { opacity: 1; }
.lb.lb-instant { transition: none; }
.lb-backdrop { position: absolute; inset: 0; background: rgba(17, 19, 17, .93); }

.lb-stage {
    position: relative;
    max-width: 94vw;
    max-height: 84vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.lb-img {
    max-width: 94vw;
    max-height: 84vh;
    width: auto;
    height: auto;          /* never upscaled past its own size on open */
    display: block;
    transform-origin: center;
    transition: transform .14s ease;
    cursor: zoom-in;
    touch-action: none;
}
.lb-img.lb-zoomed { cursor: grab; }
.lb-img.lb-zoomed:active { cursor: grabbing; }

.lb-bar {
    position: absolute;
    inset-inline: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
}
.lb-top { top: 0; }
.lb-count {
    font-family: var(--mono);
    font-size: 12px;
    color: rgba(255, 255, 255, .82);
    letter-spacing: .06em;
}
.lb-tools { display: flex; gap: 6px; }
.lb-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 3px;
    background: rgba(255, 255, 255, .06);
    color: #fff;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
}
.lb-btn:hover { background: rgba(255, 255, 255, .16); }
.lb-btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 60px;
    border: 0;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}
.lb-nav:hover { background: rgba(255, 255, 255, .18); }
.lb-nav:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.lb-prev { inset-inline-start: 10px; }
.lb-next { inset-inline-end: 10px; }

.lb-cap {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    padding: 14px 18px;
    text-align: center;
    color: rgba(255, 255, 255, .9);
    font-size: 13px;
    background: linear-gradient(to top, rgba(0, 0, 0, .55), transparent);
}

/* thumbnails that open the lightbox */
.lb-thumb { cursor: zoom-in; display: block; }
.lb-thumb:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
    .lb, .lb-img { transition: none; }
}

/* --- Route strip ---------------------------------------------------- */
.route { display: flex; flex-wrap: wrap; gap: 4px 0; align-items: flex-start; }
.route-node {
    flex: 1 1 auto;
    min-width: 76px;
    text-align: center;
    position: relative;
    padding-top: 16px;
}
.route-node::before {
    content: '';
    position: absolute;
    top: 5px;
    inset-inline: -50% 50%;
    height: 2px;
    background: var(--line);
}
.route-node:first-child::before { display: none; }
.route-dot {
    position: absolute;
    top: 0;
    inset-inline-start: 50%;
    transform: translateX(50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--paper);
    border: 2px solid var(--line);
}
.route-name { font-size: 11.5px; color: var(--muted); display: block; }
.route-node.done .route-dot { background: var(--green); border-color: var(--green); }
.route-node.done::before     { background: var(--green); }
.route-node.now  .route-dot  { background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,0,0,.06); }
.route-node.now  .route-name { color: var(--text); font-weight: 600; }
.route-node.back .route-dot  { background: var(--red); border-color: var(--red); }

/* --- Production board ----------------------------------------------- */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.board-col {
    flex: 0 0 232px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px;
}
.board-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line-soft);
    margin-bottom: 8px;
}
.board-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-inline-start: 3px solid var(--cyan);
    border-radius: 3px;
    padding: 9px 11px;
    margin-bottom: 8px;
}
.board-card.late { border-inline-start-color: var(--red); }
.board-no { font-family: var(--mono); font-size: 11.5px; }
.board-title { font-size: 13px; font-weight: 600; margin: 3px 0; }
.board-meta { font-size: 11.5px; color: var(--muted); }
.board-foot { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.board-card form { margin-top: 7px; }

/* --- Job ticket, A4, black on white ---------------------------------- */
.ticket { background: #fff; color: #000; border: 1px solid var(--line); padding: 18px 20px; }
.ticket-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
    margin-bottom: 12px;
}
.ticket-no { font-family: var(--mono); font-size: 30px; font-weight: 700; letter-spacing: .02em; }
.ticket-title { font-size: 16px; margin-top: 3px; }
.ticket-meta { font-size: 11.5px; text-align: end; line-height: 1.7; }
.ticket-sec {
    font-size: 12px;
    font-weight: 700;
    background: #f0f0f0;
    border: 1px solid #000;
    border-bottom: 0;
    padding: 4px 8px;
    margin-top: 12px;
}
.ticket-grid { width: 100%; border-collapse: collapse; font-size: 12px; }
.ticket-grid th, .ticket-grid td { border: 1px solid #000; padding: 5px 8px; text-align: start; vertical-align: top; }
.ticket-grid th { width: 15%; background: #f7f7f7; font-weight: 600; }
.ticket-sign td.sign-box { height: 40px; }
.ticket-foot { margin-top: 14px; font-family: var(--mono); font-size: 10.5px; text-align: center; }

@media print {
    .sidebar, .topbar, .btn-row, .no-print, .flash { display: none !important; }
    .main, .content, .shell { margin: 0 !important; padding: 0 !important; }
    .ticket { border: 0; padding: 0; }
    .ticket-sec { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    @page { size: A4; margin: 12mm; }
}
