:root {
  --robot-red: #ad1c29;
  --robot-red-dark: #7b0000;
  --robot-orange: #ff8400;
  --robot-orange-soft: #ffdf66;
  --robot-red-soft: #f9eae7;
  --surface: #ffffff;
  --surface-muted: #f6f6f6;
  --border: #dadada;
  --text: #333333;
  --text-muted: #696969;
  --focus: #006bb4;
  --shadow: 0 16px 42px rgba(0, 0, 0, 0.12);
  font-family: "Open Sans", Arial, "Helvetica Neue", sans-serif;
}

.page[hidden],
.admin-panel[hidden] {
  display: none;
}

.nav-link.active {
  background: var(--robot-red-soft);
  color: var(--robot-red-dark);
}

.admin-tabs,
.modal-heading,
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.admin-tabs {
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.modal-heading {
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-actions {
  justify-content: flex-start;
}

.modal {
  width: min(560px, 100%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface-muted);
  color: var(--text);
  font-family: "Open Sans", Arial, "Helvetica Neue", sans-serif;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  padding: 28px 22px;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  min-height: 56px;
}

.brand img {
  width: min(190px, 100%);
  height: auto;
}

.main-nav {
  display: grid;
  gap: 8px;
}

.nav-link {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: var(--robot-red-soft);
  outline: 3px solid rgba(0, 107, 180, 0.2);
}

.content {
  display: grid;
  gap: 24px;
  align-content: start;
  padding: 24px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.hero-copy {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 48px;
}

.eyebrow {
  margin: 0;
  color: var(--robot-red);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  color: var(--robot-red-dark);
  font-size: 3.4rem;
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  color: var(--robot-red-dark);
  font-size: 1.55rem;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  color: var(--text);
  letter-spacing: 0;
}

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

.hero-actions,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 10px 16px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: var(--robot-red);
  color: var(--surface);
}

.button.secondary {
  border-color: var(--border);
  background: var(--surface);
  color: var(--robot-red);
}

.button:hover,
.button:focus-visible,
.icon-action:hover,
.icon-action:focus-visible {
  outline: 3px solid rgba(0, 107, 180, 0.25);
  outline-offset: 2px;
}

.hero-visual {
  min-height: 360px;
  margin: 0;
  background: var(--robot-red-dark);
}

.hero-visual img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.dashboard-grid,
.admin-grid {
  display: grid;
  gap: 16px;
}

.dashboard-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.summary-card,
.flow-control-panel,
.scan-card,
.request-board,
.list-panel,
.handover-cockpit,
.form-panel,
.export-preview,
.admin-shell,
.admin-panel,
.table-panel,
.log-panel,
.support-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.summary-card {
  display: grid;
  gap: 8px;
  min-height: 136px;
  padding: 20px;
}

.summary-card strong {
  color: var(--robot-red);
  font-size: 2.4rem;
}

.summary-label,
.trend {
  color: var(--text-muted);
  font-weight: 700;
}

.flow-control-panel,
.functional-scan-panel,
.request-board,
.admin-shell,
.support-panel {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.request-board {
  border-top: 5px solid var(--robot-red);
}

.flow-control-panel {
  border-top: 5px solid var(--robot-orange);
}

.functional-scan-panel {
  border-top: 5px solid var(--robot-red-dark);
}

.scan-layout {
  display: grid;
  grid-template-columns: minmax(250px, 0.85fr) minmax(300px, 1fr) minmax(320px, 1.15fr);
  gap: 18px;
  align-items: stretch;
}

.scan-card {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
}

.scan-card.brand-surface {
  background:
    linear-gradient(90deg, rgba(173, 28, 41, 0.92), rgba(123, 0, 0, 0.78)),
    url("../public/assets/robot-visual.png") center / cover;
  color: var(--surface);
}

.scan-card.brand-surface h3,
.scan-card.brand-surface strong {
  color: var(--surface);
}

.scan-card.brand-surface .scan-checklist span {
  color: rgba(255, 255, 255, 0.88);
}

.scan-checklist {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.scan-checklist li {
  display: grid;
  gap: 4px;
  min-height: 44px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
  padding-bottom: 10px;
}

.scan-checklist li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.functional-scan-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1.2fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.functional-check-card {
  border-top: 5px solid var(--robot-red);
}

.follow-up-card {
  border-top: 5px solid var(--robot-orange);
}

.functional-checklist,
.follow-up-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.functional-checklist li,
.follow-up-list li {
  display: grid;
  gap: 5px;
  min-height: 44px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.functional-checklist li:last-child,
.follow-up-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.functional-checklist strong,
.follow-up-list strong {
  color: var(--robot-red-dark);
}

.functional-checklist span,
.follow-up-list span {
  color: var(--text-muted);
  font-weight: 700;
}

.follow-up-list li {
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: start;
}

.architecture-card {
  border-top: 5px solid var(--robot-red);
}

.architecture-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.architecture-checklist li {
  display: grid;
  gap: 5px;
  min-height: 88px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  background: var(--surface-muted);
}

.architecture-checklist strong {
  color: var(--robot-red-dark);
}

.architecture-checklist span {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.board-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1.2fr) minmax(260px, 0.65fr) minmax(280px, 0.75fr) minmax(240px, 0.65fr);
 gap: 18px;
 align-items: start;
}

.list-panel,
.handover-cockpit,
.form-panel,
.export-preview,
.admin-panel,
.table-panel,
.log-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
}

.export-preview {
 border-top: 5px solid var(--robot-orange);
}

.handover-cockpit {
 border-top: 5px solid var(--robot-red);
}

.handover-metrics {
 display: grid;
 gap: 10px;
 margin: 0;
}

.handover-metrics div {
 display: grid;
 gap: 4px;
 border-bottom: 1px solid var(--border);
 padding-bottom: 10px;
}

.handover-metrics dt {
 color: var(--text-muted);
 font-size: 0.82rem;
 font-weight: 800;
}

.handover-metrics dd {
 margin: 0;
 color: var(--robot-red-dark);
 font-weight: 900;
 overflow-wrap: anywhere;
}

.export-preview h3 {
  margin: 0;
  color: var(--robot-red-dark);
}

.export-preview dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.export-preview dl div {
  display: grid;
  gap: 3px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.export-preview dt {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.export-preview dd {
  margin: 0;
  color: var(--text);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.handover-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.request-form,
.admin-form,
.settings-form {
  display: grid;
  gap: 14px;
}

.request-form label,
.admin-form label,
.settings-form label,
.filter-control {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-weight: 800;
}

.request-form input,
.request-form select,
.admin-form input,
.admin-form select,
.settings-form select,
.filter-control select {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--text);
}

.request-form input:focus,
.request-form select:focus,
.admin-form input:focus,
.admin-form select:focus,
.settings-form select:focus,
.filter-control select:focus {
  border-color: var(--focus);
  outline: 3px solid rgba(0, 107, 180, 0.18);
}

.state-panel {
  display: grid;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-muted);
}

.state-panel.empty,
.state-panel.loading {
  border-left: 4px solid var(--robot-orange);
}

.state-panel.error {
  border-left: 4px solid var(--robot-red);
  background: var(--robot-red-soft);
}

.state-panel.success {
  border-left: 4px solid var(--robot-red-dark);
  background: #f4f4f4;
}

.section-heading,
.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.bootstrap-panel {
  border-left: 4px solid var(--robot-orange);
}

.status-pill {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.success {
  border: 1px solid #cfcfcf;
  background: #f4f4f4;
  color: #333333;
}

.status-pill.warning {
  border: 1px solid #f0c15d;
  background: #fff4d7;
  color: #6d4600;
}

.state-panel.warning {
  border-color: var(--robot-orange);
  background: #fff4d7;
  color: #6d4600;
}

.status-pill.danger {
  border: 1px solid var(--robot-red);
  background: var(--robot-red-soft);
  color: var(--robot-red-dark);
}

.status-pill.neutral {
  border: 1px solid #cfcfcf;
  background: #efefef;
  color: var(--text);
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.icon-action {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--surface);
  color: var(--robot-red);
  font-weight: 900;
  cursor: pointer;
}

.mini-list,
.state-stack,
.check-list,
.handover-checklist,
.task-list,
.audit-log {
  display: grid;
  gap: 10px;
}

.mini-list {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.mini-list div,
.handover-checklist li,
.task-list li,
.audit-log li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.check-list,
.handover-checklist,
.task-list,
.audit-log {
  margin: 0;
 padding-left: 20px;
}

.handover-checklist strong {
 color: var(--robot-red);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tabs.compact {
  margin-bottom: 0;
}

.tab {
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.tab.active,
.tab:focus-visible {
  border-color: var(--robot-red);
  box-shadow: inset 0 -3px 0 var(--robot-red);
  outline: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.38);
}

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

.modal {
  width: min(460px, 100%);
  border-radius: 8px;
  padding: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

@media (max-width: 1280px) {
  .board-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .export-preview {
    grid-column: 1 / -1;
  }
}

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

  .sidebar {
    position: static;
    height: auto;
    padding: 18px;
  }

  .main-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content {
    padding: 18px;
  }

.hero,
.scan-layout,
.functional-scan-layout,
.board-layout,
.admin-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding: 28px;
  }

  h1 {
    font-size: 2.6rem;
  }

  .hero-visual {
    min-height: 260px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .export-preview {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  .main-nav {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .flow-control-panel,
  .request-board,
  .admin-shell,
  .list-panel,
  .form-panel {
    padding: 22px;
  }

  .architecture-checklist {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.1rem;
  }

  .hero-actions,
  .button,
  .tabs,
  .tab {
    width: 100%;
  }

  .section-heading,
  .panel-heading,
  .task-list li,
  .mini-list div,
  .audit-log li {
    align-items: flex-start;
    flex-direction: column;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    min-width: 0;
  }

  table {
    min-width: 0;
  }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
  }

  td {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 10px;
    border-bottom: 0;
    padding: 8px 0;
  }

  td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-weight: 800;
  }
}
