/* ===== CMMS styles ===== */
:root {
    --bg: #f4f5f7;
    --panel: #ffffff;
    --ink: #1d2433;
    --muted: #6b7385;
    --line: #e1e4ea;
    --brand: #1f5fbf;
    --brand-dark: #174a96;
    --side: #18202f;
    --side-ink: #c9d1e0;
    --ok: #1e7b45;
    --warn: #b45309;
    --danger: #b42318;
    --radius: 8px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    font-size: 14px;
}

a { color: var(--brand); }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 12px; }
h1:focus { outline: none; }

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

.sidebar {
    width: 210px;
    flex-shrink: 0;
    background: var(--side);
    color: var(--side-ink);
    display: flex;
    flex-direction: column;
    padding: 18px 12px;
    position: sticky;
    top: 0;
    height: 100vh;
}
.brand { color: #fff; font-weight: 700; font-size: 20px; text-decoration: none; padding: 4px 10px 18px; letter-spacing: .5px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { color: var(--side-ink); text-decoration: none; padding: 9px 10px; border-radius: 6px; }
.sidebar nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar nav a.active { background: var(--brand); color: #fff; }
.sidebar-foot { margin-top: auto; font-size: 12px; opacity: .5; padding: 0 10px; }

.content { flex: 1; padding: 22px 28px 40px; min-width: 0; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }

/* ----- cards / grids ----- */
.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 16px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.tile {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex; flex-direction: column; gap: 6px;
    text-decoration: none; color: inherit;
}
.tile-label { color: var(--muted); font-size: 13px; }
.tile-value { font-size: 28px; font-weight: 700; }
.tile-value.small { font-size: 20px; }
.tile-warn .tile-value { color: var(--warn); }
.badge + .badge { margin-left: 4px; }
a.tile:hover { border-color: var(--brand); }

/* ----- tables ----- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.table-hover tbody tr:hover, tr.clickable:hover { background: #f0f5ff; }
tr.clickable { cursor: pointer; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--ink); }
.row-warn { background: #fff6e5; }

.num { text-align: right !important; }
.center { text-align: center !important; }
.nowrap { white-space: nowrap; }
.muted { color: var(--muted); }
.overdue { color: var(--danger); font-weight: 600; }
.error { color: var(--danger); }
.mono { font-family: Consolas, monospace; font-size: 12px; margin: 8px 0; }

/* ----- status badges ----- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.b-new { background: #e0ecff; color: #1f4fa0; }
.b-released { background: #e7e3ff; color: #4b3aa8; }
.b-working { background: #fff1d6; color: #8a5300; }
.b-done { background: #dcf3e5; color: #1e6b3d; }
.b-hold { background: #fde2e1; color: #9b1c15; }
.b-closed { background: #eceef2; color: #505868; }
.b-other { background: #eceef2; color: #505868; }

/* ----- forms ----- */
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }

.input {
    font: inherit;
    color: var(--ink);
    background: #fff;
    border: 1px solid #cfd4dd;
    border-radius: 6px;
    padding: 7px 9px;
    width: 100%;
    font-weight: 400;
}
.input:focus { outline: 2px solid #b9d0f5; border-color: var(--brand); }
.input-sm { width: 90px; }
textarea.input { resize: vertical; }

.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 18px; }
.span-3 { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; }

.filters .filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters label { min-width: 150px; }
.filters label:first-child { min-width: 220px; }

.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 12px; }
.inline-form .grow { flex: 1; min-width: 200px; }

.hint { margin: -6px 0 16px 4px; color: var(--muted); display: flex; gap: 10px; align-items: center; }

