:root {
  --navy: #172f45;
  --blue: #0063a6;
  --line: #d9e4e8;
  --gold: #e3bb38;
  --muted: #71808a;
  --bg: #eff5f7;
  --white: #fff;
  --ink: #1c355e;
  --body-ink: #354b57;
  --soft-blue: #f8fbfc;
  --shadow: none;
}

html { min-width: 320px; }
body {
  background: var(--bg);
  color: var(--body-ink);
  font-family: "DM Sans", Arial, Helvetica, sans-serif;
  font-size: 14px;
}
button, input, select, textarea { font-family: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #e3bb38;
  outline-offset: 2px;
}

.shell {
  grid-template-columns: 248px minmax(0, 1fr);
  background: #fff;
}
.sidebar {
  position: sticky;
  top: 0;
  z-index: 8;
  height: 100vh;
  overflow-y: auto;
  padding: 22px 15px 16px;
  color: #e9ecdf;
  background: #172f45;
  border: 0;
}
.brand {
  min-width: 0;
  gap: 11px;
  padding: 4px 5px 21px;
  border-bottom: 1px solid #436073;
}
.mark {
  flex: 0 0 47px;
  overflow: hidden;
  background: #fff;
  color: #172f45;
}
.mark .brand-original { color: #172f45; }
.mark .brand-original > span { color: #e3bb38; }
.brand-copy { min-width: 0; }
.brand strong {
  display: block;
  color: #fff;
  font: 700 20px/1.15 "DM Sans", Arial, sans-serif;
  letter-spacing: -.35px;
}
.brand-kicker {
  margin-bottom: 4px;
  color: #a8c6d6;
  font: 500 8px/1.3 "DM Mono", monospace;
  letter-spacing: .8px;
  white-space: nowrap;
}
.brand-descriptor {
  display: block;
  margin-top: 4px;
  color: #a8c6d6;
  font: 500 8px/1.3 "DM Mono", monospace;
  letter-spacing: 1px;
}
.season {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 5px 8px;
  margin-top: 20px;
  padding: 10px 11px;
  color: #e9ecdf;
  background: transparent;
  border: 1px solid #597181;
  font: 500 9px/1.35 "DM Mono", monospace;
  letter-spacing: .55px;
}
.season > span { white-space: nowrap; }
.season > strong {
  color: #fff;
  font: 700 11px/1 "DM Mono", monospace;
}
.season small {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0 0 0 14px;
  color: #a8c6d6;
  font: 400 8px/1.3 "DM Mono", monospace;
  letter-spacing: .8px;
}
.dot { background: var(--gold); }
.nav-label {
  padding: 26px 10px 8px;
  color: #a8c6d6;
  font: 500 9px/1.3 "DM Mono", monospace;
  letter-spacing: 1.4px;
}
.nav {
  min-height: 42px;
  gap: 11px;
  margin: 2px 0;
  padding: 10px 11px;
  border-left: 3px solid transparent;
  color: #e9ecdf;
  font: 500 12px/1.25 "DM Sans", Arial, sans-serif;
  letter-spacing: .1px;
  transition: background-color .16s ease, color .16s ease;
}
.nav:hover { background: #203f56; }
.nav.active {
  color: #fff;
  background: #244963;
  border-left-color: #e3bb38;
}
.sidebar-bottom { padding-top: 14px; }
.tag {
  color: #dce7e9;
  background: #203f56;
  font: 500 9px/1.3 "DM Mono", monospace;
  letter-spacing: .7px;
}
.account {
  gap: 9px;
  color: #f5f7f4;
  font: 500 10px/1.35 "DM Sans", Arial, sans-serif;
}
.account small { color: #a8c6d6; }
.avatar {
  flex: 0 0 35px;
  color: #172f45;
  background: #d9e8ed;
}
.mini-action { color: #0063a6; }
.sidebar .mini-action { color: #a8c6d6; }

.main { min-width: 0; background: #fff; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 66px;
  gap: 18px;
  padding: 0 clamp(20px, 3vw, 46px);
  background: #f8fbfc;
  border-bottom: 1px solid #d9e4e8;
}
.crumb {
  min-width: 0;
  color: #71808a;
  font: 500 9px/1.3 "DM Mono", monospace;
  letter-spacing: 1px;
  white-space: nowrap;
}
.crumb span { margin: 0 8px; color: #9eafb7; }
.crumb b {
  color: #1c355e;
  font-weight: 700;
}
.top-actions {
  flex-shrink: 0;
  gap: 15px;
  color: #71808a;
  font: 500 10px/1.3 "DM Mono", monospace;
}
.environment {
  padding: 5px 8px;
  color: #587078;
  background: #f1f6f7;
  border: 1px solid #d9e4e8;
  font: 500 9px/1.3 "DM Mono", monospace;
  letter-spacing: .35px;
}

main {
  width: 100%;
  max-width: 1600px;
  padding: 36px clamp(22px, 4vw, 58px) 48px;
  background: #fff;
}
.title-row {
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 22px;
}
.title-row > div:first-child { min-width: 0; }
.eyebrow {
  margin-bottom: 8px;
  color: #0063a6;
  font: 500 9px/1.4 "DM Mono", monospace;
  letter-spacing: 1.35px;
}
.title-row h1 {
  margin: 0 0 9px;
  color: #1c355e;
  font: 700 clamp(28px, 3vw, 43px)/1.02 "DM Sans", Arial, sans-serif;
  letter-spacing: -1.2px;
}
.subtitle {
  max-width: 740px;
  margin: 0;
  color: #71808a;
  font-size: 13px;
  line-height: 1.55;
}
.actions { gap: 9px; }
.btn {
  min-height: 42px;
  padding: 10px 16px;
  color: #1c355e;
  background: #fff;
  border: 1px solid #aebdc5;
  font: 600 12px/1.3 "DM Sans", Arial, sans-serif;
  letter-spacing: .1px;
  white-space: normal;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover:not(:disabled) { background: #eff5f7; border-color: #0063a6; }
.btn.primary {
  padding-right: 22px;
  color: #fff;
  background: #0063a6;
  border-color: #0063a6;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}
.btn.primary:hover:not(:disabled) { background: #004f86; border-color: #004f86; }
.btn.ghost { color: #1c355e; background: #fff; }
.btn:disabled {
  color: #71808a;
  background: #eff2f3;
  border-color: #d9e0e3;
  opacity: .8;
  cursor: not-allowed;
  clip-path: none;
}

.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0;
}
.stat, .panel {
  min-width: 0;
  background: #fff;
  border: 1px solid #000;
  box-shadow: none;
}
.stat {
  min-height: 118px;
  padding: 16px 18px;
}
.stat-label {
  color: #738b99;
  font: 500 9px/1.35 "DM Mono", monospace;
  letter-spacing: .75px;
}
.stat-value {
  margin: 4px 0 1px;
  color: #1c355e;
  font: 700 38px/1.1 "DM Sans", Arial, sans-serif;
}
.stat-foot { color: #71808a; font-size: 11px; }
.panels {
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
  gap: 16px;
}
.panel { margin-bottom: 16px; }
.panel-head {
  min-width: 0;
  padding: 15px 18px;
  border-bottom: 1px solid #d9e4e8;
}
.panel-title {
  color: #1c355e;
  font: 700 16px/1.3 "DM Sans", Arial, sans-serif;
}
.panel-kicker {
  color: #738b99;
  font: 500 9px/1.3 "DM Mono", monospace;
  letter-spacing: .65px;
  text-align: right;
}
.panel-body { padding: 17px 18px; }
.table-wrap { min-width: 0; max-width: 100%; overflow-x: auto; }
table { min-width: 620px; }
th {
  padding: 10px 12px;
  color: #526d79;
  background: #eff5f7;
  border-bottom: 1px solid #d9e4e8;
  font: 500 9px/1.3 "DM Mono", monospace;
  letter-spacing: .65px;
}
td {
  padding: 11px 12px;
  color: #354b57;
  border-bottom: 1px solid #d9e4e8;
  font-size: 12px;
  white-space: normal;
  overflow-wrap: anywhere;
}
tr:hover td { background: #f8fbfc; }
.code { color: #0063a6; }
.small { color: #71808a; font-size: 11px; }
.pill {
  padding: 4px 7px;
  color: #28634b;
  background: #e0f0e7;
  border: 1px solid #c5dfd0;
  font-size: 10px;
  line-height: 1.3;
  white-space: nowrap;
}
.pill.good { color: #28634b; background: #e0f0e7; border-color: #c5dfd0; }
.pill.warn { color: #745d17; background: #fff7dc; border-color: #e3bb38; }
.pill.gray { color: #526d79; background: #eff5f7; border-color: #d9e4e8; }
.pill.hold { color: #9e3e37; background: #fbefec; border-color: #edd2cc; }
.filters {
  align-items: flex-end;
  gap: 9px;
  padding: 14px 16px;
  border-bottom: 1px solid #d9e4e8;
}
.filters input, .filters select {
  min-height: 40px;
  border: 1px solid #d9e4e8;
  border-radius: 3px;
}
.filters input { min-width: 170px; }
.filters select { min-width: 140px; }
.field { min-width: 0; gap: 5px; }
.field label {
  color: #526d79;
  font: 500 9px/1.4 "DM Mono", monospace;
  letter-spacing: .55px;
}
.field input, .field select, .field textarea {
  min-height: 40px;
  border: 1px solid #dce6e9;
  border-radius: 3px;
  color: #354b57;
  background: #fff;
}
.field textarea { min-height: 76px; }
.empty { padding: 36px 22px; color: #71808a; }
.empty strong {
  color: #1c355e;
  font: 700 19px/1.3 "DM Sans", Arial, sans-serif;
}
.mini-action {
  min-height: 32px;
  padding: 5px 7px;
  color: #0063a6;
  font: 600 11px/1.3 "DM Sans", Arial, sans-serif;
}
.mini-action:hover { color: #004f86; text-decoration: underline; }
.workflow { gap: 8px; }
.step {
  min-width: 125px;
  padding: 11px;
  color: #354b57;
  background: #fff;
  border: 1px solid #d9e4e8;
  font-size: 11px;
  line-height: 1.4;
}
.step b {
  color: #0063a6;
  font: 500 9px/1.3 "DM Mono", monospace;
  letter-spacing: .7px;
}
.note {
  margin: 15px 0 0;
  padding: 13px 14px;
  color: #354b57;
  background: #f8fbfc;
  border-left: 3px solid #e3bb38;
  font-size: 11px;
  line-height: 1.55;
}
.status-line { color: #354b57; font-size: 11px; }
.bar { background: #eff5f7; }
.bar i { background: #0063a6; }
.checkbox { accent-color: #0063a6; }
.handoff-check {
  background: #f8fbfc;
  border-color: #d9e4e8;
}
.stage-flow { gap: 6px; }
.stage-flow span {
  padding: 6px 9px;
  color: #354b57;
  background: #eff5f7;
  border: 1px solid #d9e4e8;
  font-size: 10px;
}
.modal-backdrop { background: rgb(23 47 69 / 65%); }
.modal { border: 1px solid #000; }
.modal-head, .modal-foot { padding: 18px 22px; }
.modal-head { border-bottom-color: #d9e4e8; }
.modal-head h2 {
  color: #1c355e;
  font: 700 21px/1.25 "DM Sans", Arial, sans-serif;
}
.form-body { padding: 0 22px 22px; }
.form-section {
  color: #0063a6;
  border-bottom-color: #d9e4e8;
  font: 500 10px/1.4 "DM Mono", monospace;
  letter-spacing: .65px;
}
.form-section span { color: #71808a; font-family: "DM Sans", Arial, sans-serif; }
.modal-foot { border-top-color: #d9e4e8; }
.icon-btn {
  width: 40px;
  height: 40px;
  color: #1c355e;
}
.toast {
  max-width: min(450px, calc(100vw - 32px));
  padding: 13px 16px;
  color: #fff;
  background: #172f45;
  border: 1px solid #000;
  box-shadow: none;
}
.toast.error { background: #9e3e37; }
.warn-list li { color: #9e3e37; border-bottom-color: #edd2cc; }
.mobile-menu, .sidebar-scrim { display: none; }
.auth-required #content { background: #fff; }

@media (max-width: 1100px) {
  .shell { grid-template-columns: 220px minmax(0, 1fr); }
  main { padding: 30px 28px 42px; }
  .panels { grid-template-columns: minmax(0, 1fr); }
  .panels > .panel { width: 100%; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 850px) and (min-width: 741px) {
  .shell { grid-template-columns: 205px minmax(0, 1fr); }
  main { padding: 28px 22px 38px; }
  .title-row { display: block; }
  .title-row h1 { font-size: 32px; }
  .actions { margin-top: 14px; }
  .topbar { padding: 0 22px; }
  .top-actions { gap: 9px; }
}
@media (max-width: 740px) and (min-width: 641px) {
  .shell { display: grid; grid-template-columns: 205px minmax(0, 1fr); }
  .sidebar {
    position: sticky;
    width: auto;
    height: 100vh;
    transform: none;
    transition: none;
  }
  .topbar { height: 66px; padding: 0 14px; }
  .mobile-menu { display: none; }
  .top-actions { display: flex; }
  .crumb { font-size: 8px; letter-spacing: .3px; }
  main { padding: 25px 17px 34px; }
  .title-row { display: block; }
  .title-row h1 { font-size: 29px; }
  .actions { margin-top: 14px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .stat { padding: 13px; }
  .stat-value { font-size: 34px; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field.wide { grid-column: span 2; }
}
@media (max-width: 640px) {
  .shell { display: block; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 10;
    width: min(280px, calc(100vw - 48px));
    height: 100dvh;
    padding: 18px 15px 16px;
    transform: translateX(-105%);
    transition: transform .2s ease;
    box-shadow: 8px 0 24px rgb(0 0 0 / 16%);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 9;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    background: rgb(16 38 56 / 42%);
    border: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
  }
  .sidebar-scrim.visible { opacity: 1; visibility: visible; }
  .topbar {
    position: sticky;
    height: 58px;
    gap: 7px;
    padding: 0 13px;
  }
  .mobile-menu {
    display: inline-grid;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    place-items: center;
    margin: 0 2px 0 0;
    padding: 0;
    color: #172f45;
    background: transparent;
    border: 1px solid transparent;
    font-size: 22px;
  }
  .mobile-menu:hover { background: #eff5f7; border-color: #d9e4e8; }
  .crumb {
    flex: 1;
    overflow: hidden;
    font-size: 8px;
    letter-spacing: .2px;
    text-overflow: ellipsis;
  }
  .crumb span { margin: 0 4px; }
  .top-actions { display: none; }
  main { padding: 25px 16px 36px; }
  .title-row { display: block; margin-bottom: 19px; }
  .title-row h1 { font-size: clamp(28px, 8vw, 36px); }
  .subtitle { font-size: 13px; }
  .actions { margin-top: 14px; }
  .actions .btn { width: 100%; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 18px 0; }
  .stat { min-height: 105px; padding: 12px; }
  .stat-label { font-size: 8px; letter-spacing: .4px; }
  .stat-value { font-size: 32px; }
  .stat-foot { font-size: 10px; }
  .panels { gap: 12px; }
  .panel-head { align-items: flex-start; padding: 13px 14px; }
  .panel-title { font-size: 15px; }
  .panel-kicker { font-size: 8px; }
  .panel-body { padding: 14px; }
  .filters { align-items: stretch; padding: 12px; }
  .filters input, .filters select { width: 100%; min-width: 0; flex: 1 1 100%; font-size: 16px; }
  .filters .small { align-self: center; }
  .workflow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step { min-width: 0; }
  .status-line { gap: 6px; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal {
    width: 100%;
    max-height: 94dvh;
    border-width: 1px 0 0;
  }
  .modal-head, .modal-foot { padding: 13px 15px; }
  .modal-head h2 { font-size: 19px; }
  .form-body { padding: 0 15px 16px; }
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .field.wide { grid-column: auto; }
  .field input, .field select, .field textarea { font-size: 16px; }
  .form-section span { display: block; float: none; margin-top: 4px; }
  .modal-foot { justify-content: flex-end; }
  .modal-foot .btn { min-width: 110px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
