/* Metro Admissions — "registrar's desk" design language
   paper #FAF9F6 · ink #1C2333 · registrar blue #2547C9 · admit green #0E8A5F
   display: Bitter (slab letterhead) · body: Public Sans · data: Spline Sans Mono */

:root {
  --paper: #FAF9F6;
  --surface: #FFFFFF;
  --ink: #1C2333;
  --ink-soft: #5A6272;
  --blue: #2547C9;
  --blue-deep: #1B2F7E;
  --gold: #C9A227;
  --green: #0E8A5F;
  --red: #C2402A;
  --amber: #C07C1D;
  --violet: #6D4FC4;
  --line: #E4E0D5;
  --line-soft: #EFECE4;
  --tint: #F4F2EC;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(28, 35, 51, .05), 0 6px 16px rgba(28, 35, 51, .06);
  --font-display: "Bitter", Georgia, serif;
  --font-body: "Public Sans", system-ui, sans-serif;
  --font-mono: "Spline Sans Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* The hidden attribute must always win, even over display:grid/flex below. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(rgba(28, 35, 51, .045) 1px, transparent 1px) 0 0 / 18px 18px,
    var(--paper);
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

svg.lucide { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; }

.eyebrow {
  font: 600 10.5px var(--font-body);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ── Topbar (letterhead) ─────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px 26px;
  background: var(--surface);
  border-bottom: 2px solid var(--ink);
  box-shadow: 0 2px 0 var(--gold);
  position: sticky;
  top: 0;
  z-index: 40;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 13px; }
.crest { width: 38px; height: 44px; flex-shrink: 0; }
.brand h1 {
  font: 700 21px/1.15 var(--font-display);
  letter-spacing: .01em;
}
.brand .eyebrow { color: var(--blue); }

/* ledger-style stats: hairline-separated entries, slab numerals */
.ledger {
  display: flex;
  margin-left: auto;
}
.ledger .entry {
  display: flex; flex-direction: column;
  padding: 2px 18px;
  border-left: 1px solid var(--line);
}
.ledger .entry:first-child { border-left: none; }
.ledger .v {
  font: 700 20px var(--font-display);
  font-variant-numeric: tabular-nums;
}
.ledger .v.green { color: var(--green); }
.ledger .k {
  font-size: 10.5px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-soft);
}

.topbar-actions { display: flex; gap: 10px; align-items: center; }

/* ── Calling method switch ───────────────────────────────── */

.method-switch {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 3px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--tint); min-height: 44px;
}
.method-switch .method-label {
  display: inline-flex; align-items: center;
  padding: 0 6px 0 8px; color: var(--ink-soft);
}
.method-switch .method-label i { width: 16px; height: 16px; }
.method-opt {
  font: 600 13px var(--font-body);
  padding: 7px 12px; border: 0; border-radius: 6px;
  background: transparent; color: var(--ink-soft); cursor: pointer;
  transition: background .18s, color .18s, box-shadow .18s;
}
.method-opt:hover { color: var(--ink); }
.method-opt.active {
  background: var(--surface); color: var(--blue-deep);
  box-shadow: var(--shadow);
}
.method-opt:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ── Buttons ─────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 14px var(--font-body);
  padding: 10px 16px;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s, transform .15s;
}
.btn:active { transform: scale(.97); }
.btn:focus-visible, .icon-btn:focus-visible, .dropzone:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 2px;
}

.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-deep); }
.btn-primary[disabled] { opacity: .5; cursor: not-allowed; }

.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--tint); }

.icon-btn {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  background: transparent; border: none;
  border-radius: 8px; cursor: pointer; color: var(--ink-soft);
  transition: background .2s, color .2s;
}
.icon-btn:hover { background: var(--tint); color: var(--ink); }

/* ── Upload panel ────────────────────────────────────────── */

