/* =========================================================================
   Inbound · Dock Booking — design tokens and component styles.
   Ported from the Claude Design handoff (booking-system/project).
   ========================================================================= */

:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #fafaf7;
  --ink: #17181a;
  --ink-2: #3a3d42;
  --muted: #70747b;
  --faint: #b7bac0;
  --line: #e7e6e1;
  --line-2: #efeeea;
  --accent: #3244ff;
  --accent-soft: #e8ebff;
  --accent-ink: #1b27b3;
  --warn: #c2540a;
  --warn-soft: #fbecd8;
  --ok: #1d7a4c;
  --ok-soft: #dcf2e5;
  --pending: #8a6200;
  --pending-soft: #fbf0c9;
  --stage-pending: #8a6200;
  --stage-pending-soft: #fbf0c9;
  --stage-reserved: #6d5ac8;
  --stage-reserved-soft: #ece8f9;
  --stage-in-process: #c29a18;
  --stage-in-process-soft: #fcf4d2;
  --stage-finished: #1d7a4c;
  --stage-finished-soft: #dcf2e5;
  --stat-alert: #c2281f;
  --danger: #c0392b;
  --svc-inbound: #2563a8;
  --svc-inbound-soft: #b7dbf0;
  --svc-outbound: #4a7c3a;
  --svc-outbound-soft: #b9d2bd;
  --shadow: 0 1px 0 rgba(10,10,15,.02), 0 2px 4px rgba(10,10,15,.03), 0 12px 24px -12px rgba(10,10,15,.06);
  --shadow-lg: 0 2px 0 rgba(10,10,15,.02), 0 12px 24px -6px rgba(10,10,15,.08), 0 32px 64px -20px rgba(10,10,15,.12);
  --radius: 10px;
  --radius-lg: 14px;
}

html.dark {
  --bg: #0d0e10;
  --surface: #16181c;
  --surface-2: #111316;
  --ink: #f2f2ef;
  --ink-2: #c9cace;
  --muted: #8a8e96;
  --faint: #484c53;
  --line: #23262c;
  --line-2: #1c1f24;
  --accent: #7a87ff;
  --accent-soft: #1a1f45;
  --accent-ink: #bcc4ff;
  --warn: #f0a765;
  --warn-soft: #3a2914;
  --ok: #6ad59b;
  --ok-soft: #103a25;
  --pending: #e6c767;
  --pending-soft: #3a2f0e;
  --svc-inbound: #5e97d8;
  --svc-inbound-soft: #1e3348;
  --svc-outbound: #8db67c;
  --svc-outbound-soft: #1f3225;

  --stage-pending: #e6c767;
  --stage-pending-soft: #3a2f0e;
  --stage-reserved: #b5a7f5;
  --stage-reserved-soft: #2a2255;
  --stage-in-process: #e6c767;
  --stage-in-process-soft: #3a2f0e;
  --stage-finished: #6ad59b;
  --stage-finished-soft: #103a25;
  --stat-alert: #ef6f65;
  --shadow: 0 1px 0 rgba(0,0,0,.25), 0 12px 24px -12px rgba(0,0,0,.6);
  --shadow-lg: 0 12px 24px -6px rgba(0,0,0,.6), 0 32px 64px -20px rgba(0,0,0,.8);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font-family: 'Inter', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-feature-settings: "zero" 1, "ss01" 1; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }
::selection { background: var(--accent-soft); color: var(--accent-ink); }
[hidden] { display: none !important; }

/* ===== Page shell ===== */
.page { min-height: 100vh; display: flex; flex-direction: column; }
.page__hd { display: flex; align-items: center; justify-content: space-between; padding: 18px 32px; border-bottom: 1px solid var(--line); background: var(--surface); }
.page__body { flex: 1; padding: 40px 32px 80px; }
.page__body--wide { padding: 0; display: flex; flex-direction: column; min-height: 0; }

