/* DRide Transport — blue palette (#1565C0). Phone-first. Synced to web app v1.86. */
.splash { text-align: center; padding: 40px 16px; }
.splash img { max-width: 220px; width: 60%; height: auto; }
.slogan { font-size: 18px; font-weight: 400; color: #2E5A88; text-align: center; margin: 16px 0 24px; }
.banner { background: #fff3cd; border: 1px solid #f0d48a; border-radius: 8px; padding: 10px; font-size: 14px; margin: 10px 0; text-align: center; }
.banner button { margin-left: 8px; }
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; background: #eef4fb; color: #1a2a3a; }
header { background: #1565C0; color: #fff; padding: 14px 16px; text-align: center; }
header h1 { margin: 0; font-size: 20px; }
header .header-slogan { display: block; font-size: 14px; font-weight: 400; opacity: .9; margin: 4px 0 0; color: #fff; }
/* Same stacked arrangement as before, just centred in the middle of the
   blue bar: "DRide Transport" on line 1, slogan on line 2 below it. */
@media (max-width: 520px) { header h1 { font-size: 16px; } header .header-slogan { font-size: 12px; } }
main { max-width: 720px; margin: 0 auto; padding: 14px 14px 60px; }
.card { background: #fff; border-radius: 12px; padding: 16px; margin: 12px 0; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
h2 { margin: 0 0 10px; font-size: 18px; color: #1565C0; }
h3 { margin: 14px 0 6px; font-size: 15px; }
label { display: block; font-size: 13px; margin: 10px 0 4px; font-weight: 600; }
input, select, textarea { width: 100%; padding: 10px; border: 1px solid #b9c9dc; border-radius: 8px; font-size: 15px; }
button { background: #1565C0; color: #fff; border: 0; border-radius: 8px; padding: 11px 16px; font-size: 15px; cursor: pointer; margin: 6px 4px 0 0; }
button.secondary { background: #e3edf8; color: #1565C0; }
button.danger { background: #b3261e; }
button:disabled { background: #9db6cf; cursor: not-allowed; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.tabs button { margin: 0; }
.badge { display: inline-block; background: #e3edf8; color: #1565C0; border-radius: 20px; padding: 2px 10px; font-size: 12px; font-weight: 700; }
.badge.warn { background: #fff3cd; color: #7a5b00; }
.badge.ok { background: #d9f2e3; color: #146c43; }
.badge.bad { background: #fde8e8; color: #b3261e; }
.notice { background: #fff8e1; border: 1px solid #f0d48a; border-radius: 8px; padding: 10px; font-size: 14px; margin: 10px 0; }
.row { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid #eef2f7; }
.row:last-child { border-bottom: 0; }
/* Email Queue scroll box (v1.87c): the queue list is ~3 rows tall and
   scrolls vertically, so a long queue (e.g. many failed test emails)
   never makes the Email page a long post. All rows are still rendered
   inside the box — newest first — with badges, error text and Retry
   buttons working as before. */
/* Audit Log scroll box (v1.87s): same idea as the Email Queue box
   (v1.87c), but ~5 entries tall instead of ~3 — an audit entry is
   taller (action + who + date + detail). Long details (e.g. the JSON
   in a sample_company_wiped entry) wrap inside the box and never
   overflow the page. */
.au-scroll { max-height: 400px; overflow-y: auto; -webkit-overflow-scrolling: touch; border: 1px solid #e3edf8; border-radius: 8px; padding: 0 10px; margin: 8px 0; }
.au-scroll .row span { overflow-wrap: anywhere; word-break: break-word; min-width: 0; }
/* Audit Log scroll box (v1.87s): same idea as the Email Queue box
   (v1.87c), but ~5 entries tall instead of ~3 — an audit entry is
   taller (action + who + date + detail). Long details (e.g. the JSON
   in a sample_company_wiped entry) wrap inside the box and never
   overflow the page. */
.au-scroll { max-height: 400px; overflow-y: auto; -webkit-overflow-scrolling: touch; border: 1px solid #e3edf8; border-radius: 8px; padding: 0 10px; margin: 8px 0; }
.au-scroll .row span { overflow-wrap: anywhere; word-break: break-word; min-width: 0; }
.em-scroll { max-height: 270px; overflow-y: auto; -webkit-overflow-scrolling: touch; border: 1px solid #e3edf8; border-radius: 8px; padding: 0 10px; margin: 8px 0; }
.em-sample pre { white-space: pre-wrap; word-break: break-word; background: #f4f8fc; border: 1px solid #e3edf8; border-radius: 8px; padding: 10px; margin: 8px 0; font-family: inherit; }
#map { height: 320px; border-radius: 10px; border: 1px solid #b9c9dc; }
#guide-map { height: 260px; border-radius: 10px; border: 1px solid #b9c9dc; margin: 10px 0; }
ol { padding-left: 20px; }
ol li { padding: 3px 0; }
.small { font-size: 13px; color: #5a6b7d; }
footer { text-align: center; font-size: 12px; color: #5a6b7d; padding: 20px; }

/* Login card running border — copied from the web app (theme.css
   .st-runborder): a blue gradient light travels continuously around the
   card edge. The wrapper clips a large rotating conic-gradient layer to
   a thin 3px frame around the inner card. Soft, not strong: mostly pale
   blue (#B9D4EE) with a short deeper-blue segment (#1565C0). */
@keyframes st-border-spin { to { transform: rotate(360deg); } }
@-webkit-keyframes st-border-spin { to { -webkit-transform: rotate(360deg); transform: rotate(360deg); } }
.st-runborder { position: relative; overflow: hidden; border-radius: 30px; padding: 3px; isolation: isolate; box-shadow: 10px 12px 28px rgba(90, 120, 155, .28), -8px -8px 20px rgba(255, 255, 255, .85); margin: 12px auto; max-width: 448px; }
.st-runborder::before { content: ""; position: absolute; inset: -120%; z-index: 0; background: conic-gradient(from 0deg, #B9D4EE 0deg, #B9D4EE 215deg, #5B9BD5 265deg, #1565C0 300deg, #9CC7F2 330deg, #B9D4EE 360deg); -webkit-animation: st-border-spin 4.5s linear infinite; animation: st-border-spin 4.5s linear infinite; will-change: transform; }
.st-runborder-inner { position: relative; z-index: 1; border-radius: 27px; }
/* The login card is the .card inside the running-border wrapper: pale
   blue-grey like the web app (#EAF1F8), no outer margin (the wrapper
   provides it), soft inset highlight on the top edge. */
.st-runborder-inner.card { background: #EAF1F8; box-shadow: inset 1px 1px 0 rgba(255,255,255,.75); margin: 0; }

/* Mobile (narrow screens): the 3px mostly-pale frame is easy to miss on a
   small phone screen, especially when it is not moving. On phones only,
   the frame is 1px thicker and the deep-blue arc is wider (200–320deg
   instead of 265–300deg), so the blue is visible at any moment. Desktop
   (above 520px) is unchanged. */
@media (max-width: 520px) {
  .st-runborder { padding: 4px; border-radius: 26px; }
  .st-runborder::before { background: conic-gradient(from 0deg, #B9D4EE 0deg, #B9D4EE 200deg, #5B9BD5 240deg, #1565C0 285deg, #9CC7F2 320deg, #B9D4EE 360deg); }
  .st-runborder-inner { border-radius: 22px; }
}

/* Login card entrance: soft fade + rise when the sign-in screen appears. */
@keyframes st-card-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
.st-card-in { animation: st-card-in .55s ease-out both; }

@media (prefers-reduced-motion: reduce) {
  .st-card-in { animation: none; }
  /* No spinning for reduced-motion users (many phones have Reduce Motion
     on) — but do NOT leave the frame almost invisible: the old rule set
     animation: none on a ::before that is ~60% pale #B9D4EE, so on a phone
     the border looked plain. Show a static, clearly blue arc instead, so
     the border is still visible with no movement. */
  .st-runborder::before { -webkit-animation: none; animation: none; background: conic-gradient(from 200deg, #1565C0 0deg, #5B9BD5 70deg, #9CC7F2 120deg, #B9D4EE 180deg, #B9D4EE 360deg); }
}

/* v1.87l: disabled (locked) fields are greyed out so they clearly cannot be typed into. */
input:disabled, select:disabled, textarea:disabled { background: #e9eef3; color: #6b7a8a; cursor: not-allowed; }

/* v1.87m: login actions — Sign in on the left, Forgot password? on the
   right, on the same line. FirstName / LastName side by side. */
.login-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; }
/* v1.87n: 2FA QR code + recovery codes */
#totp-qr svg { max-width: 220px; height: auto; background: #fff; padding: 8px; border: 1px solid #b9d4ee; border-radius: 8px; }
#totp-box code { font-size: 15px; line-height: 1.7; word-break: break-all; }
.login-actions button { margin: 6px 0 0 0; }
.name-row { display: flex; gap: 8px; }
.name-row > div { flex: 1; min-width: 0; }
.name-row input { width: 100%; }

/* v1.87o: Admin slide-in side menu (same layout as the web app).
   The button grid is gone from the Admin main screen on BOTH mobile and
   desktop. The menu slides in from the left over an overlay; tapping an
   item opens that section below the main screen.
   v1.87r: MOBILE menu restyled to the old web-app look — white panel,
   big centred "Menu" heading with the signed-in email below it, one
   row per item with a blue icon on the left and a ">" chevron on the
   right, small grey group headings, Tutorial / Contact Support links
   and Log out at the bottom. Desktop is NOT changed here — its blue
   sidebar rules live in the (min-width: 769px) block below, which
   hides the mobile-only bits (icons, chevrons, email line, footer
   links) and shows the desktop heading instead. */
.menu-btn { background: #e3edf8; color: #1565C0; font-size: 20px; line-height: 1; padding: 8px 12px; margin: 0 12px 0 0; flex-shrink: 0; }
.admin-home-top { display: flex; align-items: flex-start; }
.admin-home-top h2 { margin-top: 2px; }
.menu-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 999; display: none; }
.menu-overlay.open { display: block; }
.side-menu { position: fixed; top: 0; left: 0; bottom: 0; width: 320px; max-width: 88vw; background: #fff; z-index: 1000; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 0 28px; box-shadow: 2px 0 16px rgba(0,0,0,.25); transform: translateX(-105%); transition: transform .25s ease-out; }
.side-menu.open { transform: translateX(0); }
body.menu-open { overflow: hidden; }
.menu-head { position: relative; display: flex; justify-content: center; align-items: center; padding: 20px 16px 2px; }
.menu-head h2.menu-title-mobile { margin: 0; font-size: 26px; font-weight: 800; color: #10243e; }
.menu-head b.menu-title-desktop { display: none; }
.menu-close { position: absolute; right: 14px; top: 16px; background: #eef2f7; color: #1565C0; font-size: 22px; line-height: 1; padding: 5px 12px; margin: 0; border-radius: 10px; }
.menu-email { text-align: center; color: #6b7a8a; font-size: 13px; padding: 2px 16px 8px; word-break: break-word; }
#menu-search { margin: 8px 16px 4px; width: calc(100% - 32px); }
.side-menu .menu-group h3 { margin: 20px 20px 4px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: #6b7a8a; }
.side-menu .menu-item { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: transparent; color: #10243e; border: 0; border-radius: 0; padding: 13px 20px; font-size: 18px; font-weight: 500; margin: 0; cursor: pointer; }
.side-menu .menu-item:active { background: #eef4fb; }
.side-menu .menu-item .menu-ic { flex-shrink: 0; width: 26px; display: flex; align-items: center; color: #1565C0; }
.side-menu .menu-item .menu-label { flex: 1; }
.side-menu .menu-item .menu-chev { color: #9aa8b8; font-size: 22px; line-height: 1; }
.side-menu .menu-signout { margin-top: 6px; }
.menu-foot { padding: 16px 20px 0; }
.menu-foot .menu-link { display: block; color: #1565C0; text-decoration: underline; font-size: 18px; padding: 9px 0; cursor: pointer; }
.menu-foot hr { border: 0; border-top: 1px solid #e3e8ee; margin: 14px 0 6px; }
.menu-foot .menu-signout { padding-left: 0; padding-right: 0; }
/* Back to Top (v1.87o): appears once the Admin has scrolled down. */
.back-top { position: fixed; right: 16px; bottom: 16px; z-index: 900; border-radius: 20px; padding: 10px 14px; box-shadow: 0 2px 10px rgba(0,0,0,.25); margin: 0; }
@media (prefers-reduced-motion: reduce) { .side-menu { transition: none; } }

/* v1.87p: Desktop (>768px) professional layout for Admins. Mobile
   (<=768px) is NOT changed — it keeps the v1.87o slide-in menu above.
   On desktop the side menu becomes a fixed left sidebar, always visible
   (no hamburger needed), in DRide blue; the content area moves right,
   widens, and Action Centre / Today at a Glance sit side by side. */
.menu-user { display: none; }
@media (min-width: 769px) {
  body.is-admin header { text-align: left; padding: 16px 32px 16px 296px; }
  body.is-admin header h1 { font-size: 22px; }
  body.is-admin header .header-slogan { font-size: 14px; }
  body.is-admin main { max-width: 1120px; margin: 0 0 0 264px; padding: 24px 32px 60px; }
  body.is-admin footer { margin-left: 264px; text-align: left; padding: 20px 32px; }
  body.is-admin .card { border: 1px solid #e3edf8; border-radius: 14px; padding: 20px 22px; box-shadow: 0 1px 3px rgba(16,42,67,.07), 0 10px 28px rgba(16,42,67,.06); }
  body.is-admin h2 { font-size: 20px; }
  body.is-admin .admin-home-top { align-items: center; }
  /* Fixed sidebar: always visible, no slide, no overlay, no hamburger. */
  body.is-admin .menu-btn, body.is-admin .menu-close { display: none; }
  body.is-admin .menu-overlay { display: none !important; }
  body.is-admin .side-menu { transform: none; width: 264px; background: linear-gradient(180deg, #1565C0 0%, #0d47a1 100%); color: #fff; padding: 20px 16px 30px; box-shadow: none; border-right: 1px solid #0d47a1; }
  body.is-admin .menu-head { justify-content: space-between; padding: 0 0 10px; }
  body.is-admin .menu-head h2.menu-title-mobile { display: none; }
  body.is-admin .menu-head b.menu-title-desktop { display: block; color: #fff; font-size: 18px; }
  body.is-admin .menu-email { display: none; }
  body.is-admin .side-menu .menu-item .menu-ic, body.is-admin .side-menu .menu-item .menu-chev { display: none; }
  body.is-admin .side-menu .menu-item { font-size: 15px; padding: 10px 12px; border-radius: 8px; margin: 4px 0; }
  body.is-admin .menu-foot { padding: 0; }
  body.is-admin .menu-foot .menu-link, body.is-admin .menu-foot hr { display: none; }
  body.is-admin .menu-foot .menu-signout { padding: 10px 12px; margin-top: 18px; }
  body.is-admin .menu-user { display: block; padding: 12px 4px 14px; margin-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,.25); }
  body.is-admin .menu-user b { display: block; color: #fff; font-size: 16px; }
  body.is-admin .menu-user span { display: block; color: #b9d4ee; font-size: 12px; margin-top: 3px; word-break: break-word; }
  body.is-admin #menu-search { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.30); color: #fff; }
  body.is-admin #menu-search::placeholder { color: #b9d4ee; }
  body.is-admin .side-menu .menu-group h3 { color: #9cc7f2; }
  body.is-admin .side-menu .menu-item { background: transparent; color: #e3edf8; padding: 10px 12px; }
  body.is-admin .side-menu .menu-item:hover { background: rgba(255,255,255,.14); color: #fff; }
  body.is-admin .side-menu .menu-item.active { background: #fff; color: #1565C0; font-weight: 700; }
  body.is-admin .side-menu .menu-signout { background: rgba(255,255,255,.14); color: #fff; }
  /* Dashboard: Action Centre + Today at a Glance side by side. */
  body.is-admin .admin-dash { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
  body.is-admin .admin-dash .card { margin: 12px 0; }
}

/* v1.87p: Download Current Data — clean row-per-sheet list (both mobile
   and desktop). Name + description on the left, small Download button
   on the right; no button grid. */
.dl-list { margin-top: 12px; }
.dl-list .dl-row { align-items: center; gap: 12px; }
.dl-list .dl-row .small { display: block; margin-top: 2px; }
.dl-list .dl-row button { flex-shrink: 0; margin: 0; }

/* v1.87s: Super Admin home overview tiles (both mobile and desktop).
   Same look as the old web app: pale blue-grey tile, big blue number,
   grey label. 3 across on phone and desktop (the combined
   "Companies / Schools" total tile was removed as redundant). */
.sa-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0; }
.sa-tile { background: #eef4fb; border-radius: 12px; padding: 18px 10px; text-align: center; }
.sa-tile b { display: block; font-size: 32px; color: #1565C0; }
.sa-tile span { color: #5a6b7d; font-size: 14px; }
@media (max-width: 480px) { .sa-tile { padding: 14px 6px; } .sa-tile b { font-size: 26px; } .sa-tile span { font-size: 12px; } }

/* Mandatory-field asterisk — red so it stands out from the label text. */
.req { color: #d32f2f; font-weight: 700; }

/* Billing (Super Admin) overdue / trial-ending highlight (v1.87s
   follow-up): same red as the mandatory-field * (.req). Light red
   background + red left border on the company row; the row always
   carries a plain-text reason, so the red is never unexplained. */
.row.bill-alert { background: #fdecea; border-left: 4px solid #d32f2f; padding-left: 8px; }
