/* Erragal - Reusable components */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.4;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn:hover {
  text-decoration: none;
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.btn--primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  color: #fff;
}

.btn--secondary {
  background: var(--color-surface-elevated);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn--secondary:hover {
  background: var(--color-border);
  color: var(--color-text);
}

.btn--danger {
  background: var(--color-danger);
  color: #fff;
  border-color: var(--color-danger);
}

.btn--danger:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

.btn--sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn--block {
  width: 100%;
}

/* Cards */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.card__header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  font-weight: 600;
  font-size: 1rem;
}

.card__body {
  padding: 1.25rem;
}

/* Login card (standalone page) */
.login-card .card__body {
  padding: 1.5rem;
}

.login-card__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.login-card__subtitle {
  margin: 0.25rem 0 1.25rem;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

.login-form .form-group {
  margin-bottom: 1rem;
}

.login-form .form-actions {
  margin-top: 1.25rem;
}

.login-form__footer {
  margin-top: 1rem;
  font-size: 0.9375rem;
}

.login-form__link {
  color: var(--color-primary);
  text-decoration: none;
}

.login-form__link:hover {
  text-decoration: underline;
}

/* Stats / dashboard cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.stat-card__value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.stat-card__label {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.table th,
.table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.table th {
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover {
  background: var(--color-surface-elevated);
}

.table .actions {
  white-space: nowrap;
}

.table .actions a + a {
  margin-left: 0.5rem;
}

/* Incident list: row opens detail, title is primary link */
.incident-list-row__title {
  color: var(--color-text);
  font-weight: 500;
  text-decoration: none;
}
.incident-list-row__title:hover {
  color: var(--color-primary);
  text-decoration: underline;
}
.incident-list-row__actions {
  cursor: default;
}
.incident-list-row__actions a {
  cursor: pointer;
}

/* Badges / status */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge--open { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.badge--acknowledged { background: rgba(234, 179, 8, 0.2); color: #facc15; }
.badge--resolved { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.badge--closed { background: rgba(139, 156, 179, 0.2); color: var(--color-text-muted); }
.badge--merged { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }

.badge--low { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.badge--medium { background: rgba(234, 179, 8, 0.2); color: #facc15; }
.badge--high { background: rgba(249, 115, 22, 0.2); color: #fb923c; }
.badge--critical { background: rgba(239, 68, 68, 0.2); color: #f87171; }

/* SLA list indicator (no theme change) */
/* Small SLA indicator in incident list */
.sla-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-md, 4px);
}
.sla-indicator--on-track { color: #166534; background: rgba(34, 197, 94, 0.15); }
.sla-indicator--due-soon { color: #a16207; background: rgba(234, 179, 8, 0.15); }
.sla-indicator--breached { color: #b91c1c; background: rgba(239, 68, 68, 0.15); }
.sla-indicator--none { color: var(--color-text-muted); background: transparent; }

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 0.375rem;
}

.form-group .help {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

.form-control {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.form-control:hover {
  border-color: var(--color-text-muted);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
  background: var(--color-surface-elevated);
}

.form-control::placeholder {
  color: var(--color-text-muted);
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

/* Modern select / dropdown – dark theme, no light grey popup */
select.form-control {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding: 0.625rem 2.5rem 0.625rem 0.875rem;
  min-height: 2.75rem;
  background-color: var(--color-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b9cb3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  color: var(--color-text);
  color-scheme: dark;
}

select.form-control:hover {
  border-color: var(--color-text-muted);
  background-color: var(--color-surface-elevated);
}

select.form-control:focus {
  background-color: var(--color-surface-elevated);
}

/* Force dark dropdown list in supporting browsers */
select.form-control option {
  background: var(--color-surface-elevated);
  color: var(--color-text);
  padding: 0.5rem;
}

/* Custom dropdown – dark blue list (replaces native light grey list) */
.custom-select-wrap {
  position: relative;
  width: 100%;
}

.custom-select-wrap select.form-control.custom-select-native {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
  min-height: 2.75rem;
  border: none;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.625rem 2.5rem 0.625rem 0.875rem;
  min-height: 2.75rem;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b9cb3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.custom-select-trigger:hover {
  border-color: var(--color-text-muted);
  background-color: var(--color-surface-elevated);
}

.custom-select-wrap.is-open .custom-select-trigger {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
  background-color: var(--color-surface-elevated);
}

.custom-select-trigger__text {
  color: var(--color-text);
}

.custom-select-trigger__text--placeholder {
  color: var(--color-text-muted);
}

/* Dropdown list – dark blue */
.custom-select-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 100;
  max-height: 280px;
  overflow-y: auto;
  background: #1a2332;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: none;
}

.custom-select-wrap.is-open .custom-select-dropdown {
  display: block;
}

.custom-select-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.875rem;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--color-text);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.1s;
}

.custom-select-option:hover {
  background: #243044;
}

.custom-select-option.is-selected {
  background: #1e2a3a;
  color: var(--color-text);
}

.custom-select-option.is-selected::before {
  content: "✓";
  font-size: 0.875rem;
  color: var(--color-primary);
  flex-shrink: 0;
}

/* Toggle switch (replaces checkbox) */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
  user-select: none;
}

.toggle__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.toggle__track {
  position: relative;
  width: 2.75rem;
  height: 1.5rem;
  flex-shrink: 0;
  background: var(--color-border);
  border-radius: 9999px;
  transition: background 0.2s ease;
}

.toggle__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.25rem;
  height: 1.25rem;
  background: var(--color-text);
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.toggle__input:focus + .toggle__track {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.toggle__input:checked + .toggle__track {
  background: var(--color-primary);
}

.toggle__input:checked + .toggle__track::after {
  transform: translateX(1.25rem);
}

.toggle__label {
  flex: 1;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* Page header with title + back/action link (shared by rules, team, credentials) */
.rules-header {
  margin-bottom: 1.5rem;
}

.rules-header__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.rules-header__top .page-title {
  margin: 0 0 0.25rem;
}

.rules-header__top .page-subtitle {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

/* Page header when used above content (e.g. Add team member) – more breathing room */
.rules-header--page {
  margin-bottom: 2rem;
}

/* Team card: header inside card with generous padding */
.team-card .rules-header {
  padding: 1.75rem 1.5rem 1.25rem;
  margin-bottom: 0;
}

.team-card .card__body {
  padding: 0 1.5rem 1.5rem;
  border-top: 1px solid var(--color-border);
}

/* Modern member list (replaces table) */
.member-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.member-list__item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border);
  transition: background 0.15s ease;
  margin: 0 -1.5rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.member-list__item:last-child {
  border-bottom: none;
}

.member-list__item:hover {
  background: var(--color-surface-elevated);
}

.member-list__avatar {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

.member-list__info {
  flex: 1;
  min-width: 0;
}

.member-list__name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-text);
  margin: 0 0 0.125rem;
}

.member-list__email {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin: 0;
}

.member-list__contact {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin: 0.125rem 0 0;
}

.member-list__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.member-list__joined {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.member-list__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.member-list__actions form {
  display: inline;
  margin: 0;
}

.badge--status {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(139, 156, 179, 0.2);
  color: var(--color-text-muted);
}

.team-card .empty-state {
  padding: 2.5rem 1.5rem;
}

/* Credentials page (post user create) – theme-safe so text is visible on dark */
.credentials-warning {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--color-text);
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.35);
  border-radius: var(--radius-sm);
}

.credentials-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.credentials-value {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
  font-family: var(--font-mono), monospace;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.form-errors {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  color: var(--color-danger);
  font-size: 0.875rem;
}

.form-errors li {
  margin-bottom: 0.25rem;
}

.field-error {
  font-size: 0.8125rem;
  color: var(--color-danger);
  margin-top: 0.25rem;
}

/* Layout helpers */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--color-text-muted);
}

.empty-state__title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 0.5rem;
}

.empty-state__text {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
}

/* Detail layout */
.detail-grid {
  display: grid;
  gap: 1.5rem;
}

.detail-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.detail-section__title {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  font-weight: 600;
  font-size: 1rem;
  margin: 0;
}

.detail-section__body {
  padding: 1.25rem;
}

.detail-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9375rem;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row__label {
  color: var(--color-text-muted);
}

.detail-row__value {
  color: var(--color-text);
}

/* Incident detail – two columns (details left, timeline right) */
.incident-detail__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

.incident-detail__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.incident-detail__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-icon {
  font-size: 0.75rem;
  font-weight: 600;
}

.incident-detail__layout {
  display: grid;
  grid-template-columns: 1fr minmax(340px, 400px);
  gap: 3rem;
  align-items: start;
  margin-top: 0.5rem;
}

@media (max-width: 960px) {
  .incident-detail__layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

.incident-detail__main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.incident-detail__cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.incident-detail__card {
  margin-bottom: 0;
}

.incident-detail__card .card__body {
  padding: 1.25rem 1.5rem;
}

.incident-detail__card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

.incident-detail__card-icon {
  flex-shrink: 0;
  color: var(--color-text-muted);
}

.incident-detail__vendor-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.incident-detail__ownership,
.incident-detail__recommended,
.incident-detail__driver-contact,
.incident-detail__evidence,
.incident-detail__notes {
  margin-top: 0;
}

.incident-detail__evidence .detail-section__body,
.incident-detail__notes .detail-section__body {
  padding: 1.25rem 1.5rem;
}

.incident-detail__evidence-list,
.incident-detail__notes-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.incident-detail__evidence-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9375rem;
}

.incident-detail__evidence-item:last-child {
  border-bottom: none;
}

.incident-detail__evidence-time {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.incident-detail__note-form {
  margin-bottom: 1rem;
}

.incident-detail__note-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}

.incident-detail__note-item:last-child {
  border-bottom: none;
}

.incident-detail__note-meta {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
}

.incident-detail__note-text {
  font-size: 0.9375rem;
}

/* Incident timeline (right column) – connected vertical spine, dots on left */
.incident-detail__timeline-wrap {
  position: sticky;
  top: 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-width: 0;
  --color-timeline-alert-a: #60a5fa;
  --color-timeline-alert-b: #818cf8;
  --color-timeline-ack: #f59e0b;
  --color-timeline-resolve: #22c55e;
  --color-timeline-breach: #ef4444;
}

.incident-detail__timeline-title {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0;
}

/* One continuous vertical spine on the left; dots sit on it, content to the right */
.incident-timeline--spine {
  position: relative;
  padding: 1.5rem 1.5rem 2rem 0;
  padding-left: 1.5rem;
  max-height: 70vh;
  overflow-y: auto;
}

.incident-timeline__spine {
  position: absolute;
  left: 11px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-border, #d1d5db);
  border-radius: 1px;
  pointer-events: none;
}

/* Phase: subtle label + tick on spine, not dominant */
.incident-timeline__phase {
  position: relative;
  margin-bottom: 1.75rem;
}

.incident-timeline__phase:first-child .incident-timeline__phase-head {
  margin-top: 0;
}

.incident-timeline__phase:last-child {
  margin-bottom: 0;
}

.incident-timeline__phase-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  padding-left: 2rem;
}

.incident-timeline__phase-tick {
  position: absolute;
  left: 6px;
  width: 10px;
  height: 1px;
  background: var(--color-border, #d1d5db);
  border-radius: 0;
}

.incident-timeline__phase-label {
  font-size: 0.625rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  opacity: 0.85;
}

/* Event: dot on spine + content block (message first, meta secondary) */
.incident-timeline__event {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding-left: 2rem;
  padding-bottom: 1.25rem;
  position: relative;
  min-height: 2.5rem;
}

.incident-timeline__event::after {
  content: "";
  position: absolute;
  left: 11px;
  top: calc(0.4rem + 10px);
  width: 2px;
  height: calc(100% - 0.4rem - 10px);
  background: rgba(148, 163, 184, 0.35);
  border-radius: 1px;
}

.incident-timeline__event:last-child {
  padding-bottom: 0;
}

.incident-timeline__event:last-child::after {
  height: 0;
}

.incident-timeline__event:hover .incident-timeline__message {
  color: var(--color-text);
}

.incident-timeline__block {
  flex: 1;
  min-width: 0;
  padding-top: 0;
}

/* Main content: the actual information (message) is what you read first */
.incident-timeline__message {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-text);
  margin: 0 0 0.35rem;
  font-weight: 400;
}

.incident-timeline__message-detail {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  font-weight: 400;
  margin-top: 0.2rem;
}

.incident-timeline__event--breach .incident-timeline__message-detail {
  color: var(--color-timeline-breach, #ef4444);
}

.incident-timeline__event--empty .incident-timeline__message {
  font-style: italic;
  color: var(--color-text-muted);
}

.incident-timeline__event--empty:hover .incident-timeline__message {
  color: var(--color-timeline-alert, #ea580c);
}

/* Meta line: type + time, small and muted so they don’t overshadow */
.incident-timeline__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.incident-timeline__type {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.incident-timeline__time {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

/* Dot on left spine: line connects each dot */
.incident-timeline__dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  position: absolute;
  left: 7px;
  top: 0.4rem;
  z-index: 1;
  box-sizing: border-box;
}

.incident-timeline__dot--filled {
  background: #60a5fa;
  border: 2px solid rgba(15, 20, 25, 0.8);
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.6), 0 0 10px rgba(59, 130, 246, 0.65);
}

.incident-timeline__dot--hollow {
  background: rgba(15, 20, 25, 0.75);
  border: 2px solid rgba(96, 165, 250, 0.65);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.45);
}

.incident-timeline__dot--alert,
.incident-timeline__dot--breach {
  background: var(--color-timeline-breach, #ef4444);
  border: 2px solid rgba(15, 20, 25, 0.85);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.7), 0 0 12px rgba(239, 68, 68, 0.7);
}

.incident-timeline__dot--alert-a {
  background: var(--color-timeline-alert-a);
  border: 2px solid rgba(15, 20, 25, 0.8);
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.6), 0 0 10px rgba(59, 130, 246, 0.65);
}

.incident-timeline__dot--alert-b {
  background: var(--color-timeline-alert-b);
  border: 2px solid rgba(15, 20, 25, 0.8);
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.6), 0 0 10px rgba(99, 102, 241, 0.65);
}

.incident-timeline__dot--action-acknowledged {
  background: var(--color-timeline-ack);
  border: 2px solid rgba(15, 20, 25, 0.85);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.6), 0 0 10px rgba(245, 158, 11, 0.6);
}

.incident-timeline__dot--action-resolved,
.incident-timeline__dot--action-closed {
  background: var(--color-timeline-resolve);
  border: 2px solid rgba(15, 20, 25, 0.85);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.6), 0 0 10px rgba(34, 197, 94, 0.6);
}

/* --- Command-oriented incident detail --- */
.page-back {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.9375rem;
  color: var(--color-primary);
  text-decoration: none;
}

.incident-command-header {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.incident-command-header__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.incident-command-header__meta {
  flex: 1;
  min-width: 0;
}

.incident-command-header__title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.incident-command-header__id {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin: 0 0 0.5rem;
}

.incident-command-header__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.incident-command-header__quiet-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.4rem 0 0.75rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-md);
  background: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.35);
  font-size: 0.875rem;
}

.incident-command-header__recovery-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 0.75rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-md);
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-size: 0.875rem;
}

