/* Dark theme override sheet.
   This file is preloaded and only enabled when dark mode is active.
   Keeping the rules unprefixed avoids expensive ancestor-selector
   invalidation across dense roster and operations views. */

:root{
  --bg:#0d171b;
  --bg-2:#101d22;
  --surface:#17262b;
  --surface-dark:#091217;
  --accent:#d9e76b;
  --text:#edf4f5;
  --muted:#a8b5b8;
  --muted-2:#839398;
  --border:rgba(232,244,245,.14);
  --border-2:rgba(232,244,245,.27);
  --success:#91c2aa;
  --warning:#dfb56f;
  --critical:#df8b86;
  --info:#94b8c5;
  --shadow:0 22px 58px rgba(0,0,0,.38);
  background:var(--bg);
}

body{background:var(--bg);color:var(--text)}
body:before{
  opacity:.10;
  background-image:radial-gradient(rgba(224,239,241,.38) .45px,transparent .45px);
}
button{color:var(--text)}
input,select,textarea{color:var(--text)}
input::placeholder,textarea::placeholder{color:#718287;opacity:1}
select option{background:#101d22;color:var(--text)}
input[type="date"]::-webkit-calendar-picker-indicator{filter:invert(1);opacity:.75}

/* Avoid expensive compositing layers in the dark theme. */
.rail,.topbar,.employee-bottom,.drawer-backdrop,.search-overlay{backdrop-filter:none;-webkit-backdrop-filter:none}

.app-shell.zenith-shell,
.zenith-header,
.zenith-nav,
.zenith-home,
.zenith-detail,
.page,
.employee-shell,
.sm-auth-shell{background:var(--bg)}

.micro-label,
.zenith-nav-item,
.zenith-nav-item span,
.system-tile-index,
.system-tile-meta,
.tile-state,
.back-link,
.panel-title,
.section-meta,
.structure-card .section-index,
.segmented button,
.tab,
.employee-nav,
.search-result .eyebrow{color:var(--muted)}

.header-line,
.designation-title,
.page-title,
.department-name,
.designation-row strong,
.staff-card strong,
.structure-card h3,
.profile-card strong,
.info-block strong{color:var(--text)}

.header-counter{background:var(--text);color:var(--bg)}
.zenith-nav-item:hover,
.zenith-nav-item.active,
.system-tile:hover{background:rgba(255,255,255,.055)}
.system-tile.attention,
.system-tile.critical{background:rgba(255,255,255,.04)}
.zenith-nav-item.active:after{background:var(--text)}

.page-intro,
.library-feature p,
.department-feature p,
.designation-row p,
.staff-card .role,
.activity-item p,
.structure-card p,
.profile-card p,
.cell-muted,
.sm-auth-panel>p,
.sm-auth-system>small{color:var(--muted)}
.designation-row .row-no{color:var(--muted-2)}

.library-feature,
.department-feature,
.duty-card{background:rgba(255,255,255,.025)}
.library-feature:hover{background:rgba(255,255,255,.055)}
.library-feature{border-color:rgba(106,204,230,.42)}
.library-feature:after{background:linear-gradient(90deg,#6edcff 0%,transparent 38%,#d9e76b 100%)}
.library-icon,
.department-status-mark,
.profile-avatar{background:var(--text);color:var(--bg)}

.panel,
.roster-wrap,
.request-list,
.notice-list,
.audit-list,
.qualification-list,
.structure-card,
.profile-card,
.info-block{background:transparent}

.field-control,
.form-field input,
.form-field select,
.form-field textarea,
.sm-auth-panel input{background:rgba(255,255,255,.045);color:var(--text);border-color:var(--border-2)}
.segmented button.active{background:var(--text);color:var(--bg)}
.request-row:hover,
.notice-row:hover,
.data-row:hover,
.structure-card.interactive:hover,
.relief-candidate:hover{background:rgba(255,255,255,.045)}
.staff-card.reassigned{background:rgba(217,231,107,.045)}
.coverage-row.short,
.staff-card.absent{background:rgba(223,139,134,.055)}
.roster-cell.selected{background:rgba(255,255,255,.075);box-shadow:inset 0 0 0 1px var(--text)}

.data-head,
.shift-code.off,
.ops-readout span,
.dept-activity>div>span,
.dept-activity>div>small,
.relief-candidate div>span,
.source-impact span,
.validation-strip .system-label,
.validation-items span,
.roster-history>div span,
.roster-history>div small,
.roster-history>p,
.notice-summary span,
.empty-state{color:var(--muted)}

.roster-name,
.roster-date{background:#101d22}
.roster-date strong,
.tab.active{color:var(--text)}
.role-badge,.pill{color:#c4d0d3}
.form-field input,.form-field select,.form-field textarea{background:#111f24}
.drawer{background:#111f24;color:var(--text);border-color:var(--border-2)}
.search-box{background:#111f24;color:var(--text);border-color:var(--border-2)}
.search-input{color:var(--text);border-color:var(--border-2)}

.primary-button{background:var(--text);border-color:var(--text);color:var(--bg)}
.primary-button:hover{background:#d6e1e3;border-color:#d6e1e3;color:#0d171b}
.small-button,
.secondary-button,
.ghost-button,
.command-button{color:var(--text);border-color:var(--border-2)}
.small-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.command-button:hover{background:rgba(255,255,255,.055);border-color:var(--text)}

.drawer-backdrop{background:rgba(0,0,0,.58)}
.search-overlay{background:rgba(0,0,0,.58)}
.search-result:hover{background:rgba(255,255,255,.05)}
.toast{background:#14242a;color:var(--text);border-color:var(--border-2)}
.system-error{background:#14242a;color:var(--text);box-shadow:0 18px 50px rgba(0,0,0,.4)}
.system-error p{color:var(--muted)}
.system-error button{background:var(--text);color:var(--bg)}
.sm-auth-message{background:rgba(255,255,255,.045);color:var(--muted)}
.sm-auth-panel form button{background:var(--text);color:var(--bg);border-color:var(--text)}
.sm-auth-link{color:var(--text)}
.sm-auth-system:before{opacity:.38}

.employee-bottom{background:#0d171b;border-color:var(--border-2)}
.employee-nav{color:var(--muted)}
.employee-nav.active{color:var(--text)}
.request-fab{background:var(--text);color:var(--bg)}
