/* =========================================================================
   SKE VENUE REQUISITION — SHARED DESIGN SYSTEM
   -------------------------------------------------------------------------
   Linked by ske-page.php on every page. Light is the default theme; dark is
   opt-in via [data-theme="dark"] on <html>, toggled and persisted in JS.

   This file also overrides the Bootstrap classes the existing pages already
   use (.table, .btn-*, .form-control, .container), so legacy markup picks up
   the new look without being rewritten.
   ========================================================================= */

/* ============================ DESIGN TOKENS ============================ */
:root{
  /* Height of the fixed SKE navbar from headers.php — measured at runtime. */
  --nav-h:92px;

  /* ---- LIGHT (default) ---- */
  --bg:#f4f6fa; --bg-2:#eef1f7; --surface:#ffffff; --surface-2:#f7f9fc;
  --border:#dde3ec; --border-soft:#e7ecf3;
  --text:#141a22; --text-dim:#55637a; --text-mute:#8593a8;
  --brand:#6366f1; --brand-2:#8b5cf6; --brand-soft:rgba(99,102,241,.10);
  --ok:#16a34a; --warn:#d97706; --danger:#dc2626; --info:#0284c7;
  --shadow:0 10px 30px rgba(19,29,47,.10);
  --shadow-sm:0 2px 10px rgba(19,29,47,.07);
  --r:14px; --r-sm:10px;
  --sidebar-w:250px;
}

/* --------------------------- STACKING ORDER ----------------------------
   One place to reason about what covers what. The site navbar has to sit
   above the portal chrome, or its dropdowns open *behind* the sticky topbar.

     1020  .topbar          sticky page header
     1025  .backdrop        dim behind the mobile drawer
     1030  .sidebar         the drawer itself (above its own backdrop)
     1040  .navbar.fixed-top   site nav + its dropdown menus
     1045  #ske-tooltip     calendar hover card
     1050  .modal-backdrop  Bootstrap
     1055  .modal           Bootstrap — always on top

   Anything inside .sidebar (e.g. the rail tooltip) only competes with its
   own siblings, because .sidebar's z-index makes it a stacking context. */

[data-theme="dark"]{
  --bg:#0f1216; --bg-2:#151a21; --surface:#1a2029; --surface-2:#212934;
  --border:#2a3440; --border-soft:#232c37;
  --text:#e8edf4; --text-dim:#9aa7b8; --text-mute:#6c7a8d;
  --brand-soft:rgba(99,102,241,.14);
  --ok:#22c55e; --warn:#f59e0b; --danger:#ef4444; --info:#38bdf8;
  --shadow:0 10px 30px rgba(0,0,0,.45);
  --shadow-sm:0 2px 10px rgba(0,0,0,.3);
}

/* ================================ BASE ================================= */
*{box-sizing:border-box}
html{scroll-behavior:smooth;background:var(--bg)}
body{
  margin:0!important;padding:0!important;
  background:var(--bg);color:var(--text);
  font-family:'Inter','Segoe UI',system-ui,-apple-system,Roboto,Helvetica,Arial,sans-serif;
  font-size:14.5px;line-height:1.55;
  transition:background .25s ease,color .25s ease;
  -webkit-font-smoothing:antialiased;
}
a{color:inherit;text-decoration:none}
h1,h2,h3,h4,h5{color:var(--text);letter-spacing:-.2px}
::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:var(--border);border-radius:8px}
::-webkit-scrollbar-thumb:hover{background:var(--text-mute)}

/* ============ SITE HEADER / FOOTER INTEROP (headers.php) ================
   headers.php renders a Bootstrap 5 `.navbar.fixed-top` inside `.container`,
   and loads Bootstrap, jQuery, moment, FullCalendar, flatpickr and SweetAlert2
   itself. It does NOT link this stylesheet — ske-page.php, login.php and
   forgot_password.php each link it after headers.php has run.

   Because the navbar is position:fixed it reserves NO vertical space, so every
   page must offset its own height. That is what --nav-h is for; it is measured
   at runtime and the shell keys all of its offsets off it.               */

.navbar.fixed-top{
  z-index:1040!important;             /* see the stacking scale below */
  background:var(--surface)!important;
  border-bottom:1px solid var(--border-soft);
  transition:background .25s ease,border-color .25s ease;
  padding-top:0!important;padding-bottom:0!important;
}
/* The wrapper around the navbar is a plain .container; let the bar span the
   full width so the STUDENT CENTER block can reach the corner. */
body > .container:first-of-type{max-width:100%!important;padding:0!important;margin:0!important}
.navbar.fixed-top > .container-fluid.container{
  max-width:1560px;position:static;
  padding-right:calc(var(--cta-size) + 16px);   /* clears the square block */
  min-height:var(--cta-size);
}
/* The stray <table border="col"> at the end of headers.php. */
body > table{display:none}

/* --- logo ---------------------------------------------------------------- */
.navbar.fixed-top .logo img{height:70px;width:auto;display:block;max-width:100%}
/* (its dark-mode plate is defined once, further down) */