.incident-command-header__recovery-banner strong {
  font-weight: 600;
  color: #10b981;
}

.incident-command-header__vehicle,
.incident-command-header__time {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0.15rem 0;
}

.incident-command-header__created {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  opacity: 0.85;
  margin: 0.25rem 0 0;
}

.incident-command-header__sla {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
}

.incident-command-header__sla-item--breached {
  color: var(--color-danger, #dc2626);
  font-weight: 600;
}

.incident-command-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.incident-command-header__action-form {
  display: inline-block;
}

.incident-command-header__sub {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
}

@media (max-width: 640px) {
  .incident-command-header__sub {
    grid-template-columns: 1fr;
  }
}

.incident-command-header__know strong,
.incident-command-header__next strong {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
}

.incident-command-header__know p,
.incident-command-header__next p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.gps-summary {
  margin-top: 0.5rem;
}

.gps-summary__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-right: 0.5rem;
}

.gps-summary__chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  vertical-align: middle;
}

.gps-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  font-size: 0.82rem;
  line-height: 1.2;
}

.gps-chip__label {
  color: var(--color-text-muted);
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.gps-chip__value {
  color: var(--color-text);
}

.gps-summary__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.5rem;
}

.gps-kv {
  padding: 0.6rem 0.75rem;
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.gps-kv__label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 0.2rem;
}