/* ===== Brand ===== */
.brand { display: flex; align-items: center; gap: 12px; }
.brand__logo { height: 32px; width: auto; display: block; }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font-family: 'JetBrains Mono', ui-monospace, monospace; font-feature-settings: "zero" 1, "ss01" 1; font-weight: 400; font-size: 18px; letter-spacing: -0.01em; }
.brand__sub { font-size: 10.5px; color: var(--muted); margin-top: 2px; letter-spacing: 0.04em; }
.hd-meta { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.meta-lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.meta-val { font-size: 12px; font-weight: 500; margin-top: 3px; }
.hd-right { display: flex; align-items: center; gap: 18px; }

/* ===== User menu (header logout pill) ===== */
.user-menu { display: inline-flex; align-items: stretch; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; transition: border-color .15s; }
.user-menu:hover { border-color: var(--faint); }
.user-menu__who { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 10px; font-size: 12px; color: var(--ink-2); }
.user-menu__who > svg { color: var(--muted); flex-shrink: 0; }
.user-menu__email { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu__logout { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border: none; border-left: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); font-size: 11.5px; font-weight: 500; cursor: pointer; transition: all .15s; }
.user-menu__logout:hover { background: var(--accent-soft); color: var(--accent-ink); }

/* ===== Greeting ===== */
.greet { margin: 0 auto 24px; max-width: 620px; }
.greet--center { text-align: center; }
.greet__title { font-size: 32px; font-weight: 600; letter-spacing: -0.025em; margin: 0 0 6px; line-height: 1.15; }
.greet__sub { font-size: 14px; color: var(--muted); margin: 0; line-height: 1.5; text-wrap: pretty; }

/* ===== Auth (login / check-email / error) ===== */
.auth-body { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 24px 80px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px; }
.auth-card--note { gap: 14px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form__submit { width: 100%; justify-content: center; }
.auth-card__divider { display: flex; align-items: center; gap: 10px; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; }
.auth-card__divider::before, .auth-card__divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-card__alt { width: 100%; justify-content: center; }
.auth-note { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface-2); border: 1px dashed var(--line); border-radius: var(--radius); font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.auth-note > svg { color: var(--accent); flex-shrink: 0; }

/* ===== Form container ===== */
.form { max-width: 620px; margin: 0 auto; }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 8px; border: 1px solid transparent; font-size: 13px; font-weight: 500; cursor: pointer; transition: all .15s; text-decoration: none; }
.btn--primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--primary:hover:not(:disabled) { filter: brightness(0.95); }
.btn--primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn--ghost:hover:not(:disabled) { border-color: var(--faint); color: var(--ink); background: var(--surface); }
.btn--ghost:disabled { opacity: 0.4; cursor: not-allowed; }
.btn--danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn--danger:hover:not(:disabled) { filter: brightness(0.92); }
.btn--danger:disabled { opacity: 0.4; cursor: not-allowed; }
.btn--lg { padding: 12px 20px; font-size: 13.5px; }
.icon-btn { width: 28px; height: 28px; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink-2); transition: all .15s; padding: 0; }
.icon-btn:hover { border-color: var(--faint); color: var(--ink); }

.drawer__header-actions { display: flex; align-items: center; gap: 0.25rem; }

