:root {
  color-scheme: light;
  --bg: #f4f6f3;
  --panel: #ffffff;
  --panel-soft: #eef3ef;
  --ink: #18211e;
  --muted: #65716b;
  --line: #d8e0d9;
  --line-strong: #b7c4bc;
  --accent: #006d77;
  --accent-dark: #004f57;
  --accent-soft: #e2f4f5;
  --ok: #1f8a5b;
  --ok-soft: #e2f4eb;
  --warn: #b7791f;
  --warn-soft: #fff3d7;
  --danger: #be3f22;
  --danger-soft: #ffe9e3;
  --violet: #5b4db7;
  --shadow: 0 18px 45px rgba(28, 42, 35, 0.1);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

[hidden] {
  display: none !important;
}

body.submitter-mode .admin-surface,
body.submitter-mode .admin-only,
body.submitter-mode .admin-field {
  display: none !important;
}

body.submitter-mode .workspace-grid {
  grid-template-columns: minmax(0, 760px);
}

body.submitter-mode .form-panel {
  width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  padding: 22px 16px;
  background: #1d2824;
  color: #f7faf7;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: var(--radius);
  background: #d7f064;
  color: #16201b;
  font-size: 0.83rem;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
  min-width: 0;
}

.brand strong {
  font-size: 0.98rem;
}

.brand span {
  color: #b7c6be;
  font-size: 0.82rem;
}

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

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: #cdd8d1;
  text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.sidebar-status {
  display: grid;
  gap: 7px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-status strong {
  font-size: 0.96rem;
}

.sidebar-status span:last-child {
  color: #b7c6be;
  font-size: 0.82rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  min-width: 0;
  width: min(100%, 1480px);
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
}

.topbar > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.topbar h1,
.panel h2,
.board-lane h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(1.85rem, 2.8vw, 3rem);
  line-height: 1.08;
}

.context-line {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-actions,
.form-actions,
.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-login {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-password {
  display: block;
  width: 148px;
}

.primary-button,
.secondary-button,
.icon-button,
.row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 800;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.primary-button {
  gap: 8px;
  padding: 0 15px;
  background: var(--accent);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.secondary-button,
.icon-button,
.row-action {
  background: #ffffff;
  border-color: var(--line);
  color: var(--ink);
}

.secondary-button {
  padding: 0 15px;
}

.icon-button,
.row-action {
  width: 40px;
  padding: 0;
}

.primary-button:active,
.secondary-button:active,
.icon-button:active,
.row-action:active {
  transform: translateY(1px);
}

.row-action:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

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

.metric-card {
  display: grid;
  gap: 6px;
  min-height: 116px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(28, 42, 35, 0.06);
}

.metric-card.risk {
  border-color: #f2b4a5;
  background: linear-gradient(180deg, #fff7f4, #ffffff);
}

.metric-card.wide {
  min-width: 0;
}

.metric-label,
.metric-note {
  color: var(--muted);
  font-size: 0.82rem;
}

.metric-card strong {
  align-self: center;
  font-size: 2.15rem;
  line-height: 1;
}

.metric-progress {
  display: grid;
  align-items: end;
  gap: 12px;
}

.bar-track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8ede8;
}

.bar-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--ok));
  transition: width 240ms ease;
}

.control-strip {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) repeat(2, minmax(150px, 190px));
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 30px rgba(28, 42, 35, 0.05);
}

.search-field,
.select-field,
.form-grid label,
.notes-field {
  display: grid;
  gap: 6px;
}

.search-field {
  position: relative;
}

.search-field svg {
  position: absolute;
  top: 50%;
  left: 12px;
  color: var(--muted);
  transform: translateY(-50%);
}

.search-field input {
  padding-left: 42px;
}

.select-field span,
.form-grid span,
.notes-field span,
.checklist-fieldset legend {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

input,
select {
  padding: 0 11px;
}

textarea {
  min-height: 92px;
  padding: 10px 11px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 109, 119, 0.16);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.45fr);
  gap: 18px;
  align-items: start;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.form-panel {
  padding: 18px;
}

.account-panel {
  padding: 18px;
}

.password-form {
  display: grid;
  gap: 12px;
}

.tracker-panel {
  min-width: 0;
  overflow: hidden;
}