.upload-panel { padding: 20px 26px 0; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 30px 24px;
  background: var(--surface);
  border: 1.5px dashed #C9C3B4;
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--blue); background: #FDFDFB; }
.dz-art { width: 96px; height: 72px; }
.dz-title { font: 600 16px var(--font-display); }
.dz-browse { color: var(--blue); text-decoration: underline; }
.dz-hint { font-size: 13.5px; color: var(--ink-soft); max-width: 580px; }
.dz-hint code {
  font-family: var(--font-mono); font-size: 12.5px;
  background: var(--tint); padding: 1px 5px; border-radius: 4px;
}
.dz-sample {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 10px; font-size: 13.5px; font-weight: 500; color: var(--blue);
  text-decoration: none; padding: 8px 10px; border-radius: 6px;
}
.dz-sample:hover { background: var(--tint); }
.dz-sample svg.lucide { width: 15px; height: 15px; }

/* ── Board: file-folder trays ────────────────────────────── */

.board {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(5, minmax(250px, 1fr));
  gap: 18px;
  padding: 26px 26px 30px;
  overflow-x: auto;
  align-items: start;
}

.col { display: flex; flex-direction: column; min-height: 220px; }

/* folder tab */
.col-head {
  display: inline-flex; align-items: center; gap: 8px;
  align-self: flex-start;
  max-width: 100%;
  padding: 7px 16px 6px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 10px 14px 0 0;
  position: relative;
  z-index: 1;
}
.col-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.col[data-stage="new"]          .col-dot { background: var(--blue); }
.col[data-stage="calling"]      .col-dot { background: var(--amber); animation: pulse 1.4s ease-in-out infinite; }
.col[data-stage="follow_up"]    .col-dot { background: var(--violet); }
.col[data-stage="qualified"]    .col-dot { background: var(--green); }
.col[data-stage="disqualified"] .col-dot { background: var(--red); }

@keyframes pulse { 50% { opacity: .35; } }

.col-title { font: 600 13.5px var(--font-display); white-space: nowrap; }
.col-count {
  font: 500 12px var(--font-mono);
  color: var(--ink-soft);
  background: var(--tint);
  border-radius: 999px;
  padding: 0 8px;
}

/* folder body */
.col-body {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  border-top-width: 2.5px;
  padding: 12px;
  display: flex; flex-direction: column; gap: 12px;
  overflow-y: auto;
  max-height: calc(100dvh - 205px);
  min-height: 120px;
}
.col[data-stage="new"]          .col-body { border-top-color: var(--blue); }
.col[data-stage="calling"]      .col-body { border-top-color: var(--amber); }
.col[data-stage="follow_up"]    .col-body { border-top-color: var(--violet); }
.col[data-stage="qualified"]    .col-body { border-top-color: var(--green); }
.col[data-stage="disqualified"] .col-body { border-top-color: var(--red); }
.col.dragover .col-body { outline: 2px dashed var(--blue); outline-offset: -5px; }