.icon-btn--danger:hover,
.icon-btn--danger:focus-visible { color: var(--danger, #c0392b); }

/* ===== Service chips ===== */
.svc-chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.svc-chip { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; text-align: left; transition: all .15s; }
.svc-chip:hover { border-color: var(--faint); }
.svc-chip.is-on { border-color: var(--c); background: color-mix(in srgb, var(--c) 8%, var(--surface)); box-shadow: inset 0 0 0 1px var(--c); }
.svc-chip__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex-shrink: 0; }
.svc-chip__lbl { flex: 1; font-size: 13px; font-weight: 500; color: var(--ink); }
.svc-chip__tag { font-size: 10px; color: var(--muted); background: var(--surface-2); padding: 3px 6px; border-radius: 4px; letter-spacing: 0.06em; }
.svc-chip.is-on .svc-chip__tag { background: var(--c); color: #fff; }
.svc-dot { display: inline-block; width: 8px; height: 8px; background: var(--c); border-radius: 50%; margin-right: 7px; vertical-align: middle; }

/* ===== Fields ===== */
.field { display: block; margin-bottom: 12px; }
.field__label { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; letter-spacing: 0.01em; }
.field__hint { font-size: 10.5px; color: var(--muted); font-weight: 400; margin-left: auto; }
.req { color: var(--svc-inbound); font-weight: 700; margin-left: 4px; font-size: 12px; }
.field__control { position: relative; display: flex; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: all .15s; }
.field__control:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field__icon { padding: 0 4px 0 12px; color: var(--muted); flex-shrink: 0; display: flex; }
.field__control:focus-within .field__icon { color: var(--accent); }
.field__input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; color: var(--ink); font-size: 13.5px; padding: 10px 12px; width: 100%; }
.field__input--ta { resize: vertical; min-height: 56px; font-family: inherit; }
.field__input::placeholder { color: var(--faint); }
.field__suffix { padding: 0 12px; font-size: 11px; color: var(--muted); background: var(--surface-2); border-left: 1px solid var(--line); align-self: stretch; display: flex; align-items: center; border-radius: 0 var(--radius) var(--radius) 0; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ===== Wizard ===== */
.wiz-steps { display: flex; gap: 4px; list-style: none; padding: 0; margin: 0 0 24px; }
.wiz-step { flex: 1; display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-size: 12px; color: var(--muted); transition: all .2s; }
.wiz-step.is-on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.wiz-step.is-done { color: var(--ink-2); background: var(--surface); }
.wiz-step.is-done .wiz-step__n { color: var(--accent); }
.wiz-step__n { font-size: 10px; font-weight: 600; letter-spacing: 0.06em; }
.wiz-step.is-on .wiz-step__n { color: var(--bg); }
.wiz-step__l { font-weight: 500; }
.wiz-body { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); min-height: 320px; }
.wiz-panel { animation: fade-in .25s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.panel-title { font-size: 18px; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 4px; }
.panel-sub { font-size: 12.5px; color: var(--muted); margin: 0 0 18px; }
.dock-note { margin-top: 14px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 8px; font-size: 12px; color: var(--ink-2); }
.wiz-foot { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.wiz-foot__meta { flex: 1; text-align: center; font-size: 11px; color: var(--muted); letter-spacing: 0.08em; }

/* ===== Slot picker: day + grid ===== */
.slot-days { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 5px; margin-bottom: 12px; }
.slot-day { padding: 8px 0; }
.slot-day { padding: 10px 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; transition: all .15s; }
.slot-day:hover { border-color: var(--faint); }
.slot-day.is-on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.slot-day__dow { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.slot-day.is-on .slot-day__dow { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.slot-day__num { font-size: 16px; font-weight: 600; line-height: 1; }
.slot-day__mon { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.slot-day.is-on .slot-day__mon { color: color-mix(in srgb, var(--bg) 70%, transparent); }

.slot-grid__day { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.slot { padding: 12px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; transition: all .15s; position: relative; }
.slot:hover:not(.is-taken) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
.slot.is-sel { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.slot.is-taken { background: transparent; border-style: dashed; cursor: not-allowed; opacity: 0.55; }
.slot__time { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.slot__range { font-size: 10.5px; color: var(--muted); }
.slot__state { font-size: 10px; color: var(--muted); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.08em; }
.slot.is-sel .slot__state { color: var(--accent-ink); font-weight: 600; }
.slot.is-taken .slot__state { color: var(--warn); }

/* ===== Attachments ===== */
.attach { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.attach__bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.attach__btn { font-size: 12.5px; padding: 8px 12px; }
.attach__counter { font-size: 11px; color: var(--muted); margin-left: auto; }
.attach__hint { font-size: 11px; color: var(--muted); margin: 6px 2px 0; }
.attach__error { position: relative; margin-top: 8px; padding: 8px 32px 8px 10px; background: var(--warn-soft); color: var(--warn); border-radius: 6px; font-size: 11.5px; font-weight: 500; border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); }
.attach__error-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.attach__error-list li { line-height: 1.35; }
.attach__error-close { position: absolute; top: 4px; right: 6px; background: transparent; border: none; color: inherit; font-size: 16px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 4px; opacity: 0.7; }
.attach__error-close:hover { opacity: 1; background: color-mix(in srgb, var(--warn) 10%, transparent); }
.attach__list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 4px; }
.attach__item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }
.attach__item-icon { color: var(--muted); flex-shrink: 0; display: flex; }
.attach__item-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); font-weight: 500; }
.attach__item-size { color: var(--muted); font-size: 10.5px; flex-shrink: 0; }
.attach__item-remove { width: 20px; height: 20px; padding: 0; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: none; border-radius: 4px; cursor: pointer; color: var(--muted); transition: all .12s; }
.attach__item-remove:hover { background: var(--line); color: var(--ink); }

/* ===== Done card ===== */
.form-done { max-width: 480px; margin: 0 auto; animation: fade-in .3s ease; }
.done-badge { width: 48px; height: 48px; border-radius: 50%; background: var(--c); color: #fff; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.done-title { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 6px; }
.done-sub { font-size: 13px; color: var(--muted); margin: 0 0 20px; line-height: 1.5; text-wrap: pretty; }
.done-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.done-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line-2); font-size: 13px; gap: 16px; }
.done-row:last-child { border-bottom: none; }
.done-row--status { padding-top: 12px; border-top: 1px solid var(--line); margin-top: 4px; }
.done-lbl { color: var(--muted); }
.done-val { font-weight: 500; color: var(--ink); text-align: right; }

/* ===== Status pills ===== */
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 100px; font-size: 11px; font-weight: 500; }
.status-pill--pending { background: var(--pending-soft); color: var(--pending); }
.status-pill--ok { background: var(--ok-soft); color: var(--ok); }
.status-pill__dot { width: 6px; height: 6px; background: currentColor; border-radius: 50%; animation: status-pulse 1.8s ease-in-out infinite; }
@keyframes status-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ===== Admin header ===== */
.admin-hd { padding: 14px 24px; }
.admin-hd-left, .admin-hd-right { display: flex; align-items: center; gap: 14px; }
.admin-role { font-size: 10px; color: var(--muted); letter-spacing: 0.12em; }

/* ===== Page footer credit ===== */
.page__ft { padding: 10px 32px; border-top: 1px solid var(--line); background: var(--surface); text-align: center; font-size: 10.5px; color: var(--muted); letter-spacing: 0.02em; }
.admin-week { display: flex; align-items: center; gap: 6px; }
.admin-week__label { font-size: 13px; font-weight: 500; padding: 0 6px; }

.bell { position: relative; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 10px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--ink-2); transition: all .15s; }
.bell.has-count { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.bell__count { font-size: 11px; font-weight: 600; }

.avatars { display: flex; align-items: center; }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; color: #fff; letter-spacing: 0.02em; border: 2px solid var(--bg); margin-left: -6px; }
.avatar:first-child { margin-left: 0; }
.avatar--more { background: var(--line) !important; color: var(--ink-2); font-size: 10px; }

/* ===== Stats bar ===== */
.admin-stats {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 16px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.admin-stats > .admin-week { margin-left: auto; align-self: flex-end; }
.stat-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 160px;
}
.stat-group .stat { width: 100%; box-sizing: border-box; }
.stat-btn {
  width: 100%;
  box-sizing: border-box;
  justify-content: center;
}
.stat {
  padding: 6px 14px;
  border-left: 3px solid var(--line);
  min-width: 120px;
}
.stat__lbl {
  display: block;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.stat__val {
  display: inline-block;
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 2px;
}
.stat__unit {
  font-size: 10px;
  color: var(--muted);
  margin-left: 4px;
}
.stat--inbound  { border-left-color: var(--svc-inbound); }
.stat--outbound { border-left-color: var(--svc-outbound); }
.stat--pending  { border-left-color: var(--stat-alert); }
.stat--pending .stat__val { color: var(--stat-alert); }

.btn--outbound,
.btn--inbound {
  background: var(--svc-outbound);
  color: #fff;
  border: 1px solid transparent;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
}
.btn--inbound { background: var(--svc-inbound); }
.btn--outbound:hover,
.btn--inbound:hover { filter: brightness(0.95); }

/* ===== Calendar: time-columns ===== */
.cal-wrap { flex: 1; padding: 24px 28px; min-height: 0; display: flex; }
.cal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); flex: 1; display: flex; flex-direction: column; box-shadow: var(--shadow); overflow: hidden; }
.tc-head { display: grid; grid-template-columns: 56px repeat(12, minmax(72px, 1fr)); border-bottom: 1px solid var(--line); flex-shrink: 0; }
.tc-gutter { display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--surface-2); }
.tc-head .tc-gutter { height: 52px; }
.tc-day { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 0; border-right: 1px solid var(--line); position: relative; }
.tc-day:last-child { border-right: none; }
.tc-day.is-today::after { content: ''; position: absolute; left: 18%; right: 18%; bottom: 0; height: 2px; background: var(--accent); }
.tc-dow { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.tc-day.is-today .tc-dow { color: var(--accent); font-weight: 600; }
.tc-num { font-size: 18px; font-weight: 600; margin-top: 2px; letter-spacing: -0.02em; }
.tc-day.is-today .tc-num { color: var(--accent); }

.tc-body { flex: 1; display: grid; grid-template-columns: 56px repeat(12, minmax(72px, 1fr)); min-height: 0; overflow: auto; }
.tc-time { padding: 4px 8px 0; text-align: right; font-size: 10.5px; color: var(--muted); border-top: 1px solid var(--line-2); }
.tc-time:first-child { border-top: none; }
.tc-col { position: relative; border-right: 1px solid var(--line); }
.tc-col:last-child { border-right: none; }
.tc-col.is-today { background: color-mix(in srgb, var(--accent) 3%, transparent); }
.tc-cell { border-top: 1px solid var(--line-2); }
.tc-cell:first-child { border-top: none; }
.tc-pill-wrap { position: absolute; left: 4px; right: 4px; }
.tc-now { position: absolute; left: 0; right: 0; display: flex; align-items: center; z-index: 5; pointer-events: none; }
.tc-now__dot { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; margin-left: -4px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.tc-now__line { flex: 1; height: 1.5px; background: var(--accent); }

/* ===== Booking pill ===== */
.pill { width: 100%; height: 100%; display: flex; align-items: stretch; padding: 0; background: var(--c-soft, var(--surface)); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; overflow: hidden; text-align: left; transition: all .15s; position: relative; }
.pill:hover { transform: translateY(-1px); border-color: var(--c); box-shadow: 0 4px 10px -2px color-mix(in srgb, var(--c) 30%, transparent); }
.pill__bar { width: 3px; background: var(--c); flex-shrink: 0; }
.pill__body { flex: 1; min-width: 0; padding: 5px 8px; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.pill__row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pill__name { font-size: 11.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.005em; }
.pill__badge { font-size: 9px; padding: 1px 5px; background: var(--pending); color: #fff; border-radius: 3px; letter-spacing: 0.06em; flex-shrink: 0; animation: badge-pulse 1.4s ease-in-out infinite; }
@keyframes badge-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.65; } }
.pill__meta { font-size: 10px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.pill__dot { width: 2px; height: 2px; background: var(--faint); border-radius: 50%; }
.pill.is-pending { background: var(--pending-soft); border-color: var(--pending); border-style: dashed; }
.pill.is-pending .pill__name { color: var(--pending); }
.pill.is-pending .pill__meta { color: var(--pending); opacity: 0.85; }

.pill__stage {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--c-soft, var(--surface));
  z-index: 2;
}
.pill--stage-pending    .pill__stage { background: var(--stage-pending); }
.pill--stage-reserved   .pill__stage { background: var(--stage-reserved); }
.pill--stage-in-process .pill__stage { background: var(--stage-in-process); }
.pill--stage-finished   .pill__stage { background: var(--stage-finished); }
.pill.is-declined { opacity: 0.45; }
.pill.is-declined .pill__stage { display: none; }

/* ===== Drawer ===== */
.drawer { position: fixed; inset: 0; background: color-mix(in srgb, #000 40%, transparent); z-index: 50; display: flex; justify-content: flex-end; animation: fade-in .18s ease; }
.drawer__panel { width: 420px; max-width: 100%; height: 100vh; background: var(--surface); border-left: 1px solid var(--line); overflow-y: auto; box-shadow: var(--shadow-lg); animation: slide-in .25s cubic-bezier(.2,.9,.3,1); display: flex; flex-direction: column; }
@keyframes slide-in { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.drawer__hd { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.drawer__title-wrap { display: flex; align-items: center; gap: 10px; }
.drawer__tag { font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 600; padding: 3px 7px; background: var(--c); color: #fff; border-radius: 4px; letter-spacing: 0.08em; }
.drawer__title { font-size: 17px; font-weight: 600; margin: 0; letter-spacing: -0.015em; }
.drawer__status { padding: 14px 22px 0; }
.drawer__list { padding: 12px 22px; margin: 0; flex: 1; }
.drawer__row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px dashed var(--line-2); font-size: 12.5px; }
.drawer__row:last-child { border-bottom: none; }
.drawer__row dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; padding-top: 2px; margin: 0; }
.drawer__row dd { margin: 0; color: var(--ink); font-weight: 500; text-align: right; max-width: 60%; }
.drawer__row--notes { flex-direction: column; gap: 6px; }
.drawer__row--notes dd { text-align: left; max-width: 100%; font-weight: 400; color: var(--ink-2); line-height: 1.4; }

.attachment-chips { padding: 0 22px 14px; }
.attachment-chips__label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.attachment-chips__row { display: flex; flex-wrap: wrap; gap: 6px; }
.attachment-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 10px; border: 1px solid var(--line-2); border-radius: 100px; background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; font-weight: 500; text-decoration: none; transition: background .15s, border-color .15s; }
.attachment-chip:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.attachment-chip svg { flex: none; }
.attachment-chip__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.drawer__actions { padding: 14px 22px 22px; display: flex; gap: 10px; justify-content: flex-end; position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); }

/* ===== Drawer form (inbound + outbound) ===== */
.drawer-form { max-width: none; margin: 0; padding: 16px 22px 0; display: flex; flex-direction: column; gap: 14px; }
.drawer-form .wiz-panel { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.drawer-form .panel-title { font-size: 13px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 12px; }
.drawer-form .field:last-child { margin-bottom: 0; }
.drawer-form .wiz-foot { margin: 4px -22px 0; padding: 14px 22px 22px; justify-content: flex-end; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--surface); }

/* Native date + select styled to match text inputs */
.drawer-form input[type="date"],
.drawer-form select.field__input {
  color-scheme: light dark;
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
}
.drawer-form input[type="date"]::-webkit-datetime-edit-text,
.drawer-form input[type="date"]::-webkit-datetime-edit-month-field,
.drawer-form input[type="date"]::-webkit-datetime-edit-day-field,
.drawer-form input[type="date"]::-webkit-datetime-edit-year-field { color: var(--ink); }
.drawer-form input[type="date"]:invalid::-webkit-datetime-edit { color: var(--faint); }
.drawer-form input[type="date"] {
  padding-right: 34px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='2' ry='2'/><line x1='16' y1='2' x2='16' y2='6'/><line x1='8' y1='2' x2='8' y2='6'/><line x1='3' y1='10' x2='21' y2='10'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.drawer-form .field__control:focus-within input[type="date"] {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%234c7cff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='2' ry='2'/><line x1='16' y1='2' x2='16' y2='6'/><line x1='8' y1='2' x2='8' y2='6'/><line x1='3' y1='10' x2='21' y2='10'/></svg>");
}
.drawer-form input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0;
  position: absolute;
  right: 0;
  top: 0;
  width: 34px;
  height: 100%;
  padding: 0;
}

select.field__input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}
.field__control:focus-within select.field__input {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%233244ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
}

/* ===== Toast ===== */
.toast-region { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 60; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 12px 18px 12px 14px; background: var(--ink); color: var(--bg); border-radius: 10px; box-shadow: var(--shadow-lg); animation: toast-in .3s cubic-bezier(.2,.9,.3,1); min-width: 320px; max-width: 420px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.toast__icon { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.toast--new .toast__icon { background: color-mix(in srgb, var(--accent) 80%, var(--ink)); color: #fff; }
.toast--ok .toast__icon { background: var(--ok); color: #fff; }
.toast--x .toast__icon { background: var(--warn); color: #fff; }
.toast__body { flex: 1; min-width: 0; }
.toast__title { font-size: 13px; font-weight: 500; letter-spacing: -0.005em; }
.toast__sub { font-size: 11px; color: color-mix(in srgb, var(--bg) 60%, transparent); margin-top: 2px; }

/* ===== Scrollbars ===== */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: var(--faint); }

/* ===== Drawer timeline ===== */
.dtl {
  display: grid;
  grid-template-columns: 28px 1fr;
  padding: 16px 20px;
  border-top: 1px solid var(--line-2);
  background: var(--surface-2);
}
.dtl__row {
  display: contents;
}
.dtl__dot-col {
  position: relative;
  grid-column: 1;
}
.dtl__dot {
  position: relative;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--line);
  box-shadow: 0 0 0 2px var(--surface-2);
  z-index: 1;
}
.dtl__dot--reserved   { background: var(--stage-reserved); box-shadow: 0 0 0 2px var(--stage-reserved-soft); }
.dtl__dot--in-process { background: var(--stage-in-process); box-shadow: 0 0 0 2px var(--stage-in-process-soft); }
.dtl__dot--finished   { background: var(--stage-finished); box-shadow: 0 0 0 2px var(--stage-finished-soft); }
.dtl__rail {
  position: absolute;
  left: 6px;
  top: 18px;
  bottom: -18px;
  width: 2px;
  background: var(--line);
}
.dtl__row:last-child .dtl__rail { display: none; }
.dtl__body { grid-column: 2; padding: 0 0 18px 8px; }
.dtl__hd { font-size: 13px; font-weight: 600; color: var(--ink); }
.dtl__hd--muted { color: var(--muted); font-weight: 500; }
.dtl__sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

.dtl__readout {
  display: grid;
  gap: 0;
  margin: 8px 12px 0 0;
  padding: 4px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.dtl__readout > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line-2);
}
.dtl__readout > div:last-child { border-bottom: 0; }
.dtl__readout > .dtl__readout__notes {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 8px 0 4px;
  border-bottom: 0;
  border-top: 1px dashed var(--line-2);
}
.dtl__readout__notes dt {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0;
}
.dtl__readout__notes dd {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12.5px;
  color: var(--ink);
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.dtl__readout dt {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0;
}
.dtl__readout dd {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink);
  font-weight: 500;
}
.dtl__attach-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: all .15s;
}
.dtl__attach-link:hover {
  border-color: var(--ink-2);
  background: var(--surface);
  color: var(--ink);
}
.dtl__form { display: grid; gap: 10px; margin-top: 10px; padding-right: 12px; }
.dtl__row-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.dtl__field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dtl__field label { font-size: 11px; color: var(--muted); }
.dtl__field input[type="number"],
.dtl__field input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background: var(--surface);
  color: var(--ink);
}
.dtl__field textarea {
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
  background: var(--surface);
  color: var(--ink);
  resize: vertical;
  transition: border-color .15s, box-shadow .15s;
}
.dtl__field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.dtl__field input[type="number"]:focus,
.dtl__field input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.dtl__field input[type="file"] {
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  font-size: 12px;
  color: var(--ink-2);
}
.dtl__field input[type="file"]::file-selector-button {
  padding: 7px 10px;
  margin-right: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.dtl__field input[type="file"]::file-selector-button:hover {
  border-color: var(--ink-2);
  background: var(--surface-2);
}
.dtl__attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.dtl__attach-btn:hover { border-color: var(--ink-2); color: var(--ink); }
.dtl__finish-btn {
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
  margin-top: 6px;
}
.dtl__finish-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.dtl__form .dtl__row-2 .btn,
.dtl__form .dtl__row-2 .dtl__finish-btn {
  width: 100%;
  justify-content: center;
  margin-top: 0;
  padding: 9px 14px;
  font-size: 13px;
  line-height: 1.2;
  box-sizing: border-box;
}

/* --- Delete modal (native <dialog>) --- */
.modal {
  border: none;
  border-radius: 12px;
  padding: 24px 28px;
  max-width: 460px;
  width: calc(100% - 32px);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.modal::backdrop {
  background: rgba(15,17,20,0.45);
}
@keyframes modal-fade-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
@keyframes modal-backdrop-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
dialog.modal[open] {
  animation: modal-fade-in 160ms ease-out;
}
dialog.modal[open]::backdrop {
  animation: modal-backdrop-fade-in 160ms ease-out;
}
.modal__title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
}
.modal__warning {
  margin: 0 0 16px;
  color: var(--warn);
  font-size: 14px;
}
.modal__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}
.modal__field select,
.modal__field textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
}
.modal__field textarea:disabled {
  background: var(--surface-2);
  color: var(--faint);
}
.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}
