/* Easy Sitters dispatch console — design tokens */
:root {
  --bg: #f4f5f9;
  --panel: #ffffff;
  --panel-2: #fafbfd;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --line: #e5e8ef;
  --line-2: #eef0f5;

  --ink: #0b1120;          /* sidebar */
  --ink-2: #131c31;
  --ink-text: #cbd5e1;
  --ink-muted: #7c8aa5;

  --primary: #4f46e5;      /* indigo */
  --primary-2: #4338ca;
  --primary-soft: #eef2ff;
  --primary-ink: #ffffff;
  --accent: #0ea5a4;       /* teal accent */

  --danger: #dc2626;
  --warn-bg: #fffbeb; --warn-ink: #92400e;
  --alert-bg: #fef2f2; --alert-ink: #991b1b;

  --s-matched: #15803d;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 6px 16px -8px rgba(15, 23, 42, .12);
  --shadow-lg: 0 24px 64px -12px rgba(15, 23, 42, .35);
  --sidebar-w: 248px;

  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.45; }
code { background: rgba(15, 23, 42, .06); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.muted { color: var(--muted); }
.hint { color: var(--muted); margin: 0 0 12px; font-size: 13px; }
h3 { font-size: 14px; margin: 16px 0 8px; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 1000;
  display: flex; flex-direction: column; gap: 18px; padding: 20px 14px;
  background: linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%); color: var(--ink-text);
  border-right: 1px solid rgba(255, 255, 255, .04);
}
.brand-row { display: flex; align-items: center; gap: 11px; padding: 2px 8px 6px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 45%, #0ea5a4 100%);
  box-shadow: 0 6px 18px -6px rgba(99, 102, 241, .7);
}
.brand { font-weight: 700; font-size: 15px; color: #fff; letter-spacing: -.01em; }
.brand-sub { font-size: 11.5px; color: var(--ink-muted); }
.tabs { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.tabs button {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  background: none; border: 0; padding: 9px 11px; border-radius: 9px; cursor: pointer;
  color: var(--ink-text); font: inherit; font-weight: 500; transition: background .15s, color .15s;
}
.tabs button svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.tabs button span:first-of-type { flex: 1; }
.tabs button:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.tabs button.active { background: rgba(99, 102, 241, .18); color: #fff; box-shadow: inset 2px 0 0 #818cf8; }
.tabs button.active svg { opacity: 1; color: #a5b4fc; }
.badge { background: #f43f5e; color: #fff; border-radius: 999px; padding: 1px 7px; font-size: 11px; font-weight: 600; line-height: 1.5; }
.sidebar-foot { display: flex; flex-direction: column; gap: 10px; padding: 12px 8px 0; border-top: 1px solid rgba(255, 255, 255, .07); }
.live { display: flex; align-items: center; gap: 8px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); flex: none; }
.pill { font-size: 12px; color: var(--ink-text); }
.sidebar .btn.ghost { color: var(--ink-text); border-color: rgba(255, 255, 255, .12); background: transparent; align-self: flex-start; }
.sidebar .btn.ghost:hover { color: #fff; border-color: rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .04); }

.content { margin-left: var(--sidebar-w); min-height: 100vh; }
main { padding: 28px 32px 40px; max-width: 1480px; margin: 0 auto; }
.tab { display: none; }
.tab.active { display: block; animation: fadein .18s ease-out; }
@keyframes fadein { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input[type=search] { min-width: 280px; padding-left: 34px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 11px center / 15px; }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Banners ---------- */
.banner { padding: 11px 32px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.banner.warn { background: var(--warn-bg); color: var(--warn-ink); border-color: #fde68a; }
.alert { background: var(--alert-bg); color: var(--alert-ink); padding: 11px 32px; display: flex; gap: 12px;
  align-items: center; flex-wrap: wrap; border-bottom: 1px solid #fecaca; font-weight: 500; font-size: 13.5px; }
.alert .grow { flex: 1; min-width: 200px; }
.alert .muted { color: #b45454; }

/* ---------- Chips / filters ---------- */
.chips { display: inline-flex; gap: 2px; flex-wrap: wrap; background: #e9ecf3; padding: 3px; border-radius: 10px; }
.chips button { border: 0; background: transparent; border-radius: 8px; padding: 6px 13px; cursor: pointer; font: inherit;
  font-weight: 500; font-size: 13px; color: var(--text-2); transition: background .15s, box-shadow .15s; }
.chips button:hover { color: var(--text); }
.chips button.active { background: #fff; color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px rgba(15, 23, 42, .04); }

/* ---------- Buttons ---------- */
.btn { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: var(--radius-sm);
  padding: 8px 14px; cursor: pointer; font: inherit; font-weight: 500; white-space: nowrap; box-shadow: var(--shadow-sm);
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; }
.btn:hover { border-color: #cfd5e1; background: var(--panel-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #5b54ea 0%, var(--primary) 100%); color: var(--primary-ink); border-color: var(--primary-2);
  box-shadow: 0 1px 2px rgba(79, 70, 229, .3), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn.primary:hover { background: linear-gradient(180deg, var(--primary) 0%, var(--primary-2) 100%); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: #fef2f2; border-color: #fecaca; }
.btn.small { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn.ghost { background: transparent; box-shadow: none; }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------- Forms ---------- */
input, select, textarea { font: inherit; padding: 8px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--text); width: 100%; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #a5b4fc; box-shadow: 0 0 0 3px rgba(99, 102, 241, .15); }
textarea { min-height: 72px; resize: vertical; }
label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 12px; }
label > input, label > select, label > textarea { margin-top: 5px; color: var(--text); font-size: 14px; font-weight: 400; }
label.check { display: flex; gap: 9px; align-items: center; color: var(--text); font-size: 14px; font-weight: 400; }
label.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }
.span2 { grid-column: span 2; }

/* ---------- Tables ---------- */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
th { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  background: var(--panel-2); position: sticky; top: 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: #f8f9fc; }
tr:last-child td { border-bottom: 0; }
td.actions { white-space: nowrap; text-align: right; }
td.actions .btn { margin-left: 4px; }
#sitterTable td:nth-child(2), #familyTable td:nth-child(2) { white-space: nowrap; }
tr.inactive td { color: var(--muted); background: #fbfbfd; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 6px; background: #eef0f5; color: var(--muted); margin-left: 4px; }
td .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
td.notes { max-width: 260px; color: var(--text-2); }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }

/* ---------- Status badges (soft tints) ---------- */
.status { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: #f1f5f9; color: #334155; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .06); }
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.status.waiting { background: #fffbeb; color: #b45309; }
.status.matched { background: #ecfdf3; color: #15803d; }
.status.completed { background: #f1f5f9; color: #475569; }
.status.no_sitter { background: #fef2f2; color: #b91c1c; }
.status.scheduled { background: #eff6ff; color: #1d4ed8; }
.status.cancelled { background: #f8fafc; color: #94a3b8; }
.status.pending_approval { background: #f5f3ff; color: #6d28d9; }
.status.pending_confirm { background: #fdf2f8; color: #be185d; }
.status.pending_verify { background: #fff7ed; color: #c2410c; }
.status.pending_payment { background: #fff1f2; color: #be123c; }

/* ---------- Overview ---------- */
.ov-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.ov-title { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
#ovDate { margin-top: 2px; }
.mode-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; min-width: 360px; box-shadow: var(--shadow); }
.mode-title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 7px 0; margin: 0; font-size: 13px; color: var(--text); cursor: pointer; font-weight: 400; }
.switch-row + .switch-row { border-top: 1px solid var(--line-2); }
.switch-row .muted { font-size: 12px; }
input.switch { appearance: none; -webkit-appearance: none; width: 38px; height: 22px; border-radius: 11px; background: #d5dae3; position: relative;
  cursor: pointer; transition: background .2s; flex: none; padding: 0; border: 0; margin: 0; box-shadow: inset 0 1px 2px rgba(15, 23, 42, .12); }
input.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  transition: left .2s; box-shadow: 0 1px 3px rgba(15, 23, 42, .25); }
input.switch:checked { background: var(--primary); }
input.switch:checked::after { left: 19px; }
input.switch:focus { box-shadow: 0 0 0 3px rgba(99, 102, 241, .2); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 15px;
  box-shadow: var(--shadow); overflow: hidden; }
.kpi::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, #6366f1, #0ea5a4); opacity: .55; }
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi .num { font-size: 32px; font-weight: 700; line-height: 1.1; margin-top: 6px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.hot { border-color: #fbcfe8; background: linear-gradient(180deg, #fff 0%, #fff7fb 100%); }
.kpi.hot::before { background: linear-gradient(90deg, #ec4899, #f43f5e); opacity: 1; }
.kpi.hot .num { color: #be185d; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; overflow: hidden; box-shadow: var(--shadow); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.panel-head h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.table-wrap.flat { border: 0; border-radius: 0; box-shadow: none; }
.action-panel { border-color: #fbcfe8; }
.action-panel .panel-head { background: linear-gradient(90deg, #fff7fb 0%, #fff 70%); }
.action-panel .panel-head h2::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ec4899;
  margin-right: 8px; vertical-align: 1px; box-shadow: 0 0 0 3px rgba(236, 72, 153, .18); }
.action-card { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--line-2); align-items: center; }
.action-card:last-child { border-bottom: 0; }
.action-card:hover { background: #fcfcfe; }
.action-card .what { font-weight: 600; margin: 6px 0 3px; font-size: 14.5px; }
.action-card .meta { color: var(--muted); font-size: 13px; }
.action-card .btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.calm { padding: 20px 18px; color: var(--muted); }
.elapsed { font-variant-numeric: tabular-nums; font-size: 12px; }

.yes { color: var(--s-matched); font-weight: 600; }
.no { color: var(--muted); }
.toggle { cursor: pointer; border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; background: #fff; font: inherit; font-size: 12px; font-weight: 500; color: var(--muted); }
.toggle.on { background: #ecfdf3; border-color: #bbf7d0; color: #15803d; font-weight: 600; }

/* ---------- Dialogs ---------- */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(680px, calc(100vw - 32px)); max-height: 90vh; box-shadow: var(--shadow-lg); }
dialog[open] { animation: pop .16s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }
dialog::backdrop { background: rgba(11, 17, 32, .5); backdrop-filter: blur(3px); }
dialog form { padding: 24px 26px; }
dialog h2 { margin: 0 0 16px; font-size: 19px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
dialog .foot { display: flex; justify-content: flex-end; gap: 8px; margin: 20px -26px -24px; padding: 14px 26px; background: var(--panel-2); border-top: 1px solid var(--line-2); }
dialog .error { color: var(--danger); }
dialog p b { color: var(--text); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 8px 0; border-bottom: 1px dashed var(--line); display: flex; justify-content: space-between; gap: 10px; }
.cand { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); gap: 10px; }
h3.form-h { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--primary); font-weight: 700; margin: 20px 0 10px; border-top: 1px solid var(--line-2); padding-top: 16px; }
.verify-box { background: #f0fdf4; border: 1px solid #bbf7d0; padding: 11px 12px; border-radius: var(--radius-sm); margin-top: 10px; }

/* ---------- Map ---------- */
#map { height: calc(100vh - 170px); min-height: 480px; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
.map-layout { display: grid; grid-template-columns: 1fr 340px; gap: 16px; }
.map-side { display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 170px); overflow-y: auto; }
.map-side .panel { margin: 0; }
.map-filters label.check { margin: 0; }
.side-item { padding: 11px 16px; border-bottom: 1px solid var(--line-2); cursor: pointer; transition: background .12s; }
.side-item:last-child { border-bottom: 0; }
.side-item:hover, .side-item.sel { background: var(--primary-soft); }
.side-item .t { font-weight: 600; margin-top: 4px; }
.side-item .m { font-size: 12px; color: var(--muted); margin-top: 2px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; vertical-align: -1px; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(15, 23, 42, .25); }
.dot.sitter-on { background: #1d9a53; } .dot.sitter-off { background: #9ca3af; } .dot.family { background: #2357d9; }
.dot.ring { background: #fff; border: 3px solid #f59e0b; box-shadow: none; }
.zone-label { background: rgba(255, 255, 255, .9); border: 0; box-shadow: 0 1px 3px rgba(15, 23, 42, .15); font-weight: 700; font-size: 12px; padding: 2px 7px; border-radius: 6px; color: var(--text); }
.pin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(15, 23, 42, .35), 0 2px 4px rgba(15, 23, 42, .25); }
/* Active request: solid orange ring (always visible) plus a soft pulse. */
.pin.active-req { width: 22px; height: 22px; border: 4px solid #f59e0b; animation: pulse 1.6s infinite; }
.pin.selected { border: 4px solid #f59e0b; width: 22px; height: 22px; }
.pin.active-req.selected { border-color: #ea580c; border-width: 5px; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, .7); } 70% { box-shadow: 0 0 0 12px rgba(245, 158, 11, 0); } 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); } }
.pin-popup { font-family: "Inter", system-ui, sans-serif; }
.pin-popup b { font-size: 14px; }
.pin-popup .btn { margin-top: 8px; }
.leaflet-popup-content-wrapper { border-radius: 12px; box-shadow: var(--shadow-lg); }
.est { font-size: 11px; color: var(--muted); }
audio { height: 34px; max-width: 280px; }

/* ---------- Login ---------- */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 16px;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(99, 102, 241, .35), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(14, 165, 164, .28), transparent 60%),
    linear-gradient(180deg, #0b1120, #131c31); }
.login-card { background: rgba(255, 255, 255, .98); padding: 34px 32px 30px; border-radius: 18px; width: min(380px, 100%); box-shadow: var(--shadow-lg); }
.login-card::before { content: ''; display: block; width: 44px; height: 44px; border-radius: 12px; margin-bottom: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11l9-7 9 7'/%3E%3Cpath d='M5 10v10h14V10'/%3E%3Cpath d='M10 20v-5h4v5'/%3E%3C/svg%3E"), linear-gradient(135deg, #6366f1 0%, #4f46e5 45%, #0ea5a4 100%);
  background-repeat: no-repeat, no-repeat; background-position: center, center; background-size: 22px 22px, 100% 100%;
  box-shadow: 0 8px 20px -8px rgba(99, 102, 241, .8); }
.login-card h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.login-card > .muted { margin: 4px 0 22px; }
.login-card .btn { width: 100%; margin-top: 8px; padding: 11px; font-weight: 600; }
.error { color: var(--danger); }

/* ---------- Responsive ---------- */

@media (max-width: 1000px) { .map-layout { grid-template-columns: 1fr; } .map-side { max-height: none; } #map { height: 60vh; } }
@media (max-width: 900px) {
  /* Sidebar becomes a top bar on small screens. */
  .sidebar { position: sticky; inset: auto; top: 0; width: auto; flex-direction: row; align-items: center; gap: 10px; padding: 10px 16px; flex-wrap: wrap; }
  .brand-sub, .sidebar-foot .live { display: none; }
  .tabs { flex-direction: row; overflow-x: auto; flex: 1 1 100%; order: 3; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { width: auto; white-space: nowrap; }
  .tabs button span:first-of-type { flex: none; }
  .sidebar-foot { flex-direction: row; border: 0; padding: 0; margin-left: auto; }
  .content { margin-left: 0; }
  main { padding: 18px 16px 32px; }
  .banner, .alert { padding-left: 16px; padding-right: 16px; }
  .mode-card { min-width: 0; width: 100%; }
}
@media (max-width: 700px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .toolbar input[type=search] { min-width: 0; width: 100%; }
}
@media (max-width: 600px) { .action-card { grid-template-columns: 1fr; } .action-card .btns { justify-content: flex-start; } }

/* Family profile: what the parent said */
.review { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 4px 14px 10px; margin-bottom: 8px; }
.review audio { width: 100%; max-width: none; }
.review .flag { margin: 6px 0; color: #b45309; font-weight: 500; font-size: 13px; }
table.heard td { padding: 7px 8px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
table.heard tr:last-child td { border-bottom: 0; }
table.heard .h-field { width: 150px; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
table.heard .h-play { width: 80px; text-align: right; }

/* ---------- Live job board (Overview) ---------- */
.board-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; }
.board-head h2 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; margin-bottom: 22px; }
.board-empty { grid-column: 1 / -1; background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; padding: 34px 18px; }
.job { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 12px; min-width: 0; border-top: 4px solid #cbd5e1; }
.job.waiting { border-top-color: #f59e0b; }
.job.pending_approval, .job.pending_confirm, .job.pending_payment { border-top-color: var(--primary); }
.job.matched { border-top-color: #16a34a; }
.job.no_sitter { border-top-color: #dc2626; }
.job.scheduled { border-top-color: #3b82f6; }
.job-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.job-head h3 { margin: 6px 0 0; font-size: 16px; font-weight: 700; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--text-2); }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: #eef0f5; color: var(--muted); }
.chip.warn { background: #fff7ed; color: #c2410c; }

/* Progress: five steps with a line between them */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; }
.steps li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; padding: 0 2px; min-width: 0; }
.steps li::before { content: ''; position: absolute; top: 8px; left: -50%; width: 100%; height: 3px; background: var(--line); z-index: 0; }
.steps li:first-child::before { display: none; }
.steps li.done::before, .steps li.now::before, .steps li.warn::before, .steps li.bad::before { background: #86efac; }
.steps .dot { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--line); z-index: 1; }
.steps li.done .dot { background: #16a34a; border-color: #16a34a; }
.steps li.now .dot { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79, 70, 229, .18); animation: nowpulse 1.4s infinite; }
.steps li.warn .dot { background: #f59e0b; border-color: #f59e0b; }
.steps li.bad .dot { background: #dc2626; border-color: #dc2626; }
.steps .sl { font-size: 11.5px; font-weight: 600; color: var(--text-2); line-height: 1.2; }
.steps li.todo .sl { color: var(--muted); font-weight: 500; }
.steps .ss { font-size: 11px; color: var(--muted); line-height: 1.2; overflow-wrap: anywhere; }
.steps li.now .ss { color: var(--primary); font-weight: 600; }
@keyframes nowpulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(79, 70, 229, .18); } 50% { box-shadow: 0 0 0 7px rgba(79, 70, 229, .06); } }

/* Sitters called */
.calls { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.calls-h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 6px; }
.callnote { font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.calls ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.call { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 7px; background: var(--panel); font-size: 13px; }
.call .ci { font-size: 15px; text-align: center; }
.call .cn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call .cs { text-align: right; color: var(--text-2); white-space: nowrap; }
.call.live { background: #fffbeb; box-shadow: inset 3px 0 0 #f59e0b; }
.call.live .cs { color: #b45309; font-weight: 600; }
.call.good { background: #ecfdf3; box-shadow: inset 3px 0 0 #16a34a; }
.call.good .cs { color: #15803d; font-weight: 700; }
.call.bad .cs { color: #b91c1c; }
.next { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.booked { font-size: 13.5px; background: #ecfdf3; color: #166534; padding: 8px 10px; border-radius: var(--radius-sm); }
.booked.bad { background: #fef2f2; color: #991b1b; }
.job-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.job-actions:empty { display: none; }

/* Tip and settings */
.tip { background: var(--primary-soft); color: #3730a3; border: 1px solid #c7d2fe; border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 13.5px; margin-bottom: 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.tip .btn { margin-left: auto; }
.settings-box { position: relative; }
.settings-box > summary { list-style: none; }
.settings-box > summary::-webkit-details-marker { display: none; }
.settings-box[open] > .mode-card { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; width: 380px; max-width: calc(100vw - 32px); box-shadow: var(--shadow-lg); }
@media (max-width: 520px) { .board { grid-template-columns: 1fr; } .steps .ss { display: none; } }

/* ---------- Phone menu ---------- */
.pm-pad { padding: 16px 18px; }
.pm-numbers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 0 18px; }
.pm-numbers input { width: 100%; }
.pm-prompt { border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--panel-2); }
.pm-prompt-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; font-size: 13.5px; }
.pm-prompt-head .muted { font-size: 12px; }
.pm-prompt label { margin-bottom: 8px; }
.pm-prompt textarea { width: 100%; min-height: 0; }
.pm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 14px; }
.pm-voice { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.pm-voice audio { height: 32px; max-width: 240px; }
.pm-using { font-size: 12px; font-weight: 600; color: var(--muted); padding: 3px 8px; border-radius: 999px; background: var(--line-2); }
.pm-using.mine { color: #065f46; background: #d1fae5; }
.pm-stale { flex-basis: 100%; font-size: 12px; color: var(--warn-ink); background: var(--warn-bg); padding: 6px 9px; border-radius: 6px; }
.pm-preview { background: var(--primary-soft); border: 1px solid #e0e7ff; border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 14px;
  display: grid; gap: 5px; font-size: 13px; color: var(--text-2); }
.pm-preview .mine { text-decoration: underline; text-decoration-color: #10b981; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.pm-opt { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px 10px; margin-bottom: 10px; background: var(--panel); }
.pm-opt.off { opacity: .55; background: var(--panel-2); }
.pm-opt-main { display: grid; grid-template-columns: 74px 150px minmax(170px, 240px) 1fr auto; gap: 12px; align-items: end; }
.pm-opt label { margin-bottom: 8px; }
.pm-opt select, .pm-opt input:not(.switch), .pm-opt textarea { width: 100%; }
.pm-opt select.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220, 38, 38, .12); }
.pm-says-row { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.pm-says-row input { margin: 0; }
.pm-says-row .muted { white-space: nowrap; font-size: 13px; }
.pm-opt-tools { display: flex; align-items: center; gap: 4px; margin-bottom: 10px; }
.pm-on { margin: 0 6px 0 0; }
.pm-extra { display: block; margin: 0 0 8px; max-width: 640px; }
.pm-note { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.pm-note.warn { color: var(--warn-ink); background: var(--warn-bg); padding: 6px 9px; border-radius: 6px; }
.pm-line { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding-top: 8px; border-top: 1px dashed var(--line-2); }
.pm-read { font-size: 12px; }
.rec-script { font-size: 17px; line-height: 1.5; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--primary-soft); margin-bottom: 14px; }
.rec-box { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.rec-time { font-variant-numeric: tabular-nums; font-size: 18px; font-weight: 600; color: var(--text-2); }
#recBtn.recording { background: var(--danger); border-color: #b91c1c; animation: recpulse 1.2s ease-in-out infinite; }
@keyframes recpulse { 50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, .2); } }
#recPreview { width: 100%; margin-bottom: 10px; }
@media (max-width: 900px) {
  .pm-opt-main { grid-template-columns: 74px 1fr; }
  .pm-says, .pm-opt-tools { grid-column: 1 / -1; }
}
.pm-voice-pick { display: grid; grid-template-columns: minmax(240px, 2fr) minmax(180px, 1fr) auto; gap: 12px; align-items: end; }
.pm-voice-pick select, .pm-voice-pick input { width: 100%; }
.pm-voice-pick .btn { margin-bottom: 12px; }
.pm-recog { border-top: 1px solid var(--line-2); padding-top: 12px !important; margin-bottom: 10px; }
@media (max-width: 900px) { .pm-voice-pick { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) { .pm-pad { padding: 12px; } .pm-opt-main { grid-template-columns: minmax(0, 1fr); } .pm-voice audio { max-width: 100%; } }

/* ---------- Take a sitter request / what sitters did ---------- */
.nr-results { display: grid; gap: 6px; margin: -4px 0 10px; }
.nr-hit { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; text-align: left; font: inherit; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--panel); cursor: pointer; }
.nr-hit:hover { border-color: #a5b4fc; background: var(--primary-soft); }
.nr-none { font-size: 13px; }
.nr-card { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--primary-soft); border: 1px solid #e0e7ff; margin-bottom: 8px; }
.nr-card .chip { margin-top: 6px; display: inline-block; }
.nr-newhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.nr-when, .nr-where { margin-bottom: 10px; }
.rsum { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.rchip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: var(--line-2); color: var(--text-2); margin: 0 4px 3px 0; white-space: nowrap; }
.rchip.good { background: #dcfce7; color: #166534; }
.rchip.bad { background: #fee2e2; color: #991b1b; }
.rchip.live { background: #e0e7ff; color: #3730a3; }
.rgroup { border-left: 3px solid var(--line); padding: 4px 0 4px 12px; margin: 10px 0; }
.rgroup.good { border-color: #22c55e; } .rgroup.bad { border-color: #ef4444; } .rgroup.live { border-color: #6366f1; }
.rgroup-h { font-weight: 600; font-size: 13.5px; margin-bottom: 4px; }
.rgroup ul { margin: 0; padding-left: 18px; font-size: 13px; }
.rgroup li { margin: 3px 0; }
.rdetails { margin-top: 12px; } .rdetails summary { cursor: pointer; color: var(--muted); font-size: 13px; }
label[hidden] { display: none; }
.rgroup.live { display: block; }

/* ---------- Texts ---------- */
.texts-cell { padding: 14px !important; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); }
.convo { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); display: flex; flex-direction: column; overflow: hidden; }
.convo header { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); }
.bubbles { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; max-height: 360px; overflow-y: auto; background: var(--panel-2); }
.bubble { max-width: 82%; padding: 7px 11px; border-radius: 14px; font-size: 13px; line-height: 1.4; }
.bubble span { display: block; font-size: 10.5px; opacity: .6; margin-top: 2px; }
.bubble.in { align-self: flex-start; background: #fff; border: 1px solid var(--line); }
.bubble.out { align-self: flex-end; background: var(--primary); color: #fff; }
.convo-reply { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line-2); }
.convo-reply input { flex: 1; min-width: 0; }

/* ---------- Website reviews ---------- */
.rev-row { display: grid; grid-template-columns: 110px 1fr 220px auto; gap: 12px; align-items: end; padding: 10px 0; border-bottom: 1px dashed var(--line-2); }
.rev-row label { margin: 0; }
.rev-row textarea, .rev-row input, .rev-row select { width: 100%; }
@media (max-width: 900px) { .rev-row { grid-template-columns: 1fr; } }

/* ---------- Dispatchers ---------- */
.disp-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(150px, 1fr) auto auto auto auto; gap: 12px; align-items: end; padding: 10px 0; border-bottom: 1px dashed var(--line-2); }
.disp-row label { margin: 0; }
.disp-row input:not([type=checkbox]) { width: 100%; }
.disp-row .check { font-size: 13px; margin-bottom: 9px; white-space: nowrap; }
.disp-events { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; margin-top: 14px; font-size: 13px; }
.disp-events .check { font-size: 13px; margin: 0; }
@media (max-width: 1100px) { .disp-row { grid-template-columns: 1fr 1fr; } .disp-row .check { white-space: normal; } }

.login-card .remember { display: flex; gap: 8px; align-items: center; margin: 2px 0 14px; font-size: 14px; color: var(--text); }
