/* Brand tokens and fonts copied from the Snow LLP site (css/styles.css). */
:root {
  color-scheme: light;
  --brand-red: #5C1515;
  --brand-red-2: #8A4A4A;
  --ivory: #F7F2E9;
  --warm-gray: #DAD5CB;
  --charcoal: #1F1D1C;
  --navy-dark: #3a0d0d;
  --accent-hover: #7a1c1c;
  --text: #1e1e1e;
  --text-light: #5a5a5a;
  --white: #ffffff;
  --stone: #f3f1ee;
  --border: #d6d2cb;
  --max-width: 1160px;
  /* Status colors */
  --ok-bg: #d9ead6;
  --ok-fg: #1e5a2b;
  --bad-bg: #f3d3cf;
  --bad-fg: #8a1f1a;
  --wait-bg: #e4e0d8;
  --wait-fg: #5a5a5a;
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/roboto-variable.woff2') format('woff2');
}
@font-face {
  font-family: 'Roboto';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/roboto-italic.woff2') format('woff2');
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Roboto', sans-serif; font-size: 15px; line-height: 1.5; color: var(--text); background: var(--stone); -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--brand-red); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
ul { list-style: none; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 36px; }

/* Header and footer */
.site-header { background: var(--stone); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.site-logo { display: inline-flex; flex-direction: column; gap: 5px; text-decoration: none; }
.site-logo:hover { text-decoration: none; }
.site-logo__mark { height: 36px; width: auto; display: block; }
.site-logo__descriptor { font: 500 10.5px/1 'Roboto', sans-serif; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brand-red-2); }
.session { font-size: 13px; color: var(--text-light); display: flex; gap: 14px; align-items: center; }
.site-footer { background: var(--navy-dark); padding: 24px 0; margin-top: auto; }
.site-footer p { font-size: 13px; color: rgba(255, 255, 255, 0.55); line-height: 1.75; }

/* Page head */
.page { padding-top: 28px; padding-bottom: 48px; }
.draw-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 16px; }
.project-name { font-size: 28px; font-weight: 700; line-height: 1.15; color: var(--brand-red); }
.pay-apps { font-size: 15px; color: var(--text-light); margin-top: 2px; }
.editor-bar { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* Controls */
button, select, input[type="text"], input[type="date"], textarea {
  font: inherit; color: var(--text); background: var(--white);
  border: 1px solid var(--border); border-radius: 3px;
}
button { height: 36px; padding: 0 14px; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--brand-red); }
button:hover { border-color: var(--brand-red-2); }
button.primary { background: var(--brand-red); border-color: var(--brand-red); color: var(--white); }
button.primary:hover { background: var(--accent-hover); }
button.danger { color: var(--bad-fg); }
button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, .cell:focus-visible, .row-label button:focus-visible {
  outline: 2px solid var(--brand-red); outline-offset: 2px;
}
/* Fixed height with no vertical padding keeps the dropdown's label centered. */
select { height: 40px; padding: 0 34px 0 12px; line-height: 38px; font-size: 16px; font-weight: 500; cursor: pointer; }
input[type="text"], input[type="date"] { height: 36px; padding: 0 10px; font-size: 14px; }
textarea { width: 100%; min-height: 150px; padding: 10px; font: 13px/1.5 ui-monospace, Consolas, monospace; }

.message { min-height: 22px; font-size: 14px; color: var(--bad-fg); margin-bottom: 6px; }
.message.ok { color: var(--ok-fg); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--text-light); margin-bottom: 10px; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.swatch.st-in_hand { background: var(--ok-fg); }
.swatch.st-outstanding { background: var(--bad-fg); }
.swatch.st-pending_after_submission { background: #8f8a80; }
.dash { color: var(--text-light); }

/* Grid */
.grid-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--border); border-radius: 4px; padding: 6px 16px 14px; }
.grid { width: 100%; min-width: 760px; table-layout: fixed; border-collapse: separate; border-spacing: 0 4px; font-size: 14px; }
.grid col.c-item { width: 38%; }
.grid col.c-lender { width: 15.5%; }
.grid col.c-resp { width: 15.5%; }
.grid thead th { text-align: left; vertical-align: bottom; padding: 10px 6px 8px; font-weight: 600; font-size: 15px; color: var(--charcoal); border-bottom: 2px solid var(--brand-red); }
.grid thead th small { display: block; font-size: 12px; font-weight: 400; color: var(--text-light); line-height: 1.45; }
.grid thead th.resp-head { padding-left: 14px; }
.grid td { padding: 0 3px; vertical-align: middle; }
.section-row th { text-align: left; padding: 18px 0 4px; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; color: var(--brand-red-2); border-bottom: 1px solid var(--border); }
.section-row th .section-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-row button { height: 28px; font-size: 13px; padding: 0 10px; }
.row-label { padding: 6px 8px 6px 0 !important; line-height: 1.35; font-weight: 400; text-align: left; }
.row-label button { all: unset; cursor: pointer; display: block; width: 100%; font: inherit; color: inherit; }
.row-label button:hover { color: var(--brand-red); }
.note { display: block; font-size: 12.5px; color: var(--text-light); margin-top: 1px; }
.has-outstanding .note { color: var(--bad-fg); }
.cell { display: flex; align-items: center; justify-content: center; width: 100%; height: 30px; border: 0; border-radius: 3px; padding: 0; }
.cell svg { width: 16px; height: 16px; }
.cell.st-in_hand { background: var(--ok-bg); color: var(--ok-fg); }
.cell.st-outstanding { background: var(--bad-bg); color: var(--bad-fg); }
.cell.st-pending_after_submission { background: var(--wait-bg); color: var(--wait-fg); }
button.cell { cursor: pointer; }
button.cell:hover { filter: brightness(0.96); }
.cell.none { color: var(--text-light); background: none; }
.resp { padding-left: 14px !important; color: var(--text-light); }
.resp-inner { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.resp button { height: 26px; padding: 0 8px; font-size: 12.5px; }

/* Editor panels */
.panel, .row-editor td > div { background: var(--ivory); border: 1px solid var(--border); border-radius: 4px; padding: 14px 16px; }
.panel { margin-bottom: 14px; }
.panel h2 { font-size: 16px; font-weight: 600; color: var(--brand-red); margin-bottom: 10px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 16px; margin-bottom: 12px; }
.fields label, .field { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--text-light); }
.fields label.wide { grid-column: 1 / -1; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; margin-bottom: 12px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions .spacer { flex: 1; }
.preview { margin: 10px 0; font-size: 14px; }
.preview li { padding: 3px 0; border-bottom: 1px solid var(--border); }
.hint { font-size: 13px; color: var(--text-light); margin-bottom: 8px; }

@media (max-width: 700px) {
  .container { padding: 0 16px; }
  .project-name { font-size: 22px; }
  .editor-bar { margin-left: 0; }
  .grid-wrap { padding: 4px 10px 10px; }
  .session span { display: none; }
  .session a { white-space: nowrap; }
  /* Narrow screens: the grid scrolls sideways and the item names stay put. */
  .grid { min-width: 640px; }
  .grid col.c-item { width: 34%; }
  .grid .row-label, .grid thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--white); }
  .section-row .section-inner { position: sticky; left: 0; width: calc(100vw - 56px); }
}
