/* Prison Dr staff webapp — implements "1a Ledger" design handoff on Slang tokens. */

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  background: var(--grad-surface);
  color: var(--ink-1);
  min-height: 100dvh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

.data-label { font-size: 12px; color: var(--ink-4, #8a8a99); font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 12.5px; font-weight: 500; color: var(--ink-3, #5c5c6b); display: inline-flex; gap: 4px; align-items: baseline; }
.eyebrow .num { color: var(--ink-5, #b8b8c4); }
.thread { width: 56px; height: 2px; border-radius: 2px; background: var(--grad-brand); margin-top: 8px; }
.note { font-size: 12.5px; color: var(--ink-4, #8a8a99); line-height: 1.5; margin-top: 8px; }
.note.center { text-align: center; margin: 14px 0 8px; }

/* ---- Shell: mobile = tab bar, desktop = left rail ---- */
.shell { min-height: 100dvh; }
.page { padding: max(20px, env(safe-area-inset-top)) 20px calc(110px + env(safe-area-inset-bottom)); max-width: 720px; margin: 0 auto; }
.rail { display: none; }
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; justify-content: space-around;
  background: rgba(255,255,255,.86); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(22,22,40,.08);
  padding: 10px 30px calc(10px + env(safe-area-inset-bottom, 24px));
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 500; color: var(--ink-4, #8a8a99); min-width: 64px; min-height: 44px; justify-content: center; }
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--ink-1); font-weight: 600; }

@media (min-width: 900px) {
  .shell { display: flex; }
  .tabbar { display: none; }
  .rail {
    display: flex; flex-direction: column; gap: 4px;
    width: 232px; flex-shrink: 0; min-height: 100dvh;
    border-right: 1px solid rgba(22,22,40,.08); padding: 24px 16px;
    position: sticky; top: 0;
  }
  .rail-head { padding: 0 10px 18px; }
  .rail-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
  .rail-item {
    display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px;
    border-radius: 12px; font-size: 14px; font-weight: 500; color: var(--ink-3, #5c5c6b);
  }
  .rail-item.active { background: #fff; border: 1px solid rgba(22,22,40,.08); box-shadow: 0 1px 2px rgba(22,22,40,.06); font-weight: 600; color: var(--ink-1); }
  .rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding: 0 10px; }
  .page { flex: 1; padding: 28px 32px 60px; }
}
.powered { font-size: 10.5px; color: var(--ink-5, #b8b8c4); display: flex; align-items: center; gap: 5px; }
.powered img { display: block; }

/* ---- Header / status pill ---- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.page-title { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; }
.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: #fff; border: 1px solid rgba(22,22,40,.08); border-radius: 999px;
  padding: 7px 13px; font-size: 12px; font-weight: 500; color: var(--ink-3, #5c5c6b);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.wavebar { width: 3px; border-radius: 2px; background: rgba(22,22,40,.18); height: 10px; }
.wavebar:nth-child(2) { height: 14px; }
.wavebar:nth-child(3) { height: 8px; }

/* ---- Filters ---- */
.filter-row { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-pill {
  height: 38px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 500;
  background: #fff; border: 1px solid rgba(22,22,40,.08); color: var(--ink-2, #2a2a38);
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; flex-shrink: 0;
  transition: transform 120ms cubic-bezier(.4,0,.2,1);
}
.filter-pill:active { transform: scale(.98); }
.filter-pill.active { border-color: rgba(22,22,40,.2); font-weight: 600; }
.filter-pill.amber .dot { width: 7px; height: 7px; border-radius: 50%; background: #e0a52b; }
.filter-pill.amber.active { background: rgba(224,165,43,.16); border-color: rgba(224,165,43,.5); color: #6b4e0e; }
.filter-pill.icon-btn { width: 38px; padding: 0; justify-content: center; margin-left: auto; }
.search-box { margin-bottom: 14px; }
.search-box input {
  width: 100%; height: 40px; border-radius: 999px; border: 1px solid rgba(22,22,40,.12);
  padding: 0 16px; font: inherit; font-size: 14px; background: #fff; outline: none;
}

/* ---- Day groups + cards ---- */
.day-divider { display: flex; justify-content: space-between; align-items: baseline; margin: 18px 2px 10px; }
.call-card {
  position: relative; background: #fff; border: 1px solid rgba(22,22,40,.08);
  border-radius: 20px; padding: 16px; margin-bottom: 10px;
  display: flex; flex-direction: column; gap: 9px;
  box-shadow: 0 1px 2px rgba(22,22,40,.06);
}
.call-card.urgent { border-color: rgba(224,165,43,.55); box-shadow: 0 6px 18px rgba(22,22,40,.08); }
.card-link { position: absolute; inset: 0; border-radius: 20px; }
.card-row1 { display: flex; justify-content: space-between; align-items: baseline; }
.caller { font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }
.summary { font-size: 14px; line-height: 1.45; color: var(--ink-3, #5c5c6b); }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 11.5px; font-weight: 500; padding: 3px 10px; border-radius: 999px; border: 1px solid transparent; }
.chip-urgent { background: #e4685a; color: #1d0a07; font-weight: 600; }
.chip-callback { background: #e0a52b; color: #221803; font-weight: 600; }
.chip-intake_link_sent { background: rgba(74,178,249,.14); border-color: rgba(74,178,249,.32); color: #1a6aa3; }
.chip-transferred { background: rgba(155,132,249,.16); border-color: rgba(155,132,249,.34); color: #584bbd; }
.chip-message_taken, .chip-answered, .chip-incomplete, .chip-hung_up_prank {
  background: var(--surface-2, #f4f4fa); border-color: rgba(22,22,40,.08); color: var(--ink-3, #5c5c6b);
}
.handled-meta { font-size: 12px; color: var(--ink-5, #b8b8c4); display: flex; align-items: center; gap: 5px; }
.action-row { display: flex; gap: 8px; position: relative; z-index: 2; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 44px; border-radius: 14px; font-size: 14px; font-weight: 600;
  transition: transform 120ms cubic-bezier(.4,0,.2,1);
}
.btn:active { transform: scale(.98); }
.btn-primary { flex: 1; background: var(--grad-button); color: #fff; }
.btn-ghost { flex: 1; background: #fff; border: 1px solid rgba(22,22,40,.12); color: var(--ink-2, #2a2a38); }
.btn-lg { height: 48px; }
.btn.full { width: 100%; }

/* ---- Prank rows ---- */
.prank-row {
  width: 100%; display: flex; align-items: center; gap: 8px;
  background: rgba(22,22,40,.04); border: 1px solid rgba(22,22,40,.04);
  border-radius: 14px; padding: 11px 14px; font-size: 13px; color: var(--ink-5, #b8b8c4);
  margin-bottom: 10px; min-height: 44px;
}
.prank-row .chev { margin-left: auto; transition: transform 180ms; }
.prank-row[aria-expanded="true"] .chev { transform: rotate(180deg); }
.prank-list { padding: 0 14px 10px; }
.prank-item { display: flex; justify-content: space-between; padding: 7px 0; font-size: 13px; color: var(--ink-4, #8a8a99); border-bottom: 1px solid rgba(22,22,40,.04); }
.empty-state { text-align: center; padding: 60px 20px; font-size: 14px; color: var(--ink-4, #8a8a99); }

/* ---- Call detail ---- */
.detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.back-btn {
  width: 36px; height: 36px; min-width: 44px; min-height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid rgba(22,22,40,.08);
}
.detail-meta { display: flex; gap: 12px; align-items: baseline; margin: 6px 0 10px; }
.tel-link { color: #825afd; font-weight: 500; font-variant-numeric: tabular-nums; }
.detail-card {
  background: #fff; border: 1px solid rgba(22,22,40,.08); border-radius: 16px;
  padding: 13px 15px; margin-top: 12px; box-shadow: 0 1px 2px rgba(22,22,40,.06);
}
.detail-summary { font-size: 14px; line-height: 1.5; color: var(--ink-2, #2a2a38); margin-top: 8px; }
.kv-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 13px; border-bottom: 1px solid rgba(22,22,40,.04); }
.kv-row:last-of-type { border-bottom: none; }
.kv-row .k { color: var(--ink-4, #8a8a99); display: flex; align-items: center; gap: 7px; }
.kv-row .v { color: var(--ink-1); font-weight: 500; text-align: right; word-break: break-word; }
.kv-row .v.on { color: #584bbd; }
.role-tag { font-size: 10px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2, #f4f4fa); border: 1px solid rgba(22,22,40,.08); color: var(--ink-3); }
.timeline-row { display: flex; align-items: baseline; gap: 10px; padding: 8px 0; font-size: 13px; color: var(--ink-2, #2a2a38); }
.tdot { width: 6px; height: 6px; min-width: 6px; border-radius: 50%; background: #825afd; position: relative; top: -2px; }

.player {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2, #f4f4fa); border-radius: 12px; padding: 9px 12px; margin-top: 10px;
}
.play-btn {
  width: 34px; height: 34px; min-width: 34px; border-radius: 50%; background: var(--ink-1);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
}
.progress-track { flex: 1; height: 4px; border-radius: 4px; background: rgba(22,22,40,.1); overflow: hidden; cursor: pointer; }
.progress-fill { height: 100%; width: 0%; background: var(--grad-brand); border-radius: 4px; }
.speed-pill { font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: #fff; border: 1px solid rgba(22,22,40,.12); font-variant-numeric: tabular-nums; }
.transcript { margin-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.tr-line { display: flex; gap: 10px; padding: 7px 9px; border-radius: 9px; font-size: 13.5px; line-height: 1.45; color: var(--ink-2, #2a2a38); }
.tr-line .data-label { min-width: 52px; }
.detail-actionbar {
  position: fixed; bottom: calc(78px + env(safe-area-inset-bottom)); left: 0; right: 0; z-index: 20;
  display: flex; gap: 8px; padding: 10px 20px;
  background: rgba(255,255,255,.86); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(22,22,40,.08);
  max-width: 720px; margin: 0 auto;
}
@media (min-width: 900px) { .detail-actionbar { position: static; background: none; border: none; padding: 16px 0; backdrop-filter: none; } }

/* ---- Analytics ---- */
.tile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.tile-grid.two { margin-top: 12px; }
@media (min-width: 900px) { .tile-grid { grid-template-columns: repeat(4, 1fr); } .tile-grid.two { grid-template-columns: 1fr 1fr; } }
.stat-tile { background: #fff; border: 1px solid rgba(22,22,40,.08); border-radius: 16px; padding: 14px 16px; }
.stat-value { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
@media (min-width: 900px) { .stat-value { font-size: 30px; } }
.stat-label { font-size: 12.5px; color: var(--ink-4, #8a8a99); margin-top: 2px; }
.stat-note { font-size: 11.5px; color: var(--ink-3, #5c5c6b); margin-top: 6px; display: flex; align-items: center; gap: 4px; }

.bars { display: flex; align-items: flex-end; gap: 4px; height: 68px; margin-top: 14px; }
.bar-col { flex: 1; display: flex; flex-direction: column-reverse; gap: 2px; min-height: 2px; }
.seg { border-radius: 3px 3px 0 0; min-height: 2px; }
.seg-intake { background: #a379f9; }
.seg-transfer { background: #4ab2f9; }
.seg-other { background: rgba(22,22,40,.12); }
.bar-col.today .seg-intake { background: #825afd; }
.bar-col.today .seg-transfer { background: #1a8fe8; }
.bar-labels { display: flex; justify-content: space-between; margin-top: 6px; }
.legend { display: flex; gap: 16px; margin-top: 12px; font-size: 12px; color: var(--ink-3, #5c5c6b); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.ldot { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }
.ldot-intake { background: #a379f9; } .ldot-transfer { background: #4ab2f9; } .ldot-other { background: rgba(22,22,40,.12); }

.card-head-row { display: flex; justify-content: space-between; align-items: center; }
.seg-control { display: inline-flex; background: var(--surface-2, #f4f4fa); border-radius: 999px; padding: 3px; }
.seg-item { font-size: 12px; font-weight: 500; padding: 5px 12px; border-radius: 999px; color: var(--ink-3, #5c5c6b); }
.seg-item.active { background: #fff; box-shadow: 0 1px 2px rgba(22,22,40,.06); color: var(--ink-1); font-weight: 600; }
.mix-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.mix-label { font-size: 13px; color: var(--ink-2, #2a2a38); min-width: 118px; }
.mix-track { flex: 1; height: 8px; border-radius: 8px; background: rgba(22,22,40,.06); overflow: hidden; }
.mix-fill { height: 100%; border-radius: 8px; }
.mix-violet { background: #a379f9; } .mix-sky { background: #4ab2f9; }
.mix-pink { background: #f782f7; } .mix-ink { background: rgba(22,22,40,.35); }
.mix-row .data-label { min-width: 34px; text-align: right; }

/* ---- Settings ---- */
.logout-btn { width: 100%; height: 44px; color: #e4685a; font-weight: 600; font-size: 14px; }

/* ---- Login ---- */
.login-body { background: var(--grad-brand-soft); min-height: 100dvh; display: flex; align-items: center; justify-content: center; }
.login-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 24px; width: 100%; max-width: 420px; }
.login-card {
  background: #fff; border-radius: 28px; border: 1px solid rgba(255,255,255,.7);
  box-shadow: 0 24px 50px rgba(22,22,40,.10); padding: 28px 24px; width: 100%;
}
.login-title { font-size: 25px; font-weight: 500; letter-spacing: -0.02em; margin-top: 6px; }
.login-label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-3, #5c5c6b); margin: 20px 0 7px; }
.login-input {
  width: 100%; height: 52px; border-radius: 14px; border: 1px solid rgba(22,22,40,.12);
  padding: 0 16px; font: inherit; font-size: 17px; font-variant-numeric: tabular-nums;
  outline: none; margin-bottom: 12px;
}
.login-input:focus { border-color: #825afd; }
.login-note { font-size: 12.5px; color: var(--ink-4, #8a8a99); text-align: center; margin-top: 14px; line-height: 1.5; }
.login-note.big { font-size: 14px; color: var(--ink-2, #2a2a38); margin-top: 20px; }
.login-note a { color: #825afd; font-weight: 500; }
.login-input.code { text-align: center; letter-spacing: .35em; font-size: 22px; font-weight: 600; }
.login-note.err { color: #e4685a; font-weight: 500; }
