:root {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #161616;
    background: #f6f4ed;
    --brand-yellow: #ffc90e;
    --ink: #161616;
    --muted: #66635b;
    --surface: #ffffff;
    --line: #ded9ca;
    --primary: #161616;
    --primary-dark: #000000;
    --danger: #a53c35;
}

* { box-sizing: border-box; }

body { margin: 0; min-height: 100vh; background: #f6f4ed; }

h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: .75rem; }
h2 { font-size: 1.2rem; margin-bottom: 1rem; }

.topbar {
    min-height: 64px;
    padding: .85rem clamp(1rem, 4vw, 2.5rem);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: var(--brand-yellow);
    border-bottom: 1px solid #d6a600;
}

.company-brand { display: flex; align-items: center; gap: .75rem; color: var(--ink); text-decoration: none; }
.header-logo { display: block; width: 86px; height: auto; }
.company-brand-text { display: grid; line-height: 1.1; }
.company-brand-text strong { font-size: .95rem; }
.company-brand-text small { margin-top: .22rem; font-size: .73rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.brand { font-size: 1.2rem; font-weight: 800; letter-spacing: -.03em; }
.muted { color: var(--muted); }
.eyebrow { color: #755800; font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.admin-topbar { justify-content: flex-start; }
.admin-topbar form { margin-left: auto; }
.admin-nav { display: flex; align-self: stretch; gap: .25rem; }
.admin-nav a {
    display: grid;
    place-items: center;
    padding: 0 1rem;
    color: var(--muted);
    border-bottom: 3px solid transparent;
    font-weight: 750;
    text-decoration: none;
}
.admin-nav a:hover { color: var(--ink); }
.admin-nav a.active { color: var(--ink); border-bottom-color: var(--ink); }

.auth-page { display: grid; place-items: center; padding: 1rem; }
.auth-card, .card, .hero-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(19, 39, 32, .06);
}
.auth-card { width: min(100%, 420px); padding: clamp(1.5rem, 5vw, 2.5rem); }
.auth-logo { display: block; width: min(100%, 250px); height: auto; margin: 0 auto 1.5rem; }
.card, .hero-card { padding: clamp(1.2rem, 4vw, 2rem); }
.hero-card { text-align: center; }

.mobile-shell { width: min(100% - 2rem, 600px); margin: 2rem auto; display: grid; gap: 1rem; }
.desktop-shell { width: min(100% - 2rem, 1280px); margin: 2rem auto 4rem; }
.admin-full-shell { width: calc(100% - 2rem); max-width: none; margin: 1rem; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.25rem; }
.page-heading h1 { margin-bottom: 0; }
.page-heading-actions { display: flex; align-items: center; gap: .8rem; }
.status-count { color: var(--primary); font-weight: 800; }
.status-heading-actions { display: flex; align-items: end; gap: 1.25rem; }
.status-date-form { display: grid; gap: .35rem; }
.status-date-form label { color: var(--muted); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; }
.status-date-controls { display: flex; gap: .5rem; }
.status-date-controls input { min-width: 155px; padding: .55rem .7rem; }
.compact-button { width: auto; padding: .55rem .9rem; }
.admin-grid { display: grid; grid-template-columns: minmax(280px, .7fr) minmax(420px, 1.3fr); gap: 1rem; margin-top: 1rem; align-items: start; }
.status-layout {
    --list-width: 70%;
    display: grid;
    grid-template-columns: minmax(320px, var(--list-width)) 10px minmax(260px, 1fr);
    min-height: 560px;
    height: calc(100vh - 190px);
    gap: 0;
    align-items: stretch;
}
.section-heading { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.section-heading h2 { margin-bottom: .35rem; }

.stack { display: grid; gap: 1rem; }
label { display: grid; gap: .45rem; font-size: .9rem; font-weight: 700; }
input, select {
    width: 100%;
    padding: .8rem .9rem;
    border: 1px solid #b8c3be;
    border-radius: 9px;
    color: var(--ink);
    background: #fff;
    font: inherit;
}
input:focus, select:focus { outline: 3px solid rgba(255, 201, 14, .4); border-color: #8d6a00; }
textarea {
    width: 100%;
    min-height: 180px;
    padding: .9rem;
    resize: vertical;
    border: 1px solid #b8c3be;
    border-radius: 9px;
    color: var(--ink);
    background: #111a1e;
    color: #e8f1ed;
    font: .9rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
}
textarea:focus { outline: 3px solid rgba(255, 201, 14, .4); border-color: #8d6a00; }

.button, .link-button { border: 0; font: inherit; font-weight: 800; cursor: pointer; }
.button { width: 100%; padding: .9rem 1.1rem; border-radius: 10px; color: #fff; }
.button:disabled { opacity: .48; cursor: not-allowed; }
.primary { color: #111; background: var(--brand-yellow); border: 1px solid #d6a600; }
.primary:hover { background: #f0b900; }
.secondary { background: #3f3f3c; }
.danger { background: var(--danger); }
.link-button { padding: .35rem; color: var(--ink); background: transparent; }
.action-button { min-height: 58px; margin-top: .8rem; font-size: 1.05rem; }
.location-status { min-height: 1.4rem; margin: .55rem 0 0; font-size: .85rem; }
.form-hint { margin: -.35rem 0 0; color: var(--muted); font-size: .82rem; }
.job-picker { display: grid; gap: .6rem; margin: 1.25rem 0; padding: 0; border: 0; text-align: left; }
.job-picker legend { margin-bottom: .55rem; font-weight: 800; }
.job-option { display: flex; grid-template-columns: none; align-items: center; gap: .75rem; padding: .8rem; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.job-option:has(input:checked) { border-color: #ad8200; background: #fff8d9; box-shadow: 0 0 0 2px rgba(255, 201, 14, .32); }
.job-option input { width: auto; margin: 0; }
.job-option span { display: grid; gap: .15rem; }
.job-option small { color: var(--muted); }
.reference { padding: .65rem; border-radius: 8px; background: #eef2f0; font-size: .8rem; overflow-wrap: anywhere; }
.button-link { display: inline-flex; width: auto; align-items: center; justify-content: center; text-align: center; text-decoration: none; }

.alert { padding: .8rem 1rem; margin-bottom: 1rem; border-radius: 9px; font-weight: 650; }
.success { color: #165c3e; background: #e1f4e9; }
.error { color: #842d2d; background: #fae5e3; }
.badge { display: inline-block; padding: .25rem .55rem; color: #59645f; background: #edf0ee; border-radius: 999px; font-size: .8rem; font-weight: 800; }
.badge.active { color: #0e5b3b; background: #dff4e7; }
.badge.pending { color: #825014; background: #fff0ce; }
.badge.error-badge { color: #842d2d; background: #fae5e3; }
.status-badge.arrived { color: #0e5b3b; background: #dff4e7; }
.status-badge.on-break { color: #7b480c; background: #ffebcc; }
.status-badge.left { color: #842d2d; background: #fae5e3; }
.job-pending { color: #705500; background: #fff1b8; }
.job-live { color: #0e5b3b; background: #dff4e7; }
.job-completed { color: #565d59; background: #e7eae8; }
.setup-expiry { display: block; margin-top: .4rem; color: var(--muted); }

.table-wrap { overflow-x: auto; border-radius: 11px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; }
th, td { padding: .75rem; border-bottom: 1px solid #e5e0d3; vertical-align: middle; }
th { color: #514a38; background: linear-gradient(180deg, #fff9dc 0%, #f7edba 100%); border-bottom: 2px solid #d5b640; font-size: .75rem; letter-spacing: .07em; text-transform: uppercase; }
tbody tr:nth-child(even) td { background: #fbfaf5; }
tbody tr:hover td { background: #fff7d3; }
tbody tr:last-child td { border-bottom: 0; }
table[data-tabulator]:not([hidden]) { overflow: hidden; border: 1px solid #d8d1bc; border-radius: 11px; box-shadow: 0 5px 16px rgba(39, 34, 19, .06); }

.activity-card { max-height: 720px; overflow-y: auto; }
.visit { padding: 1rem 0; border-top: 1px solid var(--line); }
.visit:first-of-type { border-top: 0; padding-top: 0; }
.visit-heading { display: flex; justify-content: space-between; gap: 1rem; }
.visit-heading span { color: var(--muted); }
dl { display: grid; grid-template-columns: 145px 1fr; gap: .45rem 1rem; margin-bottom: 0; font-size: .9rem; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
.break-entry { display: block; }
.timeline { padding-left: 1.1rem; margin-bottom: 0; }
.empty-state { color: var(--muted); }
.status-list-card { display: flex; min-width: 0; height: 100%; flex-direction: column; overflow: hidden; }
.status-table-wrap { min-height: 0; margin-top: .6rem; overflow: auto; }
.status-table { min-width: 650px; }
.status-table th, .status-table td { padding: .65rem .7rem; white-space: nowrap; }
.status-table th { position: sticky; top: 0; z-index: 1; background: linear-gradient(180deg, #fff9dc 0%, #f7edba 100%); }
.splitter { position: relative; cursor: col-resize; touch-action: none; }
.splitter::before { content: ""; position: absolute; inset: 0 3px; background: #c6cfca; border-radius: 999px; transition: background .15s; }
.splitter:hover::before, .splitter:focus::before { background: #b88a00; }
.splitter:focus { outline: 3px solid rgba(255, 201, 14, .45); outline-offset: -2px; }
.resizing-panels { cursor: col-resize; user-select: none; }
.map-card { display: flex; min-width: 0; height: 100%; padding-bottom: 1.2rem; flex-direction: column; }
.map-legend { display: flex; flex-wrap: wrap; justify-content: end; gap: .5rem 1rem; font-size: .8rem; }
.map-legend span { display: flex; align-items: center; gap: .35rem; white-space: nowrap; }
.legend-dot { width: .75rem; height: .75rem; border-radius: 50%; }
.legend-dot.arrived { background: #238b57; }
.legend-dot.on-break { background: #e58a22; }
.legend-dot.left { background: #c43d35; }
.map-shell { position: relative; min-height: 0; margin-top: 1rem; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #edf1ef; flex: 1; }
#status-map { width: 100%; height: 100%; }
.map-message { position: absolute; inset: 50% auto auto 50%; width: min(90%, 430px); margin: 0; padding: .9rem 1rem; transform: translate(-50%, -50%); color: #4d5a55; background: rgba(255, 255, 255, .94); border: 1px solid var(--line); border-radius: 9px; text-align: center; box-shadow: 0 5px 20px rgba(19, 39, 32, .1); }
.map-message:empty { display: none; }
.person-map-marker { display: flex; flex-direction: column; align-items: center; transform: translateY(-8px); }
.person-map-label { max-width: 180px; padding: .25rem .5rem; overflow: hidden; color: #172126; background: #fff; border: 1px solid #cdd5d1; border-radius: 6px; box-shadow: 0 2px 7px rgba(0, 0, 0, .2); font-size: .75rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.person-map-pin { width: 22px; height: 22px; margin-top: 3px; border: 3px solid #fff; border-radius: 50% 50% 50% 0; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); transform: rotate(-45deg); }
.database-layout { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 1rem; align-items: start; }
.schema-card { max-height: calc(100vh - 190px); overflow: auto; }
.schema-table { margin-top: 1.25rem; }
.schema-table h3 { margin: 0 0 .4rem; font: 800 .95rem/1.3 ui-monospace, SFMono-Regular, Consolas, monospace; }
.schema-table th, .schema-table td { padding: .4rem; font-size: .78rem; }
.sql-card { min-width: 0; }
.sql-run-button { width: auto; min-width: 150px; justify-self: start; }
.sql-feedback { margin: 1rem 0 0; }
.sql-results { margin-top: 1.5rem; }
.sql-result-table { max-height: calc(100vh - 510px); min-height: 180px; border: 1px solid var(--line); border-radius: 9px; }
.sql-result-table table { width: max-content; min-width: 100%; }
.sql-result-table th { position: sticky; top: 0; background: var(--surface); }
.sql-result-table td { max-width: 420px; overflow: hidden; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.database-danger-zone { display: flex; margin-top: 1.5rem; padding: 1rem; align-items: center; justify-content: space-between; gap: 1.5rem; background: #fff2f1; border: 1px solid #e6aaa5; border-radius: 10px; }
.database-danger-zone h2 { margin-bottom: .35rem; }
.database-danger-zone p:last-child { margin-bottom: 0; }
.database-danger-zone .button { width: auto; flex: 0 0 auto; }
.database-reset-dialog { border-color: var(--danger); }
.inline-status-form { display: flex; align-items: center; gap: .5rem; }
.inline-status-form select { min-width: 125px; padding: .55rem .7rem; }
.section-gap { margin-top: 1rem; }
.danger-text { color: var(--danger); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.photo-card { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #faf9f5; }
.photo-card img { display: block; width: 100%; height: 160px; object-fit: cover; background: #e8e8e4; }
.photo-card figcaption { display: grid; gap: .3rem; padding: .75rem; font-size: .82rem; overflow-wrap: anywhere; }
.camera-capture-row { display: flex; align-items: center; gap: 1rem; }
.camera-trigger { display: flex; min-height: 92px; padding: 1rem 1.4rem; flex: 1; align-items: center; justify-content: center; gap: .75rem; color: #111; background: var(--brand-yellow); border: 2px solid #d6a600; border-radius: 12px; font-size: 1rem; font-weight: 850; cursor: pointer; }
.camera-trigger:hover { background: #f0b900; }
.camera-trigger:focus-within { outline: 3px solid rgba(255, 201, 14, .45); outline-offset: 3px; }
.camera-icon { width: 38px; height: 38px; fill: currentColor; flex: 0 0 auto; }
.visually-hidden-file { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.photo-capture-preview { width: 92px; height: 92px; flex: 0 0 92px; object-fit: cover; background: #e8e8e4; border: 2px solid var(--line); border-radius: 12px; }
.report-tabs { display: flex; gap: .5rem; }
.report-tabs a { padding: .65rem .9rem; color: var(--ink); border: 1px solid var(--line); border-radius: 9px; text-decoration: none; font-weight: 750; }
.report-tabs a.active { background: var(--brand-yellow); border-color: #d6a600; }
.report-filters { display: grid; grid-template-columns: minmax(240px, 2fr) minmax(155px, 1fr) minmax(155px, 1fr) auto; gap: 1rem; align-items: end; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .75rem; margin: 1rem 0; }
.summary-grid div { display: grid; gap: .25rem; padding: .85rem; border: 1px solid var(--line); border-radius: 9px; }
.summary-grid span { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
.summary-grid strong { font-size: 1.25rem; }
.detail-row td { padding-top: .25rem; background: #faf9f5; }
.detail-row summary { cursor: pointer; color: var(--muted); font-weight: 700; }
.visit-detail { margin-top: .7rem; padding-left: .75rem; border-left: 3px solid var(--brand-yellow); }
.visit-detail ul { margin: .4rem 0 0; }
.total-row { font-weight: 800; background: #fff8d9; }
.plant-edit-row { display: grid; grid-template-columns: minmax(180px, 1fr) 130px auto; gap: .6rem; align-items: center; }
.plant-status-form { margin-top: .4rem; text-align: right; }
.plant-usage-form { margin-top: 1rem; }
.operator-action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-top: 1.25rem; }
.operator-action-grid form { margin: 0; }
.operator-action-grid .action-button { display: grid; width: 100%; min-height: 74px; margin: 0; place-items: center; }
.plant-picker-list { max-height: 58vh; margin-top: 1rem; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.plant-picker-row { display: grid; width: 100%; min-height: 52px; padding: .75rem 1rem; grid-template-columns: 1fr 90px; gap: 1rem; align-items: center; color: var(--ink); background: #fff; border: 0; border-bottom: 1px solid var(--line); font: inherit; text-align: left; cursor: pointer; }
.plant-picker-row:last-child { border-bottom: 0; }
.plant-picker-row:hover, .plant-picker-row:focus { background: #fff8d9; outline: none; }
.plant-picker-row strong { text-align: right; }
.plant-hours-dialog { position: fixed; z-index: 20; inset: 50% auto auto 50%; width: min(calc(100% - 2rem), 420px); padding: 1.25rem; transform: translate(-50%, -50%); background: #fff; border: 2px solid var(--brand-yellow); border-radius: 14px; box-shadow: 0 20px 80px rgba(0,0,0,.35); }
.plant-hours-dialog[hidden] { display: none; }
.dialog-actions, .row-actions { display: flex; gap: .6rem; align-items: center; }
.dialog-actions { margin-top: 1rem; }
.dialog-actions .button, .row-actions .button { width: auto; }
.yes-no-actions .button { flex: 1; min-height: 48px; }
.row-actions { min-width: 230px; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.user-row-actions { min-width: 0; flex-wrap: nowrap; }
.user-row-actions .compact-button { padding: .5rem .7rem; font-size: .84rem; white-space: nowrap; }
.form-dialog { width: min(calc(100% - 2rem), 480px); padding: 0; color: var(--ink); background: var(--surface); border: 2px solid var(--brand-yellow); border-radius: 14px; box-shadow: 0 20px 80px rgba(0,0,0,.35); }
.form-dialog::backdrop { background: rgba(15, 18, 17, .55); }
.form-dialog-content { padding: 1.4rem; }
.form-dialog h2 { margin-bottom: .45rem; }
.duration-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.duration-edit-button { padding: .2rem .35rem; color: #2c557b; background: transparent; border: 0; font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; }
.visit-approval-cell { display: flex; align-items: center; gap: .45rem; white-space: nowrap; }
.visit-approve-button { padding: .3rem .5rem; border-radius: 7px; font-size: .75rem; }
.map-heading-actions { display: flex; flex-wrap: wrap; justify-content: end; align-items: center; gap: .6rem 1rem; }
.table-heading-actions { display: flex; flex-wrap: wrap; justify-content: end; align-items: center; gap: .55rem .8rem; }
.table-action-button { white-space: nowrap; }
.table-thumbnail { display: block; width: 84px; height: 58px; object-fit: cover; border-radius: 6px; }
.geoclock-tabulator.tabulator { margin-top: .6rem; overflow: hidden; background: #fff; border: 1px solid #d8d1bc; border-radius: 11px; box-shadow: 0 7px 22px rgba(39, 34, 19, .08); font-size: .9rem; }
.geoclock-tabulator.tabulator .tabulator-header { color: #403a2b; background: linear-gradient(180deg, #fff9dc 0%, #f5e7a3 100%); border-bottom: 2px solid #d5b640; }
.geoclock-tabulator.tabulator .tabulator-header .tabulator-col { min-height: 43px; background: transparent; border-right: 1px solid rgba(143, 116, 23, .2); }
.geoclock-tabulator.tabulator .tabulator-header .tabulator-col:last-child { border-right: 0; }
.geoclock-tabulator.tabulator .tabulator-header .tabulator-col-content { padding: .72rem .7rem; }
.geoclock-tabulator.tabulator .tabulator-header .tabulator-col-title { font-size: .73rem; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.geoclock-tabulator.tabulator .tabulator-col-sorter .tabulator-arrow { border-bottom-color: #725900; }
.geoclock-tabulator.tabulator .tabulator-tableholder { background: #fff; }
.geoclock-tabulator.tabulator .tabulator-row { min-height: 48px; background: #fff; border-bottom: 1px solid #e5e0d3; transition: background .12s ease, box-shadow .12s ease; }
.geoclock-tabulator.tabulator .tabulator-row:nth-child(even) { background: #fbfaf5; }
.geoclock-tabulator.tabulator .tabulator-row:hover { background: #fff7d3; }
.geoclock-tabulator.tabulator .tabulator-row.tabulator-selected { background: #ffed9b; box-shadow: inset 4px 0 0 #a87e00; }
.geoclock-tabulator.tabulator .tabulator-row.tabulator-selected:hover { background: #ffe783; }
.geoclock-tabulator.tabulator .tabulator-cell { padding: .65rem .7rem; border-right: 1px solid #eeeadd; vertical-align: middle; white-space: normal; }
.geoclock-tabulator.tabulator .tabulator-cell:last-child { border-right: 0; }
.geoclock-tabulator.tabulator .tabulator-cell.tabulator-editing { background: #fff4bf; border: 2px solid #9c7600; border-radius: 4px; }
.geoclock-tabulator.tabulator .tabulator-footer { padding: .5rem .65rem; color: #514a38; background: #f7f3e5; border-top: 1px solid #d8d1bc; }
.geoclock-tabulator.tabulator .tabulator-footer .tabulator-page,
.geoclock-tabulator.tabulator .tabulator-footer .tabulator-page-size { min-width: 34px; min-height: 32px; margin: 2px; color: #332d20; background: #fff; border: 1px solid #c9bea0; border-radius: 7px; }
.geoclock-tabulator.tabulator .tabulator-footer .tabulator-page:hover { color: #111; background: #fff2b8; border-color: #b78c00; }
.geoclock-tabulator.tabulator .tabulator-footer .tabulator-page.active { color: #111; background: var(--brand-yellow); border-color: #b78c00; font-weight: 850; }
.geoclock-tabulator.tabulator .tabulator-header-filter input,
.geoclock-tabulator.tabulator .tabulator-header-filter select { min-height: 32px; margin-top: .4rem; padding: .35rem .5rem; background: rgba(255,255,255,.9); border-color: #c7b56f; font-size: .8rem; }
.geoclock-tabulator.tabulator .tabulator-placeholder { color: var(--muted); background: #fbfaf5; }
.tabulator-edit-list { overflow: hidden; border: 1px solid #c9bea0; border-radius: 9px; box-shadow: 0 12px 36px rgba(20,18,12,.2); }
.tabulator-edit-list .tabulator-edit-list-item { padding: .65rem .75rem; background: #fff; }
.tabulator-edit-list .tabulator-edit-list-item:hover,
.tabulator-edit-list .tabulator-edit-list-item.active { background: #fff2b8; }
.status-list-card .geoclock-tabulator .tabulator-row { min-height: 34px; }
.status-list-card .geoclock-tabulator .tabulator-cell { padding: .35rem .5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-status.pending { color: #825014; background: #fff0ce; }
.table-status.approved, .table-status.live, .table-status.active, .table-status.true, .table-status.super { color: #0e5b3b; background: #dff4e7; }
.table-status.not-approved { color: #842d2d; background: #fae5e3; }
.table-status.completed, .table-status.retired, .table-status.false { color: #565d59; background: #e7eae8; }
.table-status.admin { color: #254d7a; background: #e2edf9; }
.map-distance-label { padding: .35rem .55rem; color: #111; background: var(--brand-yellow); border: 2px solid #111; border-radius: 7px; font-size: .78rem; font-weight: 850; white-space: nowrap; }

@media (max-width: 800px) {
    .topbar:not(.admin-topbar) { flex-wrap: wrap; }
    .topbar:not(.admin-topbar) > .muted { order: 3; width: 100%; }
    .header-logo { width: 68px; }
    .company-brand-text strong { font-size: .83rem; }
    .admin-grid, .status-layout { grid-template-columns: 1fr; }
    .status-layout { height: auto; }
    .status-layout > .card { height: auto; }
    .splitter { display: none; }
    .page-heading { align-items: start; flex-direction: column; }
    .page-heading-actions { width: 100%; justify-content: space-between; }
    .status-heading-actions { width: 100%; align-items: start; flex-direction: column; }
    dl { grid-template-columns: 1fr; gap: .15rem; }
    dd { margin-bottom: .55rem; }
    .admin-topbar { flex-wrap: wrap; }
    .admin-nav { order: 3; width: 100%; justify-content: center; border-top: 1px solid var(--line); }
    .admin-nav a { min-height: 44px; }
    .map-shell { min-height: 420px; }
    #status-map { height: 420px; }
    .database-layout { grid-template-columns: 1fr; }
    .schema-card { max-height: none; }
    .sql-result-table { max-height: 480px; }
    .report-filters { grid-template-columns: 1fr; }
    .plant-edit-row { grid-template-columns: 1fr; }
    .operator-action-grid { grid-template-columns: 1fr 1fr; }
    .duration-fields { grid-template-columns: 1fr; }
}
