:root {
  color-scheme: light;
  --ink: #11110f;
  --soft: #f2f1ec;
  --panel: #ffffff;
  --line: #d8d5cd;
  --teal: #245b50;
  --mint: #a6eddd;
  --mint-pale: #e2f7f0;
  --red: #ad3434;
  --amber: #a85c05;
  --muted: #55524d;
  --muted-light: #716e67;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/assets/plus-jakarta-sans.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 200 800;
}

a {
  color: inherit;
}

.office-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 74px;
  padding: 15px clamp(16px, 4vw, 48px);
  color: #fff;
  background: rgba(17, 17, 15, 0.97);
  border-bottom: 1px solid #353531;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  display: block;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  font-weight: 760;
  line-height: 1.1;
}

.brand small {
  margin-top: 3px;
  color: #aaa79f;
  font-size: 11px;
  font-weight: 550;
}

.office-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  color: #c6c3bc;
  font-size: 13px;
  font-weight: 600;
}

.office-nav a {
  text-decoration: none;
  white-space: nowrap;
}

.office-nav a[aria-current="page"] {
  color: var(--mint);
}

.office-nav form {
  margin: 0;
}

.signout {
  padding: 8px 12px;
  color: #fff;
  background: transparent;
  border: 1px solid #55524d;
  border-radius: 6px;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.approval-trigger,
.chat-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  color: #fff;
  background: transparent;
  border: 1px solid #55524d;
  border-radius: 6px;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.approval-count {
  min-width: 18px;
  padding: 1px 5px;
  color: var(--ink);
  background: var(--mint);
  border-radius: 4px;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.controls input[type="search"] {
  width: 100%;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
}

.controls input[type="search"] {
  max-width: 280px;
  padding: 7px 10px;
}

.office-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 48px) 72px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 750;
  line-height: 1.2;
}

.label {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.meta {
  margin: 0;
  color: var(--muted-light);
  font-size: 12px;
  line-height: 1.6;
}

.panel {
  min-width: 0;
  margin-bottom: 20px;
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel h2 {
  margin: 0 0 14px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 13px;
}

select {
  padding: 7px 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}

.inbox-status-col {
  width: 112px;
}

.inbox-action-col {
  width: min(31vw, 310px);
  white-space: normal;
}

.inbox-action-col strong,
.inbox-action-col span {
  display: block;
  overflow-wrap: anywhere;
}

.inbox-action-col strong {
  margin-bottom: 2px;
  font-size: 12px;
  line-height: 1.35;
}

.inbox-action-col span {
  color: var(--muted-light);
  font-size: 11px;
  line-height: 1.45;
}

tr[data-needs-attention="true"] td:first-child {
  box-shadow: inset 3px 0 0 var(--amber);
}

caption {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
}

th,
td {
  padding: 9px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td.numeric,
th.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ledger {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-width: 0;
  gap: 0;
  margin: 0;
  font-size: 13px;
}

.ledger dt,
.ledger dd {
  min-width: 0;
  padding: 8px 0;
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.ledger dt {
  color: var(--muted);
  font-weight: 650;
}

.ledger dd {
  font-variant-numeric: tabular-nums;
}

.ledger > dt:last-of-type,
.ledger > dd:last-of-type {
  border-bottom: 0;
}

.status {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.status[data-status="blocked"] {
  color: var(--red);
  border-color: var(--red);
}

.status[data-status="declined"] {
  color: var(--muted);
  border-color: var(--muted-light);
}

.status[data-status="awaiting_payment"],
.status[data-status="paid"],
.status[data-status="exempt"] {
  color: var(--teal);
  border-color: var(--teal);
}

.status[data-status="review"],
.status[data-status="running"] {
  color: var(--amber);
  border-color: var(--amber);
}

.status[data-status="closed"],
.status[data-status="approved"],
.status[data-status="sent"] {
  color: var(--teal);
  border-color: var(--teal);
}

.unknown {
  color: var(--muted-light);
}

.workflow-summary {
  display: grid;
  grid-template-columns: minmax(150px, 0.35fr) minmax(320px, 1fr);
  gap: 20px;
  align-items: stretch;
  margin-bottom: 18px;
}

.workflow-current,
.workflow-next {
  min-width: 0;
  padding: 12px 14px;
  background: var(--soft);
  border-left: 3px solid var(--teal);
}

.workflow-next[data-needs-attention="true"] {
  border-left-color: var(--amber);
}

.workflow-next-label,
.workflow-stage-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.workflow-next strong {
  display: block;
  font-size: 14px;
  line-height: 1.35;
}

.workflow-next p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.workflow-conflict {
  margin: 0 0 16px;
  padding: 9px 11px;
  color: var(--red);
  border: 1px solid var(--red);
  font-size: 12px;
  line-height: 1.5;
}

.workflow-spine {
  display: grid;
  grid-template-columns: repeat(6, minmax(118px, 1fr));
  gap: 1px;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--line);
}

.workflow-stage {
  min-width: 118px;
  padding: 10px;
  background: var(--panel);
}

.workflow-stage-states {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.workflow-state {
  display: inline-block;
  max-width: 100%;
  padding: 3px 5px;
  overflow-wrap: anywhere;
  color: var(--muted-light);
  border: 1px solid transparent;
  font-size: 9px;
  font-weight: 750;
  line-height: 1.3;
  text-transform: uppercase;
}

.workflow-state-current {
  color: var(--ink);
  background: var(--mint-pale);
  border-color: var(--teal);
}

.blocking {
  color: var(--red);
  font-weight: 700;
}

.note {
  margin: 0;
  padding: 10px 12px;
  color: var(--muted);
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
}

.error {
  color: var(--red);
  border-color: var(--red);
}

.office-footer {
  padding: 20px clamp(16px, 4vw, 48px) 32px;
  color: var(--muted-light);
  font-size: 11px;
}

@media (max-width: 720px) {
  .office-header {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
  }

  .office-nav {
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 12px;
  }

  .office-nav [data-session-email] {
    flex: 1 1 100%;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .controls {
    flex-wrap: wrap;
  }

  .controls input[type="search"] {
    flex: 1 1 100%;
    max-width: none;
  }

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

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

  .ledger > * {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .ledger dt {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .table-scroll {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
  }

  table {
    min-width: 860px;
  }

  .workflow-summary {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .workflow-spine {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    grid-template-columns: repeat(6, 126px);
  }
}