/* --- menu ---------------------------------------------------------------- */
.navbar.fixed-top .nav-link.txt,.navbar.fixed-top .nav-link{
  color:var(--text)!important;font-weight:700;white-space:nowrap;
}
.navbar.fixed-top .nav-link:hover{color:var(--brand)!important}
.navbar.fixed-top .xzz:hover{color:inherit}
.navbar.fixed-top .dropdown-menu{
  background:var(--surface);border:1px solid var(--border-soft);
  border-radius:0;box-shadow:0 14px 34px rgba(19,29,47,.13);padding:6px 0;
}
[data-theme="dark"] .navbar.fixed-top .dropdown-menu{box-shadow:0 14px 34px rgba(0,0,0,.5)}
.navbar.fixed-top .dropdown-item{
  color:var(--text)!important;font-weight:600;padding:10px 20px;white-space:normal;
}
.navbar.fixed-top .dropdown-item:hover{background:var(--brand-soft);color:var(--brand)!important}
.navbar.fixed-top .navbar-toggler{
  border:1px solid var(--border);border-radius:8px;
}
[data-theme="dark"] .navbar.fixed-top .navbar-toggler-icon{filter:invert(1) grayscale(1)}

/* --- the cyan STUDENT CENTER square, pinned to the top-right corner ------
   headers.php styles this inline as position:absolute with 30px/75px padding,
   which made it a wide rectangle overlapping the menu. These rules win over
   the inline styles and make it a true square in the corner.             */
