:root {
  --ink: #13212d;
  --muted: #536473;
  --line: #dbe4e8;
  --panel: #ffffff;
  --canvas: #f2f6f5;
  --brand: #0b5c4d;
  --brand-dark: #07483c;
  --accent: #d6f36b;
  --danger: #b53a3a;
  --shadow: 0 16px 40px rgb(17 47 41 / 8%);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 16px/1.5 Inter, ui-sans-serif, system-ui, sans-serif; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; }

.site-header { min-height: 76px; padding: 14px clamp(20px, 5vw, 72px); display: flex; align-items: center; justify-content: space-between; gap: 24px; background: #082f2a; color: white; }
.brand { display: flex; align-items: center; gap: 12px; color: white; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; background: var(--accent); color: #17352d; font-weight: 900; }
.brand strong, .brand small { display: block; }
.brand small { color: #bad4ce; font-size: .75rem; }
nav { display: flex; align-items: center; gap: 18px; }
.site-header nav a, .link-button { color: #e7f2ef; text-decoration: none; }
.user-chip { padding: 6px 10px; border: 1px solid #48736b; border-radius: 999px; color: #cfe5e0; font-size: .85rem; }
.link-button { border: 0; padding: 0; background: transparent; cursor: pointer; }

.page-shell { width: min(1180px, calc(100% - 32px)); min-height: calc(100vh - 152px); margin: 0 auto; padding: 48px 0 64px; overflow-wrap: anywhere; }
footer { padding: 22px; background: #e4ece9; color: var(--muted); text-align: center; font-size: .85rem; }
h1, h2, h3 { margin-top: 0; line-height: 1.15; letter-spacing: -.025em; }
h1 { margin-bottom: 12px; font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: 1.35rem; }
h3 { margin-top: 28px; font-size: 1rem; }
.eyebrow { margin: 0 0 8px; color: var(--brand); font-size: .76rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.lede { max-width: 720px; margin: 0; color: var(--muted); font-size: 1.06rem; }
.muted { color: var(--muted); }

.hero-row { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.hero-row > * { min-width: 0; max-width: 100%; }
.hero-row > .button { flex-shrink: 0; }
.narrow-header { max-width: 760px; margin: 0 auto 28px; }
.metric-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 20px; }
.metric-grid div { padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.72); }
.metric-grid span, .metric-grid strong { display: block; }
.metric-grid span { color: var(--muted); font-size: .8rem; }
.metric-grid strong { font-size: 1.55rem; }
.panel { min-width: 0; padding: 26px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); }

.button { display: inline-flex; min-height: 42px; padding: 9px 16px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 10px; font-weight: 750; text-decoration: none; cursor: pointer; }
.primary { background: var(--brand); color: white; }
.primary:hover { background: var(--brand-dark); }
.secondary { border-color: #b9cbc6; background: white; color: var(--brand); }
.danger { border-color: #e4b2b2; background: #fff8f8; color: var(--danger); }
.approve { background: #dff7e8; color: #15643a; border-color: #a4d8b7; }
.inline-form { display: inline; margin: 0; }
.action-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.filter-row { display: flex; align-items: end; gap: 14px; margin-bottom: 22px; }
.filter-row label, .stack-form label { color: #314c47; font-size: .84rem; font-weight: 750; }
.grow { flex: 1; }
input, select, textarea { width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid #b7c8c4; border-radius: 9px; background: white; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 3px solid rgb(11 92 77 / 18%); border-color: var(--brand); }
.stack-form { display: flex; flex-direction: column; gap: 9px; }
.booking-form { max-width: 760px; margin: 0 auto; }
.help { color: var(--muted); }
.field-error { color: var(--danger); font-weight: 700; }

.table-wrap { min-width: 0; max-width: 100%; overflow-x: auto; }
table { width: 100%; min-width: 640px; border-collapse: collapse; }
.booking-table { table-layout: fixed; min-width: 1000px; }
.booking-title-column { width: 34%; }
.booking-resource-column { width: 16%; }
.booking-window-column { width: 24%; }
.booking-requester-column { width: 14%; }
.booking-status-column { width: 12%; }
.booking-table .status { white-space: nowrap; }
th { padding: 11px 14px; color: var(--muted); font-size: .72rem; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
.window-timezone { display: block; letter-spacing: normal; text-transform: none; }
td { padding: 15px 14px; border-top: 1px solid #e7edeb; vertical-align: top; }
td small, .history-card span { display: block; margin-top: 2px; color: var(--muted); font-size: .78rem; }
.table-link { color: var(--ink); font-weight: 750; text-decoration: none; }
.empty-state { padding: 52px; color: var(--muted); text-align: center; }
.status { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: #e8edec; color: #40514e; font-size: .75rem; font-weight: 800; }
.status-submitted { background: #fff1c7; color: #73570a; }
.status-approved { background: #dff6e7; color: #19633b; }
.status-rejected, .status-cancelled { background: #f8e3e3; color: #843535; }
.pagination { display: flex; justify-content: flex-end; gap: 18px; padding-top: 22px; color: var(--muted); }
.pagination a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.pagination a:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }

.detail-heading h1 { font-size: clamp(1.8rem, 4vw, 3rem); }
.detail-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; color: var(--muted); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; }
.detail-grid > * { min-width: 0; }
.side-stack { display: flex; flex-direction: column; gap: 20px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 24px; }
.facts div { padding: 12px 0; border-bottom: 1px solid #e9efed; }
.facts dt { color: var(--muted); font-size: .75rem; font-weight: 750; text-transform: uppercase; }
.facts dd { margin: 3px 0 0; }
.prose { padding: 16px; border-radius: 10px; background: #f5f8f7; }
.history-card { margin-bottom: 10px; padding: 12px; border-radius: 10px; background: #f4f7f6; }
.history-card p { margin-bottom: 0; }
.ai-review { margin-top: 16px; padding-top: 16px; border-top: 1px solid #e3eae7; }
.review-heading { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.review-heading small { color: var(--muted); }
.review-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.review-facts div { padding: 8px; border-radius: 8px; background: #f4f7f6; }
.review-facts dt { color: var(--muted); font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.review-facts dd { margin: 2px 0 0; }
.human-decision { display: inline-flex; margin-top: 8px; padding: 5px 8px; border-radius: 7px; font-size: .75rem; font-weight: 800; }
.human-decision.accepted { background: #dff6e7; color: #19633b; }
.human-decision.rejected { background: #f8e3e3; color: #843535; }
.audit-panel { margin-top: 20px; }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; padding-bottom: 20px; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; top: 12px; bottom: 0; left: 6px; width: 2px; background: #d8e3df; }
.timeline-dot { z-index: 1; width: 14px; height: 14px; margin-top: 4px; border: 3px solid #b8d7ce; border-radius: 50%; background: var(--brand); }
.timeline small, .timeline code { display: block; margin-top: 3px; color: var(--muted); font-size: .76rem; }
.timeline code { width: fit-content; max-width: 100%; padding: 3px 6px; border-radius: 5px; background: #eef3f1; }

.messages { margin-bottom: 18px; }
.message { padding: 12px 15px; border: 1px solid #b6d4cb; border-radius: 10px; background: #ecf8f4; }
.message.error { border-color: #e5b4b4; background: #fff2f2; color: #7d2c2c; }
.message.warning { border-color: #e5d5a5; background: #fff9e8; color: #745b15; }
.login-card { width: min(460px, 100%); margin: 30px auto; padding: 34px; border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: var(--shadow); }

@media (max-width: 760px) {
  .site-header, .hero-row { align-items: flex-start; flex-direction: column; }
  nav { width: 100%; flex-wrap: wrap; }
  .page-shell { padding-top: 30px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-row { align-items: stretch; flex-direction: column; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: 1fr; }
}
