@font-face {
  font-family: "APMontserrat";
  src: url("/static/theme/montserrat-subset.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --red: #c41e3a;
  --red2: #a3182f;
  --redbg: #fdf2f4;
  --ink: #231f20;
  --mut: #5f6368;
  --line: #e6e6e6;
  --line2: #d9d9d9;
  --bg: #f7f7f8;
  --card: #fff;
  --ok: #1e7d4a;
  --warn: #a86400;
  --err: #b3261e;
  --font: "APMontserrat", Montserrat, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 13.5px/1.45 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.redbar { height: 4px; background: var(--red); }
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 22px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  gap: 14px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 16px; }
.logo { height: 34px; width: auto; display: block; }
.divider { width: 1px; height: 32px; background: var(--line2); }
.apptitle h1 { font-size: 18px; font-weight: 800; margin: 0; letter-spacing: -0.01em; line-height: 1.1; }
.apptitle .ver {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--mut);
  background: #f1f1f3;
  border: 1px solid var(--line2);
  border-radius: 999px;
  padding: 1px 7px;
  margin-left: 6px;
  vertical-align: 3px;
}
.apptitle p { margin: 1px 0 0; font-size: 11.5px; color: var(--mut); font-weight: 500; }
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.who { font-size: 12.5px; font-weight: 600; color: var(--mut); }

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button.ghost {
  background: #fff;
  border: 1px solid var(--line2);
  border-radius: 8px;
  padding: 7px 13px;
  color: var(--ink);
  font-weight: 600;
  font-size: 12.5px;
}
button.ghost:hover { border-color: var(--ink); }
button.primary {
  background: var(--red);
  border: 0;
  color: #fff;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 13px;
}
button.primary:hover { background: var(--red2); }
button.sm { padding: 5px 9px; font-size: 11.5px; border-radius: 8px; }
button.link { background: none; border: 0; color: var(--red); font-weight: 700; font-size: 12px; padding: 0; }

.lanes {
  display: flex;
  gap: 4px;
  padding: 0 22px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.lanes a {
  color: var(--mut);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  padding: 12px 14px 10px;
  border-bottom: 3px solid transparent;
}
.lanes a.active { color: var(--ink); border-bottom-color: var(--red); }
.lanes .count {
  display: inline-block;
  margin-left: 6px;
  min-width: 1.3em;
  padding: 0 6px;
  border-radius: 999px;
  background: #f1f1f3;
  font-size: 11px;
  text-align: center;
  color: var(--ink);
}
.lanes a.active .count { background: var(--redbg); color: var(--red); }
.settings-link { margin-left: auto; }

.banner, .flash {
  margin: 12px 22px 0;
  padding: 10px 14px;
  background: #fff8e6;
  border: 1px solid #f3dc9b;
  color: #6a4a00;
  border-radius: 10px;
  font-size: 13px;
}
.banner form, .banner p { margin: 6px 0 0; }
.banner.err, .flash.error { background: #fdecea; border-color: #f5c2bd; color: #7a1f1a; }
.flash { background: #e8f5ee; border-color: #c6e6d3; color: #174d31; }
.banner label { font-weight: 700; font-size: 12px; display: block; margin-bottom: 4px; }
.banner input[type="text"] {
  border: 1px solid var(--line2);
  border-radius: 8px;
  padding: 8px 10px;
  width: min(220px, 100%);
}
.banner input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.12); }
.code-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.page { padding: 16px 22px 40px; }
.stagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.stagehead h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.sync-line { margin: 2px 0 0; color: var(--mut); font-size: 12.5px; font-weight: 500; }
.toolbar-actions { display: flex; gap: 8px; align-items: flex-end; }
.sort-form label, .f > span, .hint { color: var(--mut); font-size: 11.5px; font-weight: 600; }
.sort-form select, .settings input, .settings select, .backup input[type="file"] {
  display: block;
  margin-top: 4px;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  padding: 8px 10px;
  border: 1px solid var(--line2);
  border-radius: 8px;
  background: #fff;
  width: 100%;
}
.sort-form select { width: auto; min-width: 180px; }
select:focus, input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.12); }

.empty-line { color: var(--mut); font-weight: 600; margin: 0 0 12px; }

.days {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  align-items: flex-start;
  padding-bottom: 12px;
}
.day {
  flex: 0 0 270px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 220px;
  box-shadow: 0 1px 2px rgba(17, 17, 17, 0.04);
}
.day.today { box-shadow: inset 0 3px 0 var(--red), 0 1px 2px rgba(17, 17, 17, 0.04); }
.day.closed { background: #f3f3f5; }
.day.over { border-color: #f3dc9b; }
.day-head { padding: 12px 12px 8px; border-bottom: 1px solid var(--line); }
.day-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.dow { font-size: 15px; font-weight: 800; }
.date { color: var(--mut); font-weight: 600; }
.pill {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 1px 7px;
}
.pill.muted { background: transparent; color: var(--mut); border: 1px solid var(--line2); }
.hours-form { margin-top: 8px; }
.hours-form label { display: block; font-size: 11.5px; font-weight: 600; color: var(--mut); }
.slider-row { display: flex; align-items: center; gap: 8px; }
.slider-row input[type="range"] { width: 100%; accent-color: var(--red); }
.slider-row output { min-width: 48px; font-weight: 800; font-variant-numeric: tabular-nums; }
.load { margin: 6px 0; font-size: 12px; color: var(--mut); }
.day.over .load { color: var(--warn); font-weight: 700; }
.bar { height: 5px; background: #eee; border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--red); }
.day-jobs { min-height: 72px; padding-bottom: 8px; }

.job {
  margin: 8px;
  padding: 10px 10px 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.job.locked { border-color: #f0c2cb; background: var(--redbg); }
.job.dragging { opacity: 0.45; }
.job.drop-before { box-shadow: 0 -3px 0 var(--red); }
.job-top { display: flex; align-items: center; gap: 8px; }
.item-no { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; }
.badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 2px 7px;
}
.badge.rush { background: var(--red); color: #fff; }
.handle {
  border: 1px solid var(--line2);
  background: #fff;
  border-radius: 8px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--mut);
  cursor: grab;
}
.job h3 { margin: 6px 0 2px; font-size: 14px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.25; }
.customer { margin: 0; font-weight: 700; }
.meta { margin: 2px 0; color: #3c4043; }
.run { margin: 4px 0; font-weight: 800; }
.run span { font-weight: 600; color: var(--mut); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; margin-right: 4px; }
.job-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.job-actions form { margin: 0; }
.job-actions button.on { border-color: var(--red); color: var(--red); background: #fff; }
.locked-flag { align-self: center; font-size: 11px; font-weight: 800; color: var(--red); letter-spacing: 0.03em; text-transform: uppercase; }

.job details { margin-top: 8px; }
.job summary { cursor: pointer; color: var(--red); font-weight: 700; font-size: 12px; }
.job summary:hover { color: var(--red2); }
.detail-body { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); color: #3c4043; }
.detail-body p { margin: 4px 0; font-size: 12.5px; }
.detail-body .label { font-weight: 700; color: var(--ink); }

.settings { max-width: 980px; }
.settings h2 { margin: 0 0 6px; font-size: 20px; font-weight: 800; }
.settings > p, .note { color: var(--mut); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 14px 0;
  padding: 14px 16px 16px;
  box-shadow: 0 1px 2px rgba(17, 17, 17, 0.04);
}
.card h3 { margin: 0 0 8px; font-size: 14px; font-weight: 800; }
.card.lane-indigo { border-top: 3px solid var(--ink); }
.card.lane-iridesse { border-top: 3px solid var(--red); }
.card.lane-bindery { border-top: 3px solid var(--ok); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.settings label, .sync-form label, .backup label { display: block; font-size: 11.5px; font-weight: 600; color: var(--mut); }
.hint { display: block; font-weight: 500; margin-top: 4px; }
.saved { margin: 8px 0 0; font-weight: 800; color: var(--ok); }
.check { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--ink); font-size: 13px; font-weight: 600; }
.check input { width: auto; accent-color: var(--red); }
.press-row {
  display: grid;
  grid-template-columns: 1.6fr 0.8fr 0.6fr 0.8fr auto;
  gap: 10px;
  align-items: end;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.status-line { margin: 4px 0; font-size: 13px; }
.status-line b { font-weight: 800; }
.sync-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 10px 0; }
.row-actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; }

.login-body {
  min-height: 100vh;
  background: var(--bg);
}
.login-card {
  width: min(420px, calc(100% - 32px));
  margin: 48px auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 1px 2px rgba(17, 17, 17, 0.04);
}
.login-card h1 { margin: 8px 0; font-size: 20px; font-weight: 800; }
.login-card p { color: var(--mut); }
.login-card label { display: block; margin-top: 12px; font-size: 11.5px; font-weight: 600; color: var(--mut); }
.login-card input {
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line2);
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
}
.login-brand { display: flex; align-items: center; gap: 12px; }

@media (max-width: 800px) {
  .grid, .press-row, .sync-grid { grid-template-columns: 1fr; }
  .settings-link { margin-left: 0; }
  .lanes { flex-wrap: wrap; }
}