:root{--cta-size:120px}
.navbar.fixed-top .student-center,
.navbar.fixed-top a[href*="s_resource.php"]{
  position:absolute!important;top:0!important;right:0!important;
  left:auto!important;bottom:auto!important;
  width:var(--cta-size)!important;height:var(--cta-size)!important;
  margin:0!important;padding:0 8px!important;
  display:flex!important;align-items:center;justify-content:center;
  background:#04eaff!important;color:#000!important;
  font-family:'Inter','Segoe UI',system-ui,Roboto,sans-serif;font-weight:700!important;
  font-size:14px!important;line-height:1.3;text-align:center!important;
  transition:.16s;z-index:4;
}
.navbar.fixed-top .student-center:hover,
.navbar.fixed-top a[href*="s_resource.php"]:hover{background:#00d7f0!important;color:#000!important}

@media (max-width:1400px){
  .navbar.fixed-top .nav-link.txt{font-size:13px!important}
  .navbar.fixed-top .logo img{height:58px}
}
@media (max-width:1200px){
  :root{--cta-size:104px}
  .navbar.fixed-top .nav-link.txt{font-size:12px!important}
  .navbar.fixed-top .logo img{height:50px}
}
@media (max-width:991.98px){
  :root{--cta-size:92px}
  .navbar.fixed-top > .container-fluid.container{
    padding-right:calc(var(--cta-size) + 60px);min-height:78px;
  }
  .navbar.fixed-top .navbar-collapse{
    background:var(--surface);border-top:1px solid var(--border-soft);
    margin-top:8px;padding:6px 0 10px;max-height:70vh;overflow-y:auto;
  }
  /* headers.php hides .dropdown-menu and only reveals it on hover, which has
     no effect on touch. Let the collapsed menu show its children inline. */
  .navbar.fixed-top .navbar-collapse .dropdown-menu{
    display:block!important;position:static!important;transform:none!important;
    box-shadow:none;border:none;background:var(--surface-2);margin:0 0 6px;
  }
  .navbar.fixed-top .logo img{height:46px}
}
@media (max-width:480px){
  :root{--cta-size:78px}
  .navbar.fixed-top .student-center,
  .navbar.fixed-top a[href*="s_resource.php"]{font-size:10.5px!important}
}

/* ================= LEAKS FROM headers.php's BARE SELECTORS ==============
   headers.php styles the raw element:

       nav { background-color:#fff; border-bottom:1px solid #ddd; }

   That is aimed at the site navigation, but it matches ANY <nav> — including
   the sidebar's menu, which is why the middle of the sidebar stayed white in
   dark mode while the rest of it went dark. Undone here rather than in
   headers.php so a future restore of that file cannot bring it back.     */
.sidebar nav,
.sidebar .nav-list,
.sidebar .nav{
  background:transparent!important;
  border-bottom:none!important;
}

/* =============== THIRD-PARTY WIDGETS IN DARK MODE ======================
   SweetAlert2 and flatpickr ship light-only styling, so in dark mode they
   appear as bright white panels. Both are used across the portal (every
   confirmation dialog, and the date pickers), so they are themed here.  */
[data-theme="dark"] .swal2-popup{
  background:var(--surface)!important;color:var(--text)!important;
  border:1px solid var(--border);
}
[data-theme="dark"] .swal2-title,
[data-theme="dark"] .swal2-html-container,
[data-theme="dark"] .swal2-content{color:var(--text)!important}
[data-theme="dark"] .swal2-footer{
  color:var(--text-dim)!important;border-top-color:var(--border)!important;
}
[data-theme="dark"] .swal2-input,
[data-theme="dark"] .swal2-textarea,
[data-theme="dark"] .swal2-select{
  background:var(--surface-2)!important;color:var(--text)!important;
  border-color:var(--border)!important;
}
[data-theme="dark"] .swal2-close{color:var(--text-mute)!important}

[data-theme="dark"] .flatpickr-calendar{
  background:var(--surface);color:var(--text);
  box-shadow:var(--shadow);border:1px solid var(--border);
}
[data-theme="dark"] .flatpickr-months .flatpickr-month,
[data-theme="dark"] .flatpickr-current-month,
[data-theme="dark"] .flatpickr-weekday{color:var(--text)!important;fill:var(--text)!important}
[data-theme="dark"] .flatpickr-day{color:var(--text-dim)}
[data-theme="dark"] .flatpickr-day:hover{background:var(--surface-2);border-color:var(--border)}
[data-theme="dark"] .flatpickr-day.selected{background:var(--brand);border-color:var(--brand);color:#fff}
[data-theme="dark"] .flatpickr-day.flatpickr-disabled{color:var(--text-mute);opacity:.5}
[data-theme="dark"] .flatpickr-months .flatpickr-prev-month svg,
[data-theme="dark"] .flatpickr-months .flatpickr-next-month svg{fill:var(--text)}

/* The society logo is a JPEG with a baked-in white background, so it needs a
   plate to sit on when the bar is dark. Kept tight to the artwork. */
[data-theme="dark"] .navbar.fixed-top .logo img{
  background:#fff;border-radius:6px;padding:3px 6px;
}

/* ========================= CLOCK TIME PICKER ===========================
   Paired with ske-timepicker.js. Sits above the Bootstrap modal layer
   because the requisition form's time fields live inside a modal.        */

/* Hide the native picker button — ours opens on focus/click instead. */
input[type=time]::-webkit-calendar-picker-indicator{display:none;-webkit-appearance:none}
input[type=time]{cursor:pointer}

.ske-clock{
  position:fixed;z-index:1060;            /* above .modal (1055) */
  display:none;width:280px;
  background:var(--surface);color:var(--text);
  border:1px solid var(--border);border-radius:var(--r);
  box-shadow:var(--shadow);overflow:hidden;
  font-family:'Inter','Segoe UI',system-ui,sans-serif;
  user-select:none;
}
.ske-clock.is-open{display:block}

/* ---- header: HH : MM plus AM/PM ---- */
.ske-clock__head{
  display:flex;align-items:center;gap:4px;
  padding:12px 14px;background:linear-gradient(135deg,var(--brand),var(--brand-2));
}
.ske-clock__hh,.ske-clock__mm{
  background:rgba(255,255,255,.16);border:none;color:#fff;
  font:700 22px/1 'Inter',sans-serif;font-variant-numeric:tabular-nums;
  padding:6px 10px;border-radius:8px;cursor:pointer;transition:.15s;
}
.ske-clock__hh.is-on,.ske-clock__mm.is-on{background:#fff;color:var(--brand)}
.ske-clock__sep{color:#fff;font:700 20px/1 'Inter',sans-serif;opacity:.85}
.ske-clock__mer{display:flex;flex-direction:column;gap:3px;margin-left:auto}
.ske-clock__mer button{
  background:rgba(255,255,255,.16);border:none;color:#fff;
  font:700 10.5px/1 'Inter',sans-serif;letter-spacing:.5px;
  padding:5px 9px;border-radius:6px;cursor:pointer;transition:.15s;
}
.ske-clock__mer button.is-on{background:#fff;color:var(--brand)}

/* ---- the face ---- */
.ske-clock__hint{
  text-align:center;padding:10px 0 0;
  font-size:11.5px;font-weight:650;letter-spacing:.6px;text-transform:uppercase;
  color:var(--text-mute);
}
.ske-clock__face{
  position:relative;width:244px;height:244px;margin:10px auto 6px;
  background:var(--surface-2);border-radius:50%;
}
.ske-clock__pin{
  position:absolute;left:50%;top:50%;width:8px;height:8px;margin:-4px 0 0 -4px;
  background:var(--ok);border-radius:50%;z-index:2;
}
/* The hand is drawn UPWARD from the centre (bottom:50% + origin at its own
   bottom edge), so rotate(0deg) points at 12. Drawing it downward — as this
   first did — put every hour 180 degrees out: picking 9 parked the highlight
   ring on 3, and the white "9" was then invisible against the pale face. */
.ske-clock__hand{
  position:absolute;left:50%;bottom:50%;
  width:2px;height:96px;margin-left:-1px;
  transform-origin:50% 100%;background:var(--ok);
  transition:transform .18s cubic-bezier(.4,0,.2,1);
}
.ske-clock__hand::after{      /* ring that sits under the selected number */
  content:'';position:absolute;left:50%;top:-17px;
  width:34px;height:34px;margin-left:-17px;
  background:var(--ok);border-radius:50%;
}
.ske-clock__num{
  position:absolute;transform:translate(-50%,-50%);
  width:34px;height:34px;border:none;background:none;
  color:var(--text-dim);font:600 14px/1 'Inter',sans-serif;
  font-variant-numeric:tabular-nums;
  border-radius:50%;cursor:pointer;z-index:3;transition:color .15s;
}
.ske-clock__num:hover{color:var(--ok)}
.ske-clock__num.is-on{color:#fff;font-weight:700}

/* ---- footer ---- */
.ske-clock__foot{
  display:flex;align-items:center;gap:8px;
  padding:10px 12px;border-top:1px solid var(--border-soft);background:var(--surface);
}
.ske-clock__btn{
  background:none;border:1px solid transparent;color:var(--text-dim);
  font:600 12.5px/1 'Inter',sans-serif;padding:8px 12px;
  border-radius:8px;cursor:pointer;transition:.15s;
}
.ske-clock__btn:hover{background:var(--surface-2);color:var(--text)}
.ske-clock__btn.is-primary{
  background:linear-gradient(135deg,var(--brand),var(--brand-2));color:#fff;
}
.ske-clock__btn.is-primary:hover{filter:brightness(1.06);color:#fff}

@media (max-width:400px){
  .ske-clock{width:calc(100vw - 24px)}
  .ske-clock__face{width:220px;height:220px}
}

/* ================================ SHELL ================================ */
.ske-root{text-align:left}
.app{display:flex;min-height:100vh;padding-top:var(--nav-h)}

.sidebar{
  width:var(--sidebar-w);flex:0 0 var(--sidebar-w);
  background:var(--surface);border-right:1px solid var(--border);
  display:flex;flex-direction:column;
  position:fixed;left:0;bottom:0;top:var(--nav-h);
  z-index:1030;transition:transform .28s cubic-bezier(.4,0,.2,1);
}
.sidebar__brand{
  display:flex;align-items:center;gap:12px;
  padding:20px 20px 18px;border-bottom:1px solid var(--border-soft);
}
.brand__mark{
  width:40px;height:40px;border-radius:11px;flex:0 0 40px;
  background:linear-gradient(135deg,var(--brand),var(--brand-2));
  display:grid;place-items:center;color:#fff;font-weight:800;font-size:15px;
  box-shadow:0 6px 16px rgba(99,102,241,.35);
}
.brand__text b{display:block;font-size:14.5px;letter-spacing:.2px}
.brand__text span{display:block;font-size:11.5px;color:var(--text-mute);letter-spacing:.6px;text-transform:uppercase}

.sidebar__user{
  margin:16px;padding:14px;border-radius:var(--r-sm);
  background:var(--surface-2);border:1px solid var(--border-soft);
  display:flex;align-items:center;gap:11px;
}
.avatar{
  width:38px;height:38px;flex:0 0 38px;border-radius:50%;
  background:linear-gradient(135deg,var(--brand),var(--brand-2));
  color:#fff;display:grid;place-items:center;font-weight:700;font-size:14px;
}
.sidebar__user b{font-size:13.5px;display:block;line-height:1.25}
.sidebar__user small{color:var(--text-mute);font-size:11.5px}

.nav-list{padding:6px 12px 12px;overflow-y:auto;flex:1}
.nav__label{
  font-size:10.5px;letter-spacing:1.2px;text-transform:uppercase;
  color:var(--text-mute);padding:14px 10px 7px;font-weight:600;
}
.nav__item{
  display:flex;align-items:center;gap:11px;
  padding:10px 12px;border-radius:var(--r-sm);
  color:var(--text-dim);font-size:13.5px;font-weight:500;
  margin-bottom:2px;cursor:pointer;border:none;background:none;width:100%;
  text-align:left;transition:background .16s,color .16s,transform .16s;
  font-family:inherit;
}
.nav__item:hover{background:var(--surface-2);color:var(--text);transform:translateX(2px)}
.nav__item.is-active{background:var(--brand-soft);color:var(--brand);font-weight:600}
.nav__item svg{width:17px;height:17px;flex:0 0 17px;stroke-width:1.9;fill:none;stroke:currentColor}

.sidebar__foot{padding:12px;border-top:1px solid var(--border-soft)}

/* ===================== COLLAPSED SIDEBAR (icon rail) ====================
   Toggled by #railBtn in the topbar; the choice is remembered in
   localStorage. Everything keys off --sidebar-w, which both this file and
   dashboard.php's inline styles already use — so overriding that single
   variable on .ske-root moves the sidebar, the content offset and the
   sticky topbar together, with no duplicated width rules.

   Labels are hidden with font-size:0 rather than display:none because the
   nav items are `<a><svg/>Label</a>` with the label as a bare text node —
   there is no element to hide. The icon is unaffected: it is sized in px. */
.ske-root.is-rail{--sidebar-w:76px}

.ske-root.is-rail .sidebar{overflow:visible}
.ske-root.is-rail .sidebar__brand{justify-content:center;padding:18px 8px}
.ske-root.is-rail .brand__text{display:none}

.ske-root.is-rail .sidebar__user{
  justify-content:center;padding:10px;margin:12px 10px;
}
.ske-root.is-rail .sidebar__user > div:last-child{display:none}

.ske-root.is-rail .nav-list,
.ske-root.is-rail .nav{padding-left:10px;padding-right:10px}

/* Section headings become a hairline divider. */
.ske-root.is-rail .nav__label{
  height:1px;padding:0;margin:14px 8px 10px;font-size:0;overflow:hidden;
  background:var(--border-soft);
}

.ske-root.is-rail .nav__item{
  position:relative;justify-content:center;
  gap:0;padding:12px 0;font-size:0;
}
.ske-root.is-rail .nav__item:hover{transform:none}
.ske-root.is-rail .nav__item svg{width:19px;height:19px;flex:0 0 19px}

/* Hover tooltip — the label text is copied into data-tip by the script in
   ske-page-end.php, since the text node itself is no longer visible. */
.ske-root.is-rail .nav__item::after{
  content:attr(data-tip);
  position:absolute;left:calc(100% + 10px);top:50%;transform:translateY(-50%);
  background:var(--text);color:var(--surface);
  font-size:12px;font-weight:600;letter-spacing:.2px;white-space:nowrap;
  padding:6px 10px;border-radius:7px;box-shadow:var(--shadow-sm);
  opacity:0;pointer-events:none;transition:opacity .14s;z-index:5;
}
.ske-root.is-rail .nav__item:hover::after{opacity:1}

.ske-root.is-rail .sidebar__foot .nav__item{color:var(--danger)}

/* The toggle itself: only meaningful where the sidebar is pinned open. */
#railBtn{display:none}
@media (min-width:1025px){
  #railBtn{display:grid}
  #railBtn svg{transition:transform .25s ease}
  .ske-root.is-rail #railBtn svg{transform:rotate(180deg)}
}
/* Below 1025px the sidebar is already an off-canvas drawer, so the rail
   state must not shrink it. */
@media (max-width:1024px){
  .ske-root.is-rail{--sidebar-w:280px}
  .ske-root.is-rail .brand__text,
  .ske-root.is-rail .sidebar__user > div:last-child{display:block}
  .ske-root.is-rail .nav__item{
    justify-content:flex-start;gap:11px;padding:10px 12px;font-size:13.5px;
  }
  .ske-root.is-rail .nav__item::after{display:none}
  .ske-root.is-rail .nav__label{
    height:auto;font-size:10.5px;padding:14px 10px 7px;margin:0;background:none;
  }
  .ske-root.is-rail .sidebar__brand{justify-content:flex-start;padding:20px 20px 18px}
  .ske-root.is-rail .sidebar__user{justify-content:flex-start;padding:14px;margin:16px}
}

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

.topbar{
  position:sticky;top:var(--nav-h);z-index:1020;
  display:flex;align-items:center;gap:14px;padding:14px 26px;
  background:var(--bg);
  border-bottom:1px solid var(--border-soft);
}
.topbar h1{font-size:18px;font-weight:700;margin:0}
.topbar p{margin:0;font-size:12.5px;color:var(--text-mute)}
.topbar__spacer{flex:1}

.icon-btn{
  width:38px;height:38px;border-radius:10px;display:grid;place-items:center;
  background:var(--surface);border:1px solid var(--border);color:var(--text-dim);
  cursor:pointer;transition:.16s;flex:0 0 38px;
}
.icon-btn:hover{color:var(--text);border-color:var(--brand);transform:translateY(-1px)}
.icon-btn svg{width:18px;height:18px;stroke-width:1.9;fill:none;stroke:currentColor}
#menuBtn{display:none}

.content{padding:24px 26px 60px;max-width:1600px;width:100%}

.backdrop{display:none;position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:1025}
.backdrop.is-on{display:block}

/* ============================== PRIMITIVES ============================= */
.card{
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--r);box-shadow:var(--shadow-sm);margin-bottom:20px;
}
.card__head{
  padding:16px 20px;border-bottom:1px solid var(--border-soft);
  display:flex;align-items:center;gap:10px;flex-wrap:wrap;
}
.card__head h2{font-size:14.5px;font-weight:650;margin:0}
.card__head p{margin:0;font-size:12px;color:var(--text-mute);width:100%}
.card__body{padding:20px}

.grid-2{display:grid;grid-template-columns:360px 1fr;gap:20px;align-items:start}
.grid-2--even{grid-template-columns:1fr 1fr}

.field{margin-bottom:16px;text-align:left}
.field label,.form-label{
  display:block;font-size:12px;font-weight:650;letter-spacing:.4px;
  text-transform:uppercase;color:var(--text-mute);margin-bottom:6px;
}
.toolbar{display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap}
.toolbar .field{margin-bottom:0}
.toolbar__spacer{flex:1}

.muted{color:var(--text-mute);font-size:12.5px}

/* ---------------------------- stat cards ------------------------------- */
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:16px;margin-bottom:22px}
.stat{
  position:relative;overflow:hidden;padding:18px 20px;
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--r);box-shadow:var(--shadow-sm);transition:.2s;
}
.stat:hover{transform:translateY(-3px);box-shadow:var(--shadow);border-color:var(--brand)}
.stat::after{content:'';position:absolute;inset:0 0 auto 0;height:3px;
  background:linear-gradient(90deg,var(--sc,var(--brand)),transparent)}
.stat__top{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.stat__ico{
  width:36px;height:36px;border-radius:10px;display:grid;place-items:center;
  background:color-mix(in srgb,var(--sc,var(--brand)) 16%,transparent);color:var(--sc,var(--brand));
}
.stat__ico svg{width:18px;height:18px;stroke-width:2;fill:none;stroke:currentColor}
.stat__val{font-size:28px;font-weight:750;letter-spacing:-1px;line-height:1.1}
.stat__lbl{font-size:12px;color:var(--text-mute);text-transform:uppercase;letter-spacing:.7px;font-weight:600}

/* ------------------------------- chips --------------------------------- */
.legend{display:flex;flex-wrap:wrap;gap:8px}
.chip{
  display:inline-flex;align-items:center;gap:8px;
  padding:6px 12px 6px 8px;border-radius:999px;
  background:var(--surface-2);border:1px solid var(--border-soft);
  font-size:12.5px;color:var(--text-dim);font-weight:500;
}
.chip__swatch{width:12px;height:12px;border-radius:4px;flex:0 0 12px;box-shadow:0 0 0 1px rgba(0,0,0,.15) inset}

.badge-x{
  display:inline-block;padding:3px 10px;border-radius:999px;
  font-size:11.5px;font-weight:650;letter-spacing:.3px;white-space:nowrap;
}
.badge-x--ok{background:color-mix(in srgb,var(--ok) 15%,transparent);color:var(--ok);border:1px solid color-mix(in srgb,var(--ok) 40%,transparent)}
.badge-x--warn{background:color-mix(in srgb,var(--warn) 15%,transparent);color:var(--warn);border:1px solid color-mix(in srgb,var(--warn) 40%,transparent)}
.badge-x--mute{background:var(--surface-2);color:var(--text-mute);border:1px solid var(--border)}

/* ================= BOOTSTRAP OVERRIDES (legacy markup) ================= */

/* -- buttons -- */
.ske-root .btn{
  border-radius:var(--r-sm)!important;font-weight:600!important;
  font-size:13.5px!important;padding:9px 16px!important;
  border:1px solid transparent!important;transition:.18s!important;
  box-shadow:none!important;font-family:inherit;
}
.ske-root .btn:hover{transform:translateY(-1px)}
.ske-root .btn-sm{padding:6px 12px!important;font-size:12px!important;border-radius:8px!important}
.ske-root .btn-primary{
  background:linear-gradient(135deg,var(--brand),var(--brand-2))!important;
  color:#fff!important;box-shadow:0 4px 14px rgba(99,102,241,.30)!important;
}
.ske-root .btn-primary:hover{box-shadow:0 8px 20px rgba(99,102,241,.40)!important}
.ske-root .btn-success{background:var(--ok)!important;color:#fff!important}
.ske-root .btn-warning{background:var(--warn)!important;color:#fff!important}
.ske-root .btn-danger{background:var(--danger)!important;color:#fff!important}
.ske-root .btn-secondary{background:var(--surface-2)!important;color:var(--text-dim)!important;border-color:var(--border)!important}
.ske-root .btn-secondary:hover{color:var(--text)!important;border-color:var(--brand)!important}
.ske-root .btn.disabled,
.ske-root .btn:disabled{opacity:.45!important;pointer-events:none;transform:none!important;box-shadow:none!important}

/* --- live vs. expired row actions (booking.php) -------------------------
   Deliberately stock Bootstrap classes rather than a bespoke one, so the
   two states are still told apart if this stylesheet is served from cache:

     open     .btn-warning / .btn-danger   solid colour, real link
     expired  .btn-secondary.disabled      flat grey, no href at all

   The !important + opacity:1 below exist because a row action must never be
   dimmed by anything else on the page — a faded orange button reads as
   "disabled" to a user, which is precisely the confusion this had before. */
.ske-root .btn-warning,
.ske-root .btn-warning:hover,
.ske-root .btn-warning:focus{
  background:var(--warn)!important;border-color:var(--warn)!important;
  color:#fff!important;opacity:1!important;
}
.ske-root .btn-danger,
.ske-root .btn-danger:hover,
.ske-root .btn-danger:focus{
  background:var(--danger)!important;border-color:var(--danger)!important;
  color:#fff!important;opacity:1!important;
}

/* An action whose window has closed. Flat, dashed and cursor-blocked so it
   cannot be mistaken for something clickable. */
.ske-root .btn-secondary.disabled,
.ske-root .btn-secondary.disabled:hover,
.ske-root .btn-secondary[aria-disabled="true"]{
  background:var(--surface-2)!important;
  color:var(--text-mute)!important;
  border:1px dashed var(--border)!important;
  opacity:.7!important;
  box-shadow:none!important;
  cursor:not-allowed;
  pointer-events:none;
  transform:none!important;
  text-decoration:line-through;
}

/* our own button, used on new markup */
.ske-root .btn-x{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  padding:10px 18px;border-radius:var(--r-sm);border:1px solid transparent;
  font-size:13.5px;font-weight:600;cursor:pointer;transition:.18s;
  font-family:inherit;line-height:1.2;
}
.ske-root .btn-x svg{width:16px;height:16px;stroke-width:2;fill:none;stroke:currentColor}
.ske-root .btn-x--primary{background:linear-gradient(135deg,var(--brand),var(--brand-2));color:#fff;box-shadow:0 6px 18px rgba(99,102,241,.32)}
.ske-root .btn-x--primary:hover{transform:translateY(-2px);box-shadow:0 10px 24px rgba(99,102,241,.42)}
.ske-root .btn-x--ghost{background:var(--surface-2);border-color:var(--border);color:var(--text-dim)}
.ske-root .btn-x--ghost:hover{color:var(--text);border-color:var(--brand)}
.ske-root .btn-x--danger{background:var(--danger);color:#fff}

/* -- form controls -- */
.ske-root .form-control,
.ske-root .form-select,
.ske-root select,
.ske-root textarea,
.ske-root input[type=text],
.ske-root input[type=email],
.ske-root input[type=password],
.ske-root input[type=date],
.ske-root input[type=time],
.ske-root input[type=tel],
.ske-root input[type=number]{
  width:100%;padding:10px 13px!important;border-radius:var(--r-sm)!important;
  background:var(--surface-2)!important;border:1px solid var(--border)!important;
  color:var(--text)!important;font-size:13.5px!important;font-family:inherit;
  transition:.16s;box-shadow:none!important;
}
.ske-root .form-control:focus,
.ske-root select:focus,
.ske-root textarea:focus,
.ske-root input[type=text]:focus,
.ske-root input[type=email]:focus,
.ske-root input[type=password]:focus,
.ske-root input[type=date]:focus,
.ske-root input[type=time]:focus,
.ske-root input[type=tel]:focus{
  outline:none;border-color:var(--brand)!important;
  box-shadow:0 0 0 3px var(--brand-soft)!important;background:var(--surface)!important;
}
.ske-root .form-control::placeholder{color:var(--text-mute)!important}
.ske-root input[type=date],
.ske-root input[type=time]{color-scheme:light}
.ske-root [data-theme="dark"] input[type=date],
.ske-root [data-theme="dark"] input[type=time]{color-scheme:dark}
.ske-root input[type=color]{
  width:52px!important;height:38px;padding:3px!important;cursor:pointer;
  border:1px solid var(--border)!important;border-radius:9px!important;
  background:var(--surface-2)!important;vertical-align:middle;
}
.ske-root input[type=checkbox],
.ske-root input[type=radio]{accent-color:var(--brand);width:16px;height:16px;cursor:pointer}
/* submit inputs are buttons, not fields — undo the field styling above */
.ske-root input[type=submit],
.ske-root input[type=button],
.ske-root input[type=reset]{
  width:auto!important;background:linear-gradient(135deg,var(--brand),var(--brand-2))!important;
  color:#fff!important;border:none!important;border-radius:var(--r-sm)!important;
  padding:10px 20px!important;font-weight:600!important;font-size:13.5px!important;
  cursor:pointer;box-shadow:0 4px 14px rgba(99,102,241,.30)!important;transition:.18s;
}
.ske-root input[type=submit]:hover{transform:translateY(-1px);box-shadow:0 8px 20px rgba(99,102,241,.40)!important}
.ske-root .form-group{margin-bottom:0}

/* --- Bootstrap floating labels ------------------------------------------
   .form-floating puts the <label> INSIDE the control and relies on
   Bootstrap's own tall padding (padding-top:1.625rem) to leave room for it.
   The control padding set above is !important, so it won overrode that and
   the label sat on top of the typed text. Give floating controls their
   padding back and let the label animate as Bootstrap intends.          */
.ske-root .form-floating{position:relative}
.ske-root .form-floating > .form-control,
.ske-root .form-floating > textarea.form-control{
  height:auto;min-height:calc(3.5rem + 2px);
  padding:1.625rem .95rem .5rem!important;line-height:1.25;
}
.ske-root .form-floating > label{
  position:absolute;top:0;left:0;height:100%;
  padding:1rem .95rem;pointer-events:none;transform-origin:0 0;
  color:var(--text-mute);font-size:13.5px;font-weight:500;
  text-transform:none;letter-spacing:0;margin:0;
  transition:opacity .1s ease-in-out,transform .1s ease-in-out;
}
.ske-root .form-floating > .form-control:focus ~ label,
.ske-root .form-floating > .form-control:not(:placeholder-shown) ~ label{
  opacity:.72;transform:scale(.82) translateY(-.5rem) translateX(.15rem);
}
/* A floating label needs a placeholder to detect "empty" — if one is missing,
   pin the label up permanently rather than let it cover the text. */
.ske-root .form-floating > .form-control:not([placeholder]) ~ label{
  opacity:.72;transform:scale(.82) translateY(-.5rem) translateX(.15rem);
}

/* Plain textareas: sensible default height and a vertical-only resize grip. */
.ske-root textarea.form-control{min-height:90px;resize:vertical;line-height:1.5}

/* -- tables -- */
.ske-root .table,
.ske-root .table.table-dark{
  --bs-table-bg:transparent;--bs-table-color:var(--text);
  width:100%;margin:0;border-collapse:separate;border-spacing:0;
  color:var(--text)!important;background:transparent!important;
  font-size:13px;
}
.table > :not(caption) > * > *{background:transparent!important;color:inherit!important;box-shadow:none!important}
.ske-root .table thead th{
  background:var(--surface-2)!important;color:var(--text-mute)!important;
  font-size:10.5px!important;font-weight:700!important;text-transform:uppercase;
  letter-spacing:.9px;padding:12px 14px!important;white-space:nowrap;
  border:none!important;border-bottom:1px solid var(--border)!important;
  position:sticky;top:0;z-index:2;
}
.ske-root .table tbody td{
  padding:11px 14px!important;border:none!important;
  border-bottom:1px solid var(--border-soft)!important;
  color:var(--text-dim)!important;vertical-align:middle;
}
.ske-root .table tbody tr:last-child td{border-bottom:none!important}
.ske-root .table tbody tr{transition:background .14s}
.ske-root .table.table-hover tbody tr:hover td{background:var(--brand-soft)!important;color:var(--text)!important}
.ske-root .table tbody td:first-child{color:var(--text-mute)!important;font-variant-numeric:tabular-nums}

/* horizontal scroll container for the very wide booking tables */
.ske-root .table-wrap{
  overflow:auto;max-height:calc(100vh - var(--nav-h) - 260px);
  border-radius:var(--r);border:1px solid var(--border);background:var(--surface);
}
.ske-root .table-wrap .table{min-width:100%}

/* -- misc bootstrap bits used by the legacy pages -- */
.ske-root .container{max-width:1600px}
.ske-root .row{margin:0}
.ske-root .modal-content{
  background:var(--surface)!important;color:var(--text)!important;
  border:1px solid var(--border)!important;border-radius:var(--r)!important;
  box-shadow:var(--shadow)!important;
}

/* ============================== AUTH PAGES ============================= */
.auth{
  min-height:calc(100vh - var(--nav-h));padding:calc(var(--nav-h) + 30px) 20px 50px;
  display:flex;align-items:flex-start;justify-content:center;
}
.auth__card{
  width:100%;max-width:420px;background:var(--surface);
  border:1px solid var(--border);border-radius:var(--r);
  box-shadow:var(--shadow);overflow:hidden;
}
.auth__head{
  padding:26px 28px 22px;text-align:center;
  background:linear-gradient(135deg,var(--brand),var(--brand-2));color:#fff;
}
.auth__head .brand__mark{margin:0 auto 12px;background:rgba(255,255,255,.2);box-shadow:none}
/* Society crest. It sits on a white disc so the monochrome emblem stays
   legible against the purple header, and so a colour version can be dropped
   in later without any CSS change. */
.auth__logo{
  display:block;width:96px;height:96px;margin:0 auto 14px;
  border-radius:50%;background:#fff;padding:7px;object-fit:contain;
  box-shadow:0 6px 18px rgba(0,0,0,.20);
}
.auth__head h1{font-size:19px;font-weight:700;margin:0;color:#fff}
.auth__head p{margin:4px 0 0;font-size:12.5px;opacity:.85}
.auth__body{padding:26px 28px}
.auth__foot{
  padding:14px 28px;border-top:1px solid var(--border-soft);
  background:var(--surface-2);text-align:center;font-size:12.5px;color:var(--text-mute);
}
.auth__foot a{color:var(--brand);font-weight:600}

/* ============================== EMPTY STATE =========================== */
.empty{
  padding:44px 20px;text-align:center;color:var(--text-mute);
}
.empty svg{width:38px;height:38px;stroke-width:1.5;fill:none;stroke:currentColor;opacity:.5;margin-bottom:10px}
.empty b{display:block;color:var(--text-dim);font-size:14px;margin-bottom:4px}

/* ============================== RESPONSIVE =============================
   Four targets, one set of rules:

     phone      <= 640px    single column, tables become cards
     tablet     641–1024px  sidebar becomes a drawer, 2-up grids
     laptop     1025–1440px sidebar pinned, comfortable density
     desktop    > 1440px    wider content, roomier spacing

   The sidebar drawer switches at 1024px rather than 900px: a portrait iPad
   is 1024px wide, and a 250px fixed sidebar plus a 20-column table does not
   fit there.                                                            */

/* ------------------------------ desktop -------------------------------- */
@media (min-width:1441px){
  .content{padding:28px 34px 70px}
  .stats{grid-template-columns:repeat(4,1fr)}
}

/* ------------------------------ laptop --------------------------------- */
@media (max-width:1440px){
  :root{--sidebar-w:230px}
  .content{padding:22px 22px 60px}
}
@media (max-width:1200px){
  .grid-2{grid-template-columns:320px 1fr}
  .stats{grid-template-columns:repeat(auto-fit,minmax(190px,1fr))}
}

/* ------------------------------ tablet --------------------------------- */
@media (max-width:1024px){
  /* Sidebar off-canvas; the hamburger in the topbar opens it. */
  .sidebar{transform:translateX(-100%);width:280px;flex-basis:280px}
  .sidebar.is-open{transform:none;box-shadow:var(--shadow)}
  .main{margin-left:0}
  #menuBtn{display:grid}

  .grid-2,.grid-2--even{grid-template-columns:1fr}
  .content{padding:20px 18px 56px}
  .topbar{padding:12px 18px}
  .stats{grid-template-columns:repeat(2,1fr);gap:14px}
  .card__body{padding:18px}
  .table-wrap{max-height:none}
}

/* ---------------------- phone: tables become cards ---------------------
   The booking tables carry up to 20 columns. Horizontal scrolling those on
   a phone is unusable, so each row is restacked as a labelled card. The
   labels come from data-label, which ske-page-end.php stamps onto every
   cell at runtime by reading the table's own <thead> — no page markup
   needed, and it keeps working if a column is ever added.              */
@media (max-width:640px){
  .content{padding:16px 12px 48px}
  .topbar{padding:10px 12px;gap:10px}
  .topbar h1{font-size:15px}
  .topbar p{font-size:11.5px}
  .sidebar{width:86vw;flex-basis:86vw;max-width:320px}

  .stats{grid-template-columns:1fr 1fr;gap:10px}
  .stat{padding:14px}
  .stat__val{font-size:22px}
  .stat__lbl{font-size:10.5px}
  .stat__ico{width:30px;height:30px}
  .stat__ico svg{width:15px;height:15px}

  .card{border-radius:12px;margin-bottom:14px}
  .card__head{padding:14px 16px}
  .card__body{padding:14px 16px}

  .toolbar{gap:10px}
  .toolbar .field{flex:1 1 100%;min-width:0}
  .toolbar .btn{width:100%}

  /* --- table → card --- */
  .table-wrap{border:none;background:transparent;overflow:visible;max-height:none}
  .table-wrap thead{display:none}
  .table-wrap table,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap td{display:block;width:100%}
  .table-wrap tr{
    background:var(--surface);border:1px solid var(--border);
    border-radius:12px;margin-bottom:12px;overflow:hidden;
    box-shadow:var(--shadow-sm);
  }
  .table-wrap td{
    display:flex;align-items:center;justify-content:space-between;gap:12px;
    padding:9px 14px!important;text-align:right;
    border:none!important;border-bottom:1px solid var(--border-soft)!important;
    color:var(--text)!important;font-size:13px;
  }
  .table-wrap tr td:last-child{border-bottom:none!important}
  .table-wrap td::before{
    content:attr(data-label);
    flex:0 0 42%;text-align:left;
    font-size:10px;font-weight:700;letter-spacing:.6px;text-transform:uppercase;
    color:var(--text-mute);
  }
  /* Cells with no label (empty-state rows) stay full width. */
  .table-wrap td[colspan]{display:block;text-align:center;padding:0!important}
  .table-wrap td[colspan]::before{content:none}
  .table-wrap td:empty{display:none}
  /* Action buttons fill the row they sit in. */
  .table-wrap td .btn{width:auto;min-width:96px}

  .legend{gap:6px}
  .chip{font-size:11.5px;padding:5px 10px 5px 7px}

  /* Auth card edge-to-edge on small screens */
  .auth{padding:calc(var(--nav-h) + 16px) 12px 40px}
  .auth__card{max-width:100%}
  .auth__head{padding:22px 20px 18px}
  .auth__body{padding:20px}
  .auth__logo{width:78px;height:78px}
}

@media (max-width:380px){
  .stats{grid-template-columns:1fr}
  .table-wrap td{flex-direction:column;align-items:flex-start;text-align:left;gap:3px}
  .table-wrap td::before{flex:none}
}

/* Landscape phones: the fixed navbar eats most of a 380px-tall viewport. */
@media (max-height:480px) and (orientation:landscape){
  .sidebar{overflow-y:auto}
  .auth{padding-top:calc(var(--nav-h) + 10px)}
}

/* =============================== PRINT ================================= */
@media print{
  .sidebar,.topbar,.backdrop,nav.navbar,.no-print{display:none!important}
  .main{margin-left:0}
  .app{padding-top:0}
  .content{padding:0}
  .card{border:none;box-shadow:none}
  body{background:#fff;color:#000}
}
