:root {
  --ink: #172524;
  --muted: #64716f;
  --paper: #f6f3ec;
  --surface: #fffdf8;
  --line: #dedbd2;
  --teal: #176b65;
  --teal-dark: #0d4b47;
  --coral: #d95f4b;
  --gold: #d49a2d;
  --blue: #47759f;
  --shadow: 0 12px 35px rgba(23, 37, 36, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
a { color: var(--teal-dark); text-decoration: none; }
a:hover { color: var(--teal); }
.site-header {
  min-height: 76px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  background: var(--ink);
  color: white;
}
.brand { color: white; display: flex; align-items: center; gap: 12px; }
.brand:hover { color: white; }
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: white;
  background: var(--teal);
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 700;
}
.brand strong, .brand small { display: block; line-height: 1.2; }
.brand small { margin-top: 3px; color: #aab6b4; font-size: 11px; }
nav { display: flex; align-self: stretch; gap: 8px; }
nav a { color: #c7d0ce; padding: 0 14px; display: grid; place-items: center; border-bottom: 3px solid transparent; font-size: 14px; }
nav a:hover, nav a.active { color: white; border-bottom-color: #6eb3aa; }
nav a.queue-nav { color: white; font-weight: 800; }
.page-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; min-height: calc(100vh - 142px); padding: 42px 0 60px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin-bottom: 30px; }
.dashboard-hero, .queue-hero {
  margin-bottom: 22px;
  padding: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  color: white;
  background: var(--teal-dark);
  border-radius: 18px;
  overflow: hidden;
  position: relative;
}
.dashboard-hero::after, .queue-hero::after { content: ""; width: 300px; height: 300px; position: absolute; right: -130px; top: -155px; border: 50px solid rgba(255,255,255,.06); border-radius: 50%; }
.dashboard-hero-copy { max-width: 570px; z-index: 1; }
.eyebrow { margin: 0 0 5px; color: var(--teal); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.dashboard-hero .eyebrow, .queue-hero .eyebrow { color: #8ed0c7; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-family: Georgia, serif; font-size: clamp(34px, 5vw, 50px); line-height: 1.05; letter-spacing: -.025em; }
h2 { margin-bottom: 0; font-family: Georgia, serif; font-size: 23px; line-height: 1.2; }
.lede { max-width: 680px; margin-bottom: 0; color: var(--muted); font-size: 16px; }
.dashboard-hero .lede, .queue-hero .lede { color: #c7dad7; }
.hero-action { display: inline-block; margin-top: 20px; color: white; font-size: 14px; font-weight: 800; }
.hero-action:hover { color: #a9ded7; }
.hero-metrics { min-width: 480px; display: grid; grid-template-columns: repeat(3, 1fr); z-index: 1; }
.hero-metrics div { padding: 9px 20px; border-left: 1px solid rgba(255,255,255,.2); }
.hero-metrics strong, .queue-total strong { display: block; font-family: Georgia, serif; font-size: 43px; line-height: 1; }
.hero-metrics span, .queue-total span { display: block; margin-top: 8px; color: #c7dad7; font-size: 12px; line-height: 1.3; }
.queue-total { min-width: 140px; z-index: 1; text-align: right; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.metric { padding: 20px; border: 1px solid var(--line); border-top: 4px solid; border-radius: 12px; color: var(--ink); background: var(--surface); box-shadow: 0 5px 15px rgba(23,37,36,.04); }
.metric strong { display: block; font-family: Georgia, serif; font-size: 34px; line-height: 1; }
.metric span { color: var(--muted); font-size: 13px; }
.metric-coral { border-top-color: var(--coral); }
.metric-gold { border-top-color: var(--gold); }
.metric-blue { border-top-color: var(--blue); }
.metric-ink { border-top-color: var(--ink); }
.dashboard-grid, .detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.panel, .table-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.panel { padding: 24px; }
.panel-wide { grid-column: 1 / -1; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.panel-heading .eyebrow { margin-bottom: 2px; }
.count, .number-pill { min-width: 30px; height: 30px; padding: 0 9px; display: inline-grid; place-items: center; border-radius: 99px; background: #e8efed; color: var(--teal-dark); font-weight: 800; }
.number-alert { color: #9f3526; background: #fae2dc; }
.item-list { display: grid; }
.list-item { min-width: 0; padding: 15px 2px; display: flex; align-items: center; justify-content: space-between; gap: 18px; color: inherit; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: 0; }
.item-title { color: var(--ink); font-weight: 750; }
.list-item p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.compact .list-item { padding: 13px 2px; }
.status { padding: 5px 9px; border-radius: 99px; white-space: nowrap; background: #e7edeb; color: #52615f; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.status-missing, .status-expired { color: #9f3526; background: #fae2dc; }
.status-expiring, .status-in-progress { color: #78530a; background: #f8ebc9; }
.status-current, .status-accepted, .status-done { color: #176045; background: #dceee6; }
.status-submitted, .status-ready, .status-open { color: #315f88; background: #e0ebf4; }
.attention { padding: 5px 9px; display: inline-block; border-radius: 6px; white-space: nowrap; font-size: 10px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.attention-high { color: #922f20; background: #f9dcd4; }
.attention-medium { color: #72500a; background: #f5e6ba; }
.attention-low { color: #315f88; background: #e0ebf4; }
.customer-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.customer-card { padding: 18px; display: flex; justify-content: space-between; gap: 15px; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.customer-card strong, .customer-card small { display: block; }
.customer-card .attention { width: fit-content; margin-bottom: 10px; }
.customer-card small { margin-top: 4px; color: var(--muted); }
.customer-numbers { color: var(--muted); text-align: right; font-size: 11px; }
.customer-numbers b { display: inline-block; margin-left: 7px; color: var(--coral); font-size: 17px; }
.button, .button-small {
  border: 0;
  border-radius: 8px;
  color: white;
  background: var(--teal);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
.button { padding: 10px 16px; }
.button-small { padding: 7px 11px; font-size: 12px; }
.button:hover, .button-small:hover { color: white; background: var(--teal-dark); }
.action-menu { position: relative; }
.action-menu summary { list-style: none; cursor: pointer; }
.action-menu summary::-webkit-details-marker { display: none; }
.text-action { color: var(--teal); font-weight: 750; font-size: 13px; }
.popover-form { z-index: 5; width: min(340px, calc(100vw - 50px)); padding: 20px; position: absolute; top: calc(100% + 10px); right: 0; display: grid; gap: 12px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); }
label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
input, select, textarea { width: 100%; min-width: 0; padding: 9px 10px; color: var(--ink); background: white; border: 1px solid #c9cdc8; border-radius: 7px; font: inherit; font-size: 14px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(23, 107, 101, .2); border-color: var(--teal); }
.checkbox { display: flex; align-items: center; gap: 8px; }
.checkbox input { width: auto; }
.table-panel { overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th { padding: 13px 18px; color: var(--muted); background: #eeece5; text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
td { padding: 18px; border-top: 1px solid var(--line); }
td strong, td small { display: block; }
td small { max-width: 360px; margin-top: 3px; color: var(--muted); }
.arrow-link { white-space: nowrap; font-size: 13px; font-weight: 750; }
.back-link { display: inline-block; margin-bottom: 22px; font-size: 13px; font-weight: 750; }
.detail-heading { align-items: center; }
.scope-note, .date-card { width: 260px; padding: 18px; border-left: 4px solid var(--teal); background: #e7efec; }
.scope-note strong, .scope-note span, .date-card span, .date-card strong { display: block; }
.scope-note span, .date-card span { color: var(--muted); font-size: 12px; }
.date-card strong { margin: 5px 0 10px; font-family: Georgia, serif; font-size: 21px; }
.callout { margin-bottom: 22px; padding: 20px 24px; display: flex; justify-content: space-between; align-items: center; gap: 20px; color: #69392f; background: #f8e8df; border: 1px solid #edc9bb; border-radius: 12px; }
.callout .eyebrow { color: #a84b3a; }
.callout p { max-width: 400px; margin-bottom: 0; font-size: 13px; }
.status-select { width: auto; padding: 6px 28px 6px 9px; border: 0; border-radius: 99px; font-size: 11px; font-weight: 800; }
.status-select.status-missing { color: #9f3526; background-color: #fae2dc; }
.status-select.status-in-progress { color: #78530a; background-color: #f8ebc9; }
.status-select.status-done, .status-select.status-accepted { color: #176045; background-color: #dceee6; }
.past-due { color: #ad3f2f !important; font-weight: 750; }
.inline-form { margin-top: 18px; padding-top: 18px; display: flex; gap: 8px; border-top: 1px solid var(--line); }
.stacked-form { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.platform-card { padding: 24px; display: flex; gap: 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.platform-card h2 { margin-bottom: 5px; }
.platform-card p { min-height: 42px; color: var(--muted); font-size: 13px; }
.platform-card strong { color: var(--teal); font-size: 12px; }
.attention-key {
  margin-bottom: 16px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: #eeece5;
  font-size: 11px;
}
.attention-key strong { color: var(--ink); }
.attention-key span { white-space: nowrap; }
.attention-dot { width: 8px; height: 8px; margin-right: 5px; display: inline-block; border-radius: 50%; }
.attention-dot.attention-high { background: var(--coral); }
.attention-dot.attention-medium { background: var(--gold); }
.attention-dot.attention-low { background: var(--blue); }
.queue-jump { margin-bottom: 22px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; align-self: auto; }
.queue-jump a { min-height: 74px; padding: 13px; display: flex; flex-direction: column; justify-content: center; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-bottom: 3px solid var(--teal); border-radius: 10px; font-size: 11px; line-height: 1.25; }
.queue-jump a:hover { color: var(--teal-dark); background: white; }
.queue-jump b { display: block; font-family: Georgia, serif; font-size: 24px; line-height: 1; }
.queue-sections { display: grid; gap: 22px; }
.queue-section { scroll-margin-top: 20px; }
.queue-section .panel-heading { align-items: flex-start; }
.queue-section .panel-heading p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.queue-item { min-width: 0; padding: 16px 2px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); }
.queue-item:first-child { border-top: 0; }
.queue-item-main { min-width: 0; display: flex; align-items: center; gap: 14px; }
.queue-item-main p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.empty { margin: 15px 0; color: var(--muted); font-style: italic; }
.message-page { padding: 100px 0; text-align: center; }
footer { padding: 22px 20px; color: #7f8a88; background: #e9e6de; text-align: center; font-size: 11px; }

@media (max-width: 800px) {
  .site-header { padding: 14px 20px; align-items: flex-start; flex-direction: column; }
  nav { width: 100%; overflow-x: auto; }
  nav a { min-height: 42px; padding: 0 10px; }
  .page-shell { width: min(100% - 24px, 1180px); padding-top: 24px; }
  .page-heading, .callout { align-items: flex-start; flex-direction: column; }
  .dashboard-hero, .queue-hero { align-items: flex-start; flex-direction: column; }
  .hero-metrics { width: 100%; min-width: 0; }
  .hero-metrics div:first-child { border-left: 0; padding-left: 0; }
  .queue-total { text-align: left; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-grid, .detail-grid, .card-grid { grid-template-columns: 1fr; }
  .panel-wide { grid-column: auto; }
  .customer-cards { grid-template-columns: 1fr; }
  .scope-note, .date-card { width: 100%; }
  .table-panel { overflow-x: auto; }
  table { min-width: 720px; }
  .attention-key { align-items: flex-start; flex-wrap: wrap; gap: 8px 16px; }
  .queue-jump { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
  .metric-grid, .form-row { grid-template-columns: 1fr; }
  .dashboard-hero, .queue-hero { padding: 22px; }
  .hero-metrics { grid-template-columns: 1fr; }
  .hero-metrics div, .hero-metrics div:first-child { padding: 10px 0; border-left: 0; border-top: 1px solid rgba(255,255,255,.15); }
  .list-item, .queue-item, .queue-item-main { align-items: flex-start; }
  .queue-item { flex-direction: column; }
  .queue-item-main { flex-direction: column; gap: 8px; }
  .queue-jump { grid-template-columns: 1fr 1fr; }
}
