.intelligence-shell {
  --nav-bg: #202a33;
  --nav-text: #dfe7ec;
  --accent: #087f5b;
  --accent-soft: #e7f6f0;
  --ink-soft: #46535f;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
  background: #f3f5f7;
}

.global-sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  padding: 24px 16px 18px;
  background: var(--nav-bg);
  color: var(--nav-text);
}

.brand-block {
  display: grid;
  gap: 4px;
  padding: 0 10px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.brand-block p,
.brand-block strong,
.brand-block span {
  margin: 0;
  letter-spacing: 0;
}

.brand-block p {
  color: #9fb0bd;
  font-size: 11px;
  font-weight: 700;
}

.brand-block strong {
  color: #fff;
  font-size: 18px;
  line-height: 1.35;
}

.brand-block span {
  color: #b9c7d0;
  font-size: 12px;
}

.global-nav {
  display: grid;
  flex: 1 1 auto;
  gap: 4px;
  margin-top: 20px;
  min-height: 0;
  overscroll-behavior: contain;
  overflow-y: auto;
}

.nav-section-label {
  margin: 12px 12px 2px;
  color: #8299a8;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.nav-section-label:first-child { margin-top: 0; }

.nav-item {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border-left: 3px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #cbd6dd;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-item.is-active {
  border-left-color: #42c79a;
  background: rgba(66, 199, 154, 0.14);
  color: #fff;
}

.sidebar-user {
  display: grid;
  flex: 0 0 auto;
  gap: 3px;
  margin-top: auto;
  padding: 16px 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.sidebar-user strong {
  color: #fff;
  font-size: 13px;
}

.sidebar-user span {
  color: #aebcc6;
  font-size: 12px;
}

.sidebar-logout {
  min-height: 34px;
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  background: transparent;
  color: #fff;
  font-size: 12px;
}

.app-stage {
  min-width: 0;
}

.page-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  gap: 18px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.97);
}

.page-heading {
  min-width: 0;
}

.page-heading .eyebrow,
.page-heading h1 {
  margin: 0;
}

.page-heading h1 {
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: 0;
}

.menu-button {
  display: none;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
}

.intelligence-shell .permission-strip {
  min-height: 42px;
  padding: 8px 24px;
  background: #f9fafb;
}

.intelligence-shell .permission-strip > * {
  flex: 0 0 auto;
  white-space: nowrap;
}

.intelligence-shell .app-error {
  margin: 12px 24px 0;
}

.page-stack {
  padding: 24px;
}

.app-page {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
}

.page-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.page-intro h2,
.page-intro p {
  margin: 0;
}

.page-intro h2 {
  margin-top: 4px;
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: 0;
}

.page-intro p:not(.page-kicker) {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.page-kicker {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.compact-intro {
  align-items: center;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.kpi-card {
  display: grid;
  align-content: space-between;
  min-height: 126px;
  padding: 16px;
  border: 1px solid var(--border);
  border-top: 3px solid #657786;
  border-radius: 6px;
  background: #fff;
}

button.kpi-card { color: inherit; text-align: left; }
.kpi-action { cursor: pointer; }
.kpi-action:hover,
.kpi-action:focus-visible { border-color: #7395ab; box-shadow: 0 3px 10px rgb(15 45 64 / 10%); }

.kpi-card span {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.kpi-card strong {
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0;
}

.kpi-card small {
  color: var(--muted);
  font-size: 11px;
}

.kpi-card.attention { border-top-color: #1463d6; }
.kpi-card.warning { border-top-color: #d58b08; }
.kpi-card.danger { border-top-color: var(--red); }

.workflow-stage-panel {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.workflow-stage-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.workflow-stage-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: baseline;
  gap: 4px;
  min-height: 62px;
  padding: 12px;
  border-left: 4px solid #94a3b8;
  background: #f5f7f9;
}

.workflow-stage-card[data-workflow-stage="調査中"] { border-left-color: #1463d6; }
.workflow-stage-card[data-workflow-stage="承認待ち"] { border-left-color: #d58b08; }
.workflow-stage-card[data-workflow-stage="フォロー中"] { border-left-color: #6f42c1; }
.workflow-stage-card[data-workflow-stage="完了"] { border-left-color: var(--accent); }
.workflow-stage-card span { font-size: 12px; font-weight: 800; }
.workflow-stage-card strong { font-size: 24px; }
.workflow-stage-card small { color: var(--muted); font-size: 10px; }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.metric-panel,
.worklist-panel,
.intelligence-shell .list-panel,
.intelligence-shell .ops-panel,
.intelligence-shell .admin-panel,
.wizard-panel,
.detail-tab-panel {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.metric-panel {
  min-height: 250px;
  padding: 16px;
}

.metric-panel .section-heading,
.worklist-panel .section-heading {
  margin-bottom: 14px;
}

.metric-panel h3,
.worklist-panel h3,
.intelligence-shell .section-heading h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0;
}

.metric-period {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.pie-chart-layout {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  min-height: 180px;
}

.pie-chart {
  display: grid;
  width: 150px;
  height: 150px;
  place-items: center;
  border: 16px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.pie-legend { display: grid; gap: 7px; min-width: 0; }

.pie-legend-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 7px;
  font-size: 11px;
}

.pie-legend-item i { width: 9px; height: 9px; border-radius: 2px; }
.pie-legend-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pie-legend-item strong { text-align: right; }

.line-chart { min-height: 190px; }
.line-chart svg { display: block; width: 100%; height: 190px; overflow: visible; }
.line-axis { stroke: #cfd8df; stroke-width: 1; }
.line-series { fill: none; stroke: #1463d6; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.line-point { fill: #fff; stroke: #1463d6; stroke-width: 4; }
.line-label,
.line-value { fill: var(--muted); font-size: 11px; font-weight: 700; text-anchor: middle; }
.line-value { fill: var(--text); }

.bar-chart {
  display: grid;
  gap: 10px;
}

.bar-chart.is-empty,
.compact-list.is-empty {
  color: var(--muted);
  font-size: 13px;
}

.chart-row {
  display: grid;
  grid-template-columns: minmax(86px, 0.9fr) minmax(100px, 2fr) 28px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.chart-row > span {
  overflow: hidden;
  color: var(--ink-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-track {
  height: 8px;
  overflow: hidden;
  border-radius: 3px;
  background: #edf1f4;
}

.chart-track i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
}

.chart-row:nth-child(3n + 2) .chart-track i { background: #1463d6; }
.chart-row:nth-child(3n) .chart-track i { background: #d58b08; }

.column-chart {
  display: grid;
  grid-template-columns: repeat(12, minmax(28px, 1fr));
  align-items: end;
  gap: 5px;
  min-height: 180px;
}

.chart-column {
  display: grid;
  grid-template-rows: 20px 120px 22px;
  align-items: end;
  gap: 4px;
  min-width: 0;
  text-align: center;
}

.chart-column strong,
.chart-column span { font-size: 11px; }

.chart-column span {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-column > div {
  position: relative;
  height: 120px;
  border-bottom: 1px solid var(--border);
}

.chart-column i {
  position: absolute;
  right: 18%;
  bottom: 0;
  left: 18%;
  border-radius: 3px 3px 0 0;
  background: #1463d6;
}

.dashboard-lists {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.worklist-panel {
  min-height: 250px;
  padding: 16px;
}

.compact-list {
  display: grid;
  gap: 6px;
}

.worklist-item {
  display: grid;
  gap: 3px;
  width: 100%;
  min-width: 0;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: #f7f9fa;
  color: var(--text);
  text-align: left;
  white-space: normal;
}

.worklist-item:hover {
  border-color: #afc2cf;
  background: #fff;
}

.worklist-item strong,
.worklist-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.worklist-item strong { font-size: 12px; }
.worklist-item span { color: var(--muted); font-size: 11px; }
.worklist-item .worklist-number { color: var(--accent); font-weight: 800; }
.worklist-item.is-overdue { border-left: 3px solid var(--red); }

.intelligence-shell .list-panel,
.intelligence-shell .ops-panel,
.intelligence-shell .admin-panel {
  margin: 0;
  padding: 18px;
  box-shadow: none;
}

.intelligence-shell .filters {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 4px;
  background: #f6f8fa;
}

.intelligence-shell .keyword-filter { grid-column: span 2; }

.list-result-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 10px;
  color: var(--muted);
  font-size: 12px;
}

.list-result-meta strong { color: var(--text); }

.saved-filter-bar,
.notification-history-filters {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid var(--border);
  background: #fbfcfd;
}

.saved-filter-bar label,
.notification-history-filters label { min-width: 150px; }
.notification-history-filters .keyword-filter { flex: 1 1 260px; }

.attachment-drop-zone {
  display: grid;
  min-width: min(100%, 360px);
  min-height: 82px;
  place-content: center;
  gap: 4px;
  padding: 12px;
  border: 2px dashed #9aabb6;
  border-radius: 6px;
  background: #f7fafb;
  color: var(--ink-soft);
  text-align: center;
  cursor: pointer;
}

.attachment-drop-zone span { color: var(--muted); font-size: 11px; }
.attachment-drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.attachment-drop-zone.is-dragging,
.attachment-drop-zone:focus-visible { border-color: var(--accent); background: var(--accent-soft); outline: none; }

.pending-attachment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.pending-attachment {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 11px;
}

.pending-attachment img { width: 38px; height: 38px; object-fit: cover; }
.pending-attachment span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notification-type-badge { color: #244b68; font-size: 11px; font-weight: 800; }

.accident-table-wrap {
  border: 1px solid var(--border);
  border-radius: 4px;
}

.accident-table { min-width: 1380px; }

.accident-table th {
  padding: 10px 9px;
  background: #eef2f5;
  color: #46535f;
  font-size: 11px;
  white-space: nowrap;
}

.accident-table td {
  padding: 10px 9px;
  font-size: 12px;
  vertical-align: top;
}

.accident-table .record-number {
  color: #075f46;
  font-size: 11px;
  white-space: nowrap;
}

.accident-row-select,
#selectAllAccidents {
  width: 16px;
  min-width: 16px;
  min-height: 16px;
  margin: 0;
}

.detail-page-header {
  margin-bottom: 14px;
  padding: 0;
  border: 0;
}

.back-link {
  margin-bottom: 8px;
  padding: 0;
  background: transparent;
  color: #1463d6;
  font-size: 12px;
  font-weight: 700;
}

.detail-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin: 0 0 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--border);
}

.detail-summary-grid > div {
  min-width: 0;
  padding: 12px;
  background: #fff;
}

.workflow-timeline-panel {
  margin: 14px 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: 6px;
  background: #fff;
}

.workflow-timeline-heading,
.workflow-progress-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.workflow-timeline-heading h3 { margin: 2px 0 0; font-size: 17px; }

.workflow-progress-summary {
  align-items: flex-end;
  flex-direction: column;
  gap: 2px;
}

.workflow-progress-summary strong { color: var(--accent); font-size: 28px; }
.workflow-progress-summary span { color: var(--muted); font-size: 11px; font-weight: 700; }

.workflow-progress-track {
  overflow: hidden;
  height: 8px;
  margin: 12px 0 16px;
  background: #e4e9ed;
}

.workflow-progress-track i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 180ms ease;
}

.workflow-timeline {
  display: grid;
  grid-template-columns: repeat(10, minmax(112px, 1fr));
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 5px;
}

.workflow-step {
  display: grid;
  align-content: start;
  min-height: 112px;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #f7f9fa;
  color: var(--ink-soft);
  text-align: left;
}

.workflow-step:hover { border-color: #7d8b96; }
.workflow-step.is-completed { border-color: #8ed4ba; background: var(--accent-soft); color: #075f45; }
.workflow-step.is-in_progress { border-color: #e0a236; background: #fff8e8; color: #8a4d00; }
.workflow-step-number {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: #dce3e8;
  font-size: 11px;
  font-weight: 900;
}
.workflow-step.is-completed .workflow-step-number { background: var(--accent); color: #fff; }
.workflow-step.is-in_progress .workflow-step-number { background: #d58b08; color: #fff; }
.workflow-step strong { font-size: 12px; line-height: 1.35; }
.workflow-step small { font-size: 10px; font-weight: 800; }
.workflow-step em { color: var(--muted); font-size: 9px; font-style: normal; line-height: 1.35; }

.workflow-next-action {
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 4px solid #1463d6;
  background: #edf4ff;
  color: #183b67;
  font-size: 12px;
  font-weight: 800;
}

.table-progress { display: grid; min-width: 76px; gap: 4px; }
.table-progress strong { font-size: 12px; }
.table-progress > span { overflow: hidden; height: 5px; background: #dfe5e9; }
.table-progress i { display: block; height: 100%; background: var(--accent); }

.form-support { margin: 0; color: var(--muted); font-size: 11px; }

.detail-summary-grid dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.detail-summary-grid dd {
  overflow: hidden;
  margin: 5px 0 0;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.detail-tab {
  min-height: 42px;
  padding: 0 14px;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-tab.is-active {
  border-bottom-color: var(--accent);
  color: var(--text);
}

.detail-tab-panel { padding: 18px; }

.detail-tab-panel .workflow-section,
.detail-tab-panel .approval-panel,
.detail-tab-panel .attachments {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.detail-tab-panel .workflow-section + .workflow-section {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.two-column-sections {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.empty-copy {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.situation-summary {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.situation-summary strong,
.situation-summary span { font-size: 13px; line-height: 1.5; }
.situation-summary span { color: var(--muted); }

.detail-audit-list {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.detail-audit-row {
  display: grid;
  grid-template-columns: 150px 140px minmax(150px, 0.7fr) minmax(200px, 1fr);
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

.registration-page { max-width: 1050px; }

.wizard-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin: 0 0 14px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--border);
  list-style: none;
}

.wizard-progress li {
  display: flex;
  align-items: center;
  min-height: 48px;
  gap: 8px;
  padding: 0 14px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.wizard-progress li span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid #aebbc5;
  border-radius: 50%;
}

.wizard-progress li.is-current { background: var(--accent-soft); color: #075f46; }

.wizard-progress li.is-current span,
.wizard-progress li.is-complete span {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.wizard-panel { padding: 22px; }

.category-selection {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.classification-grid { margin-bottom: 14px; }
.classification-damage { margin: 0 0 14px; }
.summary-grid { margin-bottom: 18px; }

.category-option {
  display: grid;
  min-height: 108px;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
}

.category-option:hover { border-color: #8aa899; }

.category-option.is-selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  background: var(--accent-soft);
}

.category-option input { width: 18px; height: 18px; margin: 0; }
.category-option strong { font-size: 14px; }
.category-option span { color: var(--muted); font-size: 11px; line-height: 1.45; }

.wizard-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.split-actions { justify-content: space-between; }

#accidentForm {
  display: grid;
  gap: 12px;
  padding: 0;
}

.registration-footer {
  position: sticky;
  bottom: 12px;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 8px 20px rgba(20, 30, 40, 0.08);
}

.intelligence-shell .ops-panel,
.intelligence-shell .admin-panel { display: grid; gap: 16px; }

.intelligence-shell .admin-section,
.intelligence-shell .ops-section {
  margin-top: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.login-brand { display: grid; gap: 4px; }
.login-brand p,
.login-brand h1 { margin: 0; }
.login-brand > p:last-child { color: var(--muted); font-size: 13px; }

.demo-mode-banner {
  position: sticky;
  z-index: 1000;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 42px;
  padding: 8px 18px;
  border-bottom: 1px solid #7a4d00;
  background: #fff0bd;
  color: #573800;
  text-align: center;
  font-size: 12px;
}

.demo-mode-banner strong {
  padding: 3px 7px;
  border-radius: 3px;
  background: #6f4700;
  color: #fff;
  letter-spacing: 0.08em;
}

.is-demo-mode .login-view { min-height: calc(100vh - 42px); }
.is-demo-mode .intelligence-shell { min-height: calc(100vh - 42px); }

.demo-credentials {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d6b04b;
  border-radius: 6px;
  background: #fff9e8;
}

.demo-credentials > div:first-child {
  display: grid;
  gap: 2px;
}

.demo-credentials span { color: var(--muted); font-size: 11px; }
.demo-role-buttons { display: grid; gap: 6px; }

.demo-role-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid #d7c27e;
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.demo-role-button:hover,
.demo-role-button:focus-visible { border-color: #8a6500; background: #fff5d4; }

.demo-offline-map {
  display: grid;
  place-content: center;
  gap: 6px;
  min-height: 220px;
  border: 1px solid #d6b04b;
  border-radius: 6px;
  background-color: #fff9e8;
  background-image:
    linear-gradient(rgba(111, 71, 0, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(111, 71, 0, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
  color: #573800;
  text-align: center;
}

.demo-offline-map span { font-size: 12px; }

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(15, 23, 30, 0.45);
}

.read-only-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid #315f81;
  border-radius: 999px;
  background: #eaf4fb;
  color: #244f6d;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.read-only-notice {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-left: 4px solid #315f81;
  border-radius: 4px;
  background: #eef7fc;
  color: #244f6d;
  font-size: 13px;
  font-weight: 700;
}

.maintenance-filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.maintenance-vehicle-filters { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.vehicle-hub-filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.vehicle-dashboard-panel { margin: 1rem 0 1.25rem; padding: 1rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.vehicle-kpi-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.vehicle-detail-kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.source-state-note { margin: .75rem 0 0; color: var(--muted); font-size: .9rem; }
.vehicle-hub-table { min-width: 1160px; }
.vehicle-hub-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.vehicle-hub-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.vehicle-hub-tabs { overflow-x: auto; }
.maintenance-table .mapping-badge { white-space: nowrap; }
.maintenance-validation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1rem 0; }
.maintenance-dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1rem 0; }
.maintenance-gate-state {
  margin: 1rem 0;
  padding: 14px 16px;
  border: 1px solid #8ab9d4;
  border-left: 5px solid #315f81;
  border-radius: 5px;
  background: #eef7fc;
  color: #244f6d;
  font-weight: 750;
}
.maintenance-gate-state.is-stale { border-color: #e1bc58; border-left-color: #c18108; background: #fff9e7; color: #6e5505; }
.maintenance-gate-state.is-blocked { border-color: #db8d8d; border-left-color: #b52e2e; background: #fff0f0; color: #7f2020; }
.mapping-status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mapping-status-stat { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px; border: 1px solid #dce5ea; border-radius: 5px; }
.mapping-status-stat strong { font-size: 20px; }
.inspection-badge { display: inline-flex; padding: 3px 8px; border-radius: 999px; background: #edf1f4; color: #43515d; font-size: 11px; font-weight: 800; }
.inspection-due_soon { background: #fff2c9; color: #755800; }
.inspection-overdue { background: #fde3e3; color: #8a2525; }
.inspection-scheduled { background: #dff4e7; color: #17613a; }
.operational-maintenance { background: #fff2c9; color: #755800; }
.compact-definition-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem 1rem; margin: 0; }
.compact-definition-list div { min-width: 0; }
.compact-definition-list dt { color: var(--muted-color, #61707b); font-size: .78rem; }
.compact-definition-list dd { margin: .2rem 0 0; overflow-wrap: anywhere; font-weight: 650; }
.maintenance-mapping-table select, .maintenance-mapping-table input { min-width: 8rem; }
@media (max-width: 800px) {
  .maintenance-validation-grid,
  .maintenance-dashboard-grid { grid-template-columns: 1fr; }
  .vehicle-hub-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vehicle-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vehicle-detail-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.mapping-badge {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  background: #edf1f4;
  color: #43515d;
  font-size: 11px;
  font-weight: 800;
}

.mapping-candidate { background: #fff2c9; color: #755800; }
.mapping-confirmed { background: #dff4e7; color: #17613a; }
.mapping-conflict { background: #fde3e3; color: #8a2525; }
.mapping-inactive { background: #e8e8e8; color: #5a5a5a; }

.data-quality-summary,
.data-quality-list {
  padding: 12px 14px;
  border: 1px solid #e7c96f;
  border-radius: 5px;
  background: #fff9e7;
  color: #6e5505;
}

.data-quality-list ul { margin: 8px 0 0; padding-left: 20px; }
.mapping-summary { margin-top: 0; font-weight: 800; }

.pagination-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

@media (max-width: 1120px) {
  .intelligence-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-lists { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intelligence-shell .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .workflow-stage-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .intelligence-shell { display: block; }

  .global-sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-100%);
    width: min(290px, 86vw);
    transition: transform 180ms ease;
  }

  .global-sidebar.is-open { transform: translateX(0); }
  .menu-button { display: inline-flex; align-items: center; }
  .page-topbar { padding: 10px 16px; }
  .page-stack { padding: 18px 16px; }

  .intelligence-shell .permission-strip {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 8px 16px;
  }

  .dashboard-grid,
  .dashboard-lists { grid-template-columns: 1fr; }
  .pie-chart-layout { grid-template-columns: 130px minmax(0, 1fr); }
  .pie-chart { width: 130px; height: 130px; }
  .detail-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow-timeline { grid-template-columns: repeat(10, 124px); }
  .category-selection { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .demo-mode-banner { align-items: flex-start; flex-direction: column; gap: 3px; }
  .is-demo-mode .login-view { min-height: calc(100vh - 59px); }
  .demo-role-button { align-items: flex-start; flex-direction: column; gap: 2px; }
  .page-topbar { align-items: flex-start; flex-wrap: wrap; }
  .page-heading { flex: 1; }
  .page-heading .eyebrow { display: none; }
  .page-heading h1 { font-size: 17px; }
  .topbar-actions { width: 100%; }
  .topbar-actions button { flex: 1; }

  .page-intro {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .page-intro h2 { font-size: 22px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vehicle-hub-filters { grid-template-columns: 1fr; }
  .workflow-stage-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-card { min-height: 112px; }
  .kpi-card strong { font-size: 28px; }
  .dashboard-grid { gap: 10px; }
  .pie-chart-layout { grid-template-columns: 1fr; justify-items: center; }
  .pie-legend { width: 100%; }
  .column-chart { gap: 5px; }
  .chart-column { grid-template-rows: 20px 100px 22px; }
  .chart-column > div { height: 100px; }
  .intelligence-shell .filters { grid-template-columns: 1fr; }
  .intelligence-shell .keyword-filter { grid-column: auto; }
  .saved-filter-bar,
  .notification-history-filters { align-items: stretch; flex-direction: column; }
  .saved-filter-bar label,
  .notification-history-filters label { width: 100%; }
  .accident-table { display: block; width: 100%; min-width: 0; }
  .accident-table thead { display: none; }

  .accident-table tbody,
  .accident-table tr,
  .accident-table td { display: block; width: 100%; }

  .accident-table tbody {
    display: grid;
    gap: 10px;
    padding: 10px;
    background: #eef2f5;
  }

  .accident-table tr {
    height: auto;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: #fff;
  }

  .accident-table td {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 10px;
    padding: 7px 0;
    border: 0;
  }

  .accident-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
  }

  .accident-table .summary-cell { max-width: none; white-space: normal; }

  .detail-summary-grid,
  .two-column-sections,
  .category-selection { grid-template-columns: 1fr; }

  .detail-tabs {
    width: calc(100% + 28px);
    max-width: calc(100% + 28px);
    margin-right: -14px;
    margin-left: -14px;
    padding: 0 14px;
  }

  .detail-tab-panel,
  .wizard-panel,
  .intelligence-shell .list-panel,
  .intelligence-shell .ops-panel,
  .intelligence-shell .admin-panel { padding: 14px; }

  .wizard-progress li {
    justify-content: center;
    min-height: 54px;
    padding: 6px;
    text-align: center;
  }

  .wizard-progress li span { display: none; }
  .detail-audit-row { grid-template-columns: 1fr; }
  .workflow-timeline-heading { align-items: flex-start; flex-direction: column; }
  .workflow-progress-summary { align-items: flex-start; }
}

.metric-panel-wide { grid-column: 1 / -1; }

.report-button-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.report-workspace,
.email-workspace { display: grid; gap: 14px; }

.upload-progress {
  display: grid;
  gap: 7px;
  padding: 10px 12px;
  border: 1px solid #9bd7c4;
  border-radius: 5px;
  background: #eefbf6;
}

.upload-progress > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.upload-progress progress { width: 100%; accent-color: var(--accent); }

.attachment-link > span:last-child {
  display: grid;
  gap: 3px;
}

.attachment-link small { color: var(--muted); font-size: 11px; }

.global-loading {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 14px;
  border: 1px solid #b8c5cd;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(27, 39, 48, 0.18);
  background: #fff;
  color: #26343e;
}

.loading-spinner {
  width: 17px;
  height: 17px;
  border: 2px solid #cbd5dc;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: loading-spin 650ms linear infinite;
}

@keyframes loading-spin { to { transform: rotate(360deg); } }

.empty-cell { padding: 24px !important; color: var(--muted); text-align: center; }

@media (max-width: 620px) {
  .metric-panel-wide { grid-column: auto; }
  .report-button-grid { grid-template-columns: 1fr; }
  .detail-actions { width: 100%; flex-wrap: wrap; }
  .detail-actions button { flex: 1 1 140px; }
  .global-loading { right: 12px; bottom: 12px; }
}