.approved-panel {
  padding: 18px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.tracker-panel .panel-header {
  padding: 18px 18px 0;
}

.panel h2 {
  font-size: 1.18rem;
}

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

.pill {
  background: var(--panel-soft);
  color: #3e4b45;
}

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

.checklist-fieldset {
  margin: 15px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.checklist-fieldset legend {
  padding: 0 6px;
}

.step-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.step-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafcf9;
  color: #33413b;
  font-size: 0.84rem;
  font-weight: 750;
}

.step-check input {
  width: 17px;
  min-height: 17px;
  accent-color: var(--accent);
}

.form-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

.form-notice {
  min-height: 22px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.form-notice:empty {
  display: none;
}

.form-notice[data-tone="success"] {
  color: var(--ok);
}

.form-notice[data-tone="error"] {
  color: var(--danger);
}

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

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

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

th {
  color: var(--muted);
  background: #fafcf9;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #fbfdfb;
}

.equipment-cell {
  display: grid;
  gap: 3px;
  min-width: 170px;
}

.equipment-cell strong {
  font-size: 0.95rem;
}

.equipment-cell span,
.owner-cell span,
.next-step {
  color: var(--muted);
  font-size: 0.82rem;
}

.owner-cell {
  display: grid;
  gap: 3px;
  min-width: 118px;
}

.status-pill[data-status="Submitted"] {
  background: #edf2f7;
  color: #3e4c59;
}

.status-pill[data-status="In Review"] {
  background: #fff3d7;
  color: #8a5a12;
}

.status-pill[data-status="Forwarded"] {
  background: #e8f0ff;
  color: #2456a6;
}

.status-pill[data-status="In Progress"] {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.status-pill[data-status="Testing"] {
  background: #ecebff;
  color: var(--violet);
}

.status-pill[data-status="Blocked"] {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-pill[data-status="Complete"] {
  background: var(--ok-soft);
  color: var(--ok);
}

.priority-pill {
  margin-top: 6px;
}

.priority-pill[data-priority="Critical"] {
  background: var(--danger-soft);
  color: var(--danger);
}

.priority-pill[data-priority="High"] {
  background: var(--warn-soft);
  color: var(--warn);
}

.priority-pill[data-priority="Normal"] {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.priority-pill[data-priority="Low"] {
  background: var(--panel-soft);
  color: #4e5b55;
}

.due-pill {
  background: var(--panel-soft);
  color: #48554f;
}

.due-pill.overdue {
  background: var(--danger-soft);
  color: var(--danger);
}

.due-pill.soon {
  background: var(--warn-soft);
  color: var(--warn);
}

.progress-cell {
  display: grid;
  gap: 7px;
  min-width: 130px;
}

.progress-cell strong {
  font-size: 0.86rem;
}

.row-actions {
  justify-content: flex-end;
}

.action-column {
  width: 172px;
  text-align: right;
}

.empty-state {
  display: grid;
  gap: 5px;
  margin: 18px;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
}

.approved-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.approved-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.approved-card header,
.approved-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.approved-card header {
  min-width: 0;
}

.approved-card h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0;
}

.approved-card p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.approved-meta {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.status-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 10px;
}

.board-lane {
  display: grid;
  gap: 10px;
  min-height: 180px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.lane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lane-header h2 {
  font-size: 1rem;
}

.lane-header span {
  min-width: 28px;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

.lane-list {
  display: grid;
  gap: 8px;
}

.lane-card {
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.lane-card strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.92rem;
}

.lane-card span {
  color: var(--muted);
  font-size: 0.8rem;
}

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

  .sidebar {
    position: static;
    flex-direction: row;
    align-items: center;
    height: auto;
    padding: 12px 16px;
  }

  .nav-list {
    display: flex;
    flex-wrap: wrap;
    margin-left: auto;
  }

  .sidebar-status {
    display: none;
  }

  .metrics-grid {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }

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

  .tracker-panel {
    min-width: 0;
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 16px;
  }

  .sidebar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-list {
    width: 100%;
    margin-left: 0;
  }

  .nav-link {
    flex: 1 1 135px;
  }

  .topbar,
  .panel-header {
    flex-direction: column;
  }

  .topbar-actions,
  .form-actions {
    width: 100%;
    justify-content: stretch;
  }

  .admin-login {
    display: grid;
    grid-template-columns: 1fr auto;
    width: 100%;
  }

  .admin-password {
    width: 100%;
  }

  .topbar-actions .primary-button,
  .form-actions .primary-button,
  .form-actions .secondary-button {
    flex: 1;
  }

  .metrics-grid,
  .control-strip,
  .form-grid,
  .step-checklist,
  .approved-list,
  .status-board {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 96px;
  }
}