.gps-kv__value {
  font-size: 0.88rem;
  color: var(--color-text);
  line-height: 1.35;
}

.driving-behavior-section__subtitle {
  margin: -0.2rem 0 0.65rem;
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.driving-behavior-card {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(36, 48, 68, 0.6), rgba(15, 23, 42, 0.55));
  border: 1px solid rgba(148, 163, 184, 0.22);
  position: relative;
  overflow: hidden;
}

.driving-behavior-card__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  gap: 0.75rem;
}

.driving-behavior-card__title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.driving-behavior-card__title::before {
  content: "▣";
  color: var(--color-primary);
  font-size: 0.9rem;
}

.driving-behavior-card__duration {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.driving-behavior-card__pattern {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.driving-behavior-card__pattern-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.driving-behavior-card__pattern-pill {
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid rgba(59, 130, 246, 0.35);
  font-size: 0.8rem;
  color: var(--color-text);
}

.driving-behavior-card__list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.6rem;
  display: grid;
  gap: 0.35rem;
}

.driving-behavior-card__item {
  position: relative;
  padding-left: 1rem;
  font-size: 0.92rem;
  color: var(--color-text);
  line-height: 1.4;
}

.driving-behavior-card__item::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--color-primary);
}

.driving-behavior-card__metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.5rem;
}