/* ── Index cards ─────────────────────────────────────────── */

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
  padding: 12px 12px 10px;
  cursor: grab;
  transition: border-color .2s, box-shadow .2s;
  animation: rise .3s ease-out both;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.card:hover { border-color: #C4CBE8; }
.card.dragging { opacity: .5; }

.card-top { display: flex; align-items: center; gap: 10px; }

.avatar {
  width: 34px; height: 34px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: 50%;
  font: 600 12.5px var(--font-mono);
  color: var(--ink);
}

.card-name {
  font: 600 15px var(--font-display);
  overflow-wrap: anywhere;
}
.card-phone {
  font: 500 12.5px var(--font-mono);
  color: var(--ink-soft);
}

.card-meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 8px;
}
.chip {
  font-size: 11.5px; font-weight: 500;
  color: var(--blue); background: #F2F4FD;
  border: 1px solid #DCE2F8;
  padding: 1px 8px; border-radius: 999px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chip.plain { color: var(--ink-soft); background: var(--tint); border-color: var(--line); }

/* the rubber stamp — signature element */
.stamp {
  position: absolute;
  top: 7px; right: 8px;
  transform: rotate(-8deg);
  font: 700 9.5px var(--font-display);
  letter-spacing: .12em;
  padding: 3px 7px;
  border: 2px solid currentColor;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1.5px var(--surface), inset 0 0 0 2.5px currentColor;
  opacity: .85;
  pointer-events: none;
  animation: stamp .28s cubic-bezier(.2, 1.4, .5, 1) both;
}
@keyframes stamp { from { transform: rotate(-8deg) scale(1.7); opacity: 0; } }
.stamp.qualified { color: var(--green); background: #F0FAF5; }
.stamp.disqualified { color: var(--red); background: #FBF1EE; }

.card-note {
  margin-top: 7px;
  font-size: 13px; color: var(--ink-soft);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-note.error { color: var(--red); }

.calling-live {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 500; color: var(--amber); margin-top: 7px;
}
.calling-live .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--amber); animation: pulse 1.4s infinite;
}

.card-actions {
  display: flex; gap: 6px; margin-top: 10px;
  border-top: 1px solid var(--line-soft); padding-top: 8px;
}
.card-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 12.5px var(--font-body);
  padding: 7px 10px; min-height: 34px;
  border-radius: 6px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.card-btn svg.lucide { width: 14px; height: 14px; }
.card-btn:hover { background: var(--tint); }
.card-btn.call { color: var(--green); border-color: #BFE3D3; }
.card-btn.call:hover { background: #F0FAF5; }
.card-btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ── Empty state ─────────────────────────────────────────── */

.empty-state {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  padding: 40px 24px 60px; text-align: center; color: var(--ink-soft);
}
.empty-art { width: min(360px, 86vw); height: auto; margin-bottom: 4px; }
.empty-state h2 { font: 700 26px var(--font-display); color: var(--ink); }
.empty-state p { max-width: 420px; }
.empty-state .btn { margin-top: 16px; }

/* ── Modal (inquiry file) ────────────────────────────────── */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(28, 35, 51, .45);
  display: grid; place-items: center; padding: 20px;
}
.modal {
  background: var(--surface); border-radius: 14px;
  width: min(680px, 100%); max-height: 86dvh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(28, 35, 51, .3);
}
.modal-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 2px solid var(--ink);
  box-shadow: 0 2px 0 var(--gold);
}
.modal-head h2 { font: 700 21px var(--font-display); }
.modal-sub { font: 500 13px var(--font-mono); color: var(--ink-soft); }
.modal-head .icon-btn { margin-left: auto; }

.modal-body { padding: 18px 20px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }

.detail-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.detail-item {
  background: var(--tint); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 12px;
}
.detail-item .k {
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .09em; color: var(--ink-soft);
}
.detail-item .v { font-size: 14.5px; font-weight: 500; overflow-wrap: anywhere; }
.detail-item .v.yes { color: var(--green); }
.detail-item .v.no { color: var(--red); }

.modal-section h3 {
  font: 600 11.5px var(--font-body);
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--ink-soft); margin-bottom: 8px;
}
.summary-text { font-size: 14.5px; }
.transcript {
  font: 400 12.5px/1.7 var(--font-mono);
  background: var(--tint); border: 1px solid var(--line);
  border-radius: 8px; padding: 14px; white-space: pre-wrap;
  max-height: 300px; overflow-y: auto;
}
audio { width: 100%; }

/* ── Toasts ──────────────────────────────────────────────── */

.toasts {
  position: fixed; bottom: 20px; right: 20px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px; max-width: 380px;
}
.toast {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--ink); color: var(--paper);
  border-radius: 10px; padding: 12px 16px;
  font-size: 14px; box-shadow: var(--shadow);
  animation: slide-in .25s ease-out;
}
.toast svg.lucide { width: 17px; height: 17px; margin-top: 1px; }
.toast.success svg.lucide { color: #4ADE9C; }
.toast.error svg.lucide { color: #F49A86; }
@keyframes slide-in { from { transform: translateY(8px); opacity: 0; } }

/* ── Motion & responsive ─────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

@media (max-width: 1180px) {
  .board { grid-template-columns: repeat(5, 264px); }
}
@media (max-width: 720px) {
  .topbar { gap: 12px; }
  .ledger { order: 3; width: 100%; margin-left: 0; }
  .ledger .entry:first-child { padding-left: 0; }
  .board { padding: 16px; gap: 14px; }
}
