/* Maya Residency — management system styles.
   Same palette + fonts as the public site (charcoal, gold, cream, Playfair/Lato). */
:root {
  --ink: #2c2c2c;
  --charcoal: #3c3c3c;
  --charcoal-2: #4a4a4a;
  --gold: #c9a962;
  --gold-dark: #8b7355;
  --gold-soft: #f3ead6;
  --cream: #faf7f2;
  --cream-2: #f5f0e8;
  --sand: #e8dcc4;
  --white: #ffffff;
  --line: #e9e2d5;
  --line-2: #d9cfbc;
  --muted: #7a7268;
  --ok: #2e7d5b; --ok-bg: #e8f5ee;
  --warn: #b7791f; --warn-bg: #fdf4e3;
  --bad: #b4413c; --bad-bg: #fbeae9;
  --info: #3b6ea5; --info-bg: #e9f0f8;
  --font-heading: "Playfair Display", Georgia, serif;
  --font-body: "Lato", system-ui, -apple-system, sans-serif;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(44, 44, 44, 0.05), 0 2px 8px rgba(44, 44, 44, 0.05);
  --shadow-lg: 0 12px 32px rgba(44, 44, 44, 0.14);
  --sidebar-w: 250px;
  --hostel-accent: var(--gold);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-body); color: var(--ink); background: var(--cream); font-size: 15px; line-height: 1.5; min-height: 100vh; }
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 600; line-height: 1.25; color: var(--ink); }
h1 { font-size: 1.7rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.1rem; } h4 { font-size: 1rem; }
a { color: var(--gold-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.tiny { font-size: 0.78rem; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- layout ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--charcoal); color: var(--sand); display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 30; }
.sidebar .brand { padding: 20px 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.08); display: flex; gap: 12px; align-items: center; }
.sidebar .brand img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); }
.sidebar .brand .name { font-family: var(--font-heading); color: var(--gold); letter-spacing: 0.06em; font-size: 1rem; }
.sidebar .brand .sub { font-size: 0.72rem; color: var(--sand); opacity: 0.8; letter-spacing: 0.06em; text-transform: uppercase; }
.sidebar .hostel-chip { margin: 14px 16px 6px; padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(255,255,255,0.06); border-left: 3px solid var(--hostel-accent); }
.sidebar .hostel-chip .label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.7; }
.sidebar .hostel-chip .value { font-weight: 700; color: #fff; font-size: 0.92rem; }
.sidebar nav { padding: 8px 10px; flex: 1; overflow-y: auto; }
.sidebar nav .group { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.55; padding: 14px 12px 6px; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--sand); font-size: 0.92rem; }
.sidebar nav a i { width: 18px; text-align: center; opacity: 0.85; }
.sidebar nav a:hover { background: rgba(255,255,255,0.07); text-decoration: none; color: #fff; }
.sidebar nav a.active { background: var(--gold); color: var(--charcoal); font-weight: 700; }
.sidebar nav a .badge { margin-left: auto; }
.sidebar .user { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center; gap: 10px; }
.sidebar .user .avatar { background: var(--gold); color: var(--charcoal); }
.sidebar .user .who { flex: 1; min-width: 0; }
.sidebar .user .who div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .user button { background: none; border: 0; color: var(--sand); cursor: pointer; font-size: 1rem; padding: 6px; }
.sidebar .user .signout-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; padding: 8px 12px; font-size: .82rem; font-weight: 700; color: #fff; white-space: nowrap; min-height: 40px; }
.sidebar .user .signout-btn:hover { background: rgba(255,255,255,.08); }
.sidebar nav a.nav-signout { color: #f2b8b0; }
.sidebar nav a.nav-signout:hover { background: rgba(242,184,176,.12); color: #ffd6cf; }
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(250,247,242,0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: 12px 28px; display: flex; align-items: center; gap: 14px; }
.topbar h1 { font-size: 1.35rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .icon-btn { position: relative; }
.topbar .icon-btn .dot { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--bad); color: #fff; font-size: 0.65rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.content { padding: 24px 28px 90px; max-width: 1280px; width: 100%; }
.bottom-nav { display: none; }
@media (max-width: 1023px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .topbar { padding: 10px 16px; }
  .topbar h1 { font-size: 1.15rem; }
  .content { padding: 16px 16px 90px; }
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--charcoal); border-top: 1px solid rgba(255,255,255,0.1); z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 4px 8px; color: var(--sand); font-size: 0.68rem; text-decoration: none; }
  .bottom-nav a i { font-size: 1.1rem; }
  .bottom-nav a.active { color: var(--gold); }
  /* hamburger menu: slides in over the page with a close (✕) button and a dimmed backdrop */
  .sidebar.open { display: flex; width: min(290px, 86vw); z-index: 60; box-shadow: 0 0 40px rgba(0,0,0,.35); padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); animation: sbIn .18s ease-out; }
  .sb-backdrop { position: fixed; inset: 0; background: rgba(20,18,15,.45); z-index: 55; }
  body.menu-open { overflow: hidden; }
}
.sb-close { display: none; }
@media (max-width: 1023px) {
  .sidebar .brand { padding-right: 12px; }
  .sb-close { display: inline-flex; align-items: center; justify-content: center; margin-left: auto; flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: #fff; font-size: 1.25rem; cursor: pointer; }
  .sb-close:active { background: rgba(255,255,255,.16); }
}
@keyframes sbIn { from { transform: translateX(-100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .sidebar.open { animation: none; } }

/* ---------- components ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid-4, .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; } .grid-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
.kpi { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi .label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi .label i { color: var(--gold-dark); background: var(--gold-soft); width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 0.85rem; }
.kpi .value { font-family: var(--font-heading); font-size: 1.65rem; font-weight: 700; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .sub { font-size: 0.8rem; color: var(--muted); }
.kpi.bad .value { color: var(--bad); } .kpi.ok .value { color: var(--ok); } .kpi.warn .value { color: var(--warn); }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; background: var(--gold-soft); color: var(--gold-dark); flex-shrink: 0; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; background: var(--cream-2); color: var(--muted); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.gold { background: var(--gold-soft); color: var(--gold-dark); }
.badge.plain::before { display: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--charcoal); background: var(--charcoal); color: #fff; font-weight: 700; cursor: pointer; white-space: nowrap; transition: 0.15s; text-decoration: none !important; font-size: 0.92rem; }
.btn:hover { background: var(--charcoal-2); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--charcoal); }
.btn.gold:hover { background: #d6b874; }
.btn.secondary { background: var(--white); color: var(--ink); border-color: var(--line-2); }
.btn.secondary:hover { background: var(--cream-2); }
.btn.danger { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.btn.danger:hover { background: #f6d9d7; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 0.82rem; }
.btn.block { width: 100%; }
.icon-btn { width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--white); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--cream-2); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .search { flex: 1; min-width: 200px; position: relative; }
.toolbar .search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.toolbar .search input { padding-left: 36px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; overflow-x: auto; }
.chip { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--white); cursor: pointer; font-size: 0.85rem; white-space: nowrap; }
.chip.active { background: var(--charcoal); color: #fff; border-color: var(--charcoal); }

/* forms */
label { display: block; font-size: 0.82rem; font-weight: 700; color: var(--charcoal); margin-bottom: 6px; }
label .req { color: var(--bad); }
input, select, textarea { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--white); font: inherit; color: var(--ink); }
textarea { height: auto; padding: 10px 12px; min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,169,98,0.25); }
input.invalid, select.invalid, textarea.invalid { border-color: var(--bad); }
.field { margin-bottom: 14px; }
.field .hint { font-size: 0.78rem; color: var(--muted); margin-top: 4px; }
.field .error { font-size: 0.78rem; color: var(--bad); margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid .full { grid-column: 1 / -1; }
.form-section { font-family: var(--font-heading); font-size: 1rem; margin: 10px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line); grid-column: 1 / -1; }
.checkbox { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.checkbox input { width: auto; height: auto; }
.input-prefix { position: relative; }
.input-prefix span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-prefix input { padding-left: 28px; }

/* alerts, toasts */
.alert { padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid; font-size: 0.9rem; display: flex; gap: 10px; align-items: flex-start; }
.alert.ok { background: var(--ok-bg); border-color: #bfe3cf; color: var(--ok); }
.alert.warn { background: var(--warn-bg); border-color: #f1dcb0; color: var(--warn); }
.alert.bad { background: var(--bad-bg); border-color: #efc4c1; color: var(--bad); }
.alert.info { background: var(--info-bg); border-color: #c6d7ea; color: var(--info); }
.toasts { position: fixed; top: 16px; right: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(360px, calc(100vw - 32px)); }
.toast { background: var(--charcoal); color: #fff; padding: 12px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-size: 0.9rem; border-left: 4px solid var(--gold); animation: toast-in 0.25s ease; }
.toast.ok { border-left-color: #6fcf97; } .toast.bad { border-left-color: #e57373; }
@keyframes toast-in { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--cream); font-weight: 700; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fdfbf7; }
tr.clickable { cursor: pointer; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: 0.85rem; color: var(--muted); flex-wrap: wrap; }
.pager .pages { display: flex; gap: 6px; }
.pager button { min-width: 34px; height: 34px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--white); cursor: pointer; }
.pager button.active { background: var(--charcoal); color: #fff; border-color: var(--charcoal); }
.pager button:disabled { opacity: 0.45; cursor: not-allowed; }

/* list items / feeds */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .body { flex: 1; min-width: 0; }
.list-item .title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .meta { font-size: 0.8rem; color: var(--muted); }
.list-item .end { text-align: right; white-space: nowrap; }
a.list-item { color: inherit; } a.list-item:hover { text-decoration: none; background: #fdfbf7; }

/* student cards (mobile roster) */
.roster { display: grid; gap: 12px; }
.roster-card { background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--line-2); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); display: block; color: inherit; }
.roster-card:hover { text-decoration: none; box-shadow: var(--shadow-lg); }
.roster-card.due { border-left-color: var(--bad); }
.roster-card.clear { border-left-color: var(--ok); }
.roster-card.pending { border-left-color: var(--info); }
.roster-card .top { display: flex; gap: 12px; align-items: center; }
.roster-card .top .name { font-weight: 700; font-size: 1rem; }
.roster-card .top .code { font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.roster-card .facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin-top: 10px; padding: 10px 12px; background: var(--cream); border-radius: var(--radius-sm); font-size: 0.85rem; }
.roster-card .facts .k { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }

/* tabs */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: 0; padding: 10px 14px; cursor: pointer; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--ink); border-bottom-color: var(--gold); }

/* timeline */
.timeline { list-style: none; padding-left: 0; }
.timeline li { position: relative; padding: 0 0 18px 26px; border-left: 2px solid var(--line); margin-left: 8px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); border: 2px solid #fff; }
.timeline li:last-child { padding-bottom: 0; }
.note { background: var(--cream); border-left: 3px solid var(--gold); padding: 8px 12px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-top: 6px; font-size: 0.9rem; white-space: pre-wrap; }
.note.internal { border-left-color: var(--warn); background: var(--warn-bg); }

/* empty / loading / skeleton */
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty i { font-size: 2rem; color: var(--sand); margin-bottom: 10px; display: block; }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--line-2); border-top-color: var(--gold-dark); border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 24px; justify-content: center; }

/* modal / drawer */
.overlay { position: fixed; inset: 0; background: rgba(44,44,44,0.45); backdrop-filter: blur(2px); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--white); border-radius: var(--radius); max-width: 560px; width: 100%; max-height: calc(100vh - 32px); overflow: auto; box-shadow: var(--shadow-lg); padding: 22px; }
.modal h2 { margin-bottom: 8px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--white); z-index: 90; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.drawer .head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer .body { overflow-y: auto; flex: 1; padding: 6px 18px; }
.notif { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; cursor: pointer; }
.notif.unread .title { font-weight: 700; }
.notif .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); margin-top: 8px; flex-shrink: 0; }
.notif.read .dot { background: transparent; }

