/* GyanGuru Inquiry - shared styles (public form, admin dashboard, modals).
   Palette: brand navy for structure, saffron only for the one main action, muted green/red for status. */

@font-face { font-family: "Mukta"; font-weight: 400; font-display: swap; src: url("../fonts/mukta-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Mukta"; font-weight: 500; font-display: swap; src: url("../fonts/mukta-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Mukta"; font-weight: 600; font-display: swap; src: url("../fonts/mukta-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Mukta"; font-weight: 700; font-display: swap; src: url("../fonts/mukta-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Mukta"; font-weight: 800; font-display: swap; src: url("../fonts/mukta-latin-800-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Mukta"; font-weight: 400; font-display: swap; src: url("../fonts/mukta-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Mukta"; font-weight: 700; font-display: swap; src: url("../fonts/mukta-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Mukta"; font-weight: 400; font-display: swap; src: url("../fonts/mukta-devanagari-400-normal.woff2") format("woff2"); unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B09; }
@font-face { font-family: "Mukta"; font-weight: 600; font-display: swap; src: url("../fonts/mukta-devanagari-600-normal.woff2") format("woff2"); unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B09; }
@font-face { font-family: "Mukta"; font-weight: 700; font-display: swap; src: url("../fonts/mukta-devanagari-700-normal.woff2") format("woff2"); unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B09; }

:root {
  --navy: #123A73;
  --navy-ink: #0C2850;
  --navy-soft: #E6ECF5;
  --saffron: #F5A01A;
  --saffron-ink: #6B4100;
  --bg: #ECEFF4;
  --surface: #FFFFFF;
  --surface-2: #F5F7FA;
  --ink: #18212F;
  --muted: #566176;
  --line: #B7C1CF;          /* row lines: clearly visible */
  --line-strong: #8794A8;   /* control borders */
  --green: #1E6B47;
  --green-soft: #E3F1EA;
  --red: #A8261B;
  --red-soft: #FBE9E7;
  --focus: #2F6FD6;
  --shadow-1: 0 1px 2px rgba(12, 24, 44, .16), 0 2px 6px rgba(12, 24, 44, .10);
  --shadow-2: 0 2px 4px rgba(12, 24, 44, .18), 0 10px 28px rgba(12, 24, 44, .20);
  --shadow-3: 0 6px 16px rgba(12, 24, 44, .26), 0 24px 60px rgba(12, 24, 44, .30);
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Mukta", "Noto Sans Devanagari", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
}
[x-cloak] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
a { color: var(--navy); }
.num { font-variant-numeric: tabular-nums; }
.mr { font-weight: 500; }   /* Marathi lines */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  min-height: 40px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 15px; line-height: 1; text-decoration: none; white-space: nowrap;
  cursor: pointer; box-shadow: 0 1px 1px rgba(12, 24, 44, .10);
}
.btn:hover { background: var(--surface-2); border-color: var(--navy); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--saffron); border-color: #C77F0C; color: #2B1A00; }
.btn-primary:hover { background: #E8930C; border-color: #A86A07; }
.btn-navy { background: var(--navy); border-color: var(--navy-ink); color: #fff; }
.btn-navy:hover { background: var(--navy-ink); }
.btn-danger { background: var(--red); border-color: #7E1C13; color: #fff; }
.btn-danger:hover { background: #8E1F16; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: rgba(18, 58, 115, .08); border-color: transparent; }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 14px; }
.btn-lg { min-height: 50px; padding: 0 22px; font-size: 17px; }
.btn-block { width: 100%; }

/* ------------------------------------------------------------ form controls */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .field-label { font-weight: 600; font-size: 15px; color: var(--ink); }
.req { color: var(--red); font-weight: 700; margin-left: 2px; }
.hint { font-size: 13.5px; color: var(--muted); line-height: 1.35; }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 9px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); font-size: 16px;
}
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23566176' stroke-width='1.8'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(47, 111, 214, .25); }
.input[readonly] { background: var(--surface-2); }
.field.has-error .input, .field.has-error .select { border-color: var(--red); box-shadow: 0 0 0 3px rgba(168, 38, 27, .15); }
.msg { font-size: 14px; line-height: 1.35; display: flex; gap: 6px; align-items: flex-start; }
.msg-error { color: var(--red); font-weight: 600; }
.msg-ok { color: var(--green); font-weight: 600; }
.msg-wait { color: var(--muted); }
.with-status { position: relative; }
.with-status .status-mark { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-weight: 700; font-size: 15px; pointer-events: none; }
.status-mark.ok { color: var(--green); }
.status-mark.bad { color: var(--red); }
.spin { display: inline-block; width: 15px; height: 15px; border: 2px solid var(--line); border-top-color: var(--navy); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

.grid { display: grid; gap: 14px 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; min-height: 40px; padding: 0 16px; font-weight: 600; cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }

/* ------------------------------------------------------------ public form page */
.page { max-width: 900px; margin: 0 auto; padding: 24px 16px 120px; }
.masthead {
  background: var(--navy); color: #fff; border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 20px 24px; display: flex; gap: 18px; align-items: center; box-shadow: var(--shadow-2);
  border-bottom: 4px solid var(--saffron); position: relative; z-index: 1;
}
.masthead .logo { width: 64px; height: 64px; border-radius: 50%; background: #fff; padding: 4px; flex: none; }
.masthead .exam-tag { display: inline-block; margin-bottom: 6px; padding: 3px 10px; border-radius: 999px; background: #F5A01A; color: #12233F; font-size: 12.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.masthead h1 { margin: 0; font-size: 26px; line-height: 1.15; font-weight: 800; letter-spacing: -.01em; }
.masthead p { margin: 4px 0 0; color: #CBD7EA; font-size: 15px; }
.masthead .contact { margin-left: auto; text-align: right; font-size: 14px; color: #CBD7EA; flex: none; }
.masthead .contact strong { display: block; color: #fff; font-size: 16px; }
@media (max-width: 640px) {
  .masthead { flex-wrap: wrap; padding: 16px; gap: 12px; }
  .masthead .logo { width: 52px; height: 52px; }
  .masthead h1 { font-size: 21px; }
  .masthead .contact { margin-left: 0; text-align: left; width: 100%; }
}
.notice { background: #FFF6E5; border: 1px solid #E7C784; border-top: 0; padding: 12px 24px; color: #4A3200; font-size: 15px; }
.notice p { margin: 2px 0; }
.form-card { background: var(--surface); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--r-lg) var(--r-lg); box-shadow: var(--shadow-2); }
.section { padding: 22px 24px; border-top: 1px solid var(--line); }
.section:first-child { border-top: 0; }
.section-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 14px; }
.section-head .step { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; transform: translateY(4px); }
.section-head h2 { margin: 0; font-size: 20px; font-weight: 700; }
.section-head .sub { color: var(--muted); font-size: 14px; }
@media (max-width: 640px) { .section { padding: 18px 16px; } }
.subgrid { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-left: 4px solid var(--navy); border-radius: var(--r-sm); background: var(--surface-2); }
.form-foot { padding: 20px 24px 24px; border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.form-foot .hint { flex: 1 1 260px; }
.signature { text-align: center; margin-top: 22px; color: var(--muted); font-size: 14px; }
.signature strong { display: block; color: var(--ink); font-size: 16px; }

/* roll number block */
.roll-input { font-size: 18px; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.roll-result { margin-top: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.locked-box { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); padding: 8px 12px; }
.locked-box .k { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; }
.locked-box .v { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ branch picker */
.picker-top { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.picker-top .search { flex: 1 1 220px; }
.all-toggle { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; font-weight: 600; }
.all-toggle input { width: 20px; height: 20px; accent-color: var(--navy); }
.all-toggle.on { background: var(--navy-soft); border-color: var(--navy); }
.course-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--line); margin-bottom: 4px; overflow-x: auto; }
.course-tabs button { border: 0; background: none; padding: 10px 16px; font-weight: 700; font-size: 16px; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.course-tabs button[aria-selected="true"] { color: var(--navy); border-bottom-color: var(--saffron); }
.course-tabs .count { font-size: 12px; background: var(--navy); color: #fff; border-radius: 10px; padding: 1px 7px; margin-left: 4px; vertical-align: 2px; }
.group { border-bottom: 1px solid var(--line); }
.group > button { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 12px 2px; background: none; border: 0; font-weight: 700; font-size: 16px; cursor: pointer; text-align: left; }
.group > button .meta { color: var(--muted); font-weight: 500; font-size: 14px; }
.group > button .chev { transition: transform .15s; display: inline-block; margin-left: 8px; }
.group > button[aria-expanded="true"] .chev { transform: rotate(90deg); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 12px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface);
  font-weight: 600; font-size: 15px; cursor: pointer; text-align: left; line-height: 1.2;
}
.chip:hover { border-color: var(--navy); }
.chip.on { background: var(--navy); border-color: var(--navy-ink); color: #fff; }
.chip .rank { min-width: 26px; height: 22px; padding: 0 5px; border-radius: 11px; background: var(--saffron); color: #2B1A00; font-size: 13px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.search-results .chip { margin: 0 6px 8px 0; }
.empty-note { color: var(--muted); padding: 12px 2px; }
.all-panel { padding: 16px; border: 1px solid var(--navy); border-radius: var(--r-md); background: var(--navy-soft); }
.all-panel strong { display: block; font-size: 17px; }

.pick-bar {
  position: sticky; bottom: 0; z-index: 20; margin: 14px -24px -22px; padding: 10px 24px;
  background: var(--surface); border-top: 1px solid var(--line-strong); box-shadow: 0 -6px 18px rgba(12, 24, 44, .14);
  display: flex; align-items: center; gap: 12px;
}
.pick-bar .summary { flex: 1; min-width: 0; font-size: 15px; }
.pick-bar .summary strong { font-size: 17px; }
.pick-bar .preview-line { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; font-size: 13.5px; }
@media (max-width: 640px) { .pick-bar { margin: 14px -16px -18px; padding: 10px 16px; } }

/* arrange sheet rows */
.order-list { list-style: none; margin: 0; padding: 0; }
.order-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); min-height: 58px; background: var(--surface); }
.order-row .pos { flex: none; width: 72px; min-height: 42px; font-weight: 800; font-size: 17px; text-align: center; padding: 0 22px 0 10px; background-position: right 8px center; }
.order-row .label { flex: 1; font-weight: 600; font-size: 16px; line-height: 1.25; }
.order-row .handle { flex: none; cursor: grab; color: var(--muted); padding: 10px 8px; user-select: none; touch-action: none; font-weight: 800; font-size: 18px; line-height: 1; border-radius: var(--r-sm); }
.order-row .handle:hover { background: var(--surface-2); color: var(--navy); }

/* ------------------------------------------------------------ modals, toasts, overlay */
.backdrop { position: fixed; inset: 0; background: rgba(8, 18, 36, .62); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.backdrop > .modal { animation: modal-in .18s ease-out; }
@keyframes modal-in { from { transform: translateY(10px) scale(.985); opacity: .4; } to { transform: none; opacity: 1; } }
@media (max-width: 640px) { .backdrop.sheet > .modal { animation: sheet-in .22s ease-out; } }
@keyframes sheet-in { from { transform: translateY(40px); } to { transform: none; } }
.modal { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-3); width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; border: 1px solid var(--line-strong); }
.modal-wide { max-width: 1100px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 19px; font-weight: 700; flex: 1; }
.modal-head .x { border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; border-radius: var(--r-sm); }
.modal-head .x:hover { background: var(--surface-2); color: var(--ink); }
.modal-body { padding: 16px 18px; overflow: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
@media (max-width: 640px) {
  .backdrop.sheet { align-items: flex-end; padding: 0; }
  .backdrop.sheet .modal { max-width: none; max-height: 92vh; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .backdrop.sheet .modal-foot { border-radius: 0; }
}
.kv { width: 100%; border-collapse: collapse; }
.kv th, .kv td { text-align: left; vertical-align: top; padding: 8px 6px; border-bottom: 1px solid var(--line); font-size: 15px; }
.kv th { width: 36%; color: var(--muted); font-weight: 500; }
.kv td { font-weight: 600; }
.kv tr.group-row td { background: var(--surface-2); color: var(--navy); font-weight: 700; padding-top: 12px; }

.toasts { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; width: min(520px, calc(100vw - 24px)); }
.toast { background: var(--navy-ink); color: #fff; border-radius: var(--r-md); padding: 12px 14px; box-shadow: var(--shadow-3); display: flex; gap: 12px; align-items: center; font-size: 15px; }
.toast.err { background: var(--red); }
.toast button { margin-left: auto; background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: var(--r-sm); padding: 6px 10px; font-weight: 700; cursor: pointer; }

.overlay { position: fixed; inset: 0; z-index: 400; background: rgba(12, 40, 80, .92); display: flex; align-items: center; justify-content: center; color: #fff; text-align: center; padding: 24px; }
.overlay .box { max-width: 420px; }
.overlay h3 { margin: 22px 0 6px; font-size: 22px; }
.overlay p { margin: 4px 0; color: #CBD7EA; }
.loader { width: 74px; height: 74px; margin: 0 auto; position: relative; }
.loader::before, .loader::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 4px solid transparent; }
.loader::before { border-top-color: var(--saffron); border-right-color: var(--saffron); animation: spin 1s linear infinite; }
.loader::after { inset: 12px; border-bottom-color: #fff; border-left-color: #fff; animation: spin 1.4s linear infinite reverse; }

.success { text-align: center; padding: 8px 4px; }
.success .tick { width: 64px; height: 64px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 34px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.success .serial { margin: 12px auto; display: inline-block; padding: 8px 16px; border-radius: var(--r-sm); background: var(--navy-soft); color: var(--navy); font-size: 22px; font-weight: 800; letter-spacing: .02em; font-variant-numeric: tabular-nums; }

/* admin edit bar on the form page */
.admin-editbar { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.admin-editbar strong { display: block; font-size: 17px; }

/* ============================================================ admin dashboard */
body.admin { background: var(--bg); }
.topbar { position: sticky; top: 0; z-index: 50; background: var(--navy); color: #fff; box-shadow: var(--shadow-2); }
.topbar-inner { display: flex; align-items: center; gap: 14px; padding: 7px 18px; min-height: 60px; }
.topbar .logo { width: 40px; height: 40px; border-radius: 50%; background: #fff; padding: 3px; flex: none; }
.topbar h1 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }
.topbar h1 .short { display: none; }
.topbar .spacer { flex: 1; }
.topbar .btn { border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.08); color: #fff; box-shadow: none; }
.topbar .btn:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.6); }
.topbar .who { font-size: 14px; color: #CBD7EA; background: none; border: 0; cursor: pointer; padding: 6px 8px; border-radius: var(--r-sm); white-space: nowrap; }
.topbar .who:hover { background: rgba(255,255,255,.1); color: #fff; }

/* clock tile (quiet version of the reference style) */
.clock { display: flex; flex-direction: column; align-items: flex-end; padding: 4px 12px; border-radius: var(--r-md); background: #0A2147; border: 1px solid rgba(255,255,255,.14); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); cursor: default; min-width: 150px; }
.clock .time { font-weight: 800; font-size: 23px; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: .01em; display: flex; align-items: baseline; gap: 1px; }
.clock .hh { color: #B9CCF2; }
.clock .mm { color: #E9C3DA; }
.clock .colon { color: #8EA3C7; animation: blink 2s steps(1) infinite; }
.clock .sec { font-size: 13px; color: #8EA3C7; margin-left: 5px; font-weight: 600; }
.clock .ampm { font-size: 12px; color: #8EA3C7; margin-left: 3px; font-weight: 700; }
.clock .date { font-size: 12px; color: #9FB0CC; margin-top: 2px; white-space: nowrap; }
@keyframes blink { 50% { opacity: .35; } }

.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--r-md); box-shadow: var(--shadow-3); padding: 6px; z-index: 80; }
.menu button, .menu label { display: flex; width: 100%; align-items: center; gap: 10px; text-align: left; padding: 9px 10px; border: 0; background: none; border-radius: var(--r-sm); cursor: pointer; font-weight: 600; font-size: 15px; }
.menu button:hover, .menu label:hover { background: var(--surface-2); }
.menu label input { width: 18px; height: 18px; accent-color: var(--navy); }
.menu label.locked { color: var(--muted); cursor: default; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu .menu-title { font-size: 13px; color: var(--muted); padding: 6px 10px 2px; font-weight: 600; }

.toolbar { position: sticky; top: 64px; z-index: 40; background: var(--surface); border-bottom: 1px solid var(--line-strong); box-shadow: 0 2px 8px rgba(12, 24, 44, .10); }
.toolbar-inner { display: flex; gap: 10px; align-items: center; padding: 10px 18px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 3px; }
.tabs button { border: 0; background: none; padding: 8px 14px; border-radius: 7px; font-weight: 700; font-size: 15px; cursor: pointer; color: var(--muted); white-space: nowrap; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--navy); box-shadow: var(--shadow-1); }
.tabs .n { font-variant-numeric: tabular-nums; margin-left: 4px; padding: 1px 7px; border-radius: 10px; background: var(--line); color: var(--ink); font-size: 13px; }
.tabs button[aria-selected="true"] .n { background: var(--navy); color: #fff; }
.toolbar .search { flex: 1 1 260px; position: relative; }
.toolbar .search .input { padding-left: 36px; min-height: 42px; }
.toolbar .search::before { content: ""; position: absolute; left: 12px; top: 50%; width: 14px; height: 14px; transform: translateY(-60%); border: 2px solid var(--muted); border-radius: 50%; }
.toolbar .search::after { content: ""; position: absolute; left: 24px; top: 58%; width: 7px; height: 2px; background: var(--muted); transform: rotate(45deg); }
.toolbar .select { min-height: 42px; width: auto; }
.toolbar .count { color: var(--muted); font-size: 14px; white-space: nowrap; }
.toolbar .count strong { color: var(--ink); }
.date-custom { display: flex; gap: 6px; align-items: center; }
.date-custom .input { min-height: 42px; width: 150px; }

.table-wrap { overflow: auto; max-height: calc(100vh - 128px); background: var(--surface); border-bottom: 1px solid var(--line); }
table.grid-table { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: max-content; min-width: 100%; }
.grid-table th, .grid-table td { border-bottom: 1px solid var(--line); border-right: 1px solid #DCE2EA; padding: 9px 12px; vertical-align: top; text-align: left; overflow: hidden; }
.grid-table thead th { position: sticky; top: 0; z-index: 3; background: #E3E9F1; color: var(--navy-ink); font-size: 15.5px; font-weight: 800; letter-spacing: .01em; border-bottom: 2px solid var(--line-strong); padding-top: 12px; padding-bottom: 12px; user-select: none; }
.grid-table tbody tr:nth-child(even) td { background: #F7F9FB; }
.grid-table tbody tr:hover td { background: #EEF3FA; }
.grid-table .sticky-col { position: sticky; left: 0; z-index: 2; background: var(--surface); box-shadow: 1px 0 0 var(--line-strong); }
.grid-table thead .sticky-col { z-index: 4; background: #E3E9F1; }
.grid-table tbody tr:nth-child(even) td.sticky-col { background: #F7F9FB; }
.grid-table tbody tr:hover td.sticky-col { background: #EEF3FA; }
.col-resize { position: absolute; right: -6px; top: 0; bottom: 0; width: 12px; cursor: col-resize; z-index: 5; touch-action: none; }
.col-resize::after { content: ""; position: absolute; left: 5px; top: 22%; bottom: 22%; width: 2px; border-radius: 1px; background: var(--line-strong); opacity: 0; }
th:hover .col-resize::after, .col-resize.active::after { opacity: 1; }
@media (pointer: coarse) { .col-resize { width: 22px; right: -11px; } .col-resize::after { opacity: .7; left: 10px; } }
.grid-table th { position: sticky; }

.cell-serial .serial { font-weight: 800; font-size: 14.5px; color: var(--navy); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-serial .when { font-size: 12.5px; color: var(--muted); white-space: nowrap; margin: 2px 0 7px; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 11px; border-radius: 999px; font-weight: 700; font-size: 13.5px; cursor: pointer; border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #A3AEBF; }
.pill:hover { border-color: var(--navy); color: var(--ink); }
.pill.paid { background: var(--green-soft); border-color: #8EC3A6; color: var(--green); }
.pill.paid::before { background: var(--green); }
.cell-name .name { font-weight: 800; font-size: 16.5px; line-height: 1.25; color: var(--ink); }
.cell-name .city { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.cell-name .rejected-note { margin-top: 6px; font-size: 13px; color: var(--red); background: var(--red-soft); border-radius: var(--r-sm); padding: 4px 8px; display: inline-block; }
.cell-roll .roll { font-weight: 800; font-size: 15.5px; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.cell-roll .rs { font-size: 14px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-roll .rs strong { color: var(--ink); font-size: 15px; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 4px; background: #FFF1D6; color: var(--saffron-ink); border: 1px solid #E7C784; margin-top: 4px; }
.cell-branches ol { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.4; font-weight: 600; }
.cell-branches .more, .cell-remarks .more { margin-top: 4px; background: none; border: 0; padding: 0; color: var(--navy); font-weight: 700; cursor: pointer; font-size: 13.5px; text-decoration: underline; }
.cell-branches .allb { font-weight: 700; font-size: 14px; }
.cell-phone { font-weight: 700; font-size: 15.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-phone a { color: inherit; text-decoration: none; }
.cell-phone a:hover { text-decoration: underline; }
.actions { display: grid; grid-template-columns: repeat(4, auto); gap: 6px; justify-content: start; }
.actions .btn { min-height: 30px; padding: 0 9px; font-size: 13.5px; }
.actions .btn .badge { font-size: 11.5px; background: var(--navy); color: #fff; border-radius: 9px; padding: 0 6px; min-width: 18px; line-height: 17px; }
.actions .btn-reject { color: var(--red); border-color: #D9A49E; }
.actions .btn-reject:hover { background: var(--red-soft); border-color: var(--red); }
.empty-state { padding: 48px 18px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: var(--ink); font-size: 18px; margin-bottom: 4px; }

/* remarks floating card */
.remarks-card { position: fixed; z-index: 120; width: min(420px, calc(100vw - 16px)); max-height: min(560px, calc(100vh - 90px)); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: var(--shadow-3); display: flex; flex-direction: column; }
.remarks-card .modal-head { cursor: move; touch-action: none; background: var(--surface-2); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.remarks-card .modal-head h3 { font-size: 16.5px; }
.remarks-card .modal-head .sub { font-size: 13px; color: var(--muted); display: block; font-weight: 500; }
.remark { border-bottom: 1px solid var(--line); padding: 10px 0; }
.remark:last-child { border-bottom: 0; }
.remark .meta { display: flex; gap: 8px; align-items: baseline; font-size: 13px; color: var(--muted); }
.remark .meta .no { font-weight: 800; color: var(--navy); }
.remark .meta .tools { margin-left: auto; display: flex; gap: 2px; }
.remark .text { white-space: pre-wrap; font-size: 15px; margin-top: 3px; }
.remark.reject .text { color: var(--red); font-weight: 600; }
.remark.restore .text { color: var(--green); font-weight: 600; }
.remark .edited { font-size: 12.5px; color: var(--muted); font-style: italic; margin-top: 2px; }
.textarea { min-height: 80px; resize: vertical; line-height: 1.4; }

/* download preview */
.dl-controls { display: grid; gap: 12px; margin-bottom: 12px; }
.dl-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.dl-row .k { font-weight: 700; min-width: 72px; }
.radio { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; cursor: pointer; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); }
.radio input { accent-color: var(--navy); width: 17px; height: 17px; }
.radio.on { border-color: var(--navy); background: var(--navy-soft); }
.colpick { display: flex; flex-wrap: wrap; gap: 6px; }
.colpick label { display: inline-flex; gap: 6px; align-items: center; padding: 5px 10px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 14px; font-weight: 600; cursor: pointer; background: var(--surface); }
.colpick label.on { background: var(--navy); color: #fff; border-color: var(--navy-ink); }
.colpick input { display: none; }
.linkbtn { background: none; border: 0; color: var(--navy); font-weight: 700; cursor: pointer; text-decoration: underline; padding: 2px 4px; font-size: 14px; }
.preview-table-wrap { border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: auto; max-height: 46vh; }
.preview-table { border-collapse: collapse; font-size: 13.5px; min-width: 100%; }
.preview-table th { position: sticky; top: 0; background: var(--navy); color: #fff; text-align: left; padding: 7px 10px; white-space: nowrap; font-weight: 700; }
.preview-table td { padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: top; max-width: 360px; }
.preview-table tr:nth-child(even) td { background: #F5F7FA; }

.amount-input { display: flex; align-items: stretch; }
.amount-input .pre, .amount-input .suf { display: flex; align-items: center; padding: 0 12px; background: var(--surface-2); border: 1px solid var(--line-strong); font-weight: 700; color: var(--muted); }
.amount-input .pre { border-right: 0; border-radius: var(--r-sm) 0 0 var(--r-sm); }
.amount-input .suf { border-left: 0; border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.amount-input .input { border-radius: 0; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.quick button { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 4px 11px; font-weight: 600; cursor: pointer; font-size: 14px; }
.quick button:hover { border-color: var(--navy); }

@media (max-width: 900px) {
  .topbar h1 .full { display: none; }
  .topbar h1 .short { display: inline; }
  .topbar .who { display: none; }
}
@media (max-width: 640px) {
  .topbar-inner { padding: 8px 10px; gap: 8px; min-height: 56px; }
  .topbar .logo { width: 34px; height: 34px; }
  .topbar h1 { font-size: 17px; }
  .topbar .btn { padding: 0 9px; min-height: 36px; font-size: 14px; }
  .clock { min-width: 0; padding: 4px 9px; }
  .clock .time { font-size: 19px; }
  .clock .sec, .clock .date { display: none; }
  .clock.show-date .date { display: block; }
  .toolbar { top: 56px; }
  .toolbar-inner { padding: 8px 10px; gap: 8px; }
  .toolbar .search { order: 3; flex-basis: 100%; }
  .table-wrap { max-height: calc(100vh - 168px); }
  .grid-table th, .grid-table td { padding: 8px 9px; }
  .cell-name .name { font-size: 15.5px; }
}

/* official-result slip (roll number confirmation) */
.result-slip { max-width: 440px; overflow: hidden; }
.slip-head { background: var(--navy); color: #fff; padding: 18px 22px 16px; border-bottom: 4px solid var(--saffron); }
.slip-kicker { font-size: 13.5px; color: #CBD7EA; }
.slip-head h3 { margin: 4px 0 0; font-size: 23px; font-weight: 800; letter-spacing: -.01em; }
.slip-roll { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 16px 22px; border-bottom: 1px dashed var(--line-strong); }
.slip-roll span { color: var(--muted); font-size: 14.5px; }
.slip-roll strong { font-size: 24px; font-weight: 800; letter-spacing: .04em; white-space: nowrap; }
.slip-stats { display: grid; grid-template-columns: 1.4fr 1fr; }
.slip-stats div { padding: 16px 22px 18px; }
.slip-stats div + div { border-left: 1px solid var(--line); }
.slip-stats span { display: block; color: var(--muted); font-size: 14.5px; }
.slip-stats strong { display: block; font-size: 40px; line-height: 1.05; font-weight: 800; color: var(--navy); margin-top: 2px; }
.slip-note { margin: 0; padding: 12px 22px; background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.slip-actions { padding: 16px 22px 18px; display: grid; gap: 6px; }
@media (max-width: 640px) {
  .slip-actions { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .modal-foot { flex-direction: column-reverse; align-items: stretch; }
  .modal-foot .btn { width: 100%; min-height: 46px; }
}

/* login */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(180deg, var(--navy) 0 38%, var(--bg) 38%); }
.login-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-3); border: 1px solid var(--line-strong); overflow: hidden; }
.login-head { display: flex; gap: 14px; align-items: center; padding: 20px 22px; border-bottom: 4px solid var(--saffron); background: var(--surface-2); }
.login-head img { width: 54px; height: 54px; border-radius: 50%; border: 1px solid var(--line); background: #fff; padding: 3px; }
.login-head h1 { margin: 0; font-size: 19px; font-weight: 800; line-height: 1.2; }
.login-head p { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); }
.login-body { padding: 20px 22px 24px; display: grid; gap: 14px; }
.login-error { margin: 0; padding: 10px 12px; border-radius: var(--r-sm); background: var(--red-soft); color: var(--red); font-weight: 600; border: 1px solid #E5B3AD; }

.phone-only { display: none; }
.phone-serial { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 4px; flex-wrap: wrap; }
.phone-serial .serial { font-weight: 800; font-size: 13px; color: var(--navy); font-variant-numeric: tabular-nums; }
.phone-serial .pill { min-height: 24px; font-size: 12.5px; padding: 0 8px; }
.cell-name .when { font-size: 12px; color: var(--muted); margin-top: 3px; }
@media (max-width: 640px) {
  .desk-only { display: none !important; }
  .phone-only { display: block; }
  span.phone-only { display: inline; }
  .topbar h1 { font-size: 16px; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
  .topbar .spacer { flex: 1 1 4px; }
  .clock { flex: none; }
}

/* row actions: one colour per operation, dark bold text in the same family */
.actions .btn.act { font-weight: 700; box-shadow: 0 1px 1px rgba(12, 24, 44, .12); border-width: 1px; }
.act-preview { background: #D3E0F4; border-color: #8FA9D6; color: #12336B; }
.act-preview:hover { background: #BFD1EE; border-color: #12336B; }
.act-remarks { background: #CDE9E4; border-color: #7FBDB4; color: #0A4F49; }
.act-remarks:hover { background: #B7DFD8; border-color: #0A4F49; }
.act-remarks .badge { background: #0A4F49 !important; }
.act-edit { background: #F8E3B8; border-color: #D9A94E; color: #643C04; }
.act-edit:hover { background: #F3D598; border-color: #643C04; }
.act-email { background: #E2D9F4; border-color: #AE9BDB; color: #3F2577; }
.act-email:hover { background: #D3C6EE; border-color: #3F2577; }
.act-png { background: #CFE8F2; border-color: #86BFD5; color: #094A62; }
.act-png:hover { background: #BADDEB; border-color: #094A62; }
.act-pdf { background: #DCE1E8; border-color: #A3AEBD; color: #263142; }
.act-pdf:hover { background: #CBD2DC; border-color: #263142; }
.act-reject { background: #F6D3CE; border-color: #D7867C; color: #86170E; }
.act-reject:hover { background: #F1BEB7; border-color: #86170E; }
.act-restore { background: #CFE8DA; border-color: #7FB898; color: #165537; }
.act-restore:hover { background: #BADDC9; border-color: #165537; }
.actions { grid-template-columns: 74px 108px 64px 70px; }
.actions .btn { width: 100%; padding: 0 6px; }
.field > p { margin: 0; }

/* toasts never block clicks underneath (only their own buttons are clickable) */
.toasts { pointer-events: none; }
.toast button { pointer-events: auto; }
/* empty / loading messages stay in view even when the table is scrolled sideways */
.table-wrap .empty-state { position: sticky; left: 0; width: min(100%, 100vw); }

/* drag state: the grabbed row is clearly lifted and highlighted */
.order-list.drag-active { cursor: grabbing; user-select: none; }
.order-list.drag-active .order-row:not(.is-dragging) { opacity: .75; }
.order-row { transition: background .12s, box-shadow .12s, transform .12s; position: relative; }
.order-row.is-dragging {
  background: var(--navy-soft); border: 2px solid var(--navy); border-radius: var(--r-md);
  box-shadow: 0 10px 24px rgba(12, 24, 44, .28); transform: scale(1.02); z-index: 2; opacity: 1;
}
.order-row.is-dragging .label { color: var(--navy); font-weight: 800; }
.order-row.is-dragging .handle { background: var(--navy); color: #fff; cursor: grabbing; }
.moving-tag { flex: none; font-size: 12px; font-weight: 800; color: #2B1A00; background: var(--saffron); border-radius: 999px; padding: 2px 9px; }

/* row that was just moved: visible highlight for ~1.5 s (no animation needed, so it shows even with animations off) */
.order-row { transition: background .35s ease-out, box-shadow .35s ease-out, transform .12s; }
.order-row.just-moved { background: #FFE2A6; box-shadow: inset 5px 0 0 var(--saffron); transition: none; }
.order-row.just-moved .label { color: #4A2E00; font-weight: 800; }

/* ---------- candidate preview */
.modal.pv { max-width: 860px; overflow: hidden; }
.pv-head { display: flex; align-items: flex-start; gap: 14px; padding: 18px 20px 16px; background: linear-gradient(135deg, var(--navy-ink), var(--navy)); color: #fff; border-bottom: 4px solid var(--saffron); }
.pv-id { flex: 1; min-width: 0; }
.pv-head h3 { margin: 0; font-size: 22px; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; overflow-wrap: anywhere; }
.pv-meta { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 14px; color: #CBD7EA; }
.pv-serial { font-weight: 700; color: #fff; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); padding: 1px 9px; border-radius: 999px; letter-spacing: .02em; }
.pv-pills { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; padding-top: 2px; }
.pv-pill { font-size: 13px; font-weight: 700; padding: 4px 11px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; }
.pv-pill.is-live { background: var(--green-soft); color: var(--green); }
.pv-pill.is-rejected { background: var(--red-soft); color: var(--red); }
.pv-pill.is-paid { background: var(--saffron); color: #12233F; }
.pv-pill.is-unpaid { background: rgba(255,255,255,.14); color: #E6ECF5; border-color: rgba(255,255,255,.3); }
.pv-head .x { color: #CBD7EA; border: 0; background: none; font-size: 28px; line-height: 1; cursor: pointer; padding: 0 6px; border-radius: var(--r-sm); }
.pv-head .x:hover { background: rgba(255,255,255,.14); color: #fff; }
.pv-body { background: var(--bg); padding: 16px 18px 18px; }
.pv-alert { background: var(--red-soft); color: var(--red); border: 1px solid #E7B4AE; border-radius: var(--r-md); padding: 10px 14px; margin-bottom: 14px; font-size: 15px; }
.pv-alert small { display: block; color: #7A3A33; margin-top: 2px; font-size: 13px; }
.pv-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.pv-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 14px; box-shadow: var(--shadow-1); border-top: 3px solid var(--navy); }
.pv-stat span { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.pv-stat strong { display: block; font-size: 22px; font-weight: 800; color: var(--navy-ink); line-height: 1.25; margin-top: 2px; overflow-wrap: anywhere; }
.pv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pv-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px 14px; box-shadow: var(--shadow-1); min-width: 0; }
.pv-full { grid-column: 1 / -1; }
.pv-card h4 { margin: 0 0 8px; font-size: 14px; font-weight: 800; color: var(--navy); text-transform: uppercase; letter-spacing: .06em; padding-bottom: 7px; border-bottom: 1px solid var(--line); display: flex; align-items: baseline; gap: 8px; }
.pv-card h4 small { font-size: 12.5px; color: var(--muted); text-transform: none; letter-spacing: 0; font-weight: 500; }
.pv-card dl { margin: 0; display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr); gap: 7px 12px; }
.pv-card dt { color: var(--muted); font-size: 14px; }
.pv-card dd { margin: 0; font-weight: 700; font-size: 15px; color: var(--ink); min-width: 0; }
.pv-break { overflow-wrap: break-word; }
.pv-tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; margin-left: 6px; vertical-align: 1px; }
.pv-tag.ok { background: var(--green-soft); color: var(--green); }
.pv-tag.warn { background: #FFF1D6; color: var(--saffron-ink); }
.pv-quick { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.pv-branches { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.pv-branches li { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; min-width: 0; }
.pv-num { flex: none; width: 26px; height: 26px; border-radius: 7px; background: var(--navy); color: #fff; font-size: 13px; font-weight: 800; display: grid; place-items: center; }
.pv-all, .pv-pay { margin: 0; font-weight: 700; font-size: 15px; }
.pv-none { margin: 0; color: var(--muted); }
.pv-spacer { flex: 1; }
@media (max-width: 720px) {
  .pv-stats { grid-template-columns: 1fr 1fr; }
  .pv-grid, .pv-branches { grid-template-columns: 1fr; }
  .pv-head { flex-wrap: wrap; padding: 16px; }
  .pv-pills { order: 3; width: 100%; justify-content: flex-start; }
  .pv-spacer { display: none; }
  .pv-card dl { grid-template-columns: minmax(96px, 36%) minmax(0, 1fr); }
  .modal-foot.pv-foot { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; padding: 10px 12px; }
  .modal-foot.pv-foot .btn { width: auto; min-height: 42px; padding: 0 6px; font-size: 14px; }
  .pv-foot .act-png, .pv-foot .act-pdf, .pv-foot a[target] { grid-column: span 2; }
  .pv-foot .act-edit, .pv-foot .btn-navy { grid-column: span 3; }
}

/* ---------- paid / unpaid tabs, serial sort */
.tabs .t-paid[aria-selected="true"] .n { background: var(--green); }
.tabs .t-unpaid[aria-selected="true"] .n { background: #8A5A00; }
.sort-arrows { display: inline-flex; flex-direction: row; vertical-align: middle; margin-left: 8px; gap: 4px; }
.sort-arrows button { border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); font-size: 11px; line-height: 1; width: 26px; height: 24px; padding: 0; cursor: pointer; border-radius: 5px; }
.sort-arrows button:hover { border-color: var(--navy); color: var(--navy); }
.sort-arrows button.on { background: var(--navy); border-color: var(--navy); color: #fff; }
@media (max-width: 640px) {
  .toolbar .tabs { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); }
  .toolbar .tabs button { padding: 7px 2px; font-size: 13.5px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
  .toolbar .tabs .n { margin-left: 0; }
}
.preview-table .sl { text-align: right; font-variant-numeric: tabular-nums; width: 1%; white-space: nowrap; }
.preview-table td.sl { color: var(--muted); }
@media (max-width: 640px) { .grid-table thead th { font-size: 14.5px; } }

/* ---------- logout */
.pw-ico { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; flex: none; }
.topbar .btn.btn-logout { background: #7A5FC4; border-color: #9F88DD; color: #fff; gap: 7px; font-weight: 700; }
.topbar .btn.btn-logout:hover { background: #6A4FB3; border-color: #C2B2EE; }
.topbar .btn.btn-dl { background: #12573A; border-color: #2E8460; color: #fff; }
.topbar .btn.btn-dl:hover { background: #0D4A30; border-color: #5BAF89; }
.menu .menu-logout { color: #5B3FA8; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.dl-label { display: inline-flex; align-items: center; gap: 7px; }

/* ---------- sort buttons (one per sort), remarks + phones columns */
.sort-btns { display: inline-flex; gap: 5px; vertical-align: middle; margin-left: 8px; }
.sort-btns .sb { display: inline-flex; align-items: center; justify-content: center; gap: 1px; min-width: 30px; height: 26px; padding: 0 6px; border-radius: 6px; border: 1px solid #9DB0CC; background: #fff; color: var(--navy); font-size: 14px; font-weight: 800; line-height: 1; cursor: pointer; }
.sort-btns .sb:hover { border-color: var(--navy); }
.sort-btns .sb.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.sort-btns .sb-pay { border-color: #7FBF9C; color: #1B6B45; }
.sort-btns .sb-pay:hover { border-color: #1B6B45; }
.sort-btns .sb-pay.on { background: #1B6B45; border-color: #1B6B45; color: #fff; }
.sort-now { font-size: 13.5px; font-weight: 700; color: var(--navy); background: #E9EEF7; border: 1px solid #C9D4E6; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.updated { font-size: 13px; color: var(--muted); white-space: nowrap; }
.sort-select { max-width: 230px; }
.cell-roll .rs .k, .cell-phones .k { color: var(--muted); font-weight: 600; font-size: 13px; }
.cell-roll .roll-line { margin-top: 2px; font-size: 13.5px; }
.cell-phones .ph { display: flex; align-items: baseline; gap: 8px; line-height: 1.6; }
.cell-phones .k { min-width: 52px; }
.cell-phones a { font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; }
.cell-phones a:hover { color: var(--navy); text-decoration: underline; }
.nil { color: var(--muted); font-weight: 500; }
.rm-last { display: block; width: 100%; text-align: left; background: #FFFBF1; border: 1px solid #EBD9AE; border-radius: 8px; padding: 7px 9px; cursor: pointer; font: inherit; color: inherit; }
.rm-last:hover { border-color: var(--saffron); background: #FFF6E0; }
.rm-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.4; overflow-wrap: anywhere; cursor: pointer; }
.rm-meta { margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.rm-more { display: block; margin-top: 3px; font-size: 12.5px; font-weight: 700; color: var(--navy); }
.rmv-body { max-height: min(62vh, 560px); overflow-y: auto; background: var(--bg); }
.rmv-item { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--saffron); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; box-shadow: var(--shadow-1); }
.rmv-item.sys { border-left-color: #9DB0CC; }
.rmv-text { font-size: 15px; font-weight: 600; white-space: pre-line; overflow-wrap: anywhere; }
.rmv-meta { margin-top: 5px; font-size: 13px; color: var(--muted); }

/* ---------- fixed app layout: only the table scrolls (top bar + toolbar never move) */
body.admin { height: 100vh; height: 100dvh; overflow: hidden; }
.dash { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.dash > .topbar, .dash > .toolbar { position: relative; top: auto; flex: none; }
.dash > .table-wrap { flex: 1 1 auto; min-height: 0; max-height: none; }
@media (max-width: 640px) { .dash > .table-wrap { max-height: none; } }

/* ---------- free counselling */
.pill.free { background: #EFE9FB; border-color: #C7B6EE; color: #5B3FA8; }
.pill.free::before { background: #7A5FC4; }
.pv-pill.is-free { background: #EFE9FB; color: #5B3FA8; }
.tabs .t-free[aria-selected="true"] .n { background: #7A5FC4; }
.free-btn { width: 100%; margin-top: 12px; border-color: #C7B6EE; color: #5B3FA8; background: #F7F3FE; font-weight: 700; }
.free-btn:hover { background: #EFE9FB; border-color: #7A5FC4; }
@media (max-width: 640px) {
  .toolbar .tabs { grid-template-columns: repeat(5, 1fr); }
  .toolbar .tabs button { padding: 6px 1px; font-size: 12.5px; }
  .toolbar .select { flex: 1 1 40%; min-width: 0; min-height: 40px; }
  .toolbar .sort-select { flex: 1 1 100%; max-width: none; order: 2; }
  .toolbar .count, .toolbar .updated { font-size: 12.5px; }
  .toolbar .search { order: 4; }
  .toolbar .search .input { min-height: 40px; }
}
@media (max-width: 640px) {
  .cell-serial .serial { font-size: 12.5px; }
  .cell-serial .when { font-size: 11.5px; }
  .cell-serial .pill { min-height: 24px; font-size: 12px; padding: 0 8px; }
  .cell-name .name { font-size: 14.5px; line-height: 1.3; }
  .cell-name .city { font-size: 12.5px; }
  th .sort-btns { margin-left: 0; margin-top: 4px; display: flex; }
}

/* ---------- copy number buttons */
.copy-btn { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 26px; height: 26px; margin-left: 6px; padding: 0; border: 1px solid #C9D4E6; border-radius: 6px; background: #fff; color: var(--navy); cursor: pointer; vertical-align: middle; }
.copy-btn:hover { border-color: var(--navy); background: #EEF3FA; }
.copy-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.copy-btn.done { border-color: #5CB88A; background: #E6F5EC; color: #1B6B45; }
.cell-phones .ph { align-items: center; }
.pv-num-row { display: flex; align-items: center; }
@media (max-width: 640px) { .copy-btn { width: 30px; height: 30px; } }