.driving-behavior-card__metric {
  padding: 0.45rem 0.6rem;
  border-radius: 0.6rem;
  background: rgba(15, 20, 25, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.driving-behavior-card__metric-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 0.2rem;
}

.driving-behavior-card__metric-value {
  font-size: 0.9rem;
  color: var(--color-text);
}

.driving-behavior-card__chart {
  margin-top: 0.9rem;
}

.driving-behavior-card__chart-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 0.35rem;
}

.driving-behavior-chart {
  width: 100%;
  height: 120px;
  padding: 0.35rem 0.4rem;
  border-radius: 0.75rem;
  background: rgba(15, 20, 25, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.driving-behavior-chart__canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.incident-command-header__resolution,
.incident-command-header__closed-by {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0.5rem 0 0;
}

.incident-response-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.incident-response-panel--warning {
  border-color: var(--color-warning, #eab308);
  background: rgba(234, 179, 8, 0.06);
}

.incident-response-panel__title {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
  margin: 0 0 1rem;
}

.incident-response-panel__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.incident-response-panel__item {
  min-width: 0;
}

.incident-response-panel__label {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-bottom: 0.2rem;
}

.incident-response-panel__value {
  font-size: 0.9375rem;
  font-weight: 500;
}

.incident-response-panel__value--empty {
  color: var(--color-text-muted);
  font-style: italic;
}

.incident-response-panel__value--danger {
  color: var(--color-danger, #dc2626);
}

.incident-response-panel__value--success {
  color: var(--color-success, #16a34a);
}

.incident-response-panel__value--breached {
  color: var(--color-danger, #dc2626);
}

.incident-response-panel__meta {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.2rem;
}

.incident-response-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.incident-detail__layout {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 35%);
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .incident-detail__layout {
    grid-template-columns: 1fr;
  }
}

.incident-detail__context {
  min-width: 0;
}

.incident-detail__context-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

/* Incident Case File — authoritative, scannable */
.incident-case-file {
  min-width: 0;
}

.incident-case-file__title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 1.25rem;
  letter-spacing: 0.02em;
}

/* 1. Incident Facts — compact, quiet, 2-col grid */
.case-file-facts {
  margin-bottom: 1.5rem;
}

.case-file-facts__heading {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin: 0 0 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--color-border);
}

.case-file-facts__grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 1.25rem;
  align-items: baseline;
  font-size: 0.875rem;
  line-height: 1.45;
}

.case-file-facts__label {
  color: var(--color-text-muted);
  font-weight: 500;
}

.case-file-facts__value {
  color: var(--color-text);
}

/* 2. Evidence Collected — primary focus, most prominent */
.case-file-evidence {
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.case-file-evidence__heading {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--color-text);
}

.case-file-evidence__subheading {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text);
  margin: 0 0 0.5rem;
}

.case-file-evidence__subheading--muted {
  font-weight: 500;
  color: var(--color-text-muted);
  margin-top: 1rem;
}

.case-file-evidence__subheading--muted:first-of-type {
  margin-top: 0;
}

.case-file-evidence__alert-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.case-file-evidence__alert-scroll {
  max-height: 220px;
  overflow-y: auto;
  padding: 0.25rem 0.5rem;
  margin: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(15, 20, 25, 0.35);
}

.case-file-evidence__alert-scroll .case-file-evidence__alert-list {
  padding: 0;
  margin: 0;
}

.case-file-evidence__alert-item {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.9375rem;
  padding: 0.35rem 0;
  line-height: 1.4;
}

.case-file-evidence__alert-bullet {
  color: var(--color-primary);
  flex-shrink: 0;
}

.case-file-evidence__alert-label {
  flex: 1;
  font-weight: 500;
}

.case-file-evidence__alert-time {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.case-file-evidence__secondary {
  margin-top: 0.75rem;
}

.case-file-evidence__muted {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.45;
}

/* 3. Incident Interpretation — high emphasis */
.case-file-interpretation {
  margin-bottom: 1.5rem;
}

.case-file-interpretation__heading {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 0.5rem;
}

.case-file-interpretation__body {
  font-size: 0.9375rem;
  line-height: 1.55;
  white-space: pre-wrap;
  margin-bottom: 0.75rem;
}

.case-file-interpretation__empty {
  padding: 1rem 1.25rem;
  background: rgba(234, 179, 8, 0.08);
  border: 1px solid rgba(234, 179, 8, 0.35);
  border-radius: var(--radius-md);
}

.case-file-interpretation__warn-icon {
  font-size: 1.125rem;
  margin-right: 0.35rem;
}

.case-file-interpretation__warn-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 0.35rem;
}

.case-file-interpretation__warn-text {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.45;
  margin: 0 0 1rem;
}

.case-file-interpretation__empty .btn {
  margin-top: 0;
}

.incident-case-file__notes {
  margin-bottom: 0;
}

.incident-context-block {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.incident-context-block:last-child {
  border-bottom: none;
}

.incident-context-block__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin: 0 0 0.5rem;
}

.incident-context-block__sub {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
  margin: 0.75rem 0 0.25rem;
}

.incident-context-block__meta {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin: 0.25rem 0 0;
}

.incident-outcome {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.incident-outcome__title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

.incident-outcome__body {
  font-size: 0.9375rem;
  line-height: 1.5;
}

.incident-outcome__summary {
  white-space: pre-wrap;
  margin-bottom: 0.75rem;
}

.incident-outcome__line {
  margin: 0.25rem 0;
}

.incident-outcome__closed {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0.75rem 0 0;
}

.required {
  color: var(--color-danger, #dc2626);
}

.incident-detail__time-since {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin: 0.25rem 0 0;
}

.incident-detail__resolution-outcome,
.incident-detail__closed-by {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0.25rem 0 0;
}

.incident-detail__summary-text {
  white-space: pre-wrap;
  margin: 0 0 0.75rem;
}

.incident-detail__system-recommendation {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.incident-detail__outcome-line {
  font-weight: 500;
  margin: 0 0 0.35rem;
}

.incident-detail__outcome-closed {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0;
}

.incident-detail__driver-outcome {
  font-weight: 500;
}

.incident-detail__driver-outcome--success {
  color: var(--color-success, #16a34a);
}

.incident-detail__driver-outcome--no_response {
  color: var(--color-danger, #dc2626);
}

.incident-detail__driver-outcome--none {
  color: var(--color-text-muted);
}

.btn--small {
  font-size: 0.8125rem;
  padding: 0.35rem 0.75rem;
}

.incident-detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-left: auto;
}

.incident-detail__action-form {
  display: inline-block;
}

.incident-detail__ownership .detail-section__body,
.incident-detail__recommended .detail-section__body,
.incident-detail__driver-contact .detail-section__body {
  padding: 1.25rem 1.5rem;
}

.incident-detail__recommended-list {
  list-style: disc;
  padding-left: 1.25rem;
  margin: 0 0 0.5rem;
}

.incident-detail__recommended-list li {
  margin-bottom: 0.35rem;
  font-size: 0.9375rem;
}

.incident-detail__evidence-subtitle {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem;
}

.incident-detail__evidence-subtitle:first-child {
  margin-top: 0;
}

.incident-detail__evidence-meta {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  display: block;
  margin-top: 0.2rem;
}

/* Incident modals (Assign, Log Call) */
.incident-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.incident-modal[hidden] {
  display: none;
}

.incident-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.incident-modal__panel {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  min-width: 280px;
  max-width: 420px;
  width: 100%;
}

.incident-modal__title {
  margin: 0 0 1rem;
  font-size: 1.125rem;
  font-weight: 600;
}

.incident-modal__actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  justify-content: flex-end;
}

/* —— Manual incident creation (guided, report-style, modern) —— */
.manual-report-header .page-title {
  font-size: 1.625rem;
  font-weight: 600;
  margin: 0 0 0.375rem;
  letter-spacing: -0.02em;
}
.manual-report-subtitle {
  color: var(--color-text-muted);
  font-size: 1rem;
  line-height: 1.5;
  margin: 0;
  max-width: 42rem;
}

/* Edit page: origin (manual vs system) */
.incident-edit-origin {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0.5rem 0 0;
  max-width: 42rem;
}
.incident-edit-origin--manual {
  color: var(--color-primary);
}
.incident-edit-origin--system {
  color: var(--color-text-muted);
}
.manual-report {
  max-width: 44rem;
  margin-top: 2rem;
}
.manual-report-form {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}
.manual-report-form-errors {
  padding: 1rem 1.25rem;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: var(--radius-lg);
  list-style: none;
  margin: 0 0 1.5rem;
}
.manual-report-section {
  padding: 0;
  margin: 0;
}
.manual-report-section__head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}
.manual-report-section__head--context {
  margin-bottom: 0;
}
.manual-report-section__head--context .manual-report-collapse-trigger {
  flex: 1;
}
.manual-report-step {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  line-height: 1;
}
.manual-report-step--primary {
  color: var(--color-primary);
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.3);
}
.manual-report-step--muted {
  font-weight: 500;
  color: var(--color-text-muted);
  background: transparent;
}
.manual-report-section__title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  color: var(--color-text);
}
.manual-report-section__optional {
  font-weight: 400;
  color: var(--color-text-muted);
}
.manual-report-section__lead {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.5;
}
/* 1. Reason – radio cards, 2-col on larger screens */
.manual-report-radios {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.625rem;
}
@media (min-width: 480px) {
  .manual-report-radios {
    grid-template-columns: repeat(2, 1fr);
  }
}
.manual-report-radio-card {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.manual-report-radio-card:hover {
  border-color: var(--color-text-muted);
  background: var(--color-surface-elevated);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.manual-report-radio-card__input {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--color-primary);
}
.manual-report-radio-card__input:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.manual-report-radio-card:has(.manual-report-radio-card__input:checked) {
  border-color: var(--color-primary);
  background: rgba(59, 130, 246, 0.08);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2);
}
.manual-report-radio-card__label {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
}
/* 2. Narrative – primary, prominent card */
.manual-report-section--narrative {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
}
.manual-report-section--narrative .manual-report-section__title {
  font-size: 1.25rem;
}
.manual-report-section--narrative .form-group {
  margin-bottom: 1.25rem;
}
.manual-report-section--narrative .form-group:last-of-type {
  margin-bottom: 0;
}
.manual-report-section--narrative .form-control {
  border-radius: 10px;
  padding: 0.625rem 0.875rem;
}
.manual-report-section--narrative textarea.form-control {
  min-height: 120px;
}
/* 3. Severity with context – modern cards */
.manual-report-severity-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
@media (min-width: 420px) {
  .manual-report-severity-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
.manual-report-severity-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.manual-report-severity-card:hover {
  border-color: var(--color-text-muted);
  background: var(--color-surface-elevated);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.manual-report-severity-card__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.manual-report-severity-card:has(.manual-report-severity-card__input:focus-visible) {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.manual-report-severity-card:has(.manual-report-severity-card__input:checked) {
  border-color: var(--color-primary);
  background: rgba(59, 130, 246, 0.08);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2);
}
.manual-report-severity-card__label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
}
.manual-report-severity-card__desc {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.35;
}
.manual-report-severity-card--critical:has(.manual-report-severity-card__input:checked) {
  border-color: #dc2626;
  background: rgba(220, 38, 38, 0.1);
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.2);
}
.manual-report-severity-card--high:has(.manual-report-severity-card__input:checked) {
  border-color: #ea580c;
  background: rgba(234, 88, 12, 0.1);
  box-shadow: 0 0 0 1px rgba(234, 88, 12, 0.2);
}
/* 4. Context – collapsible */
.manual-report-section--context {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.manual-report-collapse-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 0.9375rem;
  font-family: inherit;
  text-align: left;
  color: var(--color-text);
  background: var(--color-surface);
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
}
.manual-report-collapse-trigger:hover {
  background: var(--color-surface-elevated);
}
.manual-report-collapse-trigger:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}
.manual-report-collapse-trigger__title {
  font-weight: 600;
}
.manual-report-collapse-trigger__hint {
  color: var(--color-text-muted);
  font-weight: 400;
}
.manual-report-collapse-trigger__icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238b9cb3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat center;
  transition: transform 0.25s ease;
}
.manual-report-collapse-trigger.is-open .manual-report-collapse-trigger__icon {
  transform: rotate(180deg);
}
.manual-report-collapse-panel {
  border-top: 1px solid var(--color-border);
}
.manual-report-collapse-panel__inner {
  padding: 1.25rem 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.manual-report-collapse-panel__inner .form-control {
  border-radius: 10px;
}
/* 5. Evidence – lightweight card */
.manual-report-section--evidence {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.manual-report-section--evidence .manual-report-section__head {
  margin-bottom: 1rem;
}
.manual-report-section--evidence .manual-report-section__lead {
  margin-bottom: 0;
}
.manual-report-section--evidence .form-group {
  margin-bottom: 1rem;
}
.manual-report-section--evidence .form-group:last-child {
  margin-bottom: 0;
}
.manual-report-section--evidence .form-control {
  border-radius: 10px;
}
/* Actions – primary CTA */
.manual-report-actions {
  padding-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 22rem;
}
.manual-report-actions .btn--block {
  order: -1;
}
.manual-report-submit.btn--lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
}
