/* ==========================================================================
   St. Xavier's Operations Portal — one stylesheet for every staff/faculty page.
   Loaded AFTER Bootstrap 5 (static/vendor). Bootstrap supplies the grid and
   widgets; this file supplies the college theme, the app header/menu, and the
   portal's own components (tickets, booking, tiles…), written so they never
   fight Bootstrap's classes.
   ========================================================================== */

@font-face { font-family: "Source Serif 4"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("/static/fonts/source-serif-4-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("/static/fonts/source-serif-4-latin-700-normal.woff2") format("woff2"); }

/* ── Tokens ──────────────────────────────────────────────────────────────── */
:root {
  --navy: #173a5e; --navy-700: #1f4a75; --navy-900: #0f2740; --navy-050: #eef4fb;
  --gold: #c9a227; --gold-soft: #e8d5a3; --gold-ink: #8a6d14;
  --bg: #eef1f5; --surface: #ffffff; --surface-2: #f6f8fb;
  --ink: #1e2732; --ink-2: #384452; --muted: #5f6b79; --line: #e1e6ed; --line-2: #cfd7e1;
  --ok: #1f7a4d; --ok-bg: #e3f2e9; --warn: #8f6210; --warn-bg: #fbefd5;
  --danger: #b3392f; --danger-bg: #fbe6e3; --info: #22609f; --info-bg: #e6eff9;
  --radius: 10px; --radius-sm: 7px;
  --shadow-sm: 0 1px 2px rgba(16,39,64,.07);
  --shadow: 0 1px 2px rgba(16,39,64,.06), 0 4px 14px rgba(16,39,64,.05);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Bootstrap theme hooks */
  --bs-body-bg: var(--bg); --bs-body-color: var(--ink); --bs-body-font-family: var(--sans);
  --bs-body-font-size: .9rem; --bs-emphasis-color: var(--ink); --bs-secondary-color: var(--muted);
  --bs-primary: var(--navy); --bs-primary-rgb: 23,58,94;
  --bs-link-color: var(--info); --bs-link-color-rgb: 34,96,159; --bs-link-hover-color: var(--navy);
  --bs-border-color: var(--line); --bs-border-radius: .5rem; --bs-border-radius-sm: .375rem; --bs-border-radius-lg: .7rem;
  --bs-focus-ring-color: rgba(201,162,39,.35);
}
body { background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: .9rem; line-height: 1.5; }
a { color: var(--info); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ── App header + menu ───────────────────────────────────────────────────── */
.header { background: var(--navy-900); color: #fff; height: 64px; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 1030; }
.header-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.header-logo { width: 46px; height: 46px; border-radius: 50%; background: #fff; padding: 2px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; overflow: hidden; }
.header-logo img { width: 100%; height: 100%; object-fit: contain; }
.header-title { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.header-title .college { font-family: var(--serif); font-weight: 600; font-size: 18px; color: #fff; white-space: nowrap; }
.header-title .system { font-size: 12px; color: var(--gold-soft); }
.header-right { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.user-info { color: #c9d7e6; text-align: right; line-height: 1.25; }
.user-info .user-role { display: block; font-size: 11px; color: var(--gold-soft); }
.logout-btn { color: var(--gold-soft); text-decoration: none; font-size: 13px; font-weight: 600;
  padding: 6px 13px; border: 1px solid rgba(232,213,163,.45); border-radius: var(--radius-sm); }
.logout-btn:hover { background: rgba(255,255,255,.1); color: #fff; }

.navbar-scroll-wrap { background: var(--navy); position: sticky; top: 64px; z-index: 1020;
  border-bottom: 2px solid var(--gold); overflow-x: auto; overflow-y: clip; }
.navbar-scroll-wrap::-webkit-scrollbar { height: 3px; }
.navbar-scroll-wrap::-webkit-scrollbar-thumb { background: var(--gold-soft); }
/* .navbar is also a Bootstrap class — reset its padding/justify inside our wrap */
.navbar-scroll-wrap .navbar { display: flex; gap: 2px; padding: 0 16px; align-items: stretch;
  justify-content: flex-start; flex-wrap: nowrap; min-width: max-content; }
.navbar > a, .nav-group-btn { color: #d3e0ee; text-decoration: none; padding: 0 14px; font-size: 13.5px;
  font-weight: 500; white-space: nowrap; display: flex; align-items: center; gap: 6px; height: 44px;
  background: none; border: 0; border-bottom: 3px solid transparent; font-family: inherit; cursor: pointer; }
.navbar > a:hover, .nav-group:hover .nav-group-btn { color: #fff; background: rgba(255,255,255,.08); }
.navbar > a.on, .nav-group-btn.on { color: #fff; border-bottom-color: var(--gold); font-weight: 600; }
.nav-group { position: relative; display: flex; align-items: stretch; }
.nav-group-btn .caret { font-size: 9px; opacity: .7; }
.nav-dropdown { display: none; position: fixed; min-width: 230px; background: var(--surface);
  border: 1px solid var(--line); border-top: 2px solid var(--gold); border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 12px 28px rgba(15,39,64,.18); z-index: 2000; padding: 6px; }
.nav-group:hover .nav-dropdown, .nav-group:focus-within .nav-dropdown { display: block; }
.nav-dropdown a { display: flex; align-items: center; gap: 9px; padding: 8px 12px; color: var(--ink-2);
  text-decoration: none; font-size: 13.5px; border-radius: var(--radius-sm); white-space: nowrap; }
.nav-dropdown a:hover { background: var(--navy-050); color: var(--navy); }
.nav-dropdown a.on { background: var(--navy-050); color: var(--navy); font-weight: 600; box-shadow: inset 3px 0 0 var(--gold); }
.nav-dropdown hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; opacity: 1; }

/* ── Page frame ──────────────────────────────────────────────────────────── */
.page-content { max-width: 1440px; margin: 0 auto; padding: 26px 28px 56px; }
/* Bootstrap-built pages wrap themselves in .container(-fluid) py-4: don't double the gutters */
.page-content > .container-fluid { padding-left: 0; padding-right: 0; }
.page-content > .container-fluid.py-4, .page-content > .container.py-4 { padding-top: 0 !important; }
.page-content h1, .page-content h2 { font-family: var(--serif); color: var(--navy); font-weight: 600; letter-spacing: -.005em; }
.page-content h1 { font-size: 1.65rem; }
.page-content h2 { font-size: 1.45rem; }
.page-content .accordion-header, .page-content .modal-title { font-family: var(--sans); }
.page-content h3 { font-family: var(--serif); color: var(--navy); font-weight: 600; font-size: 1.1rem; }

.page-head { margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line-2); }
.page-head h1 { margin: 0; }
.page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.page-title { font-family: var(--serif); font-size: 1.65rem; font-weight: 600; color: var(--navy); margin: 0; display: flex; align-items: center; gap: 10px; }
.page-sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.eyebrow { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
.section { font-family: var(--serif); font-size: 1.1rem; color: var(--navy); font-weight: 600; margin: 26px 0 12px; }
.back { color: var(--muted); font-size: 13px; font-weight: 500; text-decoration: none; display: inline-block; margin-bottom: 6px; }
.back:hover { color: var(--navy); }
.muted { color: var(--muted); }
.mono { font-family: Consolas, "SFMono-Regular", Menlo, monospace; font-size: .9em; font-variant-numeric: tabular-nums; }
.footnote { margin-top: 28px; font-size: 13px; color: var(--muted); }

/* ── Bootstrap component theming ─────────────────────────────────────────── */
.btn { font-weight: 600; }
.btn-primary { --bs-btn-bg: var(--navy); --bs-btn-border-color: var(--navy);
  --bs-btn-hover-bg: var(--navy-700); --bs-btn-hover-border-color: var(--navy-700);
  --bs-btn-active-bg: var(--navy-900); --bs-btn-active-border-color: var(--navy-900);
  --bs-btn-disabled-bg: var(--navy); --bs-btn-disabled-border-color: var(--navy); }
.btn-outline-primary { --bs-btn-color: var(--navy); --bs-btn-border-color: var(--line-2);
  --bs-btn-hover-bg: var(--navy); --bs-btn-hover-border-color: var(--navy);
  --bs-btn-active-bg: var(--navy-900); --bs-btn-active-border-color: var(--navy-900); }
.card { --bs-card-border-color: var(--line); --bs-card-border-radius: var(--radius);
  --bs-card-cap-bg: var(--surface-2); box-shadow: var(--shadow-sm); }
.card.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.card-header { font-weight: 600; color: var(--navy); }
.table { --bs-table-bg: transparent; --bs-table-hover-bg: #f3f7fc; --bs-table-striped-bg: #f8fafc; }
.table > thead th, .table > thead td { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
.table-dark { --bs-table-bg: var(--navy); --bs-table-border-color: var(--navy-700); }
.table-dark > :not(caption) > * > * { color: #fff; }
.table-light { --bs-table-bg: var(--surface-2); }
.form-control, .form-select { border-color: var(--line-2); }
.form-control:focus, .form-select:focus { border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(31,74,117,.14); }
.form-label { font-weight: 600; color: var(--ink-2); font-size: 13px; }
.alert { border-radius: var(--radius-sm); font-size: 13.5px; }
.alert-error { color: var(--danger); background: var(--danger-bg); border: 1px solid #eeb9b3; }
.accordion { --bs-accordion-active-bg: var(--navy-050); --bs-accordion-active-color: var(--navy);
  --bs-accordion-btn-focus-box-shadow: 0 0 0 3px rgba(201,162,39,.3); }
.nav-tabs .nav-link.active { color: var(--navy); font-weight: 600; border-top: 2px solid var(--gold); }
.pagination { --bs-pagination-active-bg: var(--navy); --bs-pagination-active-border-color: var(--navy); --bs-pagination-color: var(--navy); }
.progress-bar { background-color: var(--navy); }

/* Bare form controls (pages written without Bootstrap classes) look like .form-control */
.page-content :where(input:not([type=checkbox], [type=radio], [type=file], [type=hidden], [type=submit], [type=button], [type=range], [type=color], [class])),
.page-content :where(select:not([class])), .page-content :where(textarea:not([class])) {
  display: block; width: 100%; padding: 8px 11px; margin-bottom: 14px; font: inherit; font-size: 14px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  transition: border-color .12s, box-shadow .12s; }
.page-content :where(input:not([class]), select:not([class]), textarea:not([class])):focus {
  outline: none; border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(31,74,117,.14); }
.page-content :where(input[type=file]:not([class])) { display: block; width: 100%; font-size: 13px; margin-bottom: 14px; }
.page-content :where(label:not([class])) { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 0 0 5px; }
.page-content :where(label:not([class])) > :where(input[type=checkbox], input[type=radio]) { margin-right: 6px; }

/* ── Portal components ───────────────────────────────────────────────────── */
.btn-ghost { --bs-btn-color: var(--navy); --bs-btn-bg: var(--surface); --bs-btn-border-color: var(--line-2);
  --bs-btn-hover-color: var(--navy); --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-border-color: var(--navy);
  --bs-btn-active-bg: var(--navy-050); --bs-btn-active-border-color: var(--navy); }
.btn-danger-ghost { --bs-btn-color: var(--danger); --bs-btn-border-color: #e7c9c9; --bs-btn-hover-color: var(--danger);
  --bs-btn-hover-bg: #fdf1f1; --bs-btn-hover-border-color: var(--danger); }
.btn-inline { width: auto; }
.btn-block, .btn-full { width: 100%; }
.link-btn { background: none; border: 0; color: var(--danger); cursor: pointer; font-size: 13px; font-weight: 500; padding: 0; }
.link-btn:hover { text-decoration: underline; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow-sm); margin-bottom: 18px; }
.panel > h3, .panel > .panel-title { font-size: 1rem; margin: 0 0 12px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.form-wide { max-width: 720px; background: var(--surface); padding: 22px 24px; border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 13.5px; color: var(--ink-2); margin: 2px 0 13px; }
.check input { width: auto; margin: 0; }
.meta { color: var(--muted); font-size: 13px; margin: 2px 0; }
.body-text { white-space: pre-wrap; margin-top: 10px; color: var(--ink-2); font-size: 14px; }
.attach { font-size: 13px; margin-top: 10px; }
.resolution { margin-top: 12px; padding: 11px 13px; background: var(--ok-bg); border-radius: 8px; font-size: 13.5px; color: #0f5233; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cols { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 22px; align-items: start; }
.col-main, .col-side { min-width: 0; }

/* Tabs + search (ticket lists) */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-2); margin: 4px 0 16px; overflow-x: auto; }
.tabs a { padding: 9px 15px; font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent;
  margin-bottom: -1px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.tabs a.on { color: var(--navy); border-bottom-color: var(--gold); font-weight: 600; }
.tabs a:hover { color: var(--navy); }
.searchbar { display: flex; gap: 9px; margin-bottom: 16px; max-width: 560px; }
.page-content .searchbar input { margin: 0; flex: 1; }
.searchbar .btn { flex: 0 0 auto; }

/* Data table */
.grid { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.grid th { text-align: left; font-size: 12px; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--line);
  background: var(--surface-2); font-weight: 600; white-space: nowrap; }
.grid td { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); vertical-align: middle; }
.grid tbody tr:last-child td { border-bottom: 0; }
.grid tbody tr[onclick] { cursor: pointer; }
.grid tbody tr:hover { background: #f3f7fc; }
.grid td.subject, .grid td:nth-child(2) { color: var(--ink); }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 13px; color: var(--muted); }
.pages { display: flex; gap: 16px; align-items: center; }
.empty { text-align: center; padding: 48px 18px; color: var(--muted); background: var(--surface);
  border: 1px dashed var(--line-2); border-radius: var(--radius); }
.empty .btn { margin-top: 14px; }

/* Status / priority pills (work with or without Bootstrap .badge) */
.badge.s-open, .badge.s-in_progress, .badge.s-resolved, .badge.s-not_issue, .badge.s-closed, .badge.s-pending, .badge.s-confirmed,
.badge.s-rejected, .badge.s-cancelled, .badge.p-low, .badge.p-normal, .badge.p-high, .badge.p-urgent {
  font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 100px; text-transform: capitalize; white-space: nowrap; }
.s-open, .s-pending { background: var(--info-bg); color: var(--info); }
.s-in_progress { background: var(--warn-bg); color: var(--warn); }
.s-resolved, .s-confirmed { background: var(--ok-bg); color: var(--ok); }
.s-closed, .s-cancelled { background: #e8ecf1; color: var(--muted); }
.s-not_issue { background: #efe7f7; color: #6a3d9a; }
.s-rejected { background: var(--danger-bg); color: var(--danger); }
.p-low { background: #eef1f4; color: var(--muted); }
.p-normal { background: var(--info-bg); color: var(--info); }
.p-high { background: #fbe8d4; color: #a35d10; }
.p-urgent { background: var(--danger-bg); color: var(--danger); }

/* Conversation thread */
.thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.msg { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 11px 14px; box-shadow: var(--shadow-sm); }
.msg.mine, .msg.staff { background: #f2f7fc; border-color: #d6e4f2; }
.msg.internal { background: #fdf6e4; border-color: #ecdba9; }
.msg-head { font-size: 12.5px; font-weight: 600; color: var(--navy); margin-bottom: 4px; }
.msg-body { white-space: pre-wrap; font-size: 14px; color: var(--ink-2); }
.tag-int { font-size: 11px; background: #ecdba9; color: #6f5712; padding: 1px 8px; border-radius: 100px; margin-left: 6px; font-weight: 600; }
.reply textarea { margin-bottom: 8px; min-height: 90px; }
.reply .actions, .reply .check { margin-bottom: 0; }

/* Dashboard tiles */
.dash-section { margin-bottom: 30px; }
.dash-section > h2 { font-size: 1.05rem; margin: 0 0 12px; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 14px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 4px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 18px 21px; color: var(--ink);
  text-decoration: none; box-shadow: var(--shadow-sm); transition: border-color .12s, box-shadow .12s; }
.tile::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.tile:hover { border-color: var(--navy); box-shadow: 0 4px 16px rgba(16,39,64,.1); color: var(--ink); }
.tile-icon { font-size: 22px; line-height: 1; margin-bottom: 6px; }
.tile-title { font-family: var(--serif); font-size: 1.02rem; font-weight: 600; color: var(--navy); }
.tile-desc { font-size: 12.5px; color: var(--muted); line-height: 1.4; }

/* Stat cards (older pages) */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow-sm); border-left: 4px solid var(--navy); }
.stat-card .stat-label { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.stat-card .stat-value { font-size: 26px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }

/* Booking */
.pickbar { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.pickbar > div { flex: 1; min-width: 180px; }
.page-content .pickbar select, .page-content .pickbar input { margin: 0; }
.pickbar .btn { width: auto; }
.head-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.slotpage-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin: 18px 0 10px; flex-wrap: wrap; }
.slot-tools { display: flex; gap: 8px; }
.chip-btn { border: 1px solid var(--line-2); background: var(--surface); color: var(--navy); border-radius: 100px; padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip-btn:hover { background: var(--surface-2); border-color: var(--navy); }
.slot-period { margin-bottom: 16px; }
.slot-period-h { font-size: 12.5px; color: var(--muted); font-weight: 600; margin: 0 0 8px; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.slot { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 12px; box-shadow: var(--shadow-sm); }
.slot.free { border-color: #cfe6d8; }
.slot.taken { background: var(--surface-2); border-style: dashed; display: flex; flex-direction: column; gap: 3px; opacity: .75; }
.slot-time { font-size: 13.5px; font-weight: 600; color: var(--navy); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.slot .btn { width: 100%; }
.slot-taken-label, .slot-state { font-size: 12.5px; color: var(--muted); }
.slot.free .slot-taken-label, .slot-pick .slot-state { color: var(--ok); }
.slot-pick { cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; transition: border-color .12s, background .12s; }
.slot-pick input { position: absolute; opacity: 0; pointer-events: none; }
.slot-pick .slot-check { position: absolute; top: 9px; right: 10px; width: 19px; height: 19px; border-radius: 50%; background: var(--navy);
  color: #fff; font-size: 12px; line-height: 19px; text-align: center; opacity: 0; }
.slot-pick:hover { border-color: var(--navy); }
.slot-pick:has(input:checked) { border-color: var(--navy); background: var(--navy-050); box-shadow: 0 0 0 2px rgba(23,58,94,.15); }
.slot-pick:has(input:checked) .slot-check { opacity: 1; }
.book-bar { position: sticky; bottom: 0; margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 16px; box-shadow: 0 -4px 16px rgba(16,39,64,.08); }
.book-bar-info { display: flex; flex-direction: column; line-height: 1.35; }
.book-bar-info #selCount { font-weight: 600; color: var(--navy); font-size: 14px; }
.book-bar-info #selSpan { color: var(--muted); font-size: 13px; }
.book-bar .btn[disabled] { opacity: .5; cursor: not-allowed; }
.day-picks, .incharge-picks { display: flex; flex-wrap: wrap; gap: 7px 15px; margin-bottom: 14px; }
.daycheck { display: flex; align-items: center; gap: 6px; font-weight: 400; font-size: 13px; margin: 0; color: var(--ink-2); }
.daycheck input { width: auto; margin: 0; }
.count-pill { background: var(--gold); color: var(--navy-900); border-radius: 100px; padding: 1px 8px; font-size: 11.5px; font-weight: 700; margin-left: 5px; }
.approvals { display: flex; flex-direction: column; gap: 12px; }
.appr-card { display: flex; gap: 20px; align-items: flex-start; }
.appr-main { flex: 1; min-width: 0; }
.appr-top { font-size: 15px; color: var(--navy); margin-bottom: 5px; }
.appr-actions { width: 240px; display: flex; flex-direction: column; gap: 8px; }
.page-content .appr-actions input { margin: 0 0 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: #eef2f6; border: 1px solid var(--line-2); border-radius: 100px; padding: 3px 6px 3px 11px; font-size: 13px; }
.chip-x { border: 0; background: none; cursor: pointer; color: var(--danger); font-size: 15px; line-height: 1; padding: 0 3px; }
.chip-add { display: flex; gap: 8px; align-items: center; }
.page-content .chip-add input { margin: 0; max-width: 260px; }
.img-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.img-thumb { position: relative; width: 70px; height: 52px; border-radius: 6px; overflow: hidden; background: #e7ecf1; }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-thumb .img-x { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: 12px; line-height: 1; }
.inst-thumb { width: 96px; height: 72px; border-radius: 8px; overflow: hidden; background: #e7ecf1; flex: 0 0 auto; }
.inst-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* 403 / empty-state page */
.denied { text-align: center; padding: 60px 16px; }

/* ── Small screens ───────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .header { padding: 0 14px; height: 58px; }
  .navbar-scroll-wrap { top: 58px; }
  .header-title .college { font-size: 15px; }
  .header-title .system, .user-info { display: none; }
  .page-content { padding: 18px 14px 40px; }
  .cols { grid-template-columns: 1fr; }
  .appr-card { flex-direction: column; } .appr-actions { width: 100%; }
  .grid { display: block; overflow-x: auto; }
}

/* ── Inline filter bars: Bootstrap makes controls 100% wide, which stacks them in a flex row ── */
.page-content form.d-flex > .form-control,
.page-content form.d-flex > .form-select { width: auto; flex: 0 1 190px; min-width: 130px; }
.page-content form.d-flex > input.form-control[type=text],
.page-content form.d-flex > input.form-control[type=search] { flex: 1 1 240px; max-width: 340px; }

/* Codes / IDs: navy, not Bootstrap pink */
.page-content code { color: var(--navy-700); background: var(--navy-050); padding: 1px 5px; border-radius: 4px; font-size: .86em; }
.page-content .table code { background: none; padding: 0; }

/* ── Sign-in pages ── */
.login-wrap .card { border-top: 4px solid var(--gold) !important; }
.login-wrap h5 { font-family: var(--serif); color: var(--navy); font-size: 1.25rem; }
.login-wrap .btn-primary { --bs-btn-bg: var(--navy); --bs-btn-border-color: var(--navy);
  --bs-btn-hover-bg: var(--navy-700); --bs-btn-hover-border-color: var(--navy-700); }
.login-wrap a { color: var(--info); }

/* ── Phones: wide tables scroll sideways instead of squashing words ── */
@media (max-width: 860px) {
  .grid { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .grid th, .grid td, .page-content .table th, .page-content .table td { white-space: nowrap; }
  .page-content .card, .page-content .card-body, .page-content .accordion-body { overflow-x: auto; }
  .page-content h1, .page-title { font-size: 1.4rem; }
}

/* ── Ticket flow tracker: Raised → In progress → Resolved → Closed ── */
.flow { display: flex; list-style: none; padding: 0; margin: 0 0 18px; counter-reset: step; max-width: 640px; }
.flow li { flex: 1; position: relative; padding-top: 22px; font-size: 12.5px; color: var(--muted); text-align: center; }
.flow li::before { content: ""; position: absolute; top: 5px; left: 50%; transform: translateX(-50%);
  width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-2); z-index: 1; }
.flow li::after { content: ""; position: absolute; top: 10px; left: -50%; width: 100%; height: 2px; background: var(--line-2); }
.flow li:first-child::after { display: none; }
.flow li.done, .flow li.now { color: var(--navy); }
.flow li.done::before { background: var(--navy); border-color: var(--navy); }
.flow li.done::after, .flow li.now::after { background: var(--navy); }
.flow li.now { font-weight: 700; }
.flow li.now::before { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201,162,39,.2); }

/* Q&A given when raising */
.answers { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 18px;
  margin: 14px 0 0; padding: 12px 14px; background: var(--surface-2); border-radius: 8px; }
.answers dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.answers dd { margin: 0; font-size: 14px; color: var(--ink); }
.tabs a .n { display: inline-block; min-width: 20px; margin-left: 5px; padding: 0 6px; border-radius: 100px;
  background: var(--line); color: var(--ink-2); font-size: 11.5px; text-align: center; }
.tabs a.on .n { background: var(--gold-soft); color: var(--navy-900); }

/* ── Faculty / HOD home ──────────────────────────────────────────────────── */
.fh-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  padding-bottom: 18px; margin-bottom: 22px; border-bottom: 1px solid var(--line-2); }
.fh-date { color: var(--muted); font-size: 13px; margin: 0 0 2px; }
.page-content .fh-name { font-size: 2rem; margin: 0; line-height: 1.15; }
.fh-role { margin: 6px 0 0; color: var(--ink-2); font-size: 14px; }
.fh-hod { color: var(--gold-ink); font-weight: 700; }
.fh-cta { padding: 10px 22px; }

.fh-attention { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--gold);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px 20px 6px; margin-bottom: 22px; }
.page-content .fh-attention h2 { font-size: 1.1rem; margin: 0 0 6px; }
.fh-attention ul { list-style: none; margin: 0; padding: 0; }
.fh-attention li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.fh-attention li:first-child { border-top: 0; }
.fh-what { flex: 1; min-width: 0; font-size: 14px; color: var(--ink-2); }
.fh-what .mono { margin-left: 6px; font-size: 12px; }
.fh-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.fh-dot.ok { background: var(--ok); } .fh-dot.info { background: var(--info); } .fh-dot.warn { background: var(--gold); }

.fh-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 20px; align-items: start; }
.fh-grid.one { grid-template-columns: minmax(0, 1fr); max-width: 860px; }
.fh-card { padding: 18px 20px; margin: 0; }
.fh-card-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.page-content .fh-card-head h2 { font-size: 1.15rem; margin: 0; }
.fh-more { font-size: 13px; font-weight: 600; text-decoration: none; }

.fh-session { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px;
  text-decoration: none; color: var(--ink); margin-bottom: 10px; transition: border-color .12s; }
.fh-session:hover { border-color: var(--navy); color: var(--ink); }
.fh-session-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.fh-session-name { font-weight: 600; color: var(--navy); }
.fh-bar { height: 6px; background: var(--line); border-radius: 100px; overflow: hidden; margin-bottom: 6px; }
.fh-bar span { display: block; height: 100%; background: var(--navy); border-radius: 100px; }

.fh-tickets { list-style: none; padding: 0; margin: 0; }
.fh-tickets li { border-top: 1px solid var(--line); }
.fh-tickets li:first-child { border-top: 0; }
.fh-tickets a { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "subj badge" "meta badge";
  gap: 2px 12px; align-items: center; padding: 10px 4px; text-decoration: none; color: var(--ink); }
.fh-tickets a:hover .fh-t-subj { color: var(--navy); text-decoration: underline; }
.fh-t-subj { grid-area: subj; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fh-t-meta { grid-area: meta; font-size: 12.5px; color: var(--muted); }
.fh-tickets .badge { grid-area: badge; }
.fh-desks { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line-2); }
.fh-desks-h { font-size: 12.5px; color: var(--muted); margin: 0 0 8px; }
.fh-desk-row { display: flex; flex-wrap: wrap; gap: 8px; }
.fh-desk { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border: 1px solid var(--line-2);
  border-radius: 100px; font-size: 13px; font-weight: 600; color: var(--navy); text-decoration: none; background: var(--surface); }
.fh-desk:hover { border-color: var(--navy); background: var(--navy-050); color: var(--navy); }

@media (max-width: 860px) {
  .fh-grid { grid-template-columns: minmax(0, 1fr); }
  .page-content .fh-name { font-size: 1.55rem; }
  .fh-cta { width: 100%; }
  .fh-attention li { flex-wrap: wrap; }
  .fh-attention li .btn { margin-left: 21px; }
}
@media (max-width: 860px) {
  .fh-attention li { align-items: flex-start; }
  .fh-attention li .fh-what { flex: 1 1 calc(100% - 24px); }
  .fh-attention li .fh-dot { margin-top: 6px; }
}
/* file pickers inside inline forms need room for the file name */
.page-content form.d-flex > input[type=file].form-control { flex: 1 1 300px; max-width: 440px; }

/* OSM scan box (Attendance / Paper Intake) */
input[data-scan-box] { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .04em; text-transform: uppercase; }
input[data-scan-box]:focus { box-shadow: 0 0 0 .25rem rgba(25,135,84,.25); border-color: #198754; }
input[data-scan-box].scan-sending { background: #fff8e1; color: #6c5300; }