/* ----- buttons ----- */
.btn {
    font: inherit;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px;
    border-radius: 6px;
    border: 1px solid #cfd4dd;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { background: #f3f5f8; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { padding: 3px 9px; font-size: 12px; }

/* ----- pager ----- */
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.pager .muted { margin-right: auto; }

/* ----- alerts ----- */
.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; }
.alert-ok { background: #dcf3e5; color: #1e6b3d; }
.alert-error { background: #fde2e1; color: #9b1c15; }
.alert-warn { background: #fff1d6; color: #8a5300; }

/* ----- photos ----- */
.photos { display: flex; flex-wrap: wrap; gap: 12px; }
.photo { margin: 0; width: 180px; }
.photo img { width: 180px; height: 135px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.photo figcaption { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; gap: 4px; }

/* ----- misc ----- */
.head-actions { display: flex; gap: 8px; }
.span-2 { grid-column: span 2; }
.grid-2.even { grid-template-columns: 1fr 1fr; }
.check-group { display: flex; gap: 18px; align-items: flex-end; padding-bottom: 8px; }
label.check { flex-direction: row; align-items: center; gap: 6px; font-size: 14px; color: var(--ink); font-weight: 400; }
.nav-sep { height: 1px; background: rgba(255,255,255,.08); margin: 8px 6px; }

fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.plain:disabled .input { background: #f6f7f9; color: var(--muted); }
.alert-info { background: #e0ecff; color: #1f4fa0; display: flex; align-items: center; gap: 12px; }
.hint-box { background: #f6f8fb; border: 1px dashed var(--line); border-radius: 6px; padding: 8px 12px; color: var(--muted); }
.hint-box strong { color: var(--ink); }
.row-muted td { color: var(--muted); }
.tasklist { margin: 0; padding-left: 22px; max-height: 260px; overflow: auto; }
.tasklist li { padding: 2px 0; }
.result-list { margin: 0; padding-left: 20px; max-height: 300px; overflow: auto; }

.total-row td { font-weight: 700; border-top: 2px solid var(--line); }
.pick-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 6px; margin-top: 8px; max-height: 320px; overflow: auto; }
.pick { text-align: left; background: #fff; border: 0; border-bottom: 1px solid var(--line); padding: 8px 10px; font: inherit; cursor: pointer; }
.pick:hover { background: #f0f5ff; }
.picked { background: #f6f8fb; border: 1px solid var(--line); border-radius: 6px; padding: 10px; }
.task-grid td { padding: 4px; }
.task-grid .input { padding: 5px 7px; }

/* ----- battery station ----- */
.station { grid-template-columns: 3fr 2fr; }
.step { display: flex; gap: 12px; margin-bottom: 14px; }
.step-num { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; margin-top: 18px; }
.step-body { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip { font: inherit; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 10px; cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; }
.chip span { font-size: 12px; color: var(--muted); }
.chip-on { border-color: var(--brand); background: #e0ecff; }
.btn-lg { padding: 11px 22px; font-size: 16px; }
.big-alert { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 16px; }
.inline-label { flex-direction: row; align-items: center; gap: 8px; }
.inline-label .input { width: 200px; }
.input-md { width: 130px; }

/* ----- scan station ----- */
.status-badge { font-size: 13px; vertical-align: middle; margin-left: 8px; }
.scan-banner { background: #1d2433; color: #fff; border-radius: 10px; padding: 16px 20px; margin-bottom: 16px; font-size: 20px; display: flex; gap: 16px; align-items: center; min-height: 64px; }
.scan-banner.scan-error { background: #9b1c15; }
.scan-code { font-family: Consolas, monospace; background: rgba(255,255,255,.15); padding: 2px 10px; border-radius: 6px; }
.field-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.field { border: 2px dashed var(--line); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-height: 86px; }
.field.done { border-style: solid; border-color: #9fd8b5; background: #f2fbf5; }
.field-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.field-value { font-size: 22px; font-weight: 700; }
.field:not(.done) .field-value { color: #a3aab8; font-weight: 400; font-size: 16px; }
.field-hint { font-size: 12px; color: var(--muted); min-height: 15px; }
.sub-head { margin: 14px 0 4px; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.scan-log { max-height: 320px; overflow: auto; font-size: 13px; display: flex; flex-direction: column; gap: 3px; }
.manual { margin-top: 14px; }
.manual summary { cursor: pointer; color: var(--muted); }
.chip:disabled { opacity: .45; cursor: default; }

/* ----- racking ----- */
.component-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 18px; margin: 10px 0; }
.component { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.code-buttons { display: flex; gap: 4px; }
.code-btn { font: inherit; width: 32px; height: 28px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; font-weight: 700; color: var(--muted); }
.code-btn.on { border-color: transparent; }
.aisle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.aisle { font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #fff; cursor: pointer; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.aisle.on { border-color: var(--brand); background: #e0ecff; }
.status-summary { display: flex; gap: 6px; margin-bottom: 8px; }

/* ----- chargers ----- */
.charger-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.charger { font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; align-items: center; cursor: pointer; background: #fff; }
.charger-no { font-size: 12px; color: var(--muted); }
.charger-batt { font-weight: 700; font-size: 15px; }
.charger-time { font-size: 11px; color: var(--muted); min-height: 14px; }
.ch-ready { background: #dcf3e5; border-color: #9fd8b5; }
.ch-charging { background: #fff6dc; border-color: #f1d48a; }
.ch-free { background: #f4f5f7; }
.ch-off { background: #fff; border: 2px solid #e8a3a0; opacity: .7; }
.modal-back { position: fixed; inset: 0; background: rgba(15, 20, 30, .35); z-index: 50; }
.modal { position: fixed; top: 15vh; left: 50%; transform: translateX(-50%); width: min(520px, 92vw); background: #fff; border-radius: 10px; padding: 18px 20px; z-index: 51; box-shadow: 0 12px 40px rgba(0,0,0,.2); }

/* ----- Blazor built-ins ----- */
.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #e50000; }
.validation-message, .validation-errors { color: var(--danger); }
.validation-errors { margin: 0 0 10px; padding-left: 18px; }

.blazor-error-boundary { background: #b32121; padding: 1rem; color: white; }
.blazor-error-boundary::after { content: "An error has occurred."; }

@media (max-width: 1000px) {
    .tiles { grid-template-columns: repeat(2, 1fr); }
    .grid-2, .grid-2.even, .form-grid, .station, .row-3, .field-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .sidebar { width: 160px; }
}

/* ---------- reports ---------- */
.report-hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.report-list { list-style: none; margin: 0; padding: 0; }
.report-list li { padding: 6px 0; border-bottom: 1px solid #eee; }
.report-list li:last-child { border-bottom: 0; }
.report-list a { font-weight: 600; }
.small { font-size: 12px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filter-row label { display: flex; flex-direction: column; gap: 4px; }
.quick-dates { display: flex; flex-wrap: wrap; gap: 4px; }
.report-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.report-table tfoot td { border-top: 2px solid #999; background: #f6f6f6; }
.table-wrap { overflow-x: auto; }
.print-only { display: none; }

@media print {
    .sidebar, .no-print, #blazor-error-ui { display: none !important; }
    .print-only { display: block; margin-bottom: 8px; }
    .shell, .content { display: block !important; margin: 0 !important; padding: 0 !important; }
    .report-table { font-size: 10px; }
    .report-table a { color: inherit; text-decoration: none; }
    .table-wrap { overflow: visible; }
    .card { box-shadow: none; border: 0; padding: 0; }
}

/* ---------- login ---------- */
.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #eef1f5; padding: 16px; }
.login-card { width: 100%; max-width: 360px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-card label { display: flex; flex-direction: column; gap: 4px; }
.login-brand { font-weight: 800; letter-spacing: 2px; color: #888; }
.login-btn { margin-top: 4px; }
.user-box { font-size: 12px; line-height: 1.5; }
.user-box .user-name { font-weight: 700; font-size: 13px; }
.user-box a, .user-box button { color: inherit; opacity: .85; }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; font: inherit; }
fieldset.perm { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.perm:disabled .btn-primary, fieldset.perm:disabled .btn-danger { display: none; }
.readonly-note { background: #fff7e0; border: 1px solid #f0d58a; padding: 6px 10px; border-radius: 6px; margin-bottom: 12px; font-size: 13px; }

/* ---------- permission levels ---------- */
.levels-layout { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
.levels-layout label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.level-list { list-style: none; margin: 0 0 16px; padding: 0; }
.level-list li { padding: 8px 10px; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.level-list li:hover { background: #f1f4f8; }
.level-list li.active { background: #e3ecfa; }
.access-table td.center, .access-table th.center { text-align: center; width: 70px; }
.access-table input[type=checkbox] { width: 18px; height: 18px; cursor: pointer; }
.access-table .group-row td { background: #f6f6f6; font-weight: 700; }
@media (max-width: 900px) { .levels-layout { grid-template-columns: 1fr; } }

/* ---------- background picture (Big Bang Maintenance, vector so it stays sharp) at half strength ---------- */
.content, .login-shell { position: relative; isolation: isolate; }
.content::before, .login-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    /* dark tint over the picture so the pages stand out - raise .7 to calm it more, lower to show more */
    background: linear-gradient(rgba(8, 20, 45, .7), rgba(8, 20, 45, .7)),
                url("img/bigbang-pdca.jpg") center center / contain no-repeat, #0b1730;
    opacity: 1;              /* full strength - lower (e.g. 0.7) to fade it */
    z-index: -1;
    pointer-events: none;
}
/* text that sits straight on the picture (not inside a white box) */
.content > h1, .content > h2, .content > h3, .content > .page-head h1,
.content > p, .content > .muted, .content > .hint, .content > .hint .muted {
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
}
.content > .hint strong { color: #fff; }
.card { box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
.login-shell { background: transparent; }

@media print {
    .content::before, .login-shell::before { display: none; }
    .content > h1, .content > .page-head h1, .content > p, .content > .muted { color: #000; text-shadow: none; }
}

/* ---------- phone layout ---------- */
.side-top { display: flex; align-items: center; justify-content: space-between; }
.side-menu { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.menu-btn { display: none; background: none; border: 1px solid rgba(255,255,255,.25); color: #fff; font-size: 22px; line-height: 1;
            width: 44px; height: 40px; border-radius: 8px; cursor: pointer; }

@media (max-width: 760px) {
    .shell { flex-direction: column; }
    .sidebar { width: 100%; height: auto; padding: 6px 12px; z-index: 50; }
    .brand { padding: 6px 4px; font-size: 18px; }
    .menu-btn { display: block; }
    .side-menu { display: none; }
    .side-menu.open { display: flex; max-height: calc(100vh - 56px); overflow-y: auto; padding-bottom: 10px; }
    .sidebar nav a { padding: 12px 10px; font-size: 16px; }
    .nav-sep { margin: 4px 0; }
    .sidebar-foot { margin-top: 10px; opacity: .85; font-size: 13px; }

    .content { padding: 12px 10px 30px; }
    h1 { font-size: 19px; }
    .page-head { flex-wrap: wrap; }
    .head-actions { display: flex; flex-wrap: wrap; gap: 6px; }

    .card { padding: 12px; overflow-x: auto; }
    .table { font-size: 13px; }
    .table th, .table td { padding: 6px 6px; }

    .input { font-size: 16px; padding: 9px 10px; }       /* 16px stops iPhone zooming in */
    .btn { min-height: 38px; }
    .btn-sm { min-height: 32px; }
    .form-actions, .pager, .quick-dates, .inline-form { flex-wrap: wrap; }
    .pager { justify-content: flex-start; }
    .filters label, .filters label:first-child, .filter-row label { min-width: 0; flex: 1 1 100%; }
    .inline-form .grow, .inline-label .input, .input-md, .input-sm { min-width: 0; width: 100%; }

    .tiles { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .tile { padding: 10px 12px; }
    .tile-value { font-size: 22px; }
    .report-hub { grid-template-columns: 1fr; }
    .levels-layout { grid-template-columns: 1fr; }
    .access-table td.center, .access-table th.center { width: 50px; }
}

/* ---------- sidebar: solid, above the background picture, easy to read ---------- */
.sidebar { z-index: 2; background: #111827; box-shadow: 2px 0 12px rgba(0, 0, 0, .35); }
.sidebar nav a { color: #e8edf6; font-size: 15px; font-weight: 500; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.sidebar nav a.active { background: var(--brand); color: #fff; font-weight: 600; }
.nav-sep { background: rgba(255, 255, 255, .18); }
.sidebar-foot { opacity: .9; color: #c9d1e0; }
.nav-group summary { list-style: none; cursor: pointer; color: #e8edf6; font-size: 15px; font-weight: 500;
                     padding: 9px 10px; border-radius: 6px; display: flex; justify-content: space-between; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after { content: "▸"; opacity: .7; transition: transform .15s; }
.nav-group[open] summary::after { transform: rotate(90deg); }
.nav-group summary:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.nav-group a { padding-left: 24px !important; display: block; }
.build-stamp { margin-top: 6px; font-size: 11px; opacity: .7; }

/* ---------- dashboard tiles: dark glass so the numbers stay readable on the picture ---------- */
.tile { background: rgba(10, 25, 55, .66); border-color: rgba(255, 255, 255, .25); backdrop-filter: blur(6px); }
.tile-label, .tile-value { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }
.tile-label { font-weight: 700; letter-spacing: .3px; }
.tile-warn .tile-value { color: #ffb35c; }
a.tile:hover { border-color: rgba(255, 255, 255, .6); background: rgba(20, 45, 95, .78); }
.content > .page-head h1, .content > h1 { font-weight: 800; text-shadow: 0 2px 6px rgba(0, 0, 0, .9); }

/* ---------- colour instead of plain white, bolder text ---------- */
.card { background: linear-gradient(180deg, #f3f7ff 0%, #e6efff 100%); border: 1px solid #bcd0f0; }
.card h2 { color: #123a80; font-weight: 800; }
label { color: #23314d; font-weight: 700; }
.input { background: #fbfdff; border-color: #b8c6dc; }
.table th { color: #123a80; font-weight: 800; background: rgba(31, 95, 191, .08); }
.table td { font-weight: 500; }
.btn { font-weight: 600; }
.login-card { background: linear-gradient(180deg, #f3f7ff 0%, #e6efff 100%); }

/* ---------- work order: green = as created, red = changed since ---------- */
label.fld-changed { color: #b42318; }
label.fld-changed .input { border-left: 4px solid #d92d20; background: #fff4f3; color: #b42318; font-weight: 700; }
.legend { margin-left: auto; font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.dot-changed { background: #d92d20; }
td.was { color: #b42318; text-decoration: line-through; }
td.now { color: #1e7b45; font-weight: 700; }
.locked-note { background: #fde2e1; border: 1px solid #f3a6a1; color: #7a1a13; padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-weight: 600; }

/* ---------- signed work order notes ---------- */
.notes-title { font-size: 12px; font-weight: 700; color: #23314d; margin-bottom: 4px; }
.notes-log { background: #fffdf3; border: 1px solid #e5d9a8; border-radius: 6px; padding: 8px 10px; max-height: 260px; overflow: auto;
             font-family: Consolas, monospace; font-size: 13px; }
.note-line { color: #505868; white-space: pre-wrap; }
.note-signed { color: #14532d; white-space: pre-wrap; border-left: 3px solid #2fa565; padding-left: 8px; margin: 3px 0; }
.note-add { display: flex; gap: 10px; align-items: flex-end; margin-top: 8px; }
.note-add textarea { flex: 1; }

/* ---------- sidebar icons ---------- */
.sidebar { background: linear-gradient(180deg, #0f1d3d 0%, #0b1530 100%); }
/* brand: Huscan logo + Big Bang Maintenance */
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 16px; }
.brand img { width: 58px; height: auto; flex: none; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .6)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-size: 17px; font-weight: 900; letter-spacing: .5px; text-transform: uppercase;
              background: linear-gradient(180deg, #ffffff, #9cc8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-by { font-size: 11px; font-weight: 700; color: #7ee08a; letter-spacing: 1px; margin-top: 3px; }
.login-brand { display: flex; align-items: center; gap: 12px; letter-spacing: .5px; color: #123a80; font-size: 20px; font-weight: 900; margin-bottom: 6px; }
.login-brand img { width: 70px; height: auto; }
.login-brand small { display: block; font-size: 12px; font-weight: 700; color: #1e7b45; letter-spacing: 1px; }
@media (max-width: 760px) { .brand img { width: 40px; } .brand-name { font-size: 14px; } }
.sidebar nav a, .nav-group summary { display: flex; align-items: center; gap: 12px; }
.sidebar nav a::before, .nav-group summary::before { content: ""; width: 20px; height: 20px; flex: none; background: currentColor;
    -webkit-mask: var(--i, none) center / contain no-repeat; mask: var(--i, none) center / contain no-repeat; }
.nav-group summary::after { margin-left: auto; }
:root {
    --i-gear: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><circle cx='12' cy='12' r='3'/><path d='M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9l2.1 2.1M17 17l2.1 2.1M4.9 19.1L7 17M17 7l2.1-2.1'/><circle cx='12' cy='12' r='7'/></svg>");
}
.sidebar nav a[href=""] { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'><path d='M3 11l9-8 9 8'/><path d='M5 10v10h5v-6h4v6h5V10'/></svg>"); }
.sidebar nav a[href="workorders"] { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><rect x='5' y='4' width='14' height='17' rx='2'/><path d='M9 4h6v3H9zM8 11h8M8 15h8'/></svg>"); }
.sidebar nav a[href="workorders/new"] { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><circle cx='12' cy='12' r='9'/><path d='M12 8v8M8 12h8'/></svg>"); }
.sidebar nav a[href="assets"] { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'><path d='M12 3l8 4.5v9L12 21l-8-4.5v-9z'/><path d='M4 7.5l8 4.5 8-4.5M12 12v9'/></svg>"); }
.sidebar nav a[href="pmplans"] { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><rect x='3' y='5' width='18' height='16' rx='2'/><path d='M3 10h18M8 3v4M16 3v4M7 14h2M11 14h2M15 14h2M7 17h2M11 17h2'/></svg>"); }
.sidebar nav a[href="pms"] { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'><path d='M3 5c3-1 6-1 9 1 3-2 6-2 9-1v14c-3-1-6-1-9 1-3-2-6-2-9-1z'/><path d='M12 6v14'/></svg>"); }
.sidebar nav a[href="materials"] { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'><path d='M3 7l9-4 9 4v10l-9 4-9-4z'/><path d='M3 7l9 4 9-4M12 11v10M7.5 5l9 4'/></svg>"); }
.sidebar nav a[href="racking"] { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><path d='M4 3v18M20 3v18M4 8h16M4 14h16M4 20h16'/><rect x='7' y='10' width='4' height='4'/><rect x='13' y='4' width='4' height='4'/></svg>"); }
.sidebar nav a[href="reports"] { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><path d='M4 20h16M6 16v-4M10 16V8M14 16v-6M18 16V5'/></svg>"); }
.nav-group summary { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><rect x='3' y='7' width='16' height='11' rx='2'/><path d='M21 11v3M7 12.5h3M8.5 11v3M13 12.5h3'/></svg>"); }
.sidebar nav a[href="batteries/station"] { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'><path d='M7 7l5-4 5 4M12 3v10M5 13h14v8H5z'/></svg>"); }
.sidebar nav a[href="batteries"] { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><path d='M3 12a9 9 0 1 0 3-6.7'/><path d='M3 4v5h5M12 7v5l3 2'/></svg>"); }
.sidebar nav a[href="batteries/chargers"] { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'><path d='M13 2L4 14h7l-1 8 9-12h-7z'/></svg>"); }
.sidebar nav a[href="employees"] { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><circle cx='9' cy='8' r='3.5'/><path d='M2.5 20c.8-3.5 3.3-5.5 6.5-5.5s5.7 2 6.5 5.5'/><circle cx='17' cy='9' r='2.5'/><path d='M16 14.5c2.6 0 4.6 1.6 5.5 4.5'/></svg>"); }
.sidebar nav a[href="companies"] { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'><path d='M3 21V9l6-4v4l6-4v4l6-4v16z'/><path d='M7 15h2M11 15h2M15 15h2'/></svg>"); }
.sidebar nav a[href="settings/levels"] { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'><path d='M12 3l8 3v6c0 5-3.5 8-8 9-4.5-1-8-4-8-9V6z'/><path d='M9 12l2 2 4-4'/></svg>"); }

/* ===================== industrial theme (steel, charcoal, safety yellow) ===================== */
:root { --steel: #e4e8ed; --steel-dark: #c3cbd5; --charcoal: #1b1f24; --hazard: #0091c8; /* Huscan blue (from the logo) */ }
html, body { font-family: "Bahnschrift", "Segoe UI", system-ui, Arial, sans-serif; }
h1, h2, .tile-label, .table th, .sidebar nav a, .nav-group summary, .btn, label, .notes-title {
    font-family: "Bahnschrift", "Segoe UI", Arial, sans-serif; }
h1 { text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
h2 { text-transform: uppercase; letter-spacing: .8px; }

.content::before, .login-shell::before {
    background: linear-gradient(rgba(10, 18, 34, .68), rgba(10, 18, 34, .68)),
                url("img/bigbang-pdca.jpg") center calc(50% + 0.75in) / min(80%, calc(70vh * 1.53)) auto no-repeat,
                #0b1730; }   /* 80% / 70vh = picture size; 1.53 = its width/height; +0.75in moves it down from centre */
/* picture sits beside the sidebar (not under it) and always shows whole, banner included */
.content::before { left: 210px; }
@media (max-width: 1000px) { .content::before { left: 160px; } }
@media (max-width: 760px) { .content::before { left: 0; } }

/* sidebar: charcoal */
.sidebar { background: linear-gradient(180deg, #23282f 0%, #16191e 100%); border-right: 1px solid #000;
           box-shadow: inset -1px 0 0 rgba(255, 255, 255, .06), 2px 0 12px rgba(0, 0, 0, .45); }
.sidebar nav a, .nav-group summary { color: #e6e9ee; }
.sidebar nav a:hover, .nav-group summary:hover { background: rgba(0, 145, 200, .22); color: #fff; }
.sidebar nav a.active { background: var(--hazard); color: #fff; font-weight: 700; box-shadow: inset 4px 0 0 #7fd3f5; }
.nav-sep { background: rgba(255, 255, 255, .14); }
.brand-name { background: linear-gradient(180deg, #ffffff, #7fd3f5); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* panels: brushed steel with a yellow top edge */
.card { background: linear-gradient(180deg, #f1f3f6 0%, var(--steel) 100%); border: 1px solid var(--steel-dark);
        border-top: 4px solid var(--hazard); border-radius: 6px; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.card h2 { color: #1b1f24; }
label { color: #2b3138; }
.input { background: #fdfdfd; border-color: #a9b3bf; }
.table th { color: #1b1f24; background: #d5dbe2; }
.btn-primary { background: #1f4e8c; border-color: #163b6b; }
.btn-primary:hover { background: #163b6b; }

/* dashboard tiles: dark steel plates */
.tile { background: linear-gradient(180deg, rgba(42, 48, 56, .92), rgba(24, 28, 33, .92)); border: 1px solid #000;
        border-top: 4px solid var(--hazard); border-radius: 6px; box-shadow: 0 4px 14px rgba(0, 0, 0, .45); }
a.tile:hover { background: linear-gradient(180deg, rgba(58, 66, 76, .95), rgba(30, 35, 41, .95)); border-color: #000; border-top-color: #22aee5; }
.tile-label { color: #c9d1da; text-transform: uppercase; letter-spacing: 1px; font-size: 12px; }
.tile-value { font-family: "Bahnschrift", "Segoe UI", Arial, sans-serif; font-size: 34px; }
.tile-warn .tile-value { color: #5cc8f0; }
.sidebar nav a[href="downtime"] { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'><path d='M12 3L2 20h20z'/><path d='M12 10v4M12 17v.5'/></svg>"); }

/* ===================== printable work order ===================== */
body:has(.print-page) { background: #9aa3ad; }
.print-page { background: #fff; color: #000; max-width: 900px; margin: 20px auto; padding: 28px 34px; box-shadow: 0 4px 20px rgba(0,0,0,.35); font-size: 13px; }
.print-toolbar { display: flex; gap: 8px; margin-bottom: 14px; }
.print-head { display: flex; align-items: center; gap: 14px; border-bottom: 4px solid #111; padding-bottom: 10px; margin-bottom: 10px; }
.print-head img { width: 70px; }
.print-brand { font-size: 20px; font-weight: 800; letter-spacing: 1px; line-height: 1.1; }
.print-brand small { display: block; font-size: 11px; font-weight: 700; color: #1e7b45; }
.print-wo { margin-left: auto; text-align: right; }
.print-wo-no { font-size: 22px; font-weight: 800; }
.print-desc { font-size: 16px; font-weight: 700; padding: 8px 10px; border: 2px solid #111; margin-bottom: 10px; }
.print-page h2 { font-size: 13px; margin: 14px 0 4px; border-bottom: 1px solid #999; padding-bottom: 2px; color: #000; }
.print-grid, .print-table, .print-sign { width: 100%; border-collapse: collapse; }
.print-grid th { text-align: left; width: 16%; background: #eee; font-weight: 700; }
.print-grid th, .print-grid td, .print-table th, .print-table td { border: 1px solid #888; padding: 4px 6px; vertical-align: top; }
.print-table th { background: #eee; text-align: left; font-size: 11px; text-transform: uppercase; }
.print-table .c { text-align: center; width: 54px; } .print-table .r { text-align: right; width: 60px; }
.print-table tr.blank td { height: 24px; }
.print-box { border: 1px solid #888; min-height: 46px; padding: 6px; white-space: pre-wrap; }
.print-box.notes { font-family: Consolas, monospace; font-size: 11px; }
.print-sign { margin-top: 26px; } .print-sign td { padding: 6px 8px; font-weight: 700; }
@media print {
    body:has(.print-page) { background: #fff; }
    .print-page { box-shadow: none; margin: 0; max-width: none; padding: 0; }
    .print-table tr, .print-grid tr { break-inside: avoid; }
    @page { margin: 12mm; }
}

/* ===================== dashboard KPIs ===================== */
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 6px;
       background: linear-gradient(180deg, #f1f3f6 0%, var(--steel) 100%); border: 1px solid var(--steel-dark);
       box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.kpi-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: #4a5562; }
.kpi-value { font-size: 30px; font-weight: 700; color: #1b1f24; line-height: 1.1; }
.kpi-value small { font-size: 15px; margin-left: 2px; color: #4a5562; }
.kpi-sub { font-size: 12px; color: #5b6673; }
.kpi-good { color: #1e7b45; } .kpi-ok { color: #b45309; } .kpi-bad { color: #b42318; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 190px; padding: 8px 4px 0; border-bottom: 2px solid #8a96a3; }
.bar-week { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.bar-pair { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.bar { width: 42%; min-height: 2px; border-radius: 3px 3px 0 0; position: relative; }
.bar span { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: #1b1f24; }
.bar-created { background: #1f4e8c; } .bar-done { background: #2fa565; }
.bar-label { font-size: 11px; color: #4a5562; margin-top: 4px; white-space: nowrap; }
.bar-legend { font-size: 12px; color: #4a5562; margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 2px; } .sw-created { background: #1f4e8c; } .sw-done { background: #2fa565; margin-left: 10px; }
@media (max-width: 1200px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, 1fr); } }

/* ===================== asset documents (WI / LOTO / JSA) ===================== */
.doc-chip { display: inline-block; padding: 3px 9px; border-radius: 4px; font-size: 12px; font-weight: 600; text-decoration: none; border: 1px solid transparent; }
.doc-loto { background: #b42318; color: #fff; }
.doc-wi { background: #0091c8; color: #fff; }
.doc-jsa { background: #b45309; color: #fff; }
.doc-other { background: #d5dbe2; color: #1b1f24; }
a.doc-chip:hover { filter: brightness(1.15); }
.doc-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; }
.doc-strip-title { font-weight: 700; text-transform: uppercase; letter-spacing: .6px; font-size: 12px; color: #2b3138; }
.doc-history { margin-top: 8px; } .doc-history summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.doc-upload { border-top: 1px solid var(--steel-dark); padding-top: 12px; }

/* ===================== work order page: summary strip + sections ===================== */
.wo-hero { background: linear-gradient(135deg, #0f2a55 0%, #1f4e8c 55%, #0091c8 100%); color: #fff; border-radius: 10px;
           padding: 18px 22px 14px; margin-bottom: 16px; box-shadow: 0 6px 20px rgba(0, 0, 0, .4); border: 1px solid rgba(255,255,255,.15); }
.wo-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.wo-kicker { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #9fdcf5; }
.wo-desc { font-size: 22px; font-weight: 800; line-height: 1.25; margin-top: 2px; }
.wo-pills { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.badge.big { font-size: 14px; padding: 6px 14px; font-weight: 800; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.wo-facts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 14px; }
.wo-facts > div { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); border-radius: 8px; padding: 8px 12px; min-width: 0; }
.wo-facts span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: #bcd9f2; font-weight: 700; }
.wo-facts strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wo-facts .late { background: #b42318; border-color: #f19a92; }
.wo-facts .soon { background: #b45309; border-color: #f7c27a; }
.wo-steps { display: flex; list-style: none; margin: 14px 0 0; padding: 0; gap: 4px; counter-reset: step; }
.wo-steps li { flex: 1; text-align: center; font-size: 12px; font-weight: 700; padding: 6px 4px; border-radius: 4px;
               background: rgba(255,255,255,.12); color: #bcd0e6; counter-increment: step; }
.wo-steps li::before { content: counter(step) ". "; }
.wo-steps li.done { background: rgba(47,165,101,.85); color: #fff; }
.wo-steps li.done::before { content: "✓ "; }
.wo-steps li.now { background: #fff; color: #0f2a55; box-shadow: 0 0 0 2px #7fd3f5; }
.wo-steps li.hold { background: #b42318; color: #fff; flex: 0 0 auto; padding: 6px 12px; }
.wo-steps li.hold::before { content: ""; }

.wo-form { padding: 6px 18px 14px; }
.wo-section { border-left: 4px solid var(--sec, #0091c8); background: rgba(255,255,255,.65); border-radius: 0 8px 8px 0;
              padding: 10px 16px 16px; margin: 12px 0; }
.wo-section.s-job { --sec: #1f4e8c; } .wo-section.s-where { --sec: #0091c8; }
.wo-section.s-people { --sec: #6d4bd1; } .wo-section.s-work { --sec: #2fa565; }
.card h3.wo-sec-title { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 15px; font-weight: 800;
                       text-transform: uppercase; letter-spacing: .8px; color: #1b1f24; }
.wo-ico { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--sec); font-size: 15px;
          box-shadow: 0 2px 5px rgba(0,0,0,.25); }
.form-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.wo-form .input { min-height: 38px; border-radius: 7px; }
.wo-form .input:focus { outline: none; border-color: #0091c8; box-shadow: 0 0 0 3px rgba(0,145,200,.25); }
.wo-form .notes-log { border-radius: 8px; }
.wo-actions { position: sticky; bottom: 0; z-index: 5; margin: 6px -18px -14px; padding: 12px 18px;
              background: linear-gradient(180deg, #e9edf2, #dfe5ec); border-top: 1px solid var(--steel-dark); border-radius: 0 0 6px 6px; }
.wo-actions .btn-primary { padding: 9px 28px; font-size: 15px; }
@media (max-width: 1200px) { .wo-facts { grid-template-columns: repeat(3, 1fr); } .form-grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .wo-hero-top { flex-direction: column; } .wo-facts, .form-grid.cols-4 { grid-template-columns: 1fr; }
                            .wo-steps { flex-wrap: wrap; } }
@media print { .wo-hero { display: none; } }

/* ===================== work orders list: quick chips + livelier rows ===================== */
.quick-chips { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 14px; }
.qchip { --c: #1f4e8c; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; cursor: pointer;
         background: linear-gradient(180deg, #f6f8fb, #e6ebf1); border: 1px solid #c3cbd5; border-left: 6px solid var(--c);
         border-radius: 8px; padding: 10px 14px; box-shadow: 0 3px 10px rgba(0,0,0,.3); font-family: inherit; transition: transform .1s; }
.qchip:hover { transform: translateY(-2px); }
.qchip.on { background: var(--c); border-color: var(--c); color: #fff; }
.qchip.on .qchip-n, .qchip.on .qchip-l { color: #fff; }
.qchip-n { font-size: 26px; font-weight: 800; line-height: 1; color: var(--c); }
.qchip-l { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #2b3138; }
.q-open { --c: #1f4e8c; } .q-late { --c: #b42318; } .q-week { --c: #b45309; }
.q-working { --c: #0091c8; } .q-high { --c: #c2410c; } .q-mine { --c: #6d4bd1; }

.table tr.wo-row td { vertical-align: middle; padding-top: 9px; padding-bottom: 9px; }
.table tr.wo-row td:first-child { border-left: 5px solid transparent; }
.table tr.prio-high td:first-child { border-left-color: #b42318; }
.table tr.prio-med td:first-child { border-left-color: #e0a100; }
.table tr.prio-low td:first-child { border-left-color: #2fa565; }
.table tr.row-late { background: #fdeceb; }
.table tbody tr.wo-row:nth-child(even):not(.row-late) { background: rgba(255,255,255,.55); }
.table tbody tr.wo-row:hover { background: #dcecff; box-shadow: inset 0 0 0 1px #8fb8e8; }
.wo-no { font-weight: 800; color: #1f4e8c; white-space: nowrap; }
.wo-desc-cell { font-weight: 600; color: #1b1f24; }
.due-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.due-tag.late { background: #b42318; color: #fff; } .due-tag.soon { background: #f59e0b; color: #fff; } .due-tag.near { background: #dbe4ee; color: #34404d; }
.asset-chip { font-family: Consolas, monospace; font-size: 12px; font-weight: 700; background: #1b1f24; color: #7fd3f5; padding: 2px 7px; border-radius: 4px; }
.type-chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 4px; border: 1px solid; }
.t-pm { color: #0f5c86; border-color: #7fc4e6; background: #e3f4fc; } .t-plan { color: #4b3aa8; border-color: #b9aef0; background: #efecff; }
.t-cm { color: #9b1c15; border-color: #f3a6a1; background: #fde2e1; } .t-other { color: #505868; border-color: #c3cbd5; background: #f1f3f6; }
.avatar { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 800;
          margin-right: 8px; vertical-align: middle; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
@media (max-width: 1200px) { .quick-chips { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .quick-chips { grid-template-columns: repeat(2, 1fr); } }

/* ===================== reports hub: coloured groups + tiles ===================== */
.report-search { max-width: 340px; min-height: 40px; border-radius: 20px; padding: 0 16px; font-size: 14px; }
.rep-hub { display: flex; flex-direction: column; gap: 18px; }
.rep-group { background: linear-gradient(180deg, #f1f3f6, #e4e8ed); border: 1px solid #c3cbd5; border-top: 5px solid var(--g);
             border-radius: 8px; padding: 14px 16px 16px; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.rep-group-title { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 17px; font-weight: 800;
                   text-transform: uppercase; letter-spacing: .8px; color: #1b1f24; }
.rep-group-ico { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--g); font-size: 18px; }
.rep-count { background: var(--g); color: #fff; font-size: 12px; border-radius: 999px; padding: 1px 9px; }
.rep-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.rep-tile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff; border: 1px solid #d5dbe2;
            border-left: 4px solid var(--g); border-radius: 8px; text-decoration: none; color: inherit;
            transition: transform .1s, box-shadow .1s; }
.rep-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0,0,0,.18); border-color: var(--g); }
.rep-ico { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
           background: color-mix(in srgb, var(--g) 14%, #fff); font-size: 20px; }
.rep-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rep-text strong { color: #1b1f24; font-size: 14px; }
.rep-text small { color: #5b6673; font-size: 12px; line-height: 1.35; }
.rep-go { flex: none; font-size: 26px; font-weight: 800; color: var(--g); opacity: .5; }
.rep-tile:hover .rep-go { opacity: 1; }

/* ===================== dashboard: coloured clickable tiles, status bars ===================== */
.tile.dash-tile { --d: #1f4e8c; position: relative; overflow: hidden; text-decoration: none; border: none; border-radius: 10px;
                  background: linear-gradient(135deg, var(--d) 0%, color-mix(in srgb, var(--d) 55%, #000) 100%);
                  box-shadow: 0 6px 18px rgba(0,0,0,.45); transition: transform .12s, box-shadow .12s; padding-right: 70px; }
.tile.dash-tile:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.55); }
.d-blue { --d: #1f5fbf; } .d-red { --d: #c0261b; } .d-orange { --d: #d9730d; } .d-purple { --d: #6d4bd1; }
.dash-tile .tile-label { color: rgba(255,255,255,.85); }
.dash-tile .tile-value { color: #fff; font-size: 40px; line-height: 1.05; }
.dash-ico { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 40px; opacity: .35; }
.dash-tile:hover .dash-ico { opacity: .6; }
.dash-go { font-size: 12px; font-weight: 700; color: rgba(255,255,255,.75); }
.dash-tile:hover .dash-go { color: #fff; text-decoration: underline; }
.kpi { border-top: 4px solid #0091c8; transition: transform .12s; }
.kpi:hover { transform: translateY(-2px); }
.status-bars { display: flex; flex-direction: column; gap: 8px; }
.status-bar-row { display: grid; grid-template-columns: 130px 1fr 50px; align-items: center; gap: 12px; padding: 6px 8px;
                  border-radius: 6px; text-decoration: none; color: inherit; }
.status-bar-row:hover { background: #dcecff; }
.status-bar-row strong { text-align: right; font-size: 16px; }
.status-track { height: 12px; background: #d5dbe2; border-radius: 999px; overflow: hidden; }
.status-fill { display: block; height: 100%; border-radius: 999px; padding: 0; }
.status-fill.b-new { background: #1f4fa0; } .status-fill.b-released { background: #6d4bd1; } .status-fill.b-working { background: #e0a100; }
.status-fill.b-done { background: #2fa565; } .status-fill.b-hold { background: #c0261b; } .status-fill.b-closed, .status-fill.b-other { background: #7a8592; }
.h2-link { float: right; font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 700; color: #1f5fbf; }

/* ===================== report results: solid panel, readable rows ===================== */
.report-result { padding: 14px 16px; }
.report-result-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.rep-rows { background: #1f4e8c; color: #fff; font-weight: 800; font-size: 13px; padding: 3px 12px; border-radius: 999px; }
.report-result .table-wrap { background: #fff; border: 1px solid #c3cbd5; border-radius: 6px; max-height: 70vh; overflow: auto; }
.report-table th { position: sticky; top: 0; z-index: 1; background: #1b1f24; color: #fff; padding: 9px 10px; }
.report-table td { padding: 7px 10px; color: #1b1f24; }
.report-table tbody tr:nth-child(even) { background: #f3f6fa; }
.report-table tbody tr:hover { background: #dcecff; }
.report-table td a { color: #1f5fbf; font-weight: 700; text-decoration: none; }
.report-table td a:hover { text-decoration: underline; }
.report-table td.cell-bad { color: #b42318; font-weight: 700; }
.report-table td.cell-warn { color: #b45309; font-weight: 700; }
.report-table tfoot td { position: sticky; bottom: 0; background: #e4e8ed; border-top: 2px solid #1b1f24; font-size: 14px; }

@media print {
    body { background: #fff !important; }
    .report-result, .report-result .table-wrap { background: #fff !important; border: 0 !important; box-shadow: none !important;
                                                 padding: 0 !important; max-height: none !important; overflow: visible !important; }
    .report-table th { position: static; background: #e4e8ed !important; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .report-table tbody tr:nth-child(even) { background: #f3f6fa !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .report-table tr { break-inside: avoid; }
    .report-table tfoot td { position: static; }
    .content > .page-head h1 { color: #000 !important; text-shadow: none !important; }
}

/* ===================== KPI cards v2 + palette: Huscan blue / steel / amber / red - no purple, little green ===================== */
.kpi.kc { --k: #0091c8; position: relative; text-decoration: none; color: inherit; gap: 4px; padding: 12px 14px 10px;
          background: linear-gradient(180deg, #fbfcfd 0%, #e9edf2 100%); border: 1px solid #c3cbd5; border-top: 0;
          border-left: 6px solid var(--k); border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.kpi.kc:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.45); }
.kpi.kc.kpi-good { --k: #0091c8; } .kpi.kc.kpi-ok { --k: #e08a00; } .kpi.kc.kpi-bad { --k: #c0261b; }
.kpi-top { display: flex; align-items: center; gap: 8px; }
.kpi-ico { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; font-size: 15px;
           background: color-mix(in srgb, var(--k) 16%, #fff); }
.kpi.kc .kpi-value { color: var(--k); font-size: 34px; font-weight: 800; }
.kpi.kc .kpi-value small { color: #5b6673; }
.kpi-meter { position: relative; display: block; height: 8px; background: #d5dbe2; border-radius: 999px; margin: 2px 0 2px; }
.kpi-meter > span { display: block; height: 100%; border-radius: 999px; background: var(--k); }
.kpi-meter > i { position: absolute; top: -3px; width: 3px; height: 14px; background: #1b1f24; border-radius: 2px; transform: translateX(-1px); }
.kpi.kc .kpi-sub { font-weight: 600; }

/* dashboard tiles: colour classes must beat .tile.dash-tile */
.tile.dash-tile.d-blue { --d: #0b6fa8; } .tile.dash-tile.d-red { --d: #b42318; }
.tile.dash-tile.d-orange { --d: #d9730d; } .tile.dash-tile.d-purple { --d: #3b4654; }

/* chart: navy created, Huscan blue completed */
.bar-created, .sw-created { background: #1b3f73; } .bar-done, .sw-done { background: #0091c8; }

/* purple out */
.b-released { background: #d8f1fb; color: #0a6b94; }
.status-fill.b-released { background: #0091c8; }
.t-plan { color: #34404d; border-color: #a9b3bf; background: #e9edf2; }
.q-mine { --c: #3b4654; }
.wo-section.s-people { --sec: #e08a00; } .wo-section.s-work { --sec: #3b4654; }
.wo-steps li.done { background: rgba(0,145,200,.85); }

/* ===================== PM plans list ===================== */
.quick-chips.pm-chips { grid-template-columns: repeat(5, 1fr); }
.table tr.row-due { background: #fff3e0; }
.table tr.row-due td:first-child { border-left-color: #e08a00; }
.freq-chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; color: #fff; white-space: nowrap; }
.f-day { background: #b42318; } .f-week { background: #0b6fa8; } .f-month { background: #0091c8; }
.f-quarter { background: #0f766e; } .f-year { background: #3b4654; } .f-other { background: #7a8592; }
.avatar-stack { display: inline-flex; vertical-align: middle; margin-right: 6px; }
.avatar-stack .avatar { margin-right: -7px; border: 2px solid #fff; width: 28px; height: 28px; }
.avatar-stack .avatar:last-child { margin-right: 0; }
.avatar.more { background: #d5dbe2; color: #1b1f24; }
.wo-link-chip { display: inline-block; font-weight: 800; font-size: 12px; padding: 2px 8px; border-radius: 4px; text-decoration: none;
                background: #e3f4fc; color: #0a6b94; border: 1px solid #7fc4e6; }
.wo-link-chip:hover { background: #0091c8; color: #fff; }
@media (max-width: 1200px) { .quick-chips.pm-chips { grid-template-columns: repeat(3, 1fr); } }
.t-corr { color: #8a4b00; border-color: #f2c27a; background: #fff1d6; }

/* ===================== work order: parts used, checklist progress, save bar messages ===================== */
.parts-total { float: right; font-size: 13px; text-transform: none; letter-spacing: 0; background: #1b3f73; color: #fff; padding: 3px 12px; border-radius: 999px; }
.parts-add { margin-top: 12px; border: 2px dashed #8fb8e8; border-radius: 10px; padding: 14px 16px; background: #f5f9ff; display: flex; flex-direction: column; gap: 10px; }
.parts-step { font-weight: 800; text-transform: uppercase; letter-spacing: .6px; font-size: 13px; color: #1b1f24; display: flex; align-items: center; gap: 8px; }
.step-no { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #0091c8; color: #fff; font-size: 13px; }
.part-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.part-chip { border: 1px solid #a9c4e6; background: #fff; border-radius: 8px; padding: 6px 10px; cursor: pointer; font-family: inherit; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.part-chip:hover { border-color: #0091c8; background: #e3f4fc; }
.stock { display: inline-block; min-width: 26px; text-align: center; font-weight: 800; font-size: 12px; padding: 1px 7px; border-radius: 999px; background: #d8f1fb; color: #0a6b94; }
.stock.out { background: #fde2e1; color: #b42318; }
.pick-table { background: #fff; }
.picked-part { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid #0091c8; border-left: 5px solid #0091c8; border-radius: 8px; padding: 10px 14px; }
.picked-part .grow { flex: 1; }
.qty-stepper { display: inline-flex; align-items: center; gap: 4px; }
.qty-stepper .btn { width: 36px; font-size: 18px; font-weight: 800; padding: 4px 0; }
.qty-stepper .input { width: 80px; text-align: center; font-size: 16px; font-weight: 800; }
.parts-add-foot { display: flex; align-items: center; gap: 12px; border-top: 1px solid #c3cbd5; padding-top: 10px; }
.chk-progress { float: right; font-size: 13px; text-transform: none; letter-spacing: 0; background: #e08a00; color: #fff; padding: 3px 12px; border-radius: 999px; }
.chk-progress.all { background: #0091c8; }
.table tr.row-open td:nth-child(3), .table tr.row-open td:nth-child(4) { background: #fff3e0; }
.save-ok { color: #0a6b94; font-weight: 700; }
.save-err { color: #b42318; font-weight: 800; max-width: 520px; }
.btn-danger-outline { background: #fff; color: #b42318; border-color: #f3a6a1; margin-left: auto; } .btn-danger-outline:hover { background: #fde2e1; }

/* ===================== parts & inventory ===================== */
.quick-chips.inv-chips { grid-template-columns: repeat(5, 1fr); }
.inv-value { cursor: default; }
.inv-value:hover { transform: none; }
.filter-row label.grow { flex: 1 1 280px; }
.inv-table td { vertical-align: middle; }
.inv-part { font-family: Consolas, monospace; font-weight: 800; color: #0a6b94; font-size: 13px; }
.inv-desc { font-weight: 600; color: #1b1f24; }
.bin-chip { display: inline-block; font-family: Consolas, monospace; font-size: 12px; font-weight: 700; background: #e9edf2; border: 1px solid #a9b3bf; color: #1b1f24; padding: 2px 8px; border-radius: 4px; }
.stock-col { width: 170px; }
.stock-top { display: flex; align-items: center; gap: 6px; }
.stock-n { font-size: 16px; }
.inv-out .stock-n { color: #b42318; } .inv-low .stock-n { color: #d9730d; }
.stock-bar { position: relative; height: 7px; background: #d5dbe2; border-radius: 999px; margin-top: 4px; }
.stock-bar > span { display: block; height: 100%; border-radius: 999px; background: #0091c8; }
.inv-low .stock-bar > span { background: #e08a00; } .inv-out .stock-bar > span { background: #b42318; }
.stock-bar > i { position: absolute; top: -3px; width: 2px; height: 13px; background: #1b1f24; }
.stock-mm { display: flex; justify-content: space-between; font-size: 10px; color: #5b6673; margin-top: 2px; }
.table tr.inv-out td:first-child { border-left-color: #b42318; }
.table tr.inv-low td:first-child { border-left-color: #e08a00; }
.table tr.inv-ok td:first-child { border-left-color: #0091c8; }
.inv-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
@media (max-width: 1200px) { .quick-chips.inv-chips { grid-template-columns: repeat(3, 1fr); } }

/* ===================== bins & inventory count sheets ===================== */
a.bin-chip { text-decoration: none; cursor: pointer; }
a.bin-chip:hover { background: #0091c8; border-color: #0091c8; color: #fff; }
.bin-chip.big { font-size: 18px; padding: 2px 12px; }
.bin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-bottom: 16px; }
.bin-tile { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; background: linear-gradient(180deg, #fbfcfd, #e9edf2);
            border: 1px solid #c3cbd5; border-left: 6px solid #0091c8; border-radius: 8px; text-decoration: none; color: inherit;
            box-shadow: 0 3px 10px rgba(0,0,0,.3); transition: transform .1s; }
.bin-tile:hover { transform: translateY(-2px); border-color: #0091c8; }
.bin-name { font-family: Consolas, monospace; font-size: 18px; font-weight: 800; color: #1b1f24; }
.bin-meta { font-size: 12px; color: #4a5562; font-weight: 600; }
label.check { flex-direction: row !important; align-items: center; gap: 6px; font-weight: 700; }
.count-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 8px; }
.count-brand { font-weight: 800; letter-spacing: 1px; color: #1f4e8c; font-size: 12px; }
.count-brand small { color: #5b6673; }
.count-meta { text-align: right; font-size: 12px; color: #4a5562; font-weight: 600; }
.count-table td { vertical-align: middle; }
.count-box, .count-box-h { width: 110px; }
.count-box { border: 2px solid #1b1f24 !important; background: #fff; }
.count-notes { width: 200px; border-bottom: 1px solid #a9b3bf; }
.count-extra td { height: 30px; }
.count-sign { display: flex; justify-content: space-between; gap: 16px; margin-top: 18px; font-weight: 700; flex-wrap: wrap; }
@media print {
    .count-sheet { break-after: page; display: block !important; background: #fff !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; }
    .count-sheet:last-of-type { break-after: auto; }
    .count-table th { background: #e4e8ed !important; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .count-table tr { break-inside: avoid; }
    .count-table td { padding: 8px 6px; }
}

/* ===================== vendors ===================== */
.vendor-name { display: flex; align-items: center; gap: 10px; }
.vendor-name .avatar { width: 34px; height: 34px; font-size: 12px; margin: 0; flex: none; }
.vendor-contact { font-size: 13px; }
.vendor-contact a { display: block; color: #0a6b94; text-decoration: none; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.vendor-contact a:hover { text-decoration: underline; }
.paper-chip { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 4px; margin: 1px 3px 1px 0; white-space: nowrap; }
.paper-chip.bad { background: #fde2e1; color: #9b1c15; border: 1px solid #f3a6a1; }
.paper-chip.due { background: #fff1d6; color: #8a5300; border: 1px solid #f2c27a; }
.paper-ok { font-size: 12px; font-weight: 800; color: #0a6b94; }
.use-chip { display: inline-block; font-size: 11px; font-weight: 700; background: #e9edf2; color: #34404d; padding: 2px 7px; border-radius: 999px; margin-right: 4px; }
.role-chip { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 4px; margin-left: 4px; }
.role-chip.contr { background: #fff1d6; color: #8a5300; } .role-chip.suppl { background: #d8f1fb; color: #0a6b94; } .role-chip.off { background: #e9edf2; color: #5b6673; }
.table tr.vendor-ok td:first-child { border-left-color: #0091c8; }
.table tr.vendor-off { opacity: .7; }

/* ===================== part pictures ===================== */
.part-layout { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: start; }
.part-photo { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.part-photo img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; border: 1px solid #c3cbd5; border-radius: 8px; }
.no-photo { aspect-ratio: 1; display: grid; place-items: center; align-content: center; gap: 4px; font-size: 44px; background: #fff;
            border: 2px dashed #a9b3bf; border-radius: 8px; color: #7a8592; }
.no-photo span { font-size: 12px; font-weight: 700; }
.photo-btn { position: relative; overflow: hidden; text-align: center; cursor: pointer; }
.photo-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.inv-thumb-cell { width: 56px; padding-right: 0 !important; }
.inv-thumb { width: 46px; height: 46px; object-fit: contain; background: #fff; border: 1px solid #d5dbe2; border-radius: 6px; display: block; }
.inv-thumb.none { display: grid; place-items: center; font-size: 18px; color: #a9b3bf; border-style: dashed; }
@media (max-width: 760px) { .part-layout { grid-template-columns: 1fr; } }
.price-source { display: block; font-size: 11px; font-weight: 600; color: #0a6b94; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===================== one-page printable work order ===================== */
.wp { font-size: 11.5px; color: #000; }
.wp-head { display: flex; align-items: center; gap: 10px; border-bottom: 3px solid #1b1f24; padding-bottom: 4px; }
.wp-head img { height: 34px; }
.wp-brand { font-weight: 800; letter-spacing: 1px; font-size: 14px; flex: 1; }
.wp-brand small { font-size: 10px; color: #0a6b94; font-weight: 700; }
.wp-no { font-size: 18px; font-weight: 800; }
.wp-desc { font-size: 14px; font-weight: 800; margin: 5px 0 3px; }
.wp-facts { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 4px 0; border-bottom: 1px solid #999; }
.wp-facts b, .wp-safety b { font-size: 9.5px; text-transform: uppercase; letter-spacing: .5px; color: #444; margin-right: 3px; }
.wp-safety { display: flex; flex-wrap: wrap; gap: 2px 16px; padding: 3px 0; border-bottom: 1px solid #999; }
.wp-loto { padding: 3px 0; border-bottom: 1px solid #999; }
.wp-lock { float: right; }
.wp-tasks, .wp-small { width: 100%; border-collapse: collapse; margin-top: 6px; }
.wp-tasks th, .wp-tasks td, .wp-small th, .wp-small td { border: 1px solid #777; padding: 2px 5px; text-align: left; vertical-align: middle; }
.wp-tasks th, .wp-small th { background: #e4e8ed; font-size: 9.5px; text-transform: uppercase; letter-spacing: .3px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.wp-tasks .n { width: 22px; text-align: center; }
.wp-tasks .c { width: 38px; text-align: center; }
.wp-tasks .v { width: 120px; }
.wp-tasks tbody tr:nth-child(even) { background: #f4f6f8; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.wp-range { color: #444; font-size: 10px; }
.wp-work { border: 1px solid #777; min-height: 120px; padding: 4px 6px; margin-top: 6px; }
.wp-bottom { display: grid; grid-template-columns: 1fr 1.3fr 1.5fr; gap: 8px; margin-top: 6px; }
.wp-bottom .wp-small { margin-top: 0; }
.wp-small tr.blank td { height: 17px; }
.wp-small .r { width: 46px; text-align: right; }
.wp-comment { border: 1px solid #777; padding: 2px 6px; min-height: 70px; }
.wp-comment b { font-size: 9.5px; text-transform: uppercase; letter-spacing: .3px; }
.wp-note { font-size: 10px; }
.wp-sign { display: flex; flex-wrap: wrap; gap: 6px 24px; margin-top: 12px; font-weight: 700; }
.wp-printed { margin-left: auto; font-weight: 400; color: #666; font-size: 9.5px; }
/* longer checklists: smaller text so it stays one page */
.wp.dense-1 .wp-tasks td { padding: 1px 4px; font-size: 10.5px; }
.wp.dense-2 .wp-tasks td { padding: 0 4px; font-size: 9.5px; line-height: 1.2; }
.wp.dense-3 .wp-tasks td { padding: 0 3px; font-size: 8.5px; line-height: 1.15; }
@media print {
    @page { size: letter portrait; margin: 8mm; }
    .wp-tasks tr { break-inside: avoid; }
}

/* ===================== downtime tickets ===================== */
.quick-chips.dt-chips { grid-template-columns: repeat(5, 1fr); }
.ticket-chip { display: inline-block; font-family: Consolas, monospace; font-weight: 800; font-size: 13px; background: #1b1f24; color: #ffb35c; padding: 3px 9px; border-radius: 4px; }
input.ticket-no { font-family: Consolas, monospace; font-weight: 800; font-size: 16px; color: #b45309; }
.cause-chip { display: inline-block; margin-top: 3px; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: #e9edf2; color: #34404d; border: 1px solid #c3cbd5; }
.dt-people div { font-size: 12px; margin: 1px 0; }
.dt-people .avatar { width: 22px; height: 22px; font-size: 10px; margin-right: 6px; }
.dt-open { color: #b42318; font-weight: 800; font-size: 12px; animation: dtblink 1.6s infinite; }
@keyframes dtblink { 50% { opacity: .45; } }
.dt-fixed { color: #0a6b94; font-weight: 800; font-size: 12px; }
.hours-chip { display: inline-block; min-width: 54px; text-align: center; font-weight: 800; padding: 3px 8px; border-radius: 6px; }
.hours-chip.dt-short { background: #d8f1fb; color: #0a6b94; }
.hours-chip.dt-mid { background: #fff1d6; color: #8a5300; }
.hours-chip.dt-long { background: #b42318; color: #fff; }
.table tr.dt-long td:first-child { border-left-color: #b42318; }
.table tr.dt-mid td:first-child { border-left-color: #e08a00; }
.table tr.dt-short td:first-child { border-left-color: #0091c8; }
@media (max-width: 1200px) { .quick-chips.dt-chips { grid-template-columns: repeat(3, 1fr); } }

/* ===================== PM workload table ===================== */
details.workload summary { cursor: pointer; list-style: none; }
details.workload summary h2 { display: inline; }
.workload-table td { vertical-align: middle; }
.workload-table .avatar { width: 24px; height: 24px; font-size: 10px; }
.load { display: inline-block; min-width: 76px; text-align: center; padding: 3px 8px; border-radius: 6px; font-weight: 800; background: #e9edf2; }
.load small { font-weight: 600; color: #5b6673; }
.load.high { background: #b42318; color: #fff; } .load.high small { color: #fde2e1; }
.load.low { background: #d8f1fb; color: #0a6b94; }

/* ===================== personnel ===================== */
.people-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ptab { font-family: inherit; font-weight: 800; font-size: 14px; padding: 9px 16px; border-radius: 8px 8px 0 0; cursor: pointer;
        border: 1px solid #3b4654; border-bottom: 4px solid transparent; background: rgba(27,31,36,.85); color: #c9d1da; }
.ptab span { display: inline-block; margin-left: 6px; font-size: 12px; background: #3b4654; color: #fff; border-radius: 999px; padding: 1px 8px; }
.ptab.on { background: #f1f3f6; color: #1b1f24; border-bottom-color: #0091c8; }
.ptab.on span { background: #0091c8; }
.people-table .avatar { width: 34px; height: 34px; font-size: 12px; margin: 0; flex: none; }
.dept-chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 4px; background: #e9edf2; color: #34404d; border: 1px solid #c3cbd5; }
.shift-chip { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 999px; }
.shift-chip.day { background: #fff1d6; color: #8a5300; } .shift-chip.aft { background: #d8f1fb; color: #0a6b94; } .shift-chip.night { background: #1b3f73; color: #fff; }
.role-chip.lead { background: #fff1d6; color: #8a5300; } .role-chip.dup { background: #e08a00; color: #fff; }
.table tr.row-leader td:first-child { border-left-color: #e08a00; }

/* ===================== new work order: pick buttons, photos, line down ===================== */
.new-desc textarea { font-size: 16px; font-weight: 600; min-height: 64px; }
.pick-label { font-size: 12px; font-weight: 800; margin-bottom: 5px; color: #1b1f24; }
.pick-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pick-btn { font-family: inherit; font-size: 14px; font-weight: 800; padding: 9px 16px; border-radius: 10px; cursor: pointer;
            border: 2px solid #c3cbd5; background: #fff; color: #1b1f24; display: inline-flex; align-items: center; gap: 6px; transition: transform .08s; }
.pick-btn:hover { transform: translateY(-1px); border-color: #0091c8; }
.pick-btn small { font-weight: 600; color: #5b6673; margin-left: 4px; }
.pick-ico { font-size: 18px; }
.pick-btn.on { border-color: #0091c8; background: #0091c8; color: #fff; box-shadow: 0 3px 10px rgba(0,145,200,.4); }
.pick-btn.on small { color: #e3f4fc; }
.pick-btn.t-cm.on { background: #b42318; border-color: #b42318; } .pick-btn.t-corr.on { background: #d9730d; border-color: #d9730d; }
.pick-btn.prio.b-hold.on { background: #b42318; border-color: #b42318; } .pick-btn.prio.b-working.on { background: #d9730d; border-color: #d9730d; }
.pick-btn.prio.b-done.on { background: #0a6b94; border-color: #0a6b94; }
.dup-warn { background: #fff1d6; border: 1px solid #f2c27a; border-left: 5px solid #e08a00; border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.dup-warn a { display: block; color: #8a5300; font-weight: 700; }
.new-photos { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.new-thumb { position: relative; }
.new-thumb img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid #a9b3bf; display: block; }
.new-thumb button { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: #b42318; color: #fff; cursor: pointer; font-weight: 800; }
.add-photo { position: relative; width: 96px; height: 96px; border: 2px dashed #8fb8e8; border-radius: 8px; display: grid; place-items: center; align-content: center;
             font-size: 12px; font-weight: 800; color: #0a6b94; background: #f5f9ff; cursor: pointer; }
.add-photo span { font-size: 28px; }
.add-photo input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.line-down { display: flex !important; flex-direction: row !important; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 14px; border-radius: 8px;
             border: 2px solid #c3cbd5; background: #fff; cursor: pointer; font-size: 14px; }
.line-down input { width: 20px; height: 20px; }
.line-down.on { border-color: #b42318; background: #fde2e1; }

/* ===================== assets: views, tree, cards ===================== */
.view-switch { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; }
.view-switch button { font-family: inherit; font-weight: 800; font-size: 13px; padding: 7px 14px; border-radius: 999px; cursor: pointer;
                      border: 1px solid #3b4654; background: rgba(27,31,36,.85); color: #c9d1da; }
.view-switch button.on { background: #0091c8; border-color: #0091c8; color: #fff; }
.view-switch .muted { color: #c9d1da; margin-left: 8px; }
.type-ico { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: #e3f4fc; font-size: 16px; margin-right: 8px; flex: none; }
.type-ico.big { width: 38px; height: 38px; font-size: 20px; margin: 0; }
.wo-badge { display: inline-block; font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: #fff1d6; color: #8a5300; }
.asset-tree details { border-bottom: 1px solid #d5dbe2; padding: 6px 0; }
.tree-type { cursor: pointer; font-weight: 800; font-size: 15px; display: flex; align-items: center; list-style: none; padding: 4px 0; }
.tree-type::-webkit-details-marker { display: none; }
.tree-type::before { content: "▸"; margin-right: 8px; color: #0091c8; transition: transform .1s; }
details[open] > .tree-type::before { transform: rotate(90deg); }
.tree-count { margin-left: 8px; font-size: 12px; background: #0091c8; color: #fff; border-radius: 999px; padding: 1px 8px; }
ul.tree { list-style: none; margin: 4px 0 4px 18px; padding-left: 14px; border-left: 2px dashed #a9c4e6; }
ul.tree li { margin: 3px 0; }
.tree-node { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 6px; text-decoration: none; color: inherit; flex-wrap: wrap; }
.tree-node:hover { background: #dcecff; }
.tree-node.is-down { background: #fde2e1; }
.tree-name { font-weight: 700; }
.cards-type { display: flex; align-items: center; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.7); margin: 18px 0 8px; }
.asset-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.asset-card { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 10px; text-decoration: none; color: inherit;
              background: linear-gradient(180deg, #fbfcfd, #e9edf2); border: 1px solid #c3cbd5; border-top: 4px solid #0091c8;
              box-shadow: 0 3px 10px rgba(0,0,0,.3); transition: transform .1s; }
.asset-card:hover { transform: translateY(-2px); }
.asset-card.is-down { border-top-color: #b42318; background: linear-gradient(180deg, #fff, #fde2e1); }
.ac-top, .ac-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ac-foot { margin-top: 4px; }

/* asset page: type-aware fields switch, card photo */
.fields-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -6px 0 14px; padding: 8px 14px;
                 background: rgba(241,243,246,.95); border-radius: 8px; }
.fields-switch label.check { display: flex; align-items: center; gap: 6px; font-weight: 800; }
.ac-photo { width: 100%; height: 120px; object-fit: contain; background: #fff; border-radius: 6px; border: 1px solid #d5dbe2; margin-bottom: 4px; }
.no-photo { font-size: 44px; }

/* ===================== service contracts per asset type ===================== */
.ct-card { padding: 0; overflow-x: auto; }
.ct-table td { vertical-align: middle; }
.ct-table tr.ct-full td:first-child { border-left: 6px solid #0091c8; }
.ct-table tr.ct-part td:first-child { border-left: 6px solid #b45309; }
.ct-table tr.ct-none td:first-child { border-left: 6px solid #c3cbd5; }
.ct-icon { display: inline-block; width: 26px; font-size: 18px; text-align: center; }
.ct-meter { width: 110px; height: 8px; border-radius: 4px; background: #d5dbe3; overflow: hidden; margin-bottom: 3px; }
.ct-meter span { display: block; height: 100%; background: linear-gradient(90deg, #1f4e8c, #0091c8); }
.ct-table .input { min-width: 170px; }
.ct-table .ct-kind { min-width: 140px; } .ct-table .ct-date { min-width: 140px; }
.ct-actions { text-align: right; } .ct-actions .btn { margin-left: 4px; }
.ct-apply { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px;
            background: #e3f1f8; border: 1px solid #9ccde3; border-left: 6px solid #0091c8; border-radius: 6px; }

/* ===================== PM procedures list ===================== */
.pm-table td { vertical-align: middle; }
.pm-row td:first-child { border-left: 6px solid #c3cbd5; }
.pm-row.pm-used td:first-child { border-left-color: #0091c8; }
.pm-row.pm-idle td:first-child { border-left-color: #8a96a6; }
.pm-row.pm-empty td:first-child { border-left-color: #b45309; }
.pm-row.pm-bad td:first-child { border-left-color: #b42318; }
.pm-ico-cell { width: 46px; }
.pm-ico { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; font-size: 19px;
          background: linear-gradient(180deg, #1f4e8c, #0b2e5c); box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.pm-row.pm-idle .pm-ico { background: linear-gradient(180deg, #8a96a6, #5c6878); }
.pm-row.pm-empty .pm-ico { background: linear-gradient(180deg, #d97706, #b45309); }
.pm-row.pm-bad .pm-ico { background: linear-gradient(180deg, #d92d20, #b42318); }
.pm-name { font-weight: 800; letter-spacing: .3px; color: #14233a; }
.pm-desc { font-size: 12px; color: #4a5565; margin-top: 2px; }
.pm-table .freq-chip { margin-right: 4px; }
.pm-count { display: inline-block; min-width: 46px; padding: 2px 8px; border-radius: 999px; font-weight: 700; font-size: 12px; text-align: center;
            background: #dfe8f2; color: #1f4e8c; }
.pm-count.plans { background: #d7eef8; color: #0b6fa8; }
.pm-count.zero { background: #fdecd7; color: #b45309; }
.b-high { background: #fde2e1; color: #b42318; }

/* ===================== maintenance team categories ===================== */
.cat-chip { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700;
            border: 1px solid transparent; white-space: nowrap; font-family: inherit; }
button.cat-chip { cursor: pointer; margin: 0 6px 6px 0; padding: 4px 10px; font-size: 12px; }
button.cat-chip:disabled { opacity: .45; cursor: default; }
.cat-tl { background: #fdecd7; color: #8a3c00; border-color: #f2b77a; }
.cat-rm { background: #dbeafe; color: #1f4e8c; border-color: #9cbbe8; }
.cat-bt { background: #d7eef8; color: #0b6fa8; border-color: #8ccbe6; }
.cat-bat { background: #fde2e1; color: #b42318; border-color: #f3a6a1; }
.cat-other { background: #eceef2; color: #505868; border-color: #c3cbd5; }
.cat-add { margin-top: 10px; }

/* ===================== PM printable forms ===================== */
.pm-forms-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 12px; padding: 10px 12px;
                  background: #e3f1f8; border: 1px solid #9ccde3; border-left: 6px solid #0091c8; border-radius: 6px; }
.pm-forms-title { font-weight: 800; color: #0b2e5c; margin-right: 4px; }
.pm-form-chip { display: inline-flex; align-items: stretch; border-radius: 999px; overflow: hidden; border: 1px solid #1f4e8c;
                box-shadow: 0 2px 5px rgba(0,0,0,.2); }
.pm-form-chip a { padding: 4px 12px; font-weight: 700; font-size: 13px; text-decoration: none; background: #1f4e8c; color: #fff; }
.pm-form-chip a:hover { background: #0091c8; }
.pm-form-chip a.pm-form-dl { padding: 4px 9px; background: #fff; color: #1f4e8c; border-left: 1px solid #1f4e8c; }

/* ===================== assets covered by one PM run ===================== */
.cover-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cover-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 999px;
              background: #dbeafe; border: 1px solid #9cbbe8; font-size: 12px; }
.cover-chip a { font-weight: 800; color: #1f4e8c; text-decoration: none; }
.cover-chip small { color: #4a5565; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cover-chip button { border: 0; background: transparent; color: #b42318; cursor: pointer; font-weight: 800; padding: 0 6px; }
.cover-chip.inactive { opacity: .5; }
.cover-add { flex-wrap: wrap; }
.cover-table td { vertical-align: middle; }
.cover-table tr.cv-ok td:first-child { border-left: 6px solid #0091c8; }
.cover-table tr.cv-bad td:first-child { border-left: 6px solid #b42318; }
.cover-table tr.cv-skip td:first-child { border-left: 6px solid #8a96a6; }
.cover-table tr.row-open td:first-child { border-left: 6px solid #d97706; }
.cv-btn { font-family: inherit; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 6px; cursor: pointer; margin-right: 4px;
          background: #fff; border: 1px solid #c3cbd5; color: #2b3138; }
.cv-btn.ok.on { background: #0091c8; border-color: #0091c8; color: #fff; }
.cv-btn.bad.on { background: #b42318; border-color: #b42318; color: #fff; }
.cv-btn.skip.on { background: #5c6878; border-color: #5c6878; color: #fff; }
.cv-btn:disabled { cursor: default; opacity: .7; }
.chk-progress.warn { background: #fde2e1; color: #b42318; margin-left: 6px; }
.cv-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #eceef2; color: #505868; }
.cv-tag.cv-ok { background: #d7eef8; color: #0b6fa8; } .cv-tag.cv-bad { background: #fde2e1; color: #b42318; }

/* ===================== bulk close ===================== */
.close-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px solid var(--steel-dark); }
.close-table td { vertical-align: middle; }
.close-table tr.cl-clean td:first-child { border-left: 6px solid #0091c8; }
.close-table tr.cl-issue td:first-child { border-left: 6px solid #b45309; }
.cl-comment { font-size: 12px; color: #8a3c00; margin-top: 3px; }
.cl-flag { display: inline-block; margin: 0 4px 3px 0; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700;
           background: #fdecd7; color: #8a3c00; white-space: nowrap; }
.cl-flag.ok { background: #d7eef8; color: #0b6fa8; }

/* ===================== bulk select on the work orders list ===================== */
.pick-col { width: 34px; text-align: center; cursor: default; }
.pick-col input { width: 17px; height: 17px; cursor: pointer; }
.table tr.row-picked td { background: #dbeafe !important; }
.bulk-bar { position: sticky; top: 0; z-index: 5; background: #e3f1f8; border: 1px solid #9ccde3; border-left: 6px solid #0091c8;
            border-radius: 6px; padding: 10px 12px; }
.bulk-bar label { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.bulk-bar select { width: auto; }

/* ===================== PM plan: take turns / everyone ===================== */
.assign-mode { display: grid; gap: 6px; margin-bottom: 10px; padding: 10px 12px; background: #eef3f8; border: 1px solid #c3cbd5; border-radius: 6px; }
.assign-mode .check { font-weight: 500; }

/* ===================== labour planner ===================== */
.sidebar nav a[href="planner"] { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><circle cx='9' cy='7' r='3'/><path d='M3 20v-1a6 6 0 0 1 9-5'/><circle cx='17' cy='16' r='5'/><path d='M17 13.5V16l1.8 1.2'/></svg>"); }
.plan-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.plan-card { overflow: hidden; }
.plan-scroll { overflow-x: auto; }
.plan-table { min-width: 900px; }
.plan-table th, .plan-table td { padding: 5px 6px; }
.plan-name { position: sticky; left: 0; background: #eef1f5; z-index: 1; min-width: 190px; }
.plan-day { text-align: center; font-size: 11px; line-height: 1.2; }
.plan-day.wkend { background: #e3e7ec; }
.plan-day.today, .plan-cell.today { box-shadow: inset 0 0 0 2px #0091c8; }
.plan-cell { text-align: center; vertical-align: middle; min-width: 64px; }
.plan-cell.clickable { cursor: pointer; } .plan-cell.clickable:hover { background: #dbeafe; }
.plan-group td { background: #1f4e8c; color: #fff; font-weight: 800; font-size: 12px; letter-spacing: .4px; text-transform: uppercase; }
.plan-total td { background: #eef1f5; font-weight: 700; }
.sh-chip, .sh-count { display: inline-block; padding: 2px 7px; border-radius: 6px; font-size: 11px; font-weight: 800; color: #fff; }
.sh-count { margin: 1px; }
.sh-day { background: #0091c8; } .sh-aft { background: #d97706; } .sh-night { background: #0b2e5c; } .sh-ssi { background: #5c6878; }
.sh-off { color: #8a96a6; font-size: 11px; }
.chg-mini { margin-left: 2px; }
.chg-chip { display: inline-block; padding: 2px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; background: #fdecd7; color: #8a3c00; white-space: nowrap; }
.chg-sick, .chg-loa { background: #fde2e1; color: #b42318; }
.chg-training { background: #dbeafe; color: #1f4e8c; }
.chg-day-off, .chg-stat-holiday, .chg-uto { background: #eceef2; color: #505868; }
.chg-light-duty { background: #fff4c2; color: #7a5b00; }
.work-dot { display: block; margin-top: 3px; font-size: 10px; font-weight: 800; color: #1f4e8c; }
.work-dot.over { color: #b42318; }
.late-text { color: #b42318; font-weight: 800; }
.cov { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 6px; border-radius: 6px; margin: 1px 0; }
.cov.ok { color: #0b6fa8; background: #d7eef8; } .cov.bad { color: #b42318; background: #fde2e1; }
.win { font-size: 11px; font-weight: 700; background: #d7eef8; color: #0b2e5c; border-radius: 6px; padding: 3px 5px; margin: 2px 0; text-align: left; }
.win.nobody { background: #fde2e1; color: #b42318; }
.win-who { display: block; margin-top: 2px; }
.avatar.tiny { width: 18px; height: 18px; font-size: 8px; margin-right: 1px; }
.pick-panel { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; border-left: 6px solid #0091c8; }
.pick-panel label { display: flex; flex-direction: column; font-size: 12px; font-weight: 700; }
.pick-panel .grow { flex: 1; min-width: 160px; }
.pat-cell { display: inline-block; min-width: 30px; padding: 2px 4px; margin: 1px; border-radius: 5px; font-size: 10px; font-weight: 800; text-align: center; color: #fff; border: 0; }
.pat-cell.big { min-width: 58px; padding: 6px 4px; font-size: 13px; cursor: pointer; font-family: inherit; }
.pat-cell.big small { display: block; font-size: 10px; font-weight: 600; opacity: .85; }
.pc-off { background: #d5dbe3; color: #505868; } .pc-own { background: #1f4e8c; }
.pc-day { background: #0091c8; } .pc-aft { background: #d97706; } .pc-night { background: #0b2e5c; } .pc-ssi { background: #5c6878; }
.pat-grid { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 10px; }
.tpl-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 12px; padding: 10px; background: #eef3f8; border-radius: 6px; }
.tpl-row label { display: flex; flex-direction: column; font-size: 12px; font-weight: 700; }
.wd-picker { display: inline-flex; gap: 2px; }
.wd-picker button { width: 24px; height: 24px; border-radius: 5px; border: 1px solid #c3cbd5; background: #fff; font-size: 11px; font-weight: 800; cursor: pointer; color: #505868; }
.wd-picker button.on { background: #1f4e8c; border-color: #1f4e8c; color: #fff; }
.team-table td { vertical-align: middle; }
.team-table .input { min-width: 0; }
.timeoff-form { flex-wrap: wrap; }

/* ===================== planner: own work days, OT ===================== */
.team-days { margin-top: 4px; }
button.cov { border: 0; cursor: pointer; font-family: inherit; }
button.cov.bad:hover { background: #b42318; color: #fff; }
.ot-panel { border-left: 6px solid #b45309; }
.ot-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.ot-head h2 { margin: 0; }

.add-cross { margin-top: 12px; padding: 10px 12px; background: #eef3f8; border: 1px solid #c3cbd5; border-radius: 6px; }
.add-cross label { display: flex; flex-direction: column; font-size: 12px; font-weight: 700; }

/* ===================== battery changing history ===================== */
.bat-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 14px; }
.bat-stat { --c: #1f4e8c; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 10px; align-items: center;
            background: linear-gradient(180deg, #f6f8fb, #e6ebf1); border: 1px solid #c3cbd5; border-left: 6px solid var(--c);
            border-radius: 8px; padding: 10px 14px; box-shadow: 0 3px 10px rgba(0,0,0,.3); }
.bat-stat .bs-ico { grid-row: 1 / span 3; font-size: 26px; }
.bat-stat .bs-n { font-size: 26px; font-weight: 800; color: var(--c); line-height: 1; }
.bat-stat .bs-n small { font-size: 13px; }
.bat-stat .bs-l { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: #2b3138; }
.bat-stat > small { font-size: 11px; color: #5c6878; }
.s-blue { --c: #0091c8; } .s-amber { --c: #b45309; } .s-red { --c: #b42318; } .s-steel { --c: #5c6878; }
.bat-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.qpill { font-family: inherit; font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px; cursor: pointer;
         background: #fff; border: 1px solid #c3cbd5; color: #2b3138; }
.qpill.on { background: #1f4e8c; border-color: #1f4e8c; color: #fff; }
.bat-summary { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 8px; font-size: 13px; color: #2b3138; }
.bat-table td { vertical-align: middle; padding-top: 6px; padding-bottom: 6px; }
.bat-day td { background: #1f4e8c; color: #fff; font-weight: 800; font-size: 12px; letter-spacing: .4px; text-transform: uppercase; }
.bat-day td span { margin-left: 14px; font-weight: 600; text-transform: none; opacity: .85; }
.bat-row td:first-child { border-left: 5px solid #c3cbd5; }
.bat-row.row-shortrun td:first-child { border-left-color: #d97706; }
.bat-row.row-longwait td:first-child { border-left-color: #b42318; }
.bat-row.row-longwait td { background: #fff1f0; }
.bat-time { font-size: 15px; font-weight: 800; color: #14233a; }
.truck-chip { display: inline-block; padding: 2px 9px; border-radius: 6px; font-weight: 800; font-size: 12px; color: #fff; letter-spacing: .3px; }
.tk-ncr { background: #1f4e8c; } .tk-ncj { background: #0091c8; } .tk-cl { background: #b45309; } .tk-dr { background: #0b2e5c; } .tk-cp { background: #5c6878; } .tk-other { background: #8a96a6; }
.bat-chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-weight: 800; font-size: 12px; text-decoration: none; border: 1px solid; }
.bat-chip.out { background: #fdecd7; color: #8a3c00; border-color: #f2b77a; }
.bat-chip.in { background: #d7eef8; color: #0b6fa8; border-color: #8ccbe6; }
.bat-arrow { color: #5c6878; font-weight: 800; margin: 0 2px; }
.chg-plug { font-size: 12px; font-weight: 700; color: #2b3138; }
.run { font-weight: 700; } .run.short { color: #fff; background: #d97706; padding: 1px 7px; border-radius: 999px; }
.disch { display: inline-block; min-width: 24px; padding: 1px 6px; border-radius: 6px; font-weight: 800; font-size: 12px; background: #eceef2; color: #505868; }
.disch.d4, .disch.d5 { background: #fdecd7; color: #8a3c00; } .disch.d6, .disch.d7, .disch.d8, .disch.d9 { background: #fde2e1; color: #b42318; }
.wait { display: inline-block; min-width: 40px; text-align: center; padding: 2px 8px; border-radius: 999px; font-weight: 800; font-size: 12px; }
.wait.ok { background: #d7eef8; color: #0b6fa8; } .wait.mid { background: #fdecd7; color: #8a3c00; } .wait.long { background: #b42318; color: #fff; }
.avatar.sm { width: 22px; height: 22px; font-size: 9px; margin-right: 5px; }
.svc { display: inline-block; margin-right: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #eceef2; color: #a0a8b4; }
.svc.on { background: #d7eef8; color: #0b6fa8; }
@media (max-width: 1100px) { .bat-stats { grid-template-columns: repeat(2, 1fr); } }

.disch { display: inline-block; vertical-align: middle; width: 40px; height: 7px; border-radius: 4px; background: #d5dbe3; overflow: hidden; padding: 0; min-width: 0; }
.disch i { display: block; height: 100%; background: linear-gradient(90deg, #1f4e8c, #0091c8); }

/* ---- asset parts and vendor-imported info ---- */
.q-steel { --c: #5b6b7d; }
.ext-box { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .35rem 1rem; align-items: center; padding: .6rem .8rem; border-radius: 10px; background: #eef4fa; border-left: 4px solid #0b5fa5; font-size: .88rem; }
.ext-box > b { color: #0b5fa5; }
/* ===================== racking ===================== */
.rk-stats { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-bottom: 14px; }
.rk-stat { --c: #1f4e8c; font-family: inherit; text-align: left; cursor: pointer; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 10px; align-items: center;
           background: linear-gradient(180deg, #f6f8fb, #e6ebf1); border: 1px solid #c3cbd5; border-left: 6px solid var(--c); border-radius: 8px; padding: 10px 14px; box-shadow: 0 3px 10px rgba(0,0,0,.3); }
.rk-stat:hover { transform: translateY(-1px); }
.rk-stat.on { outline: 3px solid var(--c); outline-offset: 1px; }
.rk-stat .rk-ico { grid-row: 1 / span 3; font-size: 26px; }
.rk-stat .rk-n { font-size: 26px; font-weight: 800; color: var(--c); line-height: 1; }
.rk-stat .rk-l { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: #2b3138; }
.rk-stat small { font-size: 11px; color: #5c6878; }
.st-s { --c: #b42318; } .st-m { --c: #d97706; } .st-i { --c: #0091c8; } .st-g { --c: #1f4e8c; } .st-n { --c: #5c6878; } .st-w { --c: #8a3c00; } .st-o { --c: #b45309; }
.rk-map-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.rk-aisles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.rk-aisle { --c: #c3cbd5; font-family: inherit; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 5px; padding: 8px 10px; border-radius: 8px;
            background: #fff; border: 1px solid #d5dbe3; border-top: 5px solid var(--c); }
.rk-aisle:hover { box-shadow: 0 3px 10px rgba(0,0,0,.18); }
.rk-aisle.on { background: #e3f1fa; outline: 2px solid #0091c8; }
.rk-aisle.w-S { --c: #b42318; background: #fff4f3; } .rk-aisle.w-M { --c: #d97706; background: #fff8ee; } .rk-aisle.w-I { --c: #0091c8; }
.rk-aisle small { font-size: 11px; color: #5c6878; }
.ra-name { font-size: 18px; font-weight: 800; color: #14233a; letter-spacing: .5px; }
.ra-badges { display: flex; flex-wrap: wrap; gap: 3px; min-height: 20px; }
.ra-b { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.b-s { background: #b42318; color: #fff; } .b-m { background: #fdecd7; color: #8a3c00; } .b-i { background: #d7eef8; color: #0b6fa8; } .b-ok { background: #eceef2; color: #5c6878; }
.rk-legend { margin-top: 10px; }
.rk-pill-l { font-size: 11px; font-weight: 800; text-transform: uppercase; color: #5c6878; align-self: center; margin: 0 2px 0 8px; }
.rk-pill-l:first-child { margin-left: 0; }
.rk-table td { vertical-align: middle; }
.rk-row td:first-child { border-left: 5px solid #d5dbe3; }
.rk-row.s-S td:first-child { border-left-color: #b42318; } .rk-row.s-S td { background: #fff4f3; }
.rk-row.s-M td:first-child { border-left-color: #d97706; } .rk-row.s-I td:first-child { border-left-color: #0091c8; } .rk-row.s-G td:first-child { border-left-color: #1f4e8c; }
.rk-name { display: flex; align-items: center; gap: 10px; }
.rk-type { font-size: 20px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: #e6ebf1; }
.rk-aisle-chip { display: inline-block; padding: 1px 8px; border-radius: 6px; background: #1f4e8c; color: #fff; font-weight: 800; font-size: 11px; letter-spacing: .3px; }
.rk-status { display: inline-block; white-space: nowrap; padding: 3px 10px; border-radius: 999px; font-weight: 800; font-size: 12px; background: #eceef2; color: #5c6878; }
.rk-status.s-S { background: #b42318; color: #fff; } .rk-status.s-M { background: #d97706; color: #fff; } .rk-status.s-I { background: #d7eef8; color: #0b6fa8; }
.rk-status.s-G { background: #dbe6f4; color: #1f4e8c; }
.rk-dmg { display: inline-block; margin: 1px 3px 1px 0; padding: 1px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; border: 1px solid; }
.rk-dmg.s-S { background: #fde2e1; color: #9b1c15; border-color: #f3a8a3; } .rk-dmg.s-M { background: #fdecd7; color: #8a3c00; border-color: #f2b77a; } .rk-dmg.s-I { background: #e3f1fa; color: #0b6fa8; border-color: #9fd2ea; }
.rk-old { color: #b45309; font-weight: 700; }
.rk-nowo { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; background: #fdecd7; color: #8a3c00; border: 1px dashed #d97706; }
.rk-loc { display: inline-block; margin: 1px 3px 1px 0; padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; background: #eef2f7; color: #2b3138; border: 1px solid #d5dbe3; }
.rk-locs { margin-top: 8px; }
.rk-record { border-top: 4px solid #0091c8; }
.rk-hero { display: flex; align-items: center; gap: 14px; }
.rk-hero h1 { margin: 0; }
.rk-hero-ico { font-size: 30px; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(180deg, #f6f8fb, #dbe2ea); box-shadow: 0 3px 10px rgba(0,0,0,.3); }
.rk-hero-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; color: #d5dde8; font-weight: 600; }
.rk-banner { display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin-bottom: 14px; border-radius: 10px; background: #f1f3f6; border-left: 6px solid #5c6878; box-shadow: 0 3px 10px rgba(0,0,0,.25); }
.rk-banner > div { flex: 1; display: flex; flex-direction: column; }
.rk-banner b { font-size: 15px; }
.rk-banner-ico { font-size: 28px; }
.rk-banner.s-S { background: #fff1f0; border-left-color: #b42318; } .rk-banner.s-S b { color: #9b1c15; }
.rk-banner.s-M { background: #fff6ea; border-left-color: #d97706; } .rk-banner.s-M b { color: #8a3c00; }
.rk-banner.s-I { background: #eef7fc; border-left-color: #0091c8; } .rk-banner.s-G { background: #eef3fa; border-left-color: #1f4e8c; }
.rk-type-pick { display: flex; gap: 8px; margin-bottom: 10px; }
.rk-type-btn { font-family: inherit; font-weight: 800; padding: 8px 14px; border-radius: 8px; cursor: pointer; background: #fff; border: 1px solid #c3cbd5; color: #2b3138; }
.rk-type-btn.on { background: #1f4e8c; border-color: #1f4e8c; color: #fff; }
.rk-timeline { list-style: none; margin: 0; padding: 0 0 0 6px; }
.rk-timeline li { display: flex; gap: 12px; padding: 0 0 14px; position: relative; }
.rk-timeline li::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: #d5dbe3; }
.rk-timeline li:last-child::before { display: none; }
.rk-dot { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #eceef2; border: 2px solid #c3cbd5; font-size: 14px; }
.rk-timeline li.s-S .rk-dot { border-color: #b42318; background: #fde2e1; } .rk-timeline li.s-M .rk-dot { border-color: #d97706; background: #fdecd7; }
.rk-timeline li.s-I .rk-dot { border-color: #0091c8; background: #d7eef8; } .rk-timeline li.s-G .rk-dot { border-color: #1f4e8c; background: #dbe6f4; }
.rk-tl-body { flex: 1; display: flex; flex-direction: column; gap: 5px; padding: 6px 12px; border-radius: 8px; background: #f6f8fb; border: 1px solid #e1e6ec; }
.rk-tl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.rk-tl-del { margin-left: auto; }
.rk-tl-note { font-size: 13px; color: #2b3138; }
.code-btn.on.b-done { background: #1f4e8c; color: #fff; } .code-btn.on.b-new { background: #0091c8; color: #fff; }
.code-btn.on.b-working { background: #d97706; color: #fff; } .code-btn.on.b-hold { background: #b42318; color: #fff; }
@media (max-width: 1100px) { .rk-stats { grid-template-columns: repeat(2, 1fr); } }
/* ----- site layout drawing (racking page, aisle walk, layout setup) ----- */
.site-wrap { overflow-x: auto; margin: 0 -4px; padding: 4px; }
.site-svg { display: block; width: 100%; min-width: 860px; height: auto; font-family: "Segoe UI", system-ui, sans-serif; }
.site-bldg { fill: #fbfcfd; stroke: #8a96a8; stroke-width: 3; }
.sz rect { stroke-width: 2.5; }
.sz-rack > rect { fill: #eef3f9; stroke: #1f5fbf; }
.sz-auto rect { fill: #e6ebf1; stroke: #5c6878; stroke-dasharray: 7 4; }
.sz-auto text { fill: #3a4656; font-weight: 700; }
.sz-area rect { fill: #f4f5f7; stroke: #c3cbd5; }
.sz-area text { fill: #6b7385; font-weight: 600; }
.sz.link { cursor: pointer; }
.sz.link:hover rect { stroke: #0091c8; stroke-width: 3.5; }
.sz-title { fill: #14233a; font-weight: 800; }
.sz-title .sz-area { fill: #1f5fbf; }
.ss { cursor: pointer; }
.ss rect { fill: #cfd8e3; stroke: #9aa7b8; stroke-width: 1; }
.ss text { fill: #14233a; font-weight: 800; pointer-events: none; }
.ss .ss-n { font-weight: 700; }
.ss:hover rect { stroke: #0091c8; stroke-width: 2.5; }
.ss.on rect { stroke: #0b2f5c; stroke-width: 4; }
.ss.w-S rect { fill: #b42318; stroke: #7d140c; } .ss.w-S text { fill: #fff; }
.ss.w-M rect { fill: #f2a43a; stroke: #b45309; }
.ss.w-I rect { fill: #8fd0ea; stroke: #0091c8; }
.ss.k-ok rect { fill: #1f4e8c; stroke: #0b2f5c; } .ss.k-ok text { fill: #fff; }
.ss.k-soon rect { fill: #f2a43a; stroke: #b45309; }
.ss.k-late rect { fill: #b42318; stroke: #7d140c; } .ss.k-late text { fill: #fff; }
.ss.k-never rect { fill: #eceef2; stroke: #8a96a8; stroke-dasharray: 4 3; } .ss.k-never text { fill: #5c6878; }
.ra-b.k-ok { background: #1f4e8c; color: #fff; } .ra-b.k-soon { background: #f2a43a; color: #4a2300; }
.ra-b.k-late { background: #b42318; color: #fff; } .ra-b.k-never { background: #eceef2; color: #5c6878; border: 1px dashed #8a96a8; }
.ra-zone { font-size: 10px; font-weight: 800; color: #1f5fbf; margin-left: 4px; letter-spacing: 0; }
.ra-walk { color: #1f4e8c !important; font-weight: 700; } .ra-walk.late { color: #b42318 !important; }
.rk-aisle-chip.big { font-size: 16px; padding: 2px 12px; vertical-align: middle; }

/* ----- aisle walk ----- */
.walk-prog { height: 10px; background: #e6ebf1; border-radius: 999px; overflow: hidden; margin-bottom: 10px; }
.walk-prog div { height: 100%; background: #1f5fbf; border-radius: 999px; }
.walk-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.walk-chip { display: inline-flex; flex-direction: column; align-items: center; min-width: 54px; padding: 5px 10px; border-radius: 8px; text-decoration: none;
             background: #fff; border: 1px solid #c3cbd5; color: #14233a; font-weight: 800; }
.walk-chip:hover { box-shadow: 0 3px 10px rgba(0,0,0,.15); }
.walk-chip.big { min-width: 86px; border-top: 5px solid var(--c, #c3cbd5); }
.walk-chip small { font-size: 11px; font-weight: 600; color: #5c6878; }
.walk-chip.done { background: #1f4e8c; border-color: #1f4e8c; color: #fff; }
.walk-chip.on { outline: 3px solid #0091c8; }
.walk-chip.k-ok { --c: #1f4e8c; } .walk-chip.k-soon { --c: #f2a43a; } .walk-chip.k-late { --c: #b42318; background: #fff4f3; } .walk-chip.k-never { --c: #8a96a8; background: #f4f5f7; }
.walk-hero { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-left: 6px solid #1f5fbf; }
.walk-hero-t { font-size: 20px; font-weight: 800; color: #14233a; }
.walk-hero-b { display: flex; gap: 6px; flex-wrap: wrap; }
.walk-side { margin-top: 14px; }
.walk-side-t { font-weight: 800; color: #1f4e8c; margin-bottom: 6px; }
.walk-grid-wrap { overflow-x: auto; border: 1px solid #e1e4ea; border-radius: 8px; background: #fbfcfd; }
.walk-grid { border-collapse: separate; border-spacing: 2px; font-size: 10px; }
.walk-grid th { color: #5c6878; font-weight: 700; padding: 0 2px; text-align: center; white-space: nowrap; }
.walk-grid tbody th { text-align: right; padding-right: 4px; position: sticky; left: 0; background: #fbfcfd; }
.walk-grid td { padding: 0; text-align: center; vertical-align: top; }
.walk-upr td { padding-top: 4px; }
.walk-upr td .wc { display: block; margin: 0 auto 2px; height: 16px; }
.wc { display: inline-block; width: 28px; height: 22px; padding: 0; border-radius: 4px; border: 1px solid #c3cbd5; background: #fff; cursor: pointer;
      font: 800 11px/20px "Segoe UI", system-ui, sans-serif; color: #14233a; vertical-align: middle; }
.wc:hover { border-color: #0091c8; box-shadow: 0 0 0 2px #b9e2f3; }
.wc.on { outline: 3px solid #0b2f5c; outline-offset: 1px; }
.wc.s-S { background: #b42318; border-color: #7d140c; color: #fff; }
.wc.s-M { background: #f2a43a; border-color: #b45309; }
.wc.s-I { background: #8fd0ea; border-color: #0091c8; }
.wc.s-G { background: #dbe6f4; border-color: #1f4e8c; font-size: 10px; }
.walk-upr .wc { background: #e6ebf1; }
.walk-upr .wc.s-S { background: #b42318; } .walk-upr .wc.s-M { background: #f2a43a; } .walk-upr .wc.s-I { background: #8fd0ea; } .walk-upr .wc.s-G { background: #dbe6f4; }
.walk-sel { border: 2px solid #1f5fbf; }
.walk-sel-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.walk-done { border-left: 6px solid #1f4e8c; }
.walk-btn { font-size: 16px; padding: 10px 18px; }
.walk-msg { font-weight: 700; color: #1f4e8c; }

/* ----- layout setup ----- */
.table-scroll { overflow-x: auto; }
.lay-table td { padding: 4px; vertical-align: middle; }
.lay-table .input { min-width: 0; }
.lay-s { width: 70px; } .lay-xs { width: 64px; } .lay-n { width: 64px; }
.lay-rack td:first-child { border-left: 5px solid #1f5fbf; } .lay-auto td:first-child { border-left: 5px solid #5c6878; } .lay-area td:first-child { border-left: 5px solid #c3cbd5; }
@media (max-width: 1100px) { .rk-stats { grid-template-columns: repeat(2, 1fr); } }