/* ─── Palette tokens (Paper only) ────────────────────────────────── */
:root {
  --paper:        #f4ecdc;
  --paper-deep:   #ecddc1;
  --panel:        #faf3e3;
  --panel-soft:   #f6ecd5;
  --ink:          #1f1a14;
  --ink-2:        #4a3f2f;
  --ink-3:        #7a6a55;
  --line:         rgba(31, 26, 20, 0.14);
  --line-soft:    rgba(31, 26, 20, 0.08);
  --accent:       #b8593a;
  --accent-ink:   #faf3e3;
  --accent-2:     #5e7c5a;
  --warn:         #c4892a;
  --danger:       #a23423;
  --info:         #4a6b8c;

  --shadow-card:   0 1px 0 rgba(255,255,255,0.6) inset, 0 1px 2px rgba(31,26,20,.04), 0 4px 14px -6px rgba(31,26,20,.16);
  --shadow-hover:  0 1px 0 rgba(255,255,255,0.7) inset, 0 2px 4px rgba(31,26,20,.06), 0 10px 22px -10px rgba(31,26,20,.22);
  --radius:        10px;
  --radius-sm:     6px;
  --radius-lg:     14px;
}

/* ─── Base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
  min-height: 100vh;
  background-image:
    radial-gradient(at 18% 8%, rgba(31,26,20,0.025) 0%, transparent 40%),
    radial-gradient(at 80% 92%, rgba(31,26,20,0.025) 0%, transparent 45%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.04 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-attachment: fixed;
}
h1, h2, h3, h4 {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 500;
  letter-spacing: -0.012em;
  margin: 0;
  color: var(--ink);
}
.display { font-family: 'Newsreader', Georgia, serif; }
.mono   { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }
button { font-family: inherit; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ─── Shell ───────────────────────────────────────────────────────── */
.ocs-shell { display: flex; flex-direction: column; min-height: 100vh; }

.ocs-topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 24px;
  row-gap: 6px;
  padding: 14px 28px 0;
  background: var(--paper);
  position: sticky; top: 0; z-index: 30;
  border-bottom: 1px solid var(--line);
}
.ocs-topbar > .ocs-logo { grid-row: 1; grid-column: 1; }
.ocs-topbar > .ocs-search-wrap { grid-row: 1; grid-column: 3; align-self: center; }
.ocs-topbar > .ocs-nav { grid-row: 2; grid-column: 1 / -1; margin-top: 8px; }
.ocs-logo {
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  text-decoration: none;
}
.ocs-logo:hover { text-decoration: none; }
.ocs-logo .mark {
  width: 38px; height: 38px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: 'Newsreader', serif;
  font-weight: 600; font-size: 17px;
  letter-spacing: -0.02em;
  background: var(--panel);
  color: var(--ink);
  position: relative;
}
.ocs-logo .mark::after {
  content: '';
  position: absolute; inset: -4px;
  border: 0.5px solid var(--line);
  border-radius: 50%;
}
.ocs-logo .word {
  display: flex; flex-direction: column; line-height: 1;
}
.ocs-logo .word b {
  font-family: 'Newsreader', serif;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.ocs-logo .word small {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 3px;
}

.ocs-nav {
  display: flex;
  gap: 2px;
  align-items: flex-end;
  position: relative;
}
.ocs-nav a {
  position: relative;
  color: var(--ink-3);
  padding: 9px 16px 11px;
  font-weight: 500;
  font-size: 13.5px;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.01em;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.12s, border-color 0.12s;
  display: inline-flex; align-items: center; gap: 7px;
}
.ocs-nav a:hover {
  color: var(--ink);
  text-decoration: none;
  border-bottom-color: var(--line);
}
.ocs-nav a[data-active="1"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.ocs-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  width: 280px;
  transition: border-color 0.15s, background 0.15s;
}
.ocs-search:focus-within { border-color: var(--ink-2); background: var(--panel-soft); }
.ocs-search input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font: inherit; color: var(--ink); min-width: 0;
}
.ocs-search input::placeholder { color: var(--ink-3); }
.ocs-search svg { color: var(--ink-3); flex-shrink: 0; }
.ocs-search kbd {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--ink-3);
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
}

/* Search results dropdown */
.ocs-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-hover);
  overflow: hidden;
  max-height: 360px;
  overflow-y: auto;
  z-index: 50;
}
.ocs-search-wrap { position: relative; width: 280px; }
.ocs-search-wrap .ocs-search { width: 100%; }
.ocs-search-result {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
  color: inherit;
}
.ocs-search-result:hover { background: var(--panel-soft); text-decoration: none; }
.ocs-search-result:last-child { border-bottom: 0; }
.ocs-search-result .kind {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  width: 60px;
  flex-shrink: 0;
}
.ocs-search-result .label { color: var(--ink); font-weight: 500; flex: 1; }
.ocs-search-result .sub { color: var(--ink-3); font-size: 12.5px; }

/* ─── Buttons ─────────────────────────────────────────────────────── */
.btn {
  appearance: none;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px;
  border-radius: 7px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font: 500 13.5px/1 'IBM Plex Sans', sans-serif;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.12s;
  letter-spacing: -0.005em;
  text-decoration: none;
}
.btn:hover { box-shadow: 0 3px 0 -1px var(--accent); transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn.ghost:hover {
  background: var(--panel);
  box-shadow: none;
  transform: none;
}
.btn.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn.sm { padding: 5px 9px; font-size: 12.5px; gap: 5px; border-radius: 6px; }
.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

/* ─── Page layout ─────────────────────────────────────────────────── */
.ocs-main {
  flex: 1;
  padding: 28px 32px 80px;
  max-width: 1640px;
  width: 100%;
  margin: 0 auto;
}
.page-head {
  display: flex; align-items: end; justify-content: space-between;
  margin-bottom: 22px;
  gap: 20px; flex-wrap: wrap;
}
.page-head h1 {
  font-size: 32px;
  line-height: 1.05;
}
.page-head .date {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 4px;
}

/* ─── Card ────────────────────────────────────────────────────────── */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--line-soft);
  gap: 10px;
}
.card-head h2 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.card-head .meta {
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.card-body { padding: 14px 18px; }

/* ─── Status stamp ────────────────────────────────────────────────── */
.stamp {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 8px 3px;
  border: 1.2px solid currentColor;
  border-radius: 4px;
  background: transparent;
  white-space: nowrap;
  line-height: 1;
}
.stamp.solid {
  color: var(--accent-ink);
  background: currentColor;
}
.stamp.solid > * { color: var(--accent-ink); }
.stamp.s-booked         { color: var(--warn); border-style: dashed; }
.stamp.s-intake         { color: var(--ink-3); }
.stamp.s-diagnosing     { color: var(--info); }
.stamp.s-quoted         { color: var(--warn); }
.stamp.s-parts-required { color: var(--danger); border-style: dashed; background: color-mix(in oklab, var(--danger) 12%, transparent); }
.stamp.s-parts-ordered  { color: var(--accent); }
.stamp.s-in-progress    { color: var(--accent-2); }
.stamp.s-ready          { color: var(--accent-2); border-color: var(--accent-2); background: color-mix(in oklab, var(--accent-2) 14%, transparent); }
.stamp.s-picked-up      { color: var(--ink-3); opacity: 0.6; }

.stamp.p-required     { color: var(--danger); border-style: dashed; background: color-mix(in oklab, var(--danger) 12%, transparent); }
.stamp.p-ordered      { color: var(--warn); }
.stamp.p-in-transit   { color: var(--info); }
.stamp.p-arrived      { color: var(--accent-2); background: color-mix(in oklab, var(--accent-2) 14%, transparent); }

/* ─── Kanban ──────────────────────────────────────────────────────── */
.kanban {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}
.kanban-col {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  min-height: 200px;
  display: flex; flex-direction: column; gap: 9px;
  transition: background 0.15s, border-color 0.15s;
}
.kanban-col[data-drag-over="1"] {
  background: color-mix(in oklab, var(--accent) 12%, var(--panel-soft));
  border-color: var(--accent);
}
.kanban-col-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 4px 6px;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 2px;
}
.kanban-col-head .title {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 600;
}
.kanban-col-head .count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--ink-3);
  background: var(--panel);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--line-soft);
}

/* ─── Job ticket ──────────────────────────────────────────────────── */
.ticket {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: grab;
  box-shadow: 0 1px 0 rgba(255,255,255,0.5) inset, 0 1px 2px rgba(31,26,20,.04);
  transition: transform 0.1s, box-shadow 0.15s, border-color 0.15s;
  position: relative;
  user-select: none;
}
.ticket:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--ink-3);
  transform: translateY(-1px);
}
.ticket[data-dragging="1"] {
  opacity: 0.4;
  cursor: grabbing;
}
.ticket .ticket-no {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}
.ticket .ticket-device {
  font-weight: 500;
  font-size: 13.5px;
  color: var(--ink);
  margin-top: 1px;
  line-height: 1.25;
}
.ticket .ticket-customer {
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 6px;
  display: flex; align-items: center; gap: 6px;
}
.ticket .ticket-meta {
  display: flex; align-items: center; gap: 8px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px dashed var(--line-soft);
  font-size: 11px;
  color: var(--ink-3);
}
.ticket .ticket-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-3); }
.ticket-type-tag {
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-weight: 500;
  background: var(--paper);
  display: inline-flex; align-items: center; gap: 4px;
}

/* ─── Avatar ──────────────────────────────────────────────────────── */
.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper-deep);
  color: var(--ink);
  font-family: 'Newsreader', serif;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--line);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.avatar.sm { width: 22px; height: 22px; font-size: 11px; }
.avatar.lg { width: 56px; height: 56px; font-size: 24px; }

/* ─── Tables / lists ──────────────────────────────────────────────── */
.data-row {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background 0.1s;
  text-decoration: none;
  color: inherit;
}
.data-row:hover { background: var(--panel-soft); text-decoration: none; }
.data-row:last-child { border-bottom: 0; }
.data-row-head {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  cursor: default;
  padding: 9px 16px;
  background: color-mix(in oklab, var(--ink) 4%, transparent);
  border-bottom: 1px solid var(--line);
}
.data-row-head:hover { background: color-mix(in oklab, var(--ink) 4%, transparent); }

/* ─── Field/Form ──────────────────────────────────────────────────── */
.field {
  display: flex; flex-direction: column; gap: 5px;
}
.field label {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}
.field input, .field textarea, .field select {
  font: inherit;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.12s, background 0.12s;
  width: 100%;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--ink-2);
  background: var(--panel-soft);
}
.field textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
  line-height: 1.5;
}
.field .hint {
  font-size: 11.5px;
  color: var(--ink-3);
}
.field .field-error {
  font-size: 11.5px;
  color: var(--danger);
}
.field input.input-error,
.field textarea.input-error,
.field select.input-error {
  border-color: var(--danger);
}

/* Validation summary */
.validation-summary {
  background: color-mix(in oklab, var(--danger) 10%, var(--panel));
  border: 1px solid color-mix(in oklab, var(--danger) 30%, var(--line));
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--danger);
}
.validation-summary ul { margin: 0; padding-left: 18px; }

/* ─── Modal ───────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(20, 16, 10, 0.42);
  backdrop-filter: blur(2px);
  z-index: 100;
  display: grid; place-items: center;
  padding: 24px;
  animation: fadeIn 0.15s;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px -10px rgba(20,16,10,.4);
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  animation: slideUp 0.2s cubic-bezier(.3,.7,.4,1);
}
@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } }
.modal-head {
  padding: 22px 26px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.modal-head h2 { font-size: 22px; }
.modal-head .sub { color: var(--ink-3); font-size: 13px; margin-top: 4px; }
.modal-body { padding: 22px 26px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot {
  padding: 14px 26px 22px;
  display: flex; justify-content: flex-end; gap: 10px;
  border-top: 1px solid var(--line-soft);
}

/* ─── Utilities ───────────────────────────────────────────────────── */
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; }
.muted { color: var(--ink-3); }
.strike { text-decoration: line-through; opacity: 0.55; }
.hr {
  height: 1px;
  background: var(--line-soft);
  margin: 14px 0;
}
.hr.dashed {
  background: transparent;
  border-top: 1px dashed var(--line);
}
.small { font-size: 12.5px; }
.tiny { font-size: 11px; }
.num { font-family: 'IBM Plex Mono', monospace; font-variant-numeric: tabular-nums; }

/* Tag chips for filters */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-2);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.12s;
}
.chip:hover { border-color: var(--ink-3); }
.chip[data-on="1"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.chip .x { color: inherit; opacity: 0.7; margin-left: 2px; }

/* Tick checklist */
.check {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 12.5px;
  cursor: default;
}
.check .box {
  width: 16px; height: 16px;
  border-radius: 4px;
  display: grid; place-items: center;
  border: 1.4px solid var(--line);
  color: var(--panel);
}
.check[data-on="1"] {
  background: color-mix(in oklab, var(--accent-2) 12%, var(--panel));
  border-color: var(--accent-2);
  color: var(--ink);
}
.check[data-on="1"] .box {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: var(--paper);
}
.check[data-on="0"] .text { color: var(--ink-3); }

/* Mobile bottom nav */
.ocs-bottombar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 6px 4px max(6px, env(safe-area-inset-bottom));
  z-index: 30;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
}
.ocs-bottombar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 4px;
  border-radius: 7px;
  color: var(--ink-3);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-decoration: none;
}
.ocs-bottombar a:hover { text-decoration: none; }
.ocs-bottombar a[data-active="1"] { color: var(--ink); }
.ocs-bottombar a[data-active="1"] svg { color: var(--accent); }

@media (max-width: 880px) {
  .ocs-nav { display: none; }
  .ocs-topbar > .ocs-search-wrap { width: auto; }
  .ocs-search { width: auto; min-width: 0; }
  .ocs-search kbd { display: none; }
  .ocs-bottombar { display: grid; }
  .ocs-main { padding: 18px 14px 100px; }
  .page-head h1 { font-size: 26px; }
  .kanban { grid-template-columns: 1fr; }
  .ocs-topbar {
    padding: 10px 14px;
    grid-template-columns: auto 1fr;
    column-gap: 10px;
  }
  .ocs-topbar > .ocs-search-wrap { grid-column: 2; }
  .ocs-logo .word small { display: none; }
  .hide-mobile { display: none !important; }
}

/* Drag ghost styling */
.drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 999;
  opacity: 0.92;
  transform: rotate(-1.5deg);
  width: 240px;
}


/* Section header */
.section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  margin: 24px 0 10px;
}
.section-title .rule {
  flex: 1; height: 1px; background: var(--line);
}

/* Detail page header strip */
.detail-strip {
  display: flex; flex-wrap: wrap;
  align-items: center; gap: 16px;
  padding: 18px 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}
.detail-strip h1 {
  font-size: 26px; line-height: 1;
}

/* Contact row */
.contact-row {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13.5px; line-height: 1.5;
}
.contact-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; flex-shrink: 0;
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--ink-2);
}

/* Stat tile */
.stat {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.stat .lbl {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}
.stat .val {
  font-family: 'Newsreader', serif;
  font-size: 32px;
  line-height: 1;
  font-weight: 500;
  color: var(--ink);
}
.stat .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* Calendar */
.cal-grid {
  display: grid;
  grid-template-columns: 60px repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: var(--panel);
}
.cal-cell {
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  min-height: 44px;
  position: relative;
}
.cal-time {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line-soft);
  padding: 4px 6px 4px 0;
  text-align: right;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  color: var(--ink-3);
}
.cal-day-head {
  padding: 10px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
  text-align: left;
}
.cal-day-head .dow {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}
.cal-day-head .num {
  font-family: 'Newsreader', serif;
  font-size: 22px;
  font-weight: 500;
}
.cal-day-head[data-today="1"] .num { color: var(--accent); }
.cal-day-head[data-today="1"] {
  background: color-mix(in oklab, var(--accent) 8%, var(--panel-soft));
}
.cal-appt {
  position: absolute;
  left: 4px; right: 4px;
  padding: 5px 7px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 5px;
  font-size: 11.5px;
  line-height: 1.25;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(31,26,20,.04);
  transition: transform 0.1s, box-shadow 0.12s;
  text-decoration: none;
  color: inherit;
}
.cal-appt:hover { box-shadow: var(--shadow-hover); transform: translateX(1px); text-decoration: none; }
.cal-appt .t {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}
.cal-appt .l {
  font-weight: 500;
  color: var(--ink);
  margin-top: 1px;
}
.cal-appt.k-pickup   { border-left-color: var(--accent-2); }
.cal-appt.k-drop-off { border-left-color: var(--info); }
.cal-appt.k-consult  { border-left-color: var(--warn); }
.cal-appt.k-onsite   { border-left-color: var(--accent); }

/* Empty state */
.empty {
  padding: 36px 18px;
  text-align: center;
  color: var(--ink-3);
  font-style: italic;
  font-family: 'Newsreader', serif;
  font-size: 15px;
}

/* Section tape decoration */
.tape {
  position: relative;
  display: inline-block;
}
.tape::before {
  content: '';
  position: absolute;
  left: -10px; right: -10px; top: -6px; bottom: -2px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--accent) 26%, transparent), color-mix(in oklab, var(--accent) 16%, transparent));
  border-radius: 2px;
  transform: rotate(-1.2deg);
  z-index: -1;
  opacity: 0.5;
}

/* ─── Inline editable fields ──────────────────────────────────────── */
.inline-edit {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 3px 6px;
  font: inherit;
  color: inherit;
  width: 100%;
  transition: border-color 0.12s, background 0.12s;
}
.inline-edit:hover { border-color: var(--line); background: var(--panel-soft); }
.inline-edit:focus { border-color: var(--ink-2); background: var(--panel-soft); outline: none; }

/* ─── Filter bar ──────────────────────────────────────────────────── */
.filter-bar {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* ─── Two-column grid layout ──────────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.three-col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}
@media (max-width: 680px) {
  .two-col, .three-col { grid-template-columns: 1fr; }
}

/* ─── Detail page 2-column grid ──────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
@media (max-width: 880px) {
  .detail-grid { grid-template-columns: 1fr; }
}

/* ─── Stats strip ─────────────────────────────────────────────────── */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}
