@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/inter-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Droid Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/droid-sans-400.woff2") format("woff2");
}

@font-face {
  font-family: "Droid Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/droid-sans-700.woff2") format("woff2");
}

:root {
  --ink: #010101;
  --red: #ca0000;
  --red-dark: #9b0000;
  --paper: #e6e6e6;
  --line: #d4d4d4;
  --muted: #5c5c5c;
  --white: #ffffff;
  --focus: #ca0000;
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "Droid Sans", sans-serif;
  line-height: 1.5;
}

a { color: var(--ink); }

a:hover { color: var(--red); }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--white);
  color: var(--ink);
  padding: 8px 12px;
  z-index: 4;
}

.skip:focus { top: 12px; }

.nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--ink);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 16px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: block; padding: 0 8px; }

.brand img,
.gate-logo {
  height: 36px;
  width: auto;
  display: block;
}

.nav-close,
.nav-open { display: none; }

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 22px;
}

.nav a {
  color: var(--paper);
  text-decoration: none;
  padding: 9px 12px;
  border-left: 3px solid transparent;
}

.nav a:hover { color: var(--white); }

.nav a[aria-current="page"] {
  color: var(--white);
  border-left-color: var(--red);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 10px;
  padding: 16px 8px 0;
}

.who {
  color: var(--white);
  text-decoration: none;
  font-size: 0.95rem;
}

.sidebar button.secondary {
  width: 100%;
  background: transparent;
  color: var(--paper);
  border-color: #5c5c5c;
}

.sidebar button.secondary:hover {
  background: var(--white);
  color: var(--ink);
  border-color: var(--white);
}

.work { background: var(--paper); min-width: 0; }

.work-bar { display: none; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 36px 48px;
}

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

.page-head h1,
.page-head .lede { margin-bottom: 0; }

h1, h2, h3 {
  font-family: "Droid Sans", Inter, sans-serif;
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 12px;
}

h1 { font-size: 1.85rem; letter-spacing: -0.02em; }

h2 { font-size: 1.05rem; margin-top: 0; }

.kicker {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lede {
  max-width: 68ch;
  margin: 8px 0 0;
  color: var(--muted);
}

.banner {
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  background: var(--white);
  padding: 12px 14px;
  margin: 0 0 18px;
  color: #3a3a3a;
  font-size: 0.92rem;
}

.flash {
  background: var(--ink);
  color: var(--white);
  padding: 12px 14px;
  margin: 0 0 16px;
}

.error {
  background: var(--white);
  color: var(--red-dark);
  border: 1px solid var(--red);
  padding: 12px 14px;
  margin: 0 0 16px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.stat {
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 3px solid var(--ink);
  padding: 16px 16px 18px;
}

.stat:first-child { border-top-color: var(--red); }

.stat strong {
  display: block;
  font-family: "Droid Sans", Inter, sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.stat span,
.stat a { color: var(--muted); font-size: 0.92rem; text-decoration: none; }

.stat a:hover { color: var(--red); }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.85fr);
  gap: 16px;
  align-items: start;
}

.panel,
.cards article {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 18px;
}

.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.totals { border-top: 3px solid var(--red); }

.totals dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  margin: 0;
}

.totals dt { color: var(--muted); }

.totals dd {
  margin: 0;
  font-family: "Droid Sans", Inter, sans-serif;
  font-weight: 700;
  text-align: right;
}

.totals .balance {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  margin-top: 4px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border: 1px solid var(--line);
}

th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

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

th {
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  background: #f7f7f7;
  font-weight: 400;
}

td a { font-weight: 700; text-decoration: none; }

td a:hover { text-decoration: underline; }

.num { text-align: right; font-variant-numeric: tabular-nums; }

.table-scroll { overflow-x: auto; }

.staff-table { min-width: 760px; }

.staff-table .nowrap { white-space: nowrap; }

.pill,
.badge {
  display: inline-block;
  border: 1px solid #bdbdbd;
  color: var(--ink);
  padding: 2px 8px;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--white);
  white-space: nowrap;
}

.pill.quoted,
.pill.issued,
.badge { border-color: var(--red); color: var(--red-dark); }

.pill.closed,
.pill.declined { color: var(--muted); }

form.stack { display: grid; gap: 14px; max-width: 560px; }

label {
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
}

input, select, textarea, button { font: inherit; color: var(--ink); }

input, select, textarea {
  width: 100%;
  border: 1px solid #c4c4c4;
  background: var(--white);
  padding: 11px 12px;
  border-radius: 0;
}

textarea { min-height: 110px; resize: vertical; }

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

.actions, .inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

button, .button {
  appearance: none;
  border: 1px solid var(--red);
  background: var(--red);
  color: var(--white);
  text-decoration: none;
  padding: 10px 16px;
  cursor: pointer;
  border-radius: 0;
}

button:hover, .button:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
  color: var(--white);
}

button.secondary, .button.secondary {
  background: var(--white);
  color: var(--ink);
  border-color: var(--ink);
}

button.secondary:hover, .button.secondary:hover {
  background: var(--ink);
  color: var(--white);
}

.line-form, .remove-form { display: contents; }

.filters {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
}

.filters input, .filters select { max-width: 280px; width: auto; }
.filters label { min-width: 140px; }

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

.gate { background: var(--white); }

.gate-frame {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
}

.gate-photo {
  background: #1a1a1a url("/static/brand/warehouse.webp") center / cover no-repeat;
}

.gate-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 56px;
  background: var(--white);
}

.gate-panel .lede { margin-bottom: 18px; }

footer.site {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 36px 28px;
  color: var(--muted);
  font-size: 0.82rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

@media (max-width: 900px) {
  .shell { display: block; }
  .sidebar {
    display: none;
    position: fixed;
    z-index: 3;
    inset: 0 auto 0 0;
    width: min(280px, 88vw);
    height: 100vh;
  }
  .nav-toggle:checked ~ .shell .sidebar { display: flex; }
  .nav-toggle:checked ~ .shell .nav-close { display: inline-flex; }
  .work-bar { display: flex; padding: 14px 16px 0; }
  .nav-open, .nav-close {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--ink);
    background: var(--white);
    color: var(--ink);
    padding: 8px 12px;
    text-decoration: none;
    cursor: pointer;
  }
  .nav-close {
    align-self: flex-start;
    margin-top: 16px;
    border-color: #5c5c5c;
    background: transparent;
    color: var(--paper);
  }
  .stats, .split, .cards, .gate-frame { grid-template-columns: 1fr; }
  .gate-photo { min-height: 220px; }
  .gate-panel { padding: 28px 20px 40px; }
  .wrap { padding: 20px 16px 40px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  footer.site { padding-left: 16px; padding-right: 16px; }
}
