/* ============================================================================
   SmartTech Attendance — Design System
   Brand: red / black / white / dark gray. Mobile-first, production UI.
   ========================================================================== */

:root {
  --red: #c8102e;
  --red-dark: #9e0c24;
  --red-soft: #fdeaee;
  --black: #16161a;
  --ink: #1f1f23;
  --gray-900: #23262b;
  --gray-700: #3c4046;
  --gray-500: #697077;
  --gray-400: #9aa1a9;
  --gray-300: #d4d7db;
  --gray-200: #e7e9ec;
  --gray-100: #f3f4f6;
  --white: #ffffff;
  --green: #1e9e4a;
  --green-soft: #e2f6e9;
  --amber: #d97706;
  --amber-soft: #fdf0dd;
  --blue: #2563c4;
  --blue-soft: #e3edfb;
  --danger: #d23131;
  --danger-soft: #fde3e3;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(22, 22, 26, .06), 0 4px 16px rgba(22, 22, 26, .07);
  --shadow-lg: 0 8px 32px rgba(22, 22, 26, .18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --topbar-h: 58px;
  --sidebar-w: 242px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--gray-100);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 15px; }
a { color: var(--red); }
[hidden] { display: none !important; }
/* Inline icons: default size unless a component overrides (.btn svg, .nav-item svg…) */
svg { width: 1em; height: 1em; vertical-align: -.15em; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

/* ── Shell layout ───────────────────────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; }
#gate-root { display: none; }
body.gated .shell, body.gated #toasts { display: none !important; }
body.gated #gate-root { display: block; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--black);
  color: #d6d8dc;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  transition: transform .22s ease;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: #fff; text-decoration: none;
}
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--white);
  display: grid; place-items: center;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700; font-size: 20px; line-height: 1;
  flex: none;
}
.brand-mark .s { color: var(--red); }
.brand-mark .t { color: var(--black); }
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: .2px; }
.brand-sub { font-size: 11px; color: var(--gray-400); font-weight: 500; }

.nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; }
.nav-section {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--gray-500); margin: 14px 10px 6px; font-weight: 700;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; margin: 2px 0;
  border-radius: 9px; color: #c3c7cc;
  text-decoration: none; font-size: 14px; font-weight: 500;
  border: 0; background: none; width: 100%; cursor: pointer;
  text-align: left; min-height: 44px;
  transition: background .12s ease, color .12s ease;
}
.nav-item svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item.active { background: var(--red); color: #fff; }
.nav-item.active svg { opacity: 1; }

.sidebar .user-box {
  margin: 10px; padding: 12px;
  background: rgba(255, 255, 255, .05);
  border-radius: 10px;
  display: flex; align-items: center; gap: 10px;
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--red); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
  flex: none;
}
.user-meta { flex: 1; min-width: 0; }
.user-name { font-size: 13.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11.5px; color: var(--gray-400); }
.user-box .icon-btn { border-color: rgba(255,255,255,.18); color: #c3c7cc; }

.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px;
  position: sticky; top: 0; z-index: 50;
}
.topbar h1 { font-size: 17px; font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conn-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--gray-500); font-weight: 600; }
.conn-dot .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); }
.conn-dot.off .dot { background: var(--danger); }
.conn-dot.off { color: var(--danger); }

.view { padding: 18px; max-width: 1240px; width: 100%; margin: 0 auto; flex: 1; }

.backdrop {
  position: fixed; inset: 0; background: rgba(15, 15, 18, .45);
  z-index: 55; opacity: 0; pointer-events: none; transition: opacity .2s;
}
body.nav-open .backdrop { opacity: 1; pointer-events: auto; }
body.nav-open .sidebar { transform: translateX(0); }

@media (max-width: 920px) {
  .sidebar { transform: translateX(-105%); box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: translateX(0); }
  .main { margin-left: 0; }
  .view { padding: 13px; }
  #btn-menu { display: inline-flex !important; }
}
#btn-menu { display: none; }

/* ── Common components ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  border-radius: 10px; border: 1px solid transparent;
  font-size: 14.5px; font-weight: 600; cursor: pointer;
  background: var(--gray-100); color: var(--ink);
  transition: transform .06s ease, background .12s ease, box-shadow .12s ease;
  text-decoration: none; user-select: none; -webkit-user-select: none;
}
.btn svg { width: 17px; height: 17px; }
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-dark { background: var(--black); color: #fff; }
.btn-dark:hover { background: var(--gray-900); }
.btn-outline { background: var(--white); border-color: var(--gray-300); }
.btn-outline:hover { background: var(--gray-100); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; }
.btn-sm { min-height: 34px; padding: 5px 12px; font-size: 13px; border-radius: 8px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 9px;
  border: 1px solid var(--gray-300); background: var(--white);
  color: var(--gray-700); cursor: pointer; flex: none;
  transition: background .12s ease;
}
.icon-btn:hover { background: var(--gray-100); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.danger { color: var(--danger); border-color: #f3c1c1; }
.icon-btn.danger:hover { background: var(--danger-soft); }

.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card + .card { margin-top: 14px; }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card-title .hint { font-size: 12px; color: var(--gray-500); font-weight: 500; margin-left: auto; }

.grid { display: grid; gap: 14px; }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.stat-card {
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 15px 16px;
  display: flex; flex-direction: column; gap: 3px;
  position: relative; overflow: hidden;
}
.stat-card .label { font-size: 12px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: .06em; }
.stat-card .value { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.stat-card .sub { font-size: 12px; color: var(--gray-500); }
.stat-card .accent { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.stat-card.red .value { color: var(--red); }
.stat-card.green .value { color: var(--green); }
.stat-card.amber .value { color: var(--amber); }
.stat-card.blue .value { color: var(--blue); }

/* Chips */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.chip-present { background: var(--green-soft); color: #0d6b30; }
.chip-late { background: var(--amber-soft); color: #92500a; }
.chip-absent { background: var(--danger-soft); color: #a11d1d; }
.chip-excused { background: var(--blue-soft); color: #174a94; }
.chip-active { background: var(--green-soft); color: #0d6b30; }
.chip-scheduled { background: var(--blue-soft); color: #174a94; }
.chip-ended { background: var(--gray-200); color: var(--gray-700); }
.chip-cancelled { background: var(--danger-soft); color: #a11d1d; }
.chip-inactive { background: var(--gray-200); color: var(--gray-700); }
.chip-neutral { background: var(--gray-100); color: var(--gray-700); }
.chip-red { background: var(--red-soft); color: var(--red-dark); }

/* Tables */
.table-wrap {
  overflow-x: auto; border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm); background: var(--white);
  -webkit-overflow-scrolling: touch;
}
table.data {
  width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 620px;
}
table.data th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--gray-500); background: var(--gray-100);
  padding: 9px 12px; border-bottom: 1px solid var(--gray-200);
  white-space: nowrap; position: sticky; top: 0;
}
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
table.data tbody tr:hover { background: #fafafb; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .row-link { cursor: pointer; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--gray-700); }
.field .req::after { content: " *"; color: var(--red); }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px;
  padding: 10px 13px;
  border: 1.5px solid var(--gray-300);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  transition: border-color .12s ease, box-shadow .12s ease;
  -webkit-appearance: none; appearance: none;
}
select.input {
  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' stroke='%23697077' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
  padding-right: 34px;
}
.input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(200, 16, 46, .13); }
.input.invalid { border-color: var(--danger); }
.hint { font-size: 12px; color: var(--gray-500); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; gap: 0; } }
.form-error {
  background: var(--danger-soft); color: #8f1a1a;
  border: 1px solid #f3c1c1; border-radius: 9px;
  padding: 10px 13px; font-size: 13.5px; margin-bottom: 12px;
}

/* Toolbar */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 14px;
}
.toolbar .input, .toolbar select.input { min-height: 42px; width: auto; }
.toolbar .search { flex: 1 1 210px; min-width: 170px; }
.toolbar .spacer { flex: 1; }

/* Empty / error / skeleton states */
.empty {
  text-align: center; padding: 44px 20px; color: var(--gray-500);
  background: var(--white); border: 1px dashed var(--gray-300); border-radius: var(--radius);
}
.empty .big { font-size: 40px; margin-bottom: 8px; }
.empty h3 { color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.empty p { font-size: 13.5px; max-width: 380px; margin: 0 auto; }
.state-error {
  background: var(--danger-soft); border: 1px solid #f3c1c1; color: #8f1a1a;
  padding: 16px; border-radius: var(--radius); text-align: center; font-weight: 600;
}
.skel {
  border-radius: 8px;
  background: linear-gradient(90deg, var(--gray-200) 25%, #f0f1f3 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.15s infinite linear;
  height: 14px; margin: 10px 0;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Toasts */
#toasts {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  z-index: 300; display: flex; flex-direction: column; gap: 8px;
  width: min(430px, calc(100vw - 28px));
}
.toast {
  background: var(--black); color: #fff;
  border-radius: 11px; padding: 12px 16px;
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  animation: toast-in .22s ease;
}
.toast.success { background: #0d6b30; }
.toast.error { background: #a11d1d; }
.toast.warning { background: #92500a; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 15, 18, .5);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade-in .16s ease;
}
@media (min-width: 640px) { .modal-overlay { align-items: center; padding: 24px; } }
.modal {
  background: var(--white); width: 100%; max-width: 560px;
  border-radius: 18px 18px 0 0;
  max-height: 92vh; display: flex; flex-direction: column;
  animation: sheet-up .2s ease;
}
@media (min-width: 640px) { .modal { border-radius: 16px; max-height: 88vh; } }
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px 12px; border-bottom: 1px solid var(--gray-200);
}
.modal-head h2 { font-size: 16.5px; font-weight: 700; flex: 1; }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-foot {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 13px 18px; border-top: 1px solid var(--gray-200);
  background: var(--gray-100); border-radius: 0 0 18px 18px;
}
@media (min-width: 640px) { .modal-foot { border-radius: 0 0 16px 16px; } }
.modal-foot .btn { flex: 1; }
@media (min-width: 640px) { .modal-foot .btn { flex: 0 0 auto; min-width: 110px; } }

/* ── Scanner page ───────────────────────────────────────────────────────── */
.scanner-wrap { max-width: 640px; margin: 0 auto; }
.scanner-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px; flex-wrap: wrap;
}
.scanner-title { font-size: 19px; font-weight: 800; letter-spacing: .01em; }
.session-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: 999px; padding: 7px 14px;
  font-size: 12.5px; font-weight: 600; color: var(--gray-700);
  box-shadow: var(--shadow); max-width: 100%;
}
.session-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: pulse 1.6s infinite; }
.session-chip.none .dot { background: var(--gray-400); animation: none; }
.session-chip button { border: 0; background: none; color: var(--red); font-weight: 700; cursor: pointer; font-size: 12.5px; padding: 0; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.camera-box {
  position: relative;
  background: var(--black);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow-lg);
}
.camera-box video { width: 100%; height: 100%; object-fit: cover; display: block; }
.camera-idle {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; color: #b9bdc3; text-align: center; padding: 20px;
  background:
    radial-gradient(circle at 50% 42%, rgba(200, 16, 46, .16), transparent 55%),
    var(--black);
}
.camera-idle .cam-ico { width: 62px; height: 62px; border-radius: 50%; background: rgba(255,255,255,.08); display: grid; place-items: center; }
.camera-idle .cam-ico svg { width: 30px; height: 30px; }
.camera-idle p { font-size: 13.5px; max-width: 300px; }

.scan-frame {
  position: absolute; inset: 0; pointer-events: none;
  display: none;
}
.camera-box.scanning .scan-frame { display: block; }
.scan-frame::before {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: min(64%, 300px); aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 22px;
  box-shadow: 0 0 0 2000px rgba(10, 10, 12, .45);
  border: 3px solid rgba(255, 255, 255, .9);
}
.scan-line {
  position: absolute; left: 50%; top: 50%;
  width: min(58%, 270px); height: 3px; border-radius: 3px;
  background: var(--red);
  transform: translate(-50%, -50%);
  animation: scanline 2.1s ease-in-out infinite;
  box-shadow: 0 0 14px rgba(200, 16, 46, .85);
}
@keyframes scanline { 0%, 100% { transform: translate(-50%, calc(-50% - 108px)); } 50% { transform: translate(-50%, calc(-50% + 108px)); } }

.camera-tools {
  position: absolute; right: 10px; top: 10px; display: flex; gap: 8px; z-index: 5;
}
.camera-tools .icon-btn { background: rgba(20, 20, 24, .62); border-color: rgba(255,255,255,.25); color: #fff; backdrop-filter: blur(4px); }

.scan-controls { display: flex; gap: 10px; margin-top: 12px; }
.scan-controls .btn { flex: 1; min-height: 52px; font-size: 15.5px; }
.btn-stop { background: var(--black); color: #fff; }

.manual-entry { display: flex; gap: 9px; margin-top: 14px; }
.manual-entry .input { flex: 1; text-transform: uppercase; }
.manual-entry .btn { flex: none; padding: 10px 20px; }

.queued-banner {
  display: flex; align-items: center; gap: 9px;
  background: var(--amber-soft); border: 1px solid #f3ddb5; color: #92500a;
  padding: 10px 14px; border-radius: 11px; font-size: 13px; font-weight: 600;
  margin-top: 12px;
}

/* Scan result overlay */
.scan-result {
  position: absolute; inset: 0; z-index: 8;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(12, 12, 15, .55);
  backdrop-filter: blur(2px);
  animation: fade-in .15s ease;
  cursor: pointer;
}
.result-card {
  width: min(400px, 100%);
  background: var(--white); border-radius: 18px;
  padding: 22px 20px; text-align: center;
  box-shadow: var(--shadow-lg);
  animation: result-pop .22s cubic-bezier(.2, 1.4, .4, 1);
  border-top: 6px solid var(--gray-400);
}
@keyframes result-pop { from { transform: scale(.82); opacity: 0; } to { transform: none; opacity: 1; } }
.result-card.success { border-top-color: var(--green); }
.result-card.late { border-top-color: var(--amber); }
.result-card.duplicate { border-top-color: var(--blue); }
.result-card.error { border-top-color: var(--danger); }
.result-card .r-icon {
  width: 62px; height: 62px; border-radius: 50%;
  margin: 0 auto 10px; display: grid; place-items: center;
  font-size: 30px; font-weight: 800; color: #fff;
  background: var(--gray-400);
}
.result-card.success .r-icon { background: var(--green); }
.result-card.late .r-icon { background: var(--amber); }
.result-card.duplicate .r-icon { background: var(--blue); }
.result-card.error .r-icon { background: var(--danger); }
.result-card .r-status {
  font-size: 21px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  margin-bottom: 2px;
}
.result-card.success .r-status { color: var(--green); }
.result-card.late .r-status { color: var(--amber); }
.result-card.duplicate .r-status { color: var(--blue); }
.result-card.error .r-status { color: var(--danger); }
.result-card .r-name { font-size: 18px; font-weight: 700; margin-top: 6px; }
.result-card .r-id { font-size: 13px; color: var(--gray-500); font-weight: 600; letter-spacing: .06em; }
.result-card .r-meta {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--gray-200);
  display: grid; gap: 5px; font-size: 13.5px;
}
.result-card .r-meta .row { display: flex; justify-content: space-between; gap: 12px; }
.result-card .r-meta .row span:first-child { color: var(--gray-500); }
.result-card .r-meta .row span:last-child { font-weight: 700; text-align: right; }
.result-card .r-msg { margin-top: 10px; font-size: 13px; color: var(--gray-700); }
.result-card .r-tap { margin-top: 10px; font-size: 11.5px; color: var(--gray-400); }

/* ── Dashboard ──────────────────────────────────────────────────────────── */
.dash-grid { display: grid; gap: 14px; }
.donut-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.legend { display: flex; flex-direction: column; gap: 8px; min-width: 130px; }
.legend .li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; }
.legend .sw { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.legend .val { margin-left: auto; color: var(--gray-500); font-weight: 700; font-variant-numeric: tabular-nums; }
.hbar { margin-bottom: 11px; }
.hbar .hb-top { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 4px; gap: 10px; }
.hbar .hb-top .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .hb-top .rt { color: var(--gray-500); font-weight: 700; flex: none; }
.hbar .track { height: 9px; border-radius: 6px; background: var(--gray-200); overflow: hidden; display: flex; }
.hbar .seg-present { background: var(--green); height: 100%; }
.hbar .seg-late { background: var(--amber); height: 100%; }
.hbar .seg-rest { background: var(--gray-300); height: 100%; flex: 1; }
.feed { display: flex; flex-direction: column; }
.feed .fi { display: flex; align-items: center; gap: 11px; padding: 9px 2px; border-bottom: 1px solid var(--gray-100); font-size: 13.5px; }
.feed .fi:last-child { border-bottom: 0; }
.feed .fi .nm { font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed .fi .tm { color: var(--gray-500); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* ── Student profile ────────────────────────────────────────────────────── */
.profile-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.profile-id {
  width: 62px; height: 62px; border-radius: 15px; flex: none;
  background: var(--red); color: #fff;
  display: grid; place-items: center; font-size: 23px; font-weight: 800;
}
.qr-panel { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.qr-panel canvas { border: 1px solid var(--gray-200); border-radius: 12px; background: #fff; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--gray-500); font-weight: 600; }
.kv dd { font-weight: 600; word-break: break-word; }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 10px; }
.mini-stat { background: var(--gray-100); border-radius: 11px; padding: 10px 12px; text-align: center; }
.mini-stat .v { font-size: 21px; font-weight: 800; }
.mini-stat .l { font-size: 11px; color: var(--gray-500); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }

/* ── QR card (print) ────────────────────────────────────────────────────── */
.qr-card {
  width: 340px; margin: 0 auto;
  border: 2px solid var(--black); border-radius: 16px;
  overflow: hidden; background: #fff; text-align: center;
  font-family: Georgia, "Times New Roman", serif;
}
.qr-card .qc-head {
  background: var(--black); color: #fff; padding: 14px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.qr-card .qc-head .brand-mark { width: 34px; height: 34px; font-size: 18px; border-radius: 8px; }
.qr-card .qc-head .t1 { font-size: 18px; font-weight: 700; text-align: left; line-height: 1.1; }
.qr-card .qc-head .t2 { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #c9ccd1; }
.qr-card .qc-body { padding: 18px; }
.qr-card .qc-name { font-size: 20px; font-weight: 700; color: var(--black); }
.qr-card .qc-id { color: var(--red); font-weight: 700; font-size: 14px; letter-spacing: .1em; margin-top: 2px; }
.qr-card .qc-meta { font-size: 12.5px; color: var(--gray-700); margin-top: 8px; line-height: 1.6; }
.qr-card .qc-qr { margin: 14px auto 4px; }
.qr-card .qc-foot { font-size: 10px; color: var(--gray-500); padding: 0 18px 14px; letter-spacing: .05em; }

/* ── Login / welcome ────────────────────────────────────────────────────── */
.gate {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 18% 12%, rgba(200, 16, 46, .2), transparent 42%),
    radial-gradient(circle at 88% 90%, rgba(200, 16, 46, .12), transparent 40%),
    var(--black);
  padding: 22px;
}
.gate-card {
  width: min(420px, 100%);
  background: var(--white); border-radius: 22px;
  padding: 34px 28px; text-align: center;
  box-shadow: var(--shadow-lg);
}
.gate-card .brand-mark { width: 64px; height: 64px; font-size: 34px; border-radius: 16px; margin: 0 auto 14px; }
.gate-card h1 { font-size: 23px; font-weight: 800; }
.gate-card .sub { color: var(--gray-500); font-size: 14px; margin: 4px 0 22px; }
.gate-card .btn { width: 100%; margin-top: 10px; min-height: 52px; font-size: 15.5px; }
.gate-card .divider { display: flex; align-items: center; gap: 12px; color: var(--gray-400); font-size: 12px; margin: 18px 0 4px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.gate-card .divider::before, .gate-card .divider::after { content: ""; flex: 1; height: 1px; background: var(--gray-200); }
.gate-error { margin-bottom: 12px; }
.gate-foot { margin-top: 18px; font-size: 12px; color: var(--gray-400); }

/* ── Reports ────────────────────────────────────────────────────────────── */
.report-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.report-type {
  border: 1.5px solid var(--gray-200); background: var(--white);
  border-radius: 12px; padding: 13px; text-align: left;
  cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--gray-700);
  display: flex; align-items: center; gap: 9px;
  transition: border-color .12s ease, background .12s ease;
  min-height: 52px;
}
.report-type svg { width: 17px; height: 17px; color: var(--gray-500); flex: none; }
.report-type.active { border-color: var(--red); background: var(--red-soft); color: var(--red-dark); }
.report-type.active svg { color: var(--red); }

/* ── Print ──────────────────────────────────────────────────────────────── */
#print-root { display: none; }
@media print {
  body.printing .shell, body.printing #toasts, body.printing .modal-overlay { display: none !important; }
  body.printing #print-root { display: block; }
  body.printing { background: #fff; }
  #print-root .qr-card { box-shadow: none; page-break-inside: avoid; }
  @page { margin: 14mm; }
}

/* Focus visibility (accessibility) */
:focus-visible { outline: 3px solid rgba(200, 16, 46, .55); outline-offset: 2px; border-radius: 6px; }

/* ── Payments & Financial Enhancements ─────────────────────────────────── */
.badge-paid { background: #e2f6e9; color: #0d6b30; }
.badge-due { background: #fff3d6; color: #9a6700; }
.badge-overdue { background: #fde3e3; color: #a11d1d; }
.badge-hold { background: #ffe8cc; color: #d9480f; }

.scanner-payment-banner {
  margin-top: 14px;
  padding: 12px 14px;
  background: #fff8e6;
  border: 1.5px solid #f5cf6d;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}
.scanner-payment-banner .sp-text { font-size: 13.5px; font-weight: 700; color: #8a5700; }
.scanner-payment-banner .sp-sub { font-size: 12px; font-weight: 500; color: #6b4400; }

.billing-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.billing-card {
  background: var(--gray-100);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}
.billing-card .v { font-size: 18px; font-weight: 800; }
.billing-card .l { font-size: 11px; color: var(--gray-500); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }

.sub-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 16px;
  padding-bottom: 2px;
}
.sub-tab {
  background: none;
  border: 0;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  border-bottom: 2px solid transparent;
  transition: all .12s ease;
}
.sub-tab.active {
  color: var(--red);
  border-bottom-color: var(--red);
  font-weight: 700;
}

.perms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  background: var(--gray-100);
  padding: 14px;
  border-radius: 12px;
  margin-top: 6px;
}
.perm-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
}
.perm-check input {
  width: 17px;
  height: 17px;
  accent-color: var(--red);
  cursor: pointer;
}

/* ==========================================================================
   FUTURISTIC 3D LAB ROOMS & LIVE SESSIONS HUD
   ========================================================================== */
.sessions-header-hud {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  border-radius: 16px;
  padding: 20px 24px;
  color: #fff;
  margin-bottom: 24px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.hud-title-wrap { display: flex; flex-direction: column; gap: 4px; }
.hud-main-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.02em;
}
.hud-subtitle { font-size: 12.5px; color: #94a3b8; margin: 0; }
.hud-pulse-dot {
  width: 10px;
  height: 10px;
  background-color: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 12px #22c55e, 0 0 20px #22c55e;
  animation: hudPulse 2s infinite;
}
@keyframes hudPulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; filter: drop-shadow(0 0 8px #22c55e); }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.rooms-3d-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  perspective: 1200px;
  margin-bottom: 28px;
}

.room-3d-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  padding: 20px;
  position: relative;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.room-3d-card:hover {
  transform: translateY(-4px) rotateX(2deg);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.room-3d-card.is-active {
  border: 2px solid #4f46e5;
  box-shadow: 0 0 20px rgba(79, 70, 229, 0.25), 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
}

.room-3d-card.room-indigo.is-active { border-color: #4f46e5; }
.room-3d-card.room-cyan.is-active { border-color: #06b6d4; }
.room-3d-card.room-emerald.is-active { border-color: #10b981; }
.room-3d-card.room-purple.is-active { border-color: #8b5cf6; }
.room-3d-card.room-amber.is-active { border-color: #f59e0b; }

.room-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.room-identity { display: flex; align-items: center; gap: 12px; }
.room-icon {
  font-size: 26px;
  background: #f1f5f9;
  padding: 8px;
  border-radius: 12px;
  line-height: 1;
}
.room-name { font-size: 16px; font-weight: 700; color: #0f172a; margin: 0; }
.room-spec { font-size: 12px; color: #64748b; font-weight: 500; }

.glow-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.tag-active {
  background: #e0e7ff;
  color: #3730a3;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.35);
  animation: pulseGlow 2s infinite;
}
.tag-scheduled { background: #fef3c7; color: #92400e; }
.tag-hold { background: #fee2e2; color: #991b1b; }
.tag-idle { background: #f1f5f9; color: #64748b; }

.pulse-ring {
  width: 8px;
  height: 8px;
  background-color: #4f46e5;
  border-radius: 50%;
  box-shadow: 0 0 8px #4f46e5;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(79, 70, 229, 0); }
  100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); }
}

.room-occupancy-hud {
  margin-bottom: 16px;
  background: #f8fafc;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #f1f5f9;
}
.occ-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: #64748b;
  margin-bottom: 8px;
}
.occ-nums { font-size: 13.5px; font-weight: 800; color: #0f172a; }
.occ-meter-bar {
  height: 8px;
  width: 100%;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}
.occ-meter-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.room-current-session-box {
  background: #f8fafc;
  border-radius: 12px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  margin-top: auto;
}
.ses-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.ses-title { font-size: 14.5px; font-weight: 700; color: #1e293b; }
.ses-time-tag {
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
  background: #ffffff;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}
.ses-sub-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
  color: #64748b;
  margin-bottom: 12px;
}
.badge-group { color: #0f172a; font-weight: 700; }

.room-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.btn-quick-att {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: #ffffff;
  font-weight: 700;
  border: none;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
  transition: all 0.2s ease;
  flex: 1;
}
.btn-quick-att:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(79, 70, 229, 0.4);
  color: #fff;
}

.room-empty-state {
  text-align: center;
  padding: 18px 12px;
  color: #94a3b8;
  font-size: 13px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px dashed #cbd5e1;
}

/* ==========================================================================
   1-CLICK QUICK ATTENDANCE DRAWER
   ========================================================================== */
.quick-att-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
  animation: fadeIn 0.2s ease-out;
}
.quick-att-drawer {
  width: 100%;
  max-width: 480px;
  height: 100%;
  background: #ffffff;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
}
.drawer-title { font-size: 18px; font-weight: 800; color: #0f172a; margin: 0; }
.drawer-sub { font-size: 12.5px; color: #64748b; margin: 2px 0 0 0; }
.drawer-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
}
.drawer-close:hover { color: #0f172a; }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
.drawer-roster-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quick-roster-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  transition: all 0.15s ease;
}
.quick-roster-row:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.quick-roster-row.status-present {
  border-left: 4px solid #10b981;
  background: #f0fdf4;
}
.quick-roster-row.status-late {
  border-left: 4px solid #f59e0b;
  background: #fffbeb;
}
.quick-roster-row.status-absent {
  border-left: 4px solid #ef4444;
  background: #fef2f2;
}

.roster-info { display: flex; flex-direction: column; gap: 2px; }
.roster-name { font-size: 14.5px; font-weight: 700; color: #0f172a; }
.roster-meta { font-size: 12px; color: #64748b; }
.roster-time { font-size: 11.5px; font-weight: 600; color: #10b981; }

.quick-actions-pill {
  display: flex;
  gap: 4px;
}
.q-btn {
  border: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s ease;
  color: #475569;
}
.q-btn:hover { background: #f1f5f9; }
.q-present.is-selected { background: #10b981; color: #fff; border-color: #10b981; box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3); }
.q-late.is-selected { background: #f59e0b; color: #fff; border-color: #f59e0b; box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3); }
.q-absent.is-selected { background: #ef4444; color: #fff; border-color: #ef4444; box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3); }

.drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  background: #f8fafc;
}

/* ==========================================================================
   SCANNER NOTIFICATION BUTTONS (WHATSAPP / EMAIL)
   ========================================================================== */
.scanner-notify-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  justify-content: center;
}
.btn-wa {
  background: #25d366 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.35) !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
}
.btn-mail {
  background: #0284c7 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border: none !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
}

.section-divider {
  display: flex;
  align-items: center;
  margin: 24px 0 16px 0;
  border-bottom: 1px solid #e2e8f0;
  position: relative;
}
.divider-text {
  position: absolute;
  left: 20px;
  top: -10px;
  background: #f8fafc;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   TOPBAR QUICK SEARCH BOX
   ========================================================================== */
.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  max-width: 380px;
  flex: 1;
  margin: 0 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
}
.topbar-search:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.search-icon {
  font-size: 14px;
  color: #94a3b8;
}
.search-placeholder {
  font-size: 13px;
  color: #64748b;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-kbd {
  font-size: 11px;
  font-family: inherit;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 1px 6px;
}

/* ==========================================================================
   GLOBAL UNIVERSAL SEARCH MODAL (COMMAND PALETTE)
   ========================================================================== */
.global-search-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 80px;
  animation: gsFadeIn 0.15s ease-out;
}
@keyframes gsFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}
.global-search-box {
  background: #ffffff;
  width: 90%;
  max-width: 640px;
  max-height: 80vh;
  border-radius: 14px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.global-search-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid #e2e8f0;
}
.gs-icon {
  font-size: 18px;
}
.global-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  color: #0f172a;
  background: transparent;
  font-family: inherit;
}
.gs-esc-kbd {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
}
.global-search-body {
  padding: 12px 14px;
  overflow-y: auto;
  max-height: 55vh;
}
.gs-hint, .gs-loading, .gs-empty, .gs-error {
  padding: 24px 12px;
  text-align: center;
  font-size: 14px;
  color: #64748b;
}
.gs-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  margin: 12px 6px 6px 6px;
}
.gs-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.gs-item:hover, .gs-item.selected {
  background: #f1f5f9;
}
.gs-item-icon {
  font-size: 18px;
  width: 28px;
  text-align: center;
}
.gs-item-content {
  flex: 1;
  min-width: 0;
}
.gs-item-title {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}
.gs-item-sub {
  font-size: 12px;
  color: #64748b;
  margin-top: 1px;
}
.gs-jump-arrow {
  color: #cbd5e1;
  font-size: 13px;
  transition: transform 0.15s ease;
}
.gs-item:hover .gs-jump-arrow {
  color: #e11d48;
  transform: translateX(3px);
}
.global-search-footer {
  display: flex;
  justify-content: space-between;
  padding: 10px 16px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  font-size: 12px;
  color: #64748b;
}
.global-search-footer kbd {
  font-size: 11px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 1px 4px;
}

/* ==========================================================================
   MONTHLY CALENDAR VIEW
   ========================================================================== */
.calendar-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  padding: 16px;
  margin-bottom: 20px;
}
.calendar-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.cal-title {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}
.cal-controls {
  display: flex;
  gap: 6px;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.cal-header-day {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  padding: 6px 0;
}
.cal-cell {
  min-height: 85px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cal-cell:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}
.cal-cell.today-cell {
  border-color: #e11d48;
  background: #fff1f2;
}
.cal-cell.selected-cell {
  outline: 2px solid #e11d48;
  outline-offset: -1px;
}
.cal-cell.empty-cell {
  background: transparent;
  border-color: transparent;
  cursor: default;
}
.cal-day-num {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 4px;
}
.today-cell .cal-day-num {
  color: #e11d48;
}
.cal-session-pills {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.cal-pill {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  line-height: 1.25;
}
.pill-active {
  background: #dcfce7;
  color: #166534;
  border-left: 2px solid #16a34a;
}
.pill-sched {
  background: #e0e7ff;
  color: #3730a3;
  border-left: 2px solid #6366f1;
}
.pill-ended {
  background: #f1f5f9;
  color: #475569;
  border-left: 2px solid #94a3b8;
}
.pill-more {
  font-size: 10px;
  color: #64748b;
  font-weight: 700;
  text-align: center;
  background: #e2e8f0;
}

/* ==========================================================================
   MOBILE BOTTOM NAVIGATION BAR (SMARTPHONES & TABLETS)
   ========================================================================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  justify-content: space-around;
  align-items: center;
}
.mob-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  color: #64748b;
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  gap: 2px;
  transition: color 0.15s ease;
}
.mob-nav-item .mob-icon {
  font-size: 18px;
}
.mob-nav-item.active {
  color: #e11d48;
}

/* Responsive Breakpoints */
@media (max-width: 920px) {
  .topbar-search {
    max-width: 240px;
    margin: 0 8px;
  }
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
  }
  .view {
    padding-bottom: 75px !important;
  }
  .topbar-search .search-kbd {
    display: none;
  }
  .topbar-search {
    max-width: 180px;
  }
  .calendar-grid {
    gap: 3px;
  }
  .cal-cell {
    min-height: 60px;
    padding: 3px;
  }
  .cal-pill {
    font-size: 9px;
    padding: 1px 3px;
  }
}

@media (max-width: 480px) {
  .topbar-search .search-placeholder {
    display: none;
  }
  .topbar-search {
    max-width: 40px;
    padding: 6px 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