/* charts */
.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 320px; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* misc */
.progress { height: 8px; border-radius: 4px; background: var(--cream-2); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--gold); border-radius: 4px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; font-size: 0.92rem; }
.kv dt { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; padding-top: 2px; }
.kv dd { margin: 0; word-break: break-word; }
@media (max-width: 640px) { .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv dd { margin-bottom: 8px; } }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; background: var(--cream-2); padding: 2px 6px; border-radius: 4px; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }
.hostel-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--gold-dark); background: var(--gold-soft); padding: 2px 8px; border-radius: 999px; }
.leader { color: var(--ok); font-weight: 700; font-size: 0.75rem; }
details.filters { margin-bottom: 14px; }
details.filters summary { cursor: pointer; font-weight: 700; color: var(--gold-dark); }
.print-only { display: none; }
@media print { .sidebar, .topbar, .bottom-nav, .toolbar, .btn, .no-print { display: none !important; } .main { margin: 0; } .content { padding: 0; } .print-only { display: block; } }

/* ---------- installable app banner (admin/js/pwa.js) ---------- */
.install-banner { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; background: var(--white, #fff); border-bottom: 1px solid var(--line-2); box-shadow: 0 2px 10px rgba(0,0,0,.05); position: relative; z-index: 60; }
.install-banner img { width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; }
.install-banner .ib-text { flex: 1; min-width: 0; font-size: .85rem; line-height: 1.35; color: var(--ink); }
.install-banner .ib-text b { display: block; font-size: .9rem; }
.install-banner .ib-text span { color: var(--muted); }
.install-banner .ib-text span b { display: inline; font-size: inherit; color: var(--ink); }
.install-banner .ib-close { background: none; border: 0; color: var(--muted); font-size: 1.05rem; padding: 8px; cursor: pointer; line-height: 1; }
/* Installed app: respect the notch / status bar area */
html.standalone body { padding-top: env(safe-area-inset-top); }

/* ---------- touch devices (iPhone, iPad, Android) ---------- */
@media (pointer: coarse) {
  /* iOS Safari zooms the page when a focused field's text is under 16px */
  input, select, textarea { font-size: 16px; min-height: 44px; }
  textarea { min-height: 88px; }
  /* 44px minimum touch targets (Apple HIG / Material) */
  .btn { height: 44px; }
  .btn.sm { height: 36px; }
  .icon-btn { min-width: 40px; min-height: 40px; }
  .pager button { min-width: 44px; height: 44px; }
}
/* No grey flash on tap, no accidental text-size boost on rotate */
html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* ---------- "I am a…" role picker (common sign-in: /admin/login and the student portal) ---------- */
.roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.role { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; border: 1px solid var(--line-2); background: var(--white); border-radius: var(--radius); padding: 16px 8px; cursor: pointer; transition: 0.15s; font: inherit; color: var(--ink); min-height: 96px; }
.role:hover { border-color: var(--gold); }
.role i { font-size: 1.45rem; color: var(--gold-dark); }
.role .t { font-weight: 700; }
.role .s { font-size: 0.75rem; color: var(--muted); line-height: 1.25; }
.role.active { background: var(--charcoal); color: #fff; border-color: var(--charcoal); }
.role.active i { color: var(--gold); }
.role.active .s { color: var(--sand); }
.role { text-decoration: none !important; }

/* ---------- One sign-in / create-account card (student) ---------- */
.auth-card { padding: 0; overflow: hidden; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--cream-2); border-bottom: 1px solid var(--line); }
.auth-tabs button { background: none; border: 0; padding: 13px 10px; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; border-bottom: 3px solid transparent; }
.auth-tabs button i { font-size: 0.95rem; }
.auth-tabs button.active { background: var(--white); color: var(--ink); border-bottom-color: var(--gold); }
.auth-card > [data-el="panel"] { padding: 18px; }
.auth-card .hostel-pick { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.auth-card .hostel-pick .role { min-height: 84px; padding: 12px 6px; }
.auth-card .hostel-pick .role i { font-size: 1.2rem; }
.auth-card .hostel-pick .role .t { font-size: 0.85rem; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 46px; }
.pw-toggle { position: absolute; right: 2px; top: 2px; height: 36px; width: 40px; border: 0; background: transparent; }
.otp-input { letter-spacing: 0.4em; font-size: 1.3rem; text-align: center; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.auth-done i.fa-circle-check { font-size: 2.6rem; color: var(--ok); }
.otp-big { font: 700 2rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.28em; padding: 12px 0 12px 0.28em; margin: 12px 0 2px; background: var(--cream-2); border: 1px dashed var(--gold); border-radius: var(--radius-sm); user-select: all; -webkit-user-select: all; }
@media (max-width: 420px) {
  .auth-card .hostel-pick { grid-template-columns: 1fr; }
  .auth-card .hostel-pick .role { min-height: 0; flex-direction: row; justify-content: flex-start; gap: 10px; padding: 11px 14px; text-align: left; }
  .auth-card .hostel-pick .role .s { display: none; }
  .auth-tabs button { font-size: 0.92rem; padding: 12px 6px; }
}
