/* Prime Enquiries: team app. Prime look: navy, brand red, Sora headings, Hanken Grotesk body. Phone first. */
@font-face { font-family: Sora; src: url(fonts/sora-latin-var.woff2) format('woff2'); font-weight: 100 800; font-display: swap; }
@font-face { font-family: 'Hanken Grotesk'; src: url(fonts/hanken-grotesk-latin-var.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
:root {
  --navy: #14284B; --navy-2: #0C1A33; --royal: #2A4689; --red: #E23E4F; --red-d: #C8283D; --brand: #CE202B;
  --amber: #FFB547; --amber-d: #8A5A00; --teal: #0E8F7E; --purple: #5B4BDB; --green: #1E7D4F;
  --ink: #1A1A1A; --muted: #5A6878; --line: #E9E1DA; --soft: #FFFAF5; --bg: #F6F3EF; --card: #fff; --tint: #EEE9FF;
  --head: Sora, 'Hanken Grotesk', system-ui, sans-serif; --body: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 14px; --shadow: 0 6px 20px rgba(20,40,75,.07);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); font-size: 16px; line-height: 1.45; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--royal); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--head); color: var(--navy); margin: 0; line-height: 1.2; }
h1 { font-size: 1.35rem; } h2 { font-size: 1.1rem; } h3 { font-size: 1rem; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }

/* Top bar and navigation */
.top { position: sticky; top: 0; z-index: 20; background: var(--navy); color: #fff; }
.top__in { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-family: var(--head); font-weight: 800; font-size: 1.02rem; margin-right: auto; }
.brand__mark { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; font-weight: 800; }
.top .btn--add { background: var(--red); color: #fff; border: 0; }
.nav { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 50px; z-index: 19; }
.nav__in { max-width: 1100px; margin: 0 auto; display: flex; gap: 2px; overflow-x: auto; padding: 0 8px; scrollbar-width: none; }
.nav__in::-webkit-scrollbar { display: none; }
.nav a { flex: 0 0 auto; padding: 12px 12px; text-decoration: none; color: var(--muted); font-weight: 700; font-size: .95rem; border-bottom: 3px solid transparent; }
.nav a.on { color: var(--navy); border-color: var(--red); }
.nav .count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--red); color: #fff; font-size: .75rem; text-align: center; }
main { max-width: 1100px; margin: 0 auto; padding: 14px 14px 90px; }

/* Buttons and form controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line);
  background: #fff; color: var(--navy); font-weight: 700; font-size: .95rem; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--royal); }
.btn:disabled { opacity: .55; cursor: default; }
.btn--primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn--primary:hover { background: var(--red-d); border-color: var(--red-d); }
.btn--navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn--green { background: #1F9D55; border-color: #1F9D55; color: #fff; }
.btn--ghost { background: transparent; }
.btn--sm { min-height: 34px; padding: 4px 11px; font-size: .875rem; }
.btn--block { width: 100%; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-weight: 700; font-size: .875rem; color: var(--navy); margin-bottom: 4px; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--royal); box-shadow: 0 0 0 3px rgba(42,70,137,.12); }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0 12px; font-size: .95rem; }
.check input { width: 20px; height: 20px; margin-top: 1px; flex: 0 0 auto; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } }
.err { color: var(--red-d); font-weight: 600; font-size: .9rem; margin: 6px 0 0; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.card h2 { margin-bottom: 10px; }
.stack > * + * { margin-top: 12px; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
@media (max-width: 560px) { .kpis { grid-template-columns: repeat(3, 1fr); gap: 8px; } }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px; text-decoration: none; color: inherit; display: block; }
.kpi__n { font-family: var(--head); font-weight: 800; font-size: 1.6rem; color: var(--navy); line-height: 1.1; }
.kpi__l { font-size: .8rem; color: var(--muted); font-weight: 600; }
.kpi--alert { background: #FFF1F2; border-color: #F7C3C9; }
.kpi--alert .kpi__n { color: var(--red-d); }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.filters input[type=search] { flex: 1 1 220px; }
.filters select { flex: 0 1 auto; width: auto; }
.seg { display: inline-flex; background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 3px; overflow-x: auto; max-width: 100%; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: .875rem; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--navy); color: #fff; }

/* Enquiry list */
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; text-decoration: none; color: inherit; border-left: 5px solid var(--line); }
.item:hover { border-color: var(--royal); }
.item--late { border-left-color: var(--red); }
.item--due { border-left-color: var(--amber); }
.item__top { display: flex; align-items: baseline; gap: 8px; }
.item__name { font-family: var(--head); font-weight: 700; color: var(--navy); font-size: 1rem; margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; font-size: .85rem; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #F1EEEA; color: var(--navy); white-space: nowrap; }
.chip--New { background: #FFE7EA; color: var(--red-d); }
.chip--Contacted { background: #E7EEFF; color: var(--royal); }
.chip--Session\ booked { background: var(--tint); color: var(--purple); }
.chip--Session\ done { background: #FFF2DA; color: var(--amber-d); }
.chip--Enrolled { background: #DDF5EA; color: var(--green); }
.chip--Lost { background: #EEE; color: #666; }
.chip--late { background: var(--red); color: #fff; }
.chip--src { background: #fff; border: 1px solid var(--line); color: var(--muted); }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: var(--r); }

/* Enquiry detail */
.back { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; font-weight: 700; color: var(--muted); margin-bottom: 10px; }
.hero { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; }
.hero__main { flex: 1 1 260px; min-width: 0; }
.hero__phone { font-size: 1.05rem; font-weight: 700; margin-top: 2px; }
.hero__acts { display: flex; gap: 8px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; align-items: start; }
@media (max-width: 820px) { .grid2 { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 10px; font-size: .95rem; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.statusbar { display: flex; flex-wrap: wrap; gap: 6px; }
.statusbar button { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 11px; font-weight: 700; font-size: .85rem; cursor: pointer; color: var(--muted); }
.statusbar button.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 560px) { .quick { grid-template-columns: repeat(2, 1fr); } }
.quick .btn { white-space: normal; text-align: center; line-height: 1.15; min-height: 46px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; }
.timeline li::before { content: ''; position: absolute; left: 5px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--royal); }
.timeline li::after { content: ''; position: absolute; left: 9px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .t-call_missed::before, .timeline .t-call_noanswer::before { background: var(--red); }
.timeline .t-whatsapp_in::before, .timeline .t-whatsapp_out::before { background: #1F9D55; }
.timeline .t-booking::before { background: var(--purple); }
.timeline .t-status::before, .timeline .t-assign::before, .timeline .t-followup::before, .timeline .t-system::before { background: #B9B2AA; }
.timeline .t-form::before, .timeline .t-manual::before { background: var(--amber); }
.tl__sum { white-space: pre-wrap; overflow-wrap: anywhere; }
.tl__meta { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.details { font-size: .85rem; color: var(--muted); margin-top: 4px; }

/* Sessions */
.day { margin-top: 14px; }
.day h3 { margin-bottom: 6px; color: var(--muted); font-size: .9rem; text-transform: uppercase; letter-spacing: .04em; }
.sess { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; margin-bottom: 6px; }
.sess__time { font-family: var(--head); font-weight: 800; color: var(--navy); min-width: 66px; }
.sess__who { flex: 1; min-width: 0; }

/* Reports */
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar { display: grid; grid-template-columns: 120px 1fr 34px; gap: 8px; align-items: center; font-size: .9rem; }
.bar__track { height: 10px; background: #F1EEEA; border-radius: 99px; overflow: hidden; }
.bar__fill { height: 100%; background: var(--royal); border-radius: 99px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* Modal sheet */
.sheet-bg { position: fixed; inset: 0; background: rgba(12,26,51,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .sheet-bg { align-items: center; } .sheet { border-radius: 18px; } }
.sheet h2 { margin-bottom: 12px; }
.sheet__close { float: right; border: 0; background: none; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--muted); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 999px; font-weight: 600; z-index: 60; box-shadow: var(--shadow); max-width: 92vw; }

/* Login */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--navy); }
.auth .card { width: 100%; max-width: 400px; }
.auth h1 { margin-bottom: 4px; }
.auth p { margin-top: 0; }
.temp { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.3rem; font-weight: 700; background: var(--soft); border: 1px dashed var(--amber); padding: 10px; border-radius: 10px; text-align: center; letter-spacing: .06em; user-select: all; }
.copy { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; background: var(--soft); border: 1px solid var(--line); padding: 8px; border-radius: 8px; overflow-wrap: anywhere; }

/* Floating add button on phones */
.fab { position: fixed; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); width: 58px; height: 58px; border-radius: 50%; background: var(--red); color: #fff; border: 0;
  font-size: 2rem; line-height: 1; box-shadow: 0 10px 24px rgba(226,62,79,.4); cursor: pointer; z-index: 30; display: none; }
@media (max-width: 700px) { .fab { display: block; } .top .btn--add { display: none; } }
