/* Permanent staff dark theme; CAD geometry follows the supplied dispatch reference. */
body.staff-dark #app,body.staff-dark .main{background:#20282c;color:#eef3f5;color-scheme:dark}
body.cad-active #app .sidebar,body.cad-active #app .topbar,body.cad-active #app .op-selector-bar{display:none!important}
body.cad-active #app .main{margin:0!important;width:100%;min-height:100vh}
body.cad-active #app .app-shell{display:block}
body.cad-active #app .content{padding:0;max-width:none;margin:0}
body.cad-active #view-dashboard{height:100dvh}
#app .ref-cad{--gold:#e9ad12;--blue:#397dff;font:14px/1.35 'IBM Plex Sans',Arial,sans-serif;background:#303b43;color:#f0f3f5;height:100dvh;display:flex;flex-direction:column;overflow:hidden}
#app .ref-cad button,#app .ref-cad input,#app .ref-cad select{font:inherit;border-radius:2px;cursor:pointer}
#app .ref-tabs{height:59px;min-height:59px;background:#102855;display:flex;align-items:end;border-bottom:3px solid #397dff;gap:10px;padding:0 20px}
#app .ref-new{background:transparent;border:1px solid white;color:white;margin-bottom:9px;min-width:120px;padding:6px;font-size:12px;font-weight:600}
#app .ref-tabstrip{display:flex;align-items:end;flex:1;overflow-x:auto;gap:3px;height:100%;scrollbar-width:thin}
#app .ref-tab{display:flex;min-width:170px;max-width:210px;height:38px;border:1px solid #397dff;border-bottom:0;border-radius:12px 5px 0 0;transform:skew(-18deg);background:#102855}
#app .ref-tab button{transform:skew(18deg);border:0;background:none;color:#fff;padding:8px 12px;font-size:13px;font-weight:600;text-align:left;white-space:nowrap}
#app .ref-tab button:first-child{flex:1}#app .ref-tab button:last-child{color:#bce9ff;padding-right:8px}
#app .ref-tab.selected{background:#469cff;border-color:#77b8ff}
#app [data-ref-workspace]{align-self:center;width:115px;min-height:28px;background:#102855;border:1px solid #487cd0;color:#fff;font-size:11px}
#app .ref-layout{display:grid;grid-template-columns:158px minmax(0,1.04fr) minmax(0,1fr);flex:1;min-height:0}
#app .ref-rail{background:#303b43;border-right:1px solid #ba8f09;padding:27px 25px 16px;overflow:auto;display:flex;flex-direction:column;gap:12px}
#app .ref-rail>button,#app .ref-modules summary{min-height:62px;width:106px;padding:10px 5px;border:2px solid #d9a215;background:#8e700a;color:white;font-size:12px;font-weight:600;line-height:1.25;text-align:center;box-shadow:inset 0 0 6px #a17b15}
#app .ref-rail>button:nth-child(2){background:#a77a00}
#app .ref-rail>button:nth-child(n+3){background:#4d4930}
#app .ref-rail>button:nth-child(n+5){background:#303b43}
#app .ref-modules{margin-top:auto}#app .ref-modules summary{min-height:36px;cursor:pointer;list-style:none}
#app .ref-modules button{display:block;border:0;border-bottom:1px solid #697077;width:106px;background:#20282c;color:white;padding:10px 2px;font-size:11px}
#app .ref-main{display:grid;grid-template-rows:minmax(310px,48%) minmax(160px,1fr);min-width:0;min-height:0;border-right:4px solid #102855}
#app .ref-summary{overflow:auto;padding:22px 28px 10px;background:#303b43;scrollbar-color:#397dff #10202e;scrollbar-width:thin}
#app .ref-summary h1{font-size:23px;color:#b38b0a;margin:0 0 10px;font-weight:700}
#app .ref-times{font-size:12px;white-space:normal;border-bottom:3px solid #a3b0b6;padding-bottom:9px}#app .ref-times i{font-style:normal;padding:0 8px}
#app .ref-assignment{display:flex;gap:28px;justify-content:space-between;padding:9px 10px;border-bottom:1px solid #a3b0b6}
#app .ref-assignment>div{min-width:0}#app .ref-assignment small{display:block;color:#a0b4bd;font-size:12px}#app .ref-assignment strong{display:block;font-size:14px;overflow-wrap:anywhere}
#app .ref-unit{background:#299981;padding:1px 4px}
#app .ref-facts{display:grid;grid-template-columns:100px minmax(0,1fr);gap:12px 17px;margin:22px 0 0;font-size:14px}
#app .ref-facts dt{color:#e9ad12;text-align:right}#app .ref-facts dd{margin:0;overflow-wrap:anywhere}
#app .ref-cad a{color:#e9ad12;text-decoration:none;margin-left:5px}
#app .ref-log{display:flex;flex-direction:column;min-height:0;background:#0e1a21;padding:24px 20px 20px 34px}
#app .ref-activity{flex:1;overflow:auto;scrollbar-color:#397dff #10202e;scrollbar-width:thin;padding-right:20px}
#app .ref-log article,#app .ref-related-body>article{margin-bottom:20px;font-size:14px}#app .ref-log article header,#app .ref-related-body>article header{color:#3c8aff;font-weight:600}
#app .ref-log time{font-size:12px;font-weight:400;margin-left:6px}#app .ref-log article p{margin:3px 0;color:#9cb9c6;white-space:pre-wrap}
#app #ref-note-form{display:flex;gap:6px;margin-top:16px}#app #ref-note-form input{background:#292b1c;border:1px solid #bdb99a;color:white;flex:1;min-width:0;padding:7px}
#app #ref-note-form button{background:#8e700a;border:1px solid #bdb99a;color:white;font-size:11px;padding:7px}
#app .ref-related{background:#212a2c;overflow:auto;padding:22px 25px;scrollbar-color:#397dff #10202e;scrollbar-width:thin}
#app .ref-related-tabs{display:flex;justify-content:center;margin-bottom:24px}
#app .ref-related-tabs button{background:transparent;border:1px solid #b78c0d;color:white;font-size:12px;padding:7px 16px;border-radius:0;white-space:nowrap}
#app .ref-related-tabs button.selected{background:#a47a00}
#app .ref-related h2{font-size:17px;color:#f5b20b;font-weight:600;margin:0 0 9px;padding-bottom:6px;border-bottom:1px solid #3c4e51}
#app .ref-related h2 span{float:right;font-size:17px}#app .ref-related section{margin-bottom:24px}
#app .ref-related p{font-size:13px;margin:8px 0 12px}
#app .ref-table{width:100%;border-collapse:collapse;background:transparent;color:#eff5f6;font-size:12px;table-layout:fixed}
#app .ref-table th{background:none;color:#9aafb3;font-size:11px;font-weight:400;border-bottom:1px solid #3c4e51;padding:7px 0;text-align:left}
#app .ref-table th:first-child{width:105px}#app .ref-table th:nth-child(2){width:140px}
#app .ref-table td{padding:10px 8px 8px 0;border:0;vertical-align:top;overflow-wrap:anywhere;font-size:12px;font-weight:600}
#app .ref-table small{display:block;color:#b5c2c5;font-size:12px;font-style:italic;font-weight:400;margin-top:5px}
#app .ref-table button{color:#e9ad12;border:0;padding:0;background:none;font-size:12px;text-align:left;font-weight:600}
#app .ref-status{display:inline-block;font-size:11px;padding:2px 5px;color:#fff;background:#62520a;border-radius:1px;margin:1px 4px}
#app .ref-status.urgent{background:#960d33}#app .ref-status.travel{background:#2154ab}#app .ref-status.onscene{background:#066a64}#app .ref-status.done{background:#30693e}
#app .ref-footer{height:29px;min-height:29px;background:#102855;border-top:1px solid #397dff;display:flex;align-items:center;gap:25px;padding:0 13px;color:#5799ff;font-size:12px}
#app .ref-footer .ref-connection{margin-left:auto;color:#8fff00}#app .ref-muted{color:#8da6b2}
/* Supporting staff screens and forms stay dark regardless of device theme or time. */
:where(body.staff-dark #app) :is(.sidebar,.topbar,.op-selector-bar,.panel,.ops-panel,.record-list,.record-detail,.account-metric,.module-stat,.ops-toolbar,.op-table-wrap,.command-hero,.welcome-row,.toolbar,.module-row,.request-row,.account-tabs button,.op-tabs button){background:#202b33;color:#e2eaf0;border-color:#455461}
:where(body.staff-dark #app) :is(.nav-label,.nav-section-label,.user-card,.panel-head,.ops-panel-head,.detail-box-head,.ops-head,th){background:#15232e;color:#d9e5ec;border-color:#455461}
:where(body.staff-dark #app) :is(h1,h2,h3,h4,strong,.cell-main,.nav-btn,.user-copy strong){color:inherit}
:where(body.staff-dark #app) :is(p,small,.cell-sub,label,.account-note,.user-copy span){color:#b7c8d3}
:where(body.staff-dark #app) :is(input,select,textarea){color-scheme:dark;background:#101d27;color:#edf3f6;border-color:#526575}
:where(body.staff-dark #app) :is(.secondary-btn,.tiny-btn){background:#273b4b;color:#edf3f6;border-color:#526575}
:where(body.staff-dark #app) .nav-btn.active{background:#35516b;color:white;border-left-color:#e9ad12}
:where(body.staff-dark #app) .primary-btn{background:#a77a00;color:white;border-color:#d9a215}
:where(body.staff-dark #app) .view{color:#e2eaf0}:where(body.staff-dark #app) td{border-color:#3c4e59}
body.staff-dark #modal-root :is(.modal,.modal-body,.cad-intake,.detail-box,.detail-box-body,.info-card,.note){background:#27333d!important;color:#eef3f5;border-color:#546675}
body.staff-dark #modal-root :is(.modal-head,.modal-foot,.detail-box-head,.form-section-title){background:#182832!important;color:#f0b525!important;border-color:#546675}
body.staff-dark #modal-root :is(h2,h3,strong,label,p,.detail-fact span){color:inherit!important}
body.staff-dark #modal-root :is(input,select,textarea){background:#101e28!important;color:#eef3f5!important;border-color:#668091!important;color-scheme:dark}
body.staff-dark #modal-root :is(.secondary-btn,.tiny-btn){background:#30495b;color:white;border-color:#668091}
body.staff-dark #modal-root .primary-btn{background:#a77a00;color:white;border-color:#d9a215}
body.staff-dark #modal-root .ref-table{width:100%;color:#eef3f5;border-collapse:collapse}body.staff-dark #modal-root .ref-table td{padding:9px;border-bottom:1px solid #53626d}body.staff-dark #modal-root .ref-table button{background:none;color:#f0b525;border:0;cursor:pointer}body.staff-dark #modal-root .ref-table small{display:block}
@media(min-width:1600px){#app .ref-main{grid-template-rows:48% 52%}#app .ref-summary{padding-left:30px;padding-right:28px}}
@media(max-width:1100px){#app .ref-layout{grid-template-columns:108px minmax(0,1fr) minmax(0,.9fr)}#app .ref-rail{padding:20px 10px}#app .ref-rail>button,#app .ref-modules summary,#app .ref-modules button{width:86px}#app .ref-summary{padding:18px}#app .ref-related{padding:18px 14px}#app .ref-table th:first-child{width:80px}#app .ref-table th:nth-child(2){width:100px}#app .ref-assignment{gap:10px}#app .ref-related-tabs button{padding:7px 8px;font-size:10px}}
@media(max-width:760px){#app .ref-cad{height:auto;min-height:100dvh;overflow:visible}#app .ref-tabs{position:sticky;top:0;z-index:5;padding:0 8px;gap:6px}#app .ref-new{min-width:95px;font-size:11px}#app .ref-tab{min-width:140px}#app .ref-layout{display:flex;flex-direction:column}#app .ref-rail{flex-direction:row;gap:6px;border-right:0;border-bottom:1px solid #b78c0d;padding:8px;flex-wrap:wrap}#app .ref-rail>button{width:auto;min-width:75px;min-height:42px;font-size:10px}#app .ref-modules{margin:0}#app .ref-modules summary{min-height:42px}#app .ref-main{display:block;border-right:0}#app .ref-summary{max-height:none}#app .ref-log{height:340px;padding:20px}#app .ref-related{max-height:none}#app .ref-footer{position:sticky;bottom:0;gap:10px;font-size:10px}#app .ref-facts{grid-template-columns:80px minmax(0,1fr);font-size:13px}#app .ref-times{font-size:10px}#app .ref-assignment{flex-wrap:wrap}#app [data-ref-workspace]{width:85px;font-size:10px}}

body.staff-dark #app :is(.driver-app,.driver-card,.driver-empty,.driver-shift-card,.driver-inspection,.driver-tabs,.driver-tabs button,.driver-outline,.driver-note,.driver-detail dl,.driver-detail-actions a,.driver-detail-actions button){background:#202b33;color:#eef3f5;border-color:#465761;border-radius:3px}
body.staff-dark #app :is(.driver-card h3,.driver-section-head h2,.driver-shift h2){color:#eef3f5}
body.staff-dark #app :is(.driver-card-location,.driver-muted,.driver-inspection small,.driver-detail>p){color:#b7c8d3}
