/* Pengambilan murid (admissions CRM): board, lead page, reports, public enquiry form. Tokens from app.css. */

/* ---------- sub navigation & filters ---------- */
.adm-tabs { margin-bottom: var(--s4); }
.adm-filter { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; margin-bottom: var(--s4); }
.adm-filter input[type=search] { flex: 1 1 220px; max-width: 320px; }
.adm-filter select, .adm-filter input[type=date] { width: auto; min-width: 0; }
.adm-filter .check { margin: 0; }
.adm-filter label:not(.check):not(.sr-only) { font-size: 13px; color: var(--muted); font-weight: 600; }

/* ---------- pipeline board ---------- */
.adm-board { display: flex; gap: var(--s3); overflow-x: auto; align-items: flex-start; padding: 2px 2px var(--s3); scroll-snap-type: x proximity; }
.adm-col {
  flex: 0 0 252px; scroll-snap-align: start; display: flex; flex-direction: column; max-height: calc(100vh - 230px);
  background: linear-gradient(180deg, color-mix(in srgb, var(--sheet-2, #f3f3ee) 92%, var(--brand) 2%), var(--sheet-2, #f3f3ee));
  border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
  transition: box-shadow .15s, border-color .15s;
}
.adm-col.over { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.adm-col-head { display: flex; align-items: center; gap: var(--s2); padding: 10px 12px 8px; border-bottom: 1px solid var(--rule-2); border-top: 3px solid color-mix(in srgb, var(--brand) 55%, #fff); border-radius: var(--radius) var(--radius) 0 0; }
.adm-col.k-won .adm-col-head { border-top-color: var(--ok); }
.adm-col.k-lost .adm-col-head { border-top-color: var(--stamp); }
.adm-col-head h2 { font-size: 13.5px; margin: 0; letter-spacing: .01em; }
.adm-n { margin-left: auto; min-width: 24px; text-align: center; font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: var(--r-pill); background: var(--sheet); border: 1px solid var(--rule); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.adm-cards { overflow-y: auto; padding: var(--s2); display: flex; flex-direction: column; gap: var(--s2); min-height: 56px; }
.adm-none { color: var(--muted); font-size: 12.5px; text-align: center; margin: var(--s3) 0; }
.adm-card {
  background: var(--g-paper); border: 1px solid var(--rule); border-radius: 10px; padding: 9px 11px 10px;
  box-shadow: var(--hl), var(--sh-1); cursor: grab; min-width: 0;
}
.adm-card:hover { box-shadow: var(--hl), var(--sh-2); }
.adm-card.dragging { opacity: .5; }
.adm-card-name { display: block; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.adm-card-sub { font-size: 12.5px; color: var(--ink-2); margin-top: 1px; overflow-wrap: anywhere; }
.adm-card-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-top: 7px; font-size: 11.5px; }
.adm-card-meta .chip { font-size: 11px; padding: 1px 7px; }
.adm-src { padding: 1px 7px; border-radius: var(--r-pill); background: var(--sheet); border: 1px solid var(--rule-2); color: var(--ink-2); font-weight: 600; }
.adm-src.s-facebook { border-color: #c5d3ee; color: #2b4f93; background: #f2f6fd; }
.adm-src.s-instagram { border-color: #ecc8dc; color: #8f2d63; background: #fdf3f8; }
.adm-src.s-tiktok { border-color: #c9d0d4; color: #1f2a30; background: #f3f5f6; }
.adm-src.s-google { border-color: #cfe0c7; color: #2f6b22; background: #f4faf1; }
.adm-src.s-rakan { border-color: #ecd9a6; color: #6a4a00; background: #fffbee; }
.adm-task { display: inline-flex; gap: 3px; align-items: center; color: var(--ink-2); font-weight: 600; }
.adm-task svg { width: 13px; height: 13px; }
.adm-due { color: var(--stamp); font-weight: 700; }
.chip.adm-wait { --c: #7a4b00; --cs: #fff3d6; }
.adm-hint { margin-top: var(--s2); }

/* ---------- lead page ---------- */
.adm-head .actions { align-self: center; }
.adm-wa .btn svg { width: 15px; height: 15px; }
.banner.ok { background: linear-gradient(180deg, #fff, var(--ok-soft)); border-color: color-mix(in srgb, var(--ok) 25%, #fff); }
.banner.ok::before { background: var(--ok); }
.banner > svg { flex: none; width: 18px; height: 18px; }
.adm-detail .panel h2 { font-size: 16px; }
.adm-msg { white-space: normal; }
.adm-static { margin: 6px 0 0; font-weight: 600; }
.adm-edit { margin-top: var(--s4); border-top: 1px dashed var(--rule); padding-top: var(--s3); }
.adm-edit summary { cursor: pointer; font-weight: 700; color: var(--brand-text, var(--brand)); }
.adm-edit form { margin-top: var(--s3); }
.adm-note textarea { width: 100%; }
.adm-note-btns { display: flex; gap: var(--s2); flex-wrap: wrap; margin: var(--s2) 0 var(--s4); }
.adm-tl { list-style: none; margin: 0; padding: 0; position: relative; }
.adm-tl::before { content: ""; position: absolute; left: 14px; top: 6px; bottom: 6px; width: 2px; background: var(--rule-2); border-radius: 2px; }
.adm-tl li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: var(--s3); padding: 6px 0 10px; position: relative; }
.adm-tl-ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--sheet); border: 1px solid var(--rule); color: var(--ink-2); z-index: 1; }
.adm-tl-ic svg { width: 15px; height: 15px; }
.adm-tl li.k-whatsapp .adm-tl-ic { background: #e9f7ef; border-color: #b8e2c7; color: #1f8f4e; }
.adm-tl li.k-stage .adm-tl-ic { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 30%, #fff); color: var(--brand-text, var(--brand)); }
.adm-tl li.k-form .adm-tl-ic, .adm-tl li.k-email .adm-tl-ic { background: #eef3fb; border-color: #c9d6ee; color: #2b4f93; }
.adm-tl li.k-visit .adm-tl-ic { background: #fff6e2; border-color: #ecd9a6; color: #7a4b00; }
.adm-tl-h { font-size: 13.5px; line-height: 1.3; padding-top: 5px; }
.adm-tl-b { margin-top: 3px; font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.adm-lost { display: grid; gap: 6px; margin: var(--s3) 0; }
.adm-lost[hidden] { display: none; }
.adm-lost label { font-size: 13px; font-weight: 600; color: var(--muted); }
.adm-stage select { width: 100%; }
.adm-stage .btn.block, .adm-hand .btn.block { margin-top: var(--s3); }
.adm-hand form + form { margin-top: var(--s2); }
.adm-copy { display: flex; gap: var(--s2); align-items: stretch; margin: var(--s2) 0; }
.adm-copy input, .adm-copy textarea { flex: 1; min-width: 0; font-size: 12.5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.adm-copy .btn { flex: none; align-self: flex-start; }
.adm-tasks, .adm-visits, .adm-dups ul { list-style: none; margin: 0 0 var(--s3); padding: 0; }
.adm-tasks li, .adm-visits li, .adm-dups li { display: flex; gap: var(--s2); align-items: flex-start; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--ledger, var(--rule-2)); }
.adm-tasks li > div, .adm-visits li > div:first-child, .adm-dups li > div { min-width: 0; overflow-wrap: anywhere; }
.adm-tasks li.due b { color: var(--stamp); }
.adm-tasks li.done { opacity: .6; }
.adm-tasks li.done b { text-decoration: line-through; }
.adm-vbtns { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.adm-addtask .field, .adm-detail form .field { margin-bottom: var(--s3); }
.adm-del { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.adm-del input { flex: 1 1 160px; }
.adm-late td:first-child { white-space: nowrap; }

/* ---------- waitlist ---------- */
.adm-wl { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s4); margin-bottom: var(--s5); }
.adm-wl .panel { margin-bottom: 0; }
.adm-wl-h h2 { font-size: 16px; margin-bottom: 6px; }
.adm-cap { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
.adm-bar { height: 8px; border-radius: 6px; background: var(--rule-2); position: relative; overflow: hidden; box-shadow: var(--sh-inset); }
.adm-bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--p); background: var(--g-brand, var(--brand)); border-radius: 6px; }
.adm-free { color: var(--ok); }
.adm-next { margin: var(--s3) 0; }
.adm-wl-list { list-style: none; padding: 0; margin: var(--s3) 0 0; }
.adm-wl-list li { display: flex; gap: var(--s3); align-items: flex-start; padding: 7px 0; border-bottom: 1px solid var(--rule-2); }
.adm-pos { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12.5px; background: var(--sheet); border: 1px solid var(--rule); }
.adm-wl-list li:first-child .adm-pos { background: var(--g-brand, var(--brand)); color: var(--brand-ink, #fff); border-color: transparent; }

/* ---------- reports ---------- */
.adm-funnel { display: grid; gap: 8px; margin-top: var(--s3); }
.adm-fun-row { display: grid; grid-template-columns: minmax(90px, 150px) minmax(0, 1fr) auto; gap: var(--s3); align-items: center; font-size: 13.5px; }
.adm-fun-l { overflow-wrap: anywhere; font-weight: 600; }
.adm-fun-bar { height: 22px; background: var(--sheet-2, #f1f1ec); border-radius: 6px; box-shadow: var(--sh-inset); overflow: hidden; }
.adm-fun-bar > span { display: block; height: 100%; background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 75%, #fff), var(--brand)); border-radius: 6px; }
.adm-fun-bar > span.won { background: linear-gradient(180deg, color-mix(in srgb, var(--ok) 75%, #fff), var(--ok)); }
.adm-fun-n { white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 82px; text-align: right; }
.adm-months { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(34px, 64px); justify-content: start; gap: 8px; overflow-x: auto; align-items: end; padding-bottom: 4px; }
.adm-mcol { text-align: center; }
.adm-mbars { height: 140px; display: flex; gap: 2px; align-items: flex-end; justify-content: center; }
.adm-mbars span { width: 42%; max-width: 18px; border-radius: 3px 3px 0 0; min-height: 2px; }
.adm-mbars .a, .adm-key.a { background: var(--chart-a, #c9d3dd); }
.adm-mbars .b, .adm-key.b { background: var(--brand); }
.adm-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; }

/* ---------- settings ---------- */
.adm-share-grid { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: var(--s5); align-items: start; }
.adm-share h3 { font-size: 14px; margin: var(--s4) 0 4px; }
.adm-qr { margin: 0; text-align: center; padding: var(--s3); background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--hl), var(--sh-1); }
.adm-qr img { display: block; width: 100%; max-width: 180px; height: auto; margin: 0 auto var(--s2); image-rendering: pixelated; }
.adm-stages input[name$="[name]"] { width: 100%; }
.adm-ord { display: inline-flex; gap: 2px; }

/* ---------- dashboard card ---------- */
.adm-dash-head { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s3); }
.adm-dash-head h2 { margin: 0; }
.adm-dash-head .btn { margin-left: auto; }
.adm-dash-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.adm-dash-figs a { display: grid; gap: 2px; padding: var(--s3) var(--s4); border: 1px solid var(--rule); border-radius: 10px; background: var(--sheet); color: var(--ink); text-decoration: none; box-shadow: var(--hl); }
.adm-dash-figs a:hover { box-shadow: var(--hl), var(--sh-1); }
.adm-dash-figs .lbl { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.adm-dash-figs b { font-size: 24px; font-variant-numeric: tabular-nums; }
.adm-dash-figs a.due b { color: var(--stamp); }
.adm-dash-figs .hint { font-size: 12px; color: var(--muted); }
.adm-dash-mine { margin: var(--s3) 0 0; padding-left: 18px; font-size: 14px; }

/* ---------- public enquiry form ---------- */
.enq { max-width: 640px; margin: 0 auto; }
.enq-kicker { margin: 0 0 2px; font-size: 12.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-text, var(--brand)); }
.enq h1 { margin-bottom: var(--s2); }
.enq-intro { color: var(--ink-2); }
.enq-form fieldset { border: 0; padding: 0; margin: 0 0 var(--s4); }
.enq-form legend { font-weight: 800; font-size: 15px; margin-bottom: var(--s2); padding: 0; }
.enq-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.enq-pdpa { font-size: 13.5px; line-height: 1.45; margin: var(--s2) 0 var(--s4); padding: var(--s3); border: 1px solid var(--rule); border-radius: 10px; background: var(--sheet); }
.enq-pdpa input { margin-top: 2px; flex: none; width: 18px; height: 18px; accent-color: var(--brand); }
.enq-call { text-align: center; margin-top: var(--s3); }
.enq-done { text-align: center; }
.enq-tick { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; font-size: 28px; font-weight: 800; color: #fff; background: var(--g-brand, var(--brand)); box-shadow: var(--hl), var(--sh-1); margin-bottom: var(--s3); }
.embed-body { background: transparent; }
.embed-main { padding: var(--s3); }
.embed-main .authbox::before { display: none; }
.enq-embed { box-shadow: none; }
.embed-foot { text-align: center; font-size: 11.5px; color: var(--muted); padding: 0 0 var(--s3); }

@media (max-width: 999px) {
  .adm-share-grid { grid-template-columns: minmax(0, 1fr); }
  .adm-qr { justify-self: start; }
}
@media (max-width: 760px) {
  /* lead page on a phone: details, then actions (stage, registration, follow-ups, visit), timeline last */
  .adm-detail { gap: var(--s4); }
  .adm-detail > div { display: contents; }
  .adm-detail > div > .panel { margin-bottom: 0; }
  .adm-detail #garis-masa { order: 8; }
  .adm-detail .adm-del { order: 9; }
  /* the board becomes a list: stages stacked, cards full width */
  .adm-board { flex-direction: column; overflow: visible; gap: var(--s3); }
  .adm-col { flex: none; width: 100%; max-height: none; }
  .adm-cards { overflow: visible; }
  .adm-card { cursor: default; }
  .adm-hint { display: none; }
  .adm-dash-figs { grid-template-columns: minmax(0, 1fr); }
  .adm-dash-figs a { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .adm-dash-figs .hint { grid-column: 1 / -1; }
  .adm-head .actions { margin-left: 0; width: 100%; }
  .adm-fun-row { grid-template-columns: minmax(0, 1fr) auto; }
  .adm-fun-bar { grid-column: 1 / -1; grid-row: 2; }
  .adm-filter input[type=search] { max-width: none; }
  .adm-list th:nth-child(4), .adm-list td:nth-child(4), .adm-list th:nth-child(7), .adm-list td:nth-child(7) { display: none; }
}
@media (max-width: 520px) {
  .enq-form .row { grid-template-columns: minmax(0, 1fr); }
  .embed-main { padding: 0; }
}
@media (prefers-reduced-motion: reduce) { .adm-col { transition: none; } }
/* "Pautan borang minat" popover on the admissions page (for admissions staff who cannot open the settings) */
.adm-share { position: relative; }
.adm-share > summary { list-style: none; cursor: pointer; }
.adm-share > summary::-webkit-details-marker { display: none; }
.adm-share-box { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: 360px; max-width: calc(100vw - 32px); padding: 14px; border: 1px solid var(--rule); border-radius: var(--radius, 12px); background: var(--sheet); box-shadow: 0 14px 36px rgba(15, 30, 40, .18); }
.adm-share-box .small { margin: 0 0 8px; }
@media (max-width: 700px) { .adm-share-box { right: auto; left: 0; } }
