/* Kolling admin — same palette as the landing page: warm paper, navy ink, one green. */

:root {
  --paper: #faf8f3;
  --card: #ffffff;
  --ink: #16202e;
  --muted: #6b7280;
  --line: #e6e1d6;
  --accent: #0f6b57;
  --accent-soft: #e8f2ee;
  --danger: #a33a2b;
  --danger-soft: #fbece9;
  --warn: #8a5a00;
  --warn-soft: #fdf3e0;
}

* { box-sizing: border-box; }

body.admin {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

.topbar {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
/* Same width as the page content, so the logo lines up with everything below it. */
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 24px;
  min-height: 64px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 750 20px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; opacity: .85; }
.logo-mark { width: 30px; height: 30px; flex: none; }
.logo-mark rect { fill: var(--accent); }
.logo-mark path { fill: #fff; }

.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.nav a, .nav button {
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.nav a:hover, .nav button:hover { background: var(--paper); color: var(--ink); }
.nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav form.inline { display: inline; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 28px 24px 64px; }

h1 {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 4px 0 6px;
}
h2 { font-size: 17px; margin: 0 0 12px; letter-spacing: -0.01em; }
p { margin: 0 0 12px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.clip { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 18px 0 22px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}
.stat-value {
  font-family: Georgia, serif;
  font-size: 26px;
  line-height: 1.1;
}
.stat-label { color: var(--muted); font-size: 13px; margin-top: 4px; }
.stat-hint { color: var(--muted); font-size: 12px; margin-top: 2px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 22px;
  margin: 0 0 18px;
}
.card.narrow { max-width: 440px; margin: 40px auto; padding: 28px 28px 24px; box-shadow: 0 1px 2px rgba(22,32,46,.04), 0 12px 32px -14px rgba(22,32,46,.16); }
.card.narrow h1 { margin-top: 0; }
.card.narrow form.stack { margin-top: 18px; }
.card.narrow form.stack button.primary { justify-self: stretch; margin-top: 4px; }
.card.narrow > p.small, .card.narrow form + p { margin-top: 14px; }
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.card-head h2 { margin: 0; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) {
  .grid2 { grid-template-columns: 1fr; }
  .topbar-inner { padding: 10px 16px; }
  .wrap { padding: 20px 16px 48px; }
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--paper);
  color: var(--muted);
  border: 1px solid var(--line);
}
.badge.booked { background: var(--accent-soft); color: var(--accent); border-color: #cfe3da; }
.badge.message, .badge.transfer { background: var(--warn-soft); color: var(--warn); border-color: #f0dfbe; }
.badge.failed, .badge.abandoned { background: var(--danger-soft); color: var(--danger); border-color: #f2d5cf; }
.badge.answered, .badge.confirmed { background: var(--paper); color: var(--ink); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.list.big li p { margin: 6px 0 0; }

.empty {
  color: var(--muted);
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 18px;
  text-align: center;
  margin: 0;
}

.notice {
  padding: 10px 14px;
  border-radius: 10px;
  margin: 0 0 16px;
  font-size: 14px;
}
.notice.ok { background: var(--accent-soft); color: var(--accent); }
.notice.error { background: var(--danger-soft); color: var(--danger); }

form.stack { display: grid; gap: 14px; margin: 0; }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }
label .hint { font-weight: 400; font-size: 12.5px; color: var(--muted); margin-top: -2px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }

input, select, textarea {
  font: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
textarea { resize: vertical; }
label.check input { width: auto; }

button.primary, button.secondary {
  font: inherit;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 10px;
  cursor: pointer;
  justify-self: start;
}
button.primary { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
button.primary:hover { filter: brightness(1.08); }
button.secondary { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
button.secondary:hover { background: var(--paper); }

table.hours th { width: 130px; padding-left: 0; }
table.hours td { padding: 6px 8px 6px 0; }

.transcript { list-style: none; margin: 0; padding: 0; }
.transcript li {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.transcript li:last-child { border-bottom: 0; }
.transcript .who {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding-top: 2px;
}
.transcript li.agent .said { color: var(--accent); }
.transcript li.tool .said { color: var(--muted); font-family: ui-monospace, monospace; font-size: 12px; }

audio { width: 100%; max-width: 420px; }

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 20px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 8px 24px 32px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.foot a { color: var(--muted); }

/* Action bar for long forms: keeps Save attached to the cards it saves. */
.form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin: 0 0 18px;
}
.form-actions button { justify-self: auto; }

.big-number {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 20px;
  margin: 0 0 6px;
}

/* Voice picker (Account page) */
.voice-options { display: grid; gap: 10px; }
.voice-option { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 400; }
.voice-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.voice-option input { width: auto; accent-color: var(--accent); }
.voice-option-text { display: grid; gap: 2px; }
.voice-option audio { height: 32px; width: 220px; max-width: 100%; }
@media (max-width: 760px) {
  .voice-option { grid-template-columns: auto 1fr; }
  .voice-option audio { grid-column: 1 / -1; width: 100%; }
}

/* Internal docs (/admin/docs) */
.docs { display: grid; grid-template-columns: 210px 1fr; gap: 28px; align-items: start; }
.docs-nav { position: sticky; top: 84px; display: grid; gap: 2px; }
.docs-nav-title { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; font-weight: 600; }
.docs-nav a { padding: 8px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 14px; }
.docs-nav a:hover { background: var(--card); }
.docs-nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.docs-nav-foot { margin-top: 14px; line-height: 1.5; }
.docs-body { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 28px 32px; min-width: 0; }
.docs-body h1 { margin-top: 0; }
.docs-body h2 { font-size: 18px; margin: 30px 0 12px; }
.docs-body table { margin-bottom: 8px; }
.docs-body td.num, .docs-body th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.docs-body tr.total td { font-weight: 700; border-top: 2px solid var(--ink); }
.docs-body ul, .docs-body ol { padding-left: 20px; }
.docs-body li { margin: 6px 0; }
.docs-body code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: var(--paper); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
.callout { background: var(--warn-soft); border: 1px solid #f0dfbe; color: #5c3d00; border-radius: 10px; padding: 14px 16px; margin: 18px 0; font-size: 14px; }

.flow { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin: 20px 0 8px; }
.flow-step { flex: 1 1 140px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 4px; align-content: start; font-size: 13px; color: var(--muted); }
.flow-step strong { color: var(--ink); font-size: 14px; }
.flow-step.tel { border-color: #cfd8e8; }
.flow-step.cf { flex: 2 1 260px; background: var(--accent-soft); border-color: #cfe3da; }
.flow-k { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.flow-arrow { align-self: center; color: var(--accent); font-size: 20px; font-weight: 700; }
.flow-trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.flow-trio span { background: var(--card); border: 1px solid #cfe3da; border-radius: 8px; padding: 8px; font-size: 12px; color: var(--ink); line-height: 1.4; }
.steps-list li::marker { color: var(--accent); font-weight: 700; }

@media (max-width: 860px) {
  .docs { grid-template-columns: 1fr; }
  .docs-nav { position: static; grid-auto-flow: column; overflow-x: auto; gap: 6px; }
  .docs-nav-title, .docs-nav-foot { display: none; }
  .docs-nav a { white-space: nowrap; border: 1px solid var(--line); background: var(--card); }
  .docs-body { padding: 20px 16px; overflow-x: auto; }
  .flow-arrow { transform: rotate(90deg); flex-basis: 100%; text-align: center; }
  .flow-step, .flow-step.cf { flex-basis: 100%; }
}

/* Staff mailbox (/admin/mail) */
.mail-list li { padding: 0; }
.mail-row { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 12px 6px; color: var(--ink); text-decoration: none; border-radius: 10px; }
.mail-row:hover { background: var(--paper); }
.mail-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: grid; place-items: center; flex: none; }
.mail-main { display: grid; min-width: 0; }
.mail-subject { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-date { white-space: nowrap; }
.mail-read .mail-title { font-size: 24px; margin: 0 0 14px; }
.mail-meta { display: flex; gap: 12px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.mail-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.6; margin-bottom: 18px; }

/* Booking source + transcript tool steps */
.src { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 8px 2px 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--muted); white-space: nowrap; }
.src svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.src-phone { color: var(--accent); background: var(--accent-soft); border-color: #cfe3da; }
button.linklike.danger { color: var(--danger); font-size: 13px; padding: 2px 4px; background: none; border: 0; cursor: pointer; font-family: inherit; }
button.linklike.danger:hover { text-decoration: underline; }
form.inline { display: inline; }
.booking-form .grid2 { gap: 14px; }
.transcript li.tool .said { font-family: inherit; font-size: 13px; color: var(--muted); }
.tool-raw { margin-top: 4px; }
.tool-raw summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.tool-raw code { display: block; margin-top: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; white-space: pre-wrap; word-break: break-all; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }

/* Booking row: transcript link + inline cancel confirmation (no JS) */
.src-cell { white-space: nowrap; }
.call-link { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-left: 6px; border-radius: 8px; color: var(--accent); border: 1px solid var(--line); vertical-align: middle; }
.call-link:hover { background: var(--accent-soft); border-color: #cfe3da; }
.call-link svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cancel-cell { position: relative; text-align: right; }
details.confirm summary { list-style: none; cursor: pointer; color: var(--danger); font-size: 13px; }
details.confirm summary::-webkit-details-marker { display: none; }
details.confirm[open] summary { color: var(--muted); }
details.confirm[open] summary { font-size: 0; }
details.confirm[open] summary::after { content: "Keep"; font-size: 13px; text-decoration: underline; }
.confirm-box { position: absolute; right: 0; top: 100%; z-index: 5; display: grid; gap: 8px; width: 230px; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; box-shadow: 0 10px 28px -12px rgba(22,32,46,.3); font-size: 13px; }
.confirm-yes { font: 600 13px inherit; color: #fff; background: var(--danger); border: 0; border-radius: 8px; padding: 7px 10px; cursor: pointer; width: 100%; font-family: inherit; }
.confirm-yes:hover { filter: brightness(1.08); }
