/* ==================================================================
   Atease® Client Portal — design system
   Mobile-first, installable PWA. Light + dark themes.
   Brand: navy #1a1a2e · Atease red #e24b4a
   ================================================================== */

:root {
  --navy:    #1a1a2e;
  --navy-2:  #24243e;
  --red:     #e24b4a;
  --red-2:   #c0392b;

  --bg:      #f4f5f8;
  --surface: #ffffff;
  --surface-2:#fbfbfd;
  --ink:     #1a1a24;
  --muted:   #6b7280;
  --faint:   #9aa1ad;
  --line:    #e8eaef;
  --line-2:  #f1f2f6;

  --good:    #1f9d57;
  --good-bg: #e7f6ee;
  --warn:    #c98a12;
  --warn-bg: #fbf1dc;
  --bad:     #d8352f;
  --bad-bg:  #fbe9e8;
  --info:    #2c5fb3;
  --info-bg: #e9f0fb;

  --radius:  16px;
  --radius-s:11px;
  --shadow:  0 1px 2px rgba(20,20,30,.05), 0 10px 30px -14px rgba(20,20,30,.18);
  --shadow-lg:0 20px 48px -20px rgba(20,20,30,.4);

  --nav-w:   248px;
  --bar-h:   58px;
  --tab-h:   62px;

  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:      #0f0f17;
    --surface: #1a1a26;
    --surface-2:#20202e;
    --ink:     #eceef3;
    --muted:   #9aa1ad;
    --faint:   #6b7280;
    --line:    #2a2a3a;
    --line-2:  #23232f;
    --good-bg: #12301f;
    --warn-bg: #33280f;
    --bad-bg:  #331716;
    --info-bg: #12233f;
    --shadow:  0 1px 2px rgba(0,0,0,.4), 0 12px 32px -14px rgba(0,0,0,.7);
  }
}
:root[data-theme="light"] {
  --bg:#f4f5f8; --surface:#fff; --surface-2:#fbfbfd; --ink:#1a1a24; --muted:#6b7280;
  --faint:#9aa1ad; --line:#e8eaef; --line-2:#f1f2f6;
  --good-bg:#e7f6ee; --warn-bg:#fbf1dc; --bad-bg:#fbe9e8; --info-bg:#e9f0fb;
  --shadow:0 1px 2px rgba(20,20,30,.05), 0 10px 30px -14px rgba(20,20,30,.18);
}
:root[data-theme="dark"] {
  --bg:#0f0f17; --surface:#1a1a26; --surface-2:#20202e; --ink:#eceef3; --muted:#9aa1ad;
  --faint:#6b7280; --line:#2a2a3a; --line-2:#23232f;
  --good-bg:#12301f; --warn-bg:#33280f; --bad-bg:#331716; --info-bg:#12233f;
  --shadow:0 1px 2px rgba(0,0,0,.4), 0 12px 32px -14px rgba(0,0,0,.7);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
svg { display: block; }

/* ==================================================================
   AUTH SCREENS (login / forgot / reset)  — centered card
   ================================================================== */
.auth-body {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  background: #0f0f1a;
}
.auth-body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 20% 20%, rgba(226,75,74,.10) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(26,26,46,.6) 0%, transparent 60%);
}
.login-card {
  position: relative; z-index: 1; width: 100%; max-width: 420px;
  background: rgba(255,255,255,.98); border-radius: 20px; overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.card-accent { height: 4px; background: linear-gradient(90deg, var(--red), var(--red-2)); }
.card-body   { padding: 2.5rem 2.25rem 2rem; }
.logo-wrap {
  text-align: center; background: var(--navy);
  margin: -2.5rem -2.25rem 1.75rem; padding: 1.75rem 2.25rem;
}
.logo-wrap img { max-height: 52px; width: auto; }
.logo-fallback { font-size: 26px; font-weight: 700; color: #fff; letter-spacing: -.5px; }
.logo-fallback sup { color: var(--red); font-size: 13px; }
.card-title    { font-size: 19px; font-weight: 600; color: var(--navy); margin-bottom: .25rem; }
.card-subtitle { font-size: 13px; color: #9ca3af; margin-bottom: 1.5rem; }
.card-footer {
  text-align: center; padding: 1rem 2.25rem 1.5rem; border-top: 1px solid #f3f4f6;
  font-size: 11.5px; color: #b0b7c3;
}
.card-foot-link { text-align: center; margin-top: 1.5rem; font-size: 12.5px; color: #6b7280; }
.card-foot-link a { color: var(--red-2); font-weight: 600; }
.card-foot-link a:hover { text-decoration: underline; }

/* Fields (shared by auth + app forms) */
.field { margin-bottom: 1.1rem; }
.field label {
  display: block; font-size: 12px; font-weight: 600; color: var(--ink);
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px;
}
.auth-body .field label { color: #374151; }
.input-wrap { position: relative; }
.input-wrap > svg {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: #9ca3af; pointer-events: none;
}
.field input {
  width: 100%; height: 46px; padding: 0 14px 0 40px; font-size: 14px; font-family: inherit;
  border: 1.5px solid #e5e7eb; border-radius: 10px; background: #f9fafb; color: #111; outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input:focus { border-color: var(--navy); background: #fff; box-shadow: 0 0 0 4px rgba(26,26,46,.07); }
.field input::placeholder { color: #c4c9d4; }
.pw-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: #9ca3af; padding: 6px; line-height: 0;
}
.field .input-wrap input[type="password"], .field .input-wrap input[type="text"] { padding-right: 42px; }
.row-between { display: flex; align-items: center; justify-content: space-between; margin: -.3rem 0 1.25rem; }
.link { font-size: 12.5px; color: var(--red-2); font-weight: 500; }
.link:hover { text-decoration: underline; }

.btn {
  width: 100%; height: 48px; margin-top: .25rem; background: var(--navy); color: #fff;
  border: none; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer;
  letter-spacing: .02em; transition: background .15s, transform .1s;
}
.btn:hover  { background: var(--navy-2); }
.btn:active { transform: scale(.98); }
.btn.btn-ghost { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); }

/* Alerts (shared) */
.alert { font-size: 13px; line-height: 1.45; padding: 11px 14px; border-radius: 10px; margin-bottom: 1.25rem; }
.alert-error   { background: var(--bad-bg);  color: var(--bad);  }
.alert-success { background: var(--good-bg); color: var(--good); }
.alert-info    { background: var(--info-bg); color: var(--info); }

/* ==================================================================
   APP SHELL (logged-in pages)
   ================================================================== */
.app { min-height: 100vh; }

/* Top bar */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--bar-h); z-index: 40;
  display: flex; align-items: center; gap: 12px; padding: 0 14px;
  background: var(--navy); color: #fff;
}
.topbar__menu, .topbar__icon {
  background: none; border: none; color: #fff; cursor: pointer;
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
}
.topbar__menu:hover, .topbar__icon:hover { background: rgba(255,255,255,.1); }
.topbar__brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.topbar__brand sup { color: var(--red); font-size: .6em; }
.topbar__spacer { flex: 1; }
.topbar__icon { position: relative; }
.badge-dot {
  position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--red); color: #fff; border-radius: 100px; font-size: 10px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--navy);
}

/* Sidebar */
.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; width: var(--nav-w); z-index: 60;
  background: var(--surface); border-right: 1px solid var(--line);
  transform: translateX(-100%); transition: transform .22s ease;
  display: flex; flex-direction: column; overflow-y: auto;
}
.sidebar.open { transform: translateX(0); }
.sidebar__head {
  padding: 18px 18px 16px; background: var(--navy); color: #fff;
  display: flex; align-items: center; gap: 10px;
}
.sidebar__head .avatar { width: 40px; height: 40px; border-radius: 12px; background: var(--red); display: grid; place-items: center; font-weight: 700; }
.sidebar__head .who { font-size: 13.5px; font-weight: 600; line-height: 1.2; }
.sidebar__head .sub { font-size: 11.5px; color: #b9bccb; }
.nav { padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.nav__label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 12px 12px 6px; font-weight: 700; }
.nav__item {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 11px;
  color: var(--ink); font-size: 14px; font-weight: 500;
}
.nav__item svg { width: 19px; height: 19px; color: var(--muted); flex: none; }
.nav__item:hover { background: var(--line-2); }
.nav__item.active { background: var(--navy); color: #fff; }
.nav__item.active svg { color: var(--red); }
.nav__item .count { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 100px; }

.overlay {
  position: fixed; inset: 0; background: rgba(10,10,18,.5); z-index: 50;
  opacity: 0; visibility: hidden; transition: opacity .2s;
}
.overlay.show { opacity: 1; visibility: visible; }

/* Content */
.content {
  padding: calc(var(--bar-h) + 16px) 16px calc(var(--tab-h) + 20px);
  max-width: 1080px; margin: 0 auto;
}
.page-head { margin-bottom: 16px; }
.page-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.page-head p  { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* Bottom tab bar (mobile) */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; height: var(--tab-h); z-index: 40;
  background: var(--surface); border-top: 1px solid var(--line);
  display: flex; padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 10.5px; color: var(--muted); font-weight: 500;
}
.tabbar a svg { width: 21px; height: 21px; }
.tabbar a.active { color: var(--red); }

/* Cards */
.card2 {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card2__head { padding: 16px 18px 0; display: flex; align-items: center; justify-content: space-between; }
.card2__head h2 { font-size: 15px; font-weight: 700; }
.card2__body { padding: 16px 18px; }

/* KPI grid */
.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 15px 15px 14px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.kpi__icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 10px; }
.kpi__icon svg { width: 18px; height: 18px; }
.kpi__val { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi__label { font-size: 12px; color: var(--muted); margin-top: 2px; }
.i-red   { background: var(--bad-bg);  color: var(--bad);  }
.i-green { background: var(--good-bg); color: var(--good); }
.i-blue  { background: var(--info-bg); color: var(--info); }
.i-amber { background: var(--warn-bg); color: var(--warn); }

/* Chart (hand-drawn SVG) */
.chart { width: 100%; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .bar { fill: var(--red); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .lbl { fill: var(--muted); font-size: 10px; }
.chart .val { fill: var(--ink); font-size: 9.5px; font-weight: 600; }

/* Status pills */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 100px; }
.pill--ok   { background: var(--good-bg); color: var(--good); }
.pill--warn { background: var(--warn-bg); color: var(--warn); }
.pill--bad  { background: var(--bad-bg);  color: var(--bad);  }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 520px; background: var(--surface); }
table.data th, table.data td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table.data th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 700; background: var(--surface-2); position: sticky; top: 0; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:active { background: var(--line-2); }

/* Toolbar (search + export) */
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.search { position: relative; flex: 1; min-width: 180px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--faint); }
.search input {
  width: 100%; height: 44px; padding: 0 14px 0 38px; border: 1.5px solid var(--line);
  border-radius: 11px; background: var(--surface); color: var(--ink); font-size: 14px; font-family: inherit; outline: none;
}
.search input:focus { border-color: var(--navy); }
.btn-sm {
  height: 44px; padding: 0 16px; border-radius: 11px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 13.5px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-sm:hover { background: var(--line-2); }
.btn-sm.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-sm svg { width: 16px; height: 16px; }

.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; margin: 0 auto 12px; color: var(--faint); }

.muted { color: var(--muted); }
.section-gap { height: 16px; }

/* Reports grid (hub) */
.rgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.rtile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px;
}
.rtile:active { transform: scale(.98); }
.rtile__icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--navy); color: #fff; }
.rtile__icon svg { width: 20px; height: 20px; }
.rtile h3 { font-size: 14px; font-weight: 600; }
.rtile span { font-size: 12px; color: var(--muted); }

/* Notifications */
.note-item { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.note-item:last-child { border-bottom: none; }
.note-item .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); margin-top: 6px; flex: none; }
.note-item.read .dot { background: var(--line); }
.note-item h4 { font-size: 14px; font-weight: 600; }
.note-item p  { font-size: 13px; color: var(--muted); margin-top: 2px; }
.note-item time { font-size: 11px; color: var(--faint); }

/* Install banner */
.install-banner {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--tab-h) + 12px); z-index: 45;
  background: var(--navy); color: #fff; border-radius: 14px; padding: 12px 14px;
  display: none; align-items: center; gap: 12px; box-shadow: var(--shadow-lg);
}
.install-banner.show { display: flex; }
.install-banner p { font-size: 13px; flex: 1; }
.install-banner button { border: none; border-radius: 9px; padding: 8px 14px; font-weight: 600; font-size: 13px; cursor: pointer; }
.install-banner .ib-yes { background: var(--red); color: #fff; }
.install-banner .ib-no  { background: transparent; color: #b9bccb; }

/* Offline banner */
.offline-bar {
  position: fixed; top: var(--bar-h); left: 0; right: 0; z-index: 39;
  background: var(--warn); color: #1a1200; text-align: center; font-size: 12.5px; font-weight: 600;
  padding: 6px; display: none;
}
.offline-bar.show { display: block; }

/* ==================================================================
   Desktop
   ================================================================== */
@media (min-width: 900px) {
  .topbar__menu { display: none; }
  .sidebar { transform: translateX(0); box-shadow: none; }
  .overlay { display: none; }
  .tabbar  { display: none; }
  .content { margin-left: var(--nav-w); max-width: none; padding-bottom: 32px; padding-left: 28px; padding-right: 28px; }
  .topbar  { left: var(--nav-w); }
  /* auto-fit: packs as many cards per row as the width allows (5–6 on a
     laptop) instead of forcing exactly 4 and wrapping the 5th. */
  .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .rgrid   { grid-template-columns: repeat(3, 1fr); }
  .install-banner { left: auto; right: 24px; bottom: 24px; max-width: 380px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ==================================================================
   Date bar, filters, summary/detail toggle, pagination, totals
   ================================================================== */
.date-bar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
}
.date-bar label { font-size: 13px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.date-bar label svg { width: 15px; height: 15px; }
.date-bar input[type="date"] {
  height: 44px; border: 1.5px solid var(--line); border-radius: 11px;
  background: var(--surface); color: var(--ink); padding: 0 12px; font-size: 14px; font-family: inherit;
}
.date-bar input[type="date"]:focus { border-color: var(--navy); outline: none; }

/* dd/MM/yyyy date control (native picker underneath, styled display on top) */
.datepick {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 12px; min-width: 156px;
  border: 1.5px solid var(--line); border-radius: 11px; background: var(--surface); cursor: pointer;
}
.datepick:focus-within { border-color: var(--navy); }
.datepick__text { font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 500; }
.datepick > svg { width: 16px; height: 16px; color: var(--muted); margin-left: auto; }
.datepick__native {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; border: 0; margin: 0; padding: 0; cursor: pointer;
}
/* Hide the native calendar glyph (we render our own) */
.datepick__native::-webkit-calendar-picker-indicator { opacity: 0; cursor: pointer; }

/* Back button on report pages */
.page-head.with-back { display: flex; align-items: center; gap: 12px; }
.page-head.with-back h1 { margin: 0; }
.back-btn {
  flex: none; width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink);
}
.back-btn svg { width: 20px; height: 20px; }
.back-btn:hover { background: var(--line-2); }

/* Clickable KPI cards */
a.kpi { cursor: pointer; text-decoration: none; color: inherit; transition: transform .12s, box-shadow .12s; }
a.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
a.kpi:active { transform: translateY(0); }

/* Date chooser — a plain <select>, so the dd/MM/yyyy format is ours and
   nothing depends on the browser locale. Compact on mobile. */
.date-bar { gap: 8px; margin-bottom: 12px; }
.date-select, .ctl-form select {
  height: 40px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface);
  color: var(--ink); padding: 0 32px 0 12px; font-size: 14px; font-family: inherit; cursor: pointer;
  font-variant-numeric: tabular-nums;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa1ad' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.date-select:focus, .ctl-form select:focus { border-color: var(--navy); outline: none; }

/* Report header: export as an icon, pinned right */
.icon-btn {
  margin-left: auto; flex: none;
  width: 40px; height: 40px; display: grid; place-items: center;
  border: none; border-radius: 10px; background: var(--navy); color: #fff; cursor: pointer;
  transition: background .15s, opacity .15s;
}
.icon-btn:hover { background: var(--navy-2); }
.icon-btn:disabled { opacity: .55; cursor: default; }
.icon-btn svg { width: 18px; height: 18px; }

/* Group row inside the device table (Sales Order Apps / Van Sales Apps).
   Colour-matched to the KPI cards: blue = sales orders, amber = van sales.
   !important because the nth-child zebra striping is more specific. */
table.data tbody tr.grp-row td {
  position: relative;
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: 9px 10px 8px 20px; white-space: nowrap;
  border-top: 1px solid var(--line);
}
/* Short accent bar, inset from the left/top/bottom (not a full-height edge) */
table.data tbody tr.grp-row td::before {
  content: '';
  position: absolute;
  left: 8px; top: 7px; bottom: 7px;
  width: 3px; border-radius: 2px;
  background: currentColor;
}
table.data tbody tr.grp-row:first-child td { border-top: none; }

table.data tbody tr.grp-row--so td {
  background: var(--info-bg) !important;
  color: var(--info);
}
table.data tbody tr.grp-row--van td {
  background: var(--warn-bg) !important;
  color: var(--warn);
}

/* Dark table header — matches the Tabulator report grids */
table.data thead th {
  background: var(--navy);
  color: rgba(255,255,255,.88);
  text-align: center;
  border-bottom: none;
  border-right: none;
  border-left: 1px solid #fff;   /* white separator, left edge — never trails at the end */
}
table.data thead th:first-child { border-left: none; }

/* Outer grid frame — subtle line, corners clip the dark header */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  overflow-x: auto;
  overflow-y: hidden;          /* no stray vertical scrollbar / clipped last row */
}
table.data thead th:first-child { border-top-left-radius: 7px; }
table.data thead th:last-child  { border-top-right-radius: 7px; }
table.data tbody tr:last-child td { border-bottom: none; }

/* Slim, unobtrusive horizontal scrollbar (it was reading as a stray strip) */
.table-wrap::-webkit-scrollbar { height: 8px; }
.table-wrap::-webkit-scrollbar-track { background: transparent; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.table-wrap::-webkit-scrollbar-thumb:hover { background: var(--faint); }
.table-wrap { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

/* ==================================================================
   Device states: expiring / reset / inactive / expired
   ================================================================== */
.pill--info  { background: var(--info-bg); color: var(--info); }
.pill--muted { background: var(--line-2);  color: var(--faint); }

table.data tbody tr.row-expiring td { background: var(--warn-bg) !important; }
table.data tbody tr.row-reset    td { background: var(--info-bg) !important; }
table.data tbody tr.row-inactive td { background: var(--bad-bg)  !important; }
table.data tbody tr.row-expired  td {
  background: var(--line-2) !important;
  color: var(--faint);
  text-decoration-color: var(--faint);
}
/* Dashboard shows expired apps in red (Devices page greys them instead) */
table.data tbody tr.row-expired-red td { background: var(--bad-bg) !important; color: var(--bad); }
.tag-exp {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 5px;
  background: var(--bad); color: #fff; font-size: 9.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; vertical-align: middle;
}
table.data tbody tr.row-expired td .btn-sm { opacity: .6; }

/* ==================================================================
   Route map + visit timeline
   ================================================================== */
.map-split { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 1000px) {
  .map-split { grid-template-columns: 1fr 330px; align-items: start; }
}

.map-card {
  position: relative;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
#routeMap {
  width: 100%;
  height: calc(100vh - 350px);
  min-height: 380px;
  background: var(--line-2);
}

/* Expand button — sits above Leaflet's own controls (they use z-index 1000) */
.map-full {
  position: absolute; top: 10px; right: 10px; z-index: 1001;
  width: 34px; height: 34px; display: grid; place-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  color: #1a1a24; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.map-full:hover { background: #f1f2f6; }
.map-full svg { width: 17px; height: 17px; }
.map-full .ico-shrink { display: none; }
.map-card.is-full .map-full .ico-expand { display: none; }
.map-card.is-full .map-full .ico-shrink { display: block; }

/* Full screen. Two mechanisms, one look:
   1. Fullscreen API — also hides the browser tabs/address bar (biggest view).
   2. Fixed overlay — the fallback for iOS Safari, which won't grant the
      Fullscreen API to ordinary elements. */
.map-card.is-full {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column;
  border: 0; border-radius: 0; box-shadow: none;
  background: var(--surface);
}
.map-card.is-full #routeMap { flex: 1; height: auto; min-height: 0; }
body.map-locked { overflow: hidden; }

/* When the Fullscreen API grants it, the element IS the screen */
.map-card:fullscreen,
.map-card:-webkit-full-screen {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  background: var(--surface);
}
.map-card:fullscreen #routeMap,
.map-card:-webkit-full-screen #routeMap { flex: 1; height: auto; min-height: 0; }
.leaflet-container { font-family: var(--font); }
.leaflet-popup-content { font-size: 12.5px; line-height: 1.5; margin: 10px 12px; }
.leaflet-popup-content strong { color: #1a1a24; }
.leaflet-popup-content em { color: var(--muted); font-style: normal; font-size: 11.5px; }
.leaflet-control-attribution { font-size: 10px; }

/* Numbered stop pin */
.stop-pin { background: none; border: none; }
.stop-pin__num {
  display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  color: #fff; font-size: 12px; font-weight: 700; font-family: var(--font);
  border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35);
}

.map-legend {
  display: flex; flex-wrap: wrap; gap: 8px 16px;
  padding: 11px 14px; border-top: 1px solid var(--line);
  background: var(--surface-2); font-size: 11.5px; color: var(--muted);
}
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-legend .dot {
  width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
}
.dot-ok    { background: #1f9d57; }
.dot-warn  { background: #c98a12; }
.dot-far   { background: #d8352f; }
.dot-nogeo { background: #9aa1ad; }

/* Visit timeline */
.timeline {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.timeline__head { padding: 13px 15px; border-bottom: 1px solid var(--line); }
.timeline__head h2 { font-size: 14px; font-weight: 700; }
.timeline__head span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.timeline__list {
  list-style: none; margin: 0; padding: 6px;
  max-height: calc(100vh - 430px); min-height: 200px; overflow-y: auto;
}
.tl {
  display: flex; gap: 11px; padding: 9px 9px; border-radius: 10px;
  cursor: pointer; outline: none;
}
.tl:hover, .tl:focus-visible { background: var(--line-2); }
.tl.active { background: var(--info-bg); }
.tl__num {
  flex: none; display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%;
  color: #fff; font-size: 11.5px; font-weight: 700;
}
.tl__num.v-ok    { background: #1f9d57; }
.tl__num.v-warn  { background: #c98a12; }
.tl__num.v-far   { background: #d8352f; }
.tl__num.v-nogeo { background: #9aa1ad; }
.tl__body { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.tl__body strong {
  font-size: 13px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tl__meta { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl__flag {
  display: inline-block; width: fit-content; margin-top: 2px;
  padding: 1px 7px; border-radius: 5px;
  font-size: 10.5px; font-weight: 700;
}
.tl__flag.bad   { background: var(--bad-bg);  color: var(--bad); }
.tl__flag.warn  { background: var(--warn-bg); color: var(--warn); }
.tl__flag.muted { background: var(--line-2);  color: var(--faint); }

/* In-cell setting dropdown (Auto Upload / Location on the Devices page) */
.cell-select {
  height: 32px; padding: 0 26px 0 9px; font-size: 12.5px; font-family: inherit;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%239aa1ad' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
}
.cell-select:focus { border-color: var(--navy); outline: none; }

/* Legend under the device table */
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; padding: 0 2px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.legend .sw { width: 12px; height: 12px; border-radius: 4px; border: 1px solid var(--line); }
.sw-expiring { background: var(--warn-bg); }
.sw-reset    { background: var(--info-bg); }
.sw-inactive { background: var(--bad-bg);  }
.sw-expired  { background: var(--line-2);  }

/* Expiry banner (devices page) */
.exp-banner {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--warn-bg); color: var(--warn);
  border-radius: var(--radius-s); padding: 12px 14px; margin-bottom: 14px;
  font-size: 13px; line-height: 1.45;
}
.exp-banner svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.exp-banner strong { font-weight: 700; }
.exp-bad { display: inline-block; margin-left: 8px; color: var(--bad); font-weight: 600; }

/* ==================================================================
   Modal (app-expiry notice at sign-in)
   ================================================================== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(12,12,22,.58);
  display: grid; place-items: center; padding: 20px;
}
.modal {
  width: 100%; max-width: 420px;
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden;
  animation: modalIn .22s cubic-bezier(.2,.75,.2,1) both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.modal__head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
}
.modal__head h2 { display: flex; align-items: center; gap: 8px; font-size: 15.5px; font-weight: 700; }
.modal__head svg { width: 18px; height: 18px; color: var(--warn); }
.modal__x {
  margin-left: auto; background: none; border: none; cursor: pointer;
  font-size: 24px; line-height: 1; color: var(--faint); padding: 0 4px;
}
.modal__x:hover { color: var(--ink); }
.modal__body { padding: 16px 18px; }
.modal__foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 12px 18px 16px; border-top: 1px solid var(--line-2);
}

/* Confirm dialog */
.modal--sm { max-width: 380px; }
.modal--sm .modal__head h2 { font-size: 15px; }
.confirm__msg { font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.btn-sm.danger {
  background: var(--bad); color: #fff; border-color: var(--bad);
}
.btn-sm.danger:hover { filter: brightness(1.08); background: var(--bad); }

.exp-list { list-style: none; display: grid; gap: 8px; margin-bottom: 14px; }
.exp-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--warn-bg); color: var(--warn);
  border-radius: 9px; padding: 9px 12px; font-size: 13px; font-weight: 600;
}
.exp-detail { display: grid; gap: 6px; }
.exp-detail div {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 12.5px; color: var(--muted);
  padding: 5px 2px; border-bottom: 1px dashed var(--line-2);
}
.exp-detail em { font-style: normal; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.exp-expired {
  margin-top: 12px; padding: 9px 12px; border-radius: 9px;
  background: var(--bad-bg); color: var(--bad); font-size: 13px; font-weight: 600;
}

/* One control row: date · filters · summary/details · search
   Margins kept tight — every px here is a px of grid. */
.ctl-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.page-head.with-back { margin-bottom: 12px; }
.ctl-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; }
.ctl-row .search { flex: 1 1 200px; min-width: 170px; }
.ctl-row .search input { height: 40px; border-radius: 10px; }
.ctl-row .seg { height: 40px; border-radius: 10px; }
.ctl-row .seg a { height: 100%; padding: 0 14px; font-size: 13px; }

/* Compact 2-row KPI card: [icon + label] then a centred value */
.kpi { padding: 12px 12px 13px; }
.kpi__top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.kpi__icon { width: 26px; height: 26px; border-radius: 8px; margin-bottom: 0; flex: none; }
.kpi__icon svg { width: 15px; height: 15px; }
.kpi__label { font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 0; line-height: 1.2; }
.kpi__val { font-size: 24px; text-align: center; margin-top: 2px; }

.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filter-bar select {
  height: 44px; border: 1.5px solid var(--line); border-radius: 11px; background: var(--surface);
  color: var(--ink); padding: 0 34px 0 12px; font-size: 13.5px; font-family: inherit; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa1ad' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.filter-bar select:focus { border-color: var(--navy); outline: none; }

.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 11px; overflow: hidden; }
.seg a { padding: 0 16px; height: 44px; display: flex; align-items: center; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.seg a.on { background: var(--navy); color: #fff; }

/* Alternate row colour.
   Plain tables stripe with :nth-child. Grouped and paginated tables set an
   explicit .alt class instead, because group headers / hidden rows would
   otherwise break the odd-even parity. */
table.data:not(.paginate):not(.grouped) tbody tr:nth-child(even) td { background: var(--line-2); }
table.data tbody tr.alt td { background: var(--line-2); }

/* Totals row */
table.data tfoot td { font-weight: 700; border-top: 2px solid var(--line); background: var(--surface-2); white-space: nowrap; }
table.data tfoot td.tfoot-label { color: var(--muted); }
table.data tfoot td.tfoot-val { color: var(--ink); }

/* Location cell wraps */
table.data td.loc { white-space: normal; max-width: 240px; min-width: 160px; font-size: 12px; color: var(--muted); word-break: break-word; line-height: 1.4; }
table.data td.loc .loc-text { display: block; }
.maplink {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 4px;
  font-size: 11.5px; font-weight: 600; color: var(--info); white-space: nowrap;
}
.maplink svg { width: 13px; height: 13px; }
.maplink:hover { text-decoration: underline; }

/* Pager */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 14px 10px 4px; flex-wrap: wrap; }
.pager:empty { display: none; }   /* single page -> no empty padded strip */
.pager__btn {
  height: 38px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.pager__btn:hover:not(:disabled) { background: var(--line-2); }
.pager__btn:disabled { opacity: .45; cursor: default; }
.pager__info { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ==================================================================
   Login polish
   ================================================================== */
/* Login — same navy as the app shell (top bar / sidebar), red accent. */
.auth-body {
  display: block;                /* split layout handles its own centring */
  padding: 0;
  background:
    radial-gradient(1000px 560px at 20% -10%, #24243e 0%, rgba(26,26,46,0) 62%),
    var(--navy);
}
.auth-body::before {
  display: block;
  background: radial-gradient(ellipse 70% 55% at 12% 18%, rgba(226,75,74,.13) 0%, transparent 62%);
}

/* ---------- split: brand panel | sign-in ---------- */
.auth-split { position: relative; z-index: 1; min-height: 100vh; }

/* Brand mark: the Atease web icon + the ATEASE(R) wordmark.
   NOTE: these sit on the DARK panel, so the text must be light — the earlier
   dark values (meant for the white card) made it invisible. */
.brand-mark { display: inline-flex; align-items: center; gap: 15px; }
.brand-mark__icon {
  width: 58px; height: 58px; border-radius: 15px; display: block;
  box-shadow: 0 14px 30px -12px rgba(0,0,0,.55);
}
.auth-body .brand-title {
  font-size: 31px; font-weight: 700; color: #fff;
  letter-spacing: .01em; line-height: 1;
}
/* The ® font glyph renders as a sub-pixel smudge at this size no matter the
   colour or size, so it's drawn as an SVG instead: a real circle + a real "R",
   which stay crisp at any scale. */
.auth-body .brand-title {
  display: inline-flex;
  align-items: flex-start;
}
.brand-reg {
  width: 17px; height: 17px;
  flex: none;
  margin-left: 5px; margin-top: 1px;
  color: #fff;
  overflow: visible;
}
.auth-body .brand-tagline {
  font-size: 13.5px; color: rgba(255,255,255,.62); margin-top: 6px; letter-spacing: .01em;
}

.auth-lede {
  font-size: 27px; font-weight: 700; color: #fff;
  letter-spacing: -.02em; line-height: 1.3; max-width: 20ch;
}
.auth-feats { list-style: none; display: grid; gap: 11px; margin-top: 22px; }
.auth-feats li {
  display: flex; align-items: center; gap: 10px;
  color: rgba(255,255,255,.8); font-size: 14px;
}
.auth-feats svg { flex: none; width: 17px; height: 17px; color: var(--red); }

.auth-contacts { margin-top: 30px; }   /* was crowding the feature list */
.auth-contacts__label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em;
  color: rgba(255,255,255,.5); margin-bottom: 10px;
}
.auth-trust {
  margin-top: 24px; font-size: 12px; color: rgba(255,255,255,.38); letter-spacing: .01em;
}
.auth-contacts__row { display: flex; flex-wrap: wrap; gap: 9px; }
.auth-contact {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 13px; border-radius: 11px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  color: #fff; font-size: 13px; transition: background .15s, border-color .15s;
}
.auth-contact:hover { background: rgba(255,255,255,.13); border-color: rgba(255,255,255,.24); }
.auth-contact svg { flex: none; }
.auth-contact span { display: flex; flex-direction: column; line-height: 1.25; }
.auth-contact em {
  font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: rgba(255,255,255,.45);
}
.auth-contact.wa {
  background: rgba(37,211,102,.13); border-color: rgba(37,211,102,.32); color: #4ee08a;
}
.auth-contact.wa:hover { background: rgba(37,211,102,.2); border-color: rgba(37,211,102,.5); }
.auth-contact.wa em { color: rgba(78,224,138,.6); }

/* ---------- right column ---------- */
.announce {
  width: 100%; max-width: 420px;
  display: flex; align-items: flex-start; gap: 9px;
  padding: 10px 13px; border-radius: 12px;
  background: rgba(226,75,74,.12); border: 1px solid rgba(226,75,74,.3);
  color: #f7d5d4; font-size: 12.5px; line-height: 1.45;
}
.announce svg { flex: none; margin-top: 1px; color: var(--red); }

.install-cta {
  display: none; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 11px; cursor: pointer; font-family: inherit;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.15);
  color: #fff; font-size: 13.5px; font-weight: 600;
}
.install-cta.show { display: inline-flex; }
.install-cta:hover { background: rgba(255,255,255,.14); }

/* Install toast — slides up when the browser offers installation */
.toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 95;
  transform: translate(-50%, 160%); opacity: 0;
  display: flex; align-items: center; gap: 11px;
  width: calc(100% - 32px); max-width: 430px;
  padding: 11px 11px 11px 13px; border-radius: 14px;
  background: #fff; box-shadow: 0 22px 50px -18px rgba(0,0,0,.6);
  transition: transform .34s cubic-bezier(.2,.75,.2,1), opacity .3s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast__icon img { display: block; width: 38px; height: 38px; border-radius: 9px; }
.toast__body { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.toast__body strong { font-size: 13.5px; font-weight: 700; color: #1e1e2e; }
.toast__body span { font-size: 12px; color: #6b7280; }
.toast__btn {
  margin-left: auto; flex: none; padding: 9px 15px; border-radius: 9px; border: none;
  background: var(--navy); color: #fff; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.toast__btn:hover { background: var(--navy-2); }
.toast__x {
  flex: none; background: none; border: none; cursor: pointer;
  color: #b0b7c3; font-size: 20px; line-height: 1; padding: 0 2px;
}
.toast__x:hover { color: #1e1e2e; }

.auth-links { font-size: 12px; color: rgba(255,255,255,.4); text-align: center; }
.auth-links a { color: rgba(255,255,255,.68); }
.auth-links a:hover { color: #fff; text-decoration: underline; }
.auth-links span { margin: 0 6px; }

/* ---------- desktop: two columns ---------- */
@media (min-width: 960px) {
  .auth-split { display: grid; grid-template-columns: 1.05fr .95fr; }
  .auth-brand {
    display: flex; flex-direction: column; justify-content: center; gap: 34px;
    padding: 56px 24px 56px 6vw;
  }
  .auth-main {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 14px; padding: 48px 6vw 48px 24px;
  }
}

/* ---------- mobile: brand on top, contacts below the card ---------- */
@media (max-width: 959px) {
  .auth-split {
    display: flex; flex-direction: column; align-items: center;
    gap: 14px; padding: 26px 18px 36px;
  }
  .auth-brand { display: contents; }            /* lets us reorder its children */
  .auth-brand__head { order: 1; text-align: center; }
  .auth-main {
    order: 2; width: 100%;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
  }
  .auth-brand__body { order: 3; width: 100%; max-width: 420px; }

  /* The pitch is for first-timers on a big screen — on a phone the form wins. */
  .auth-lede, .auth-feats { display: none; }
  .auth-contacts { margin-top: 4px; }
  .auth-contacts__label { text-align: center; }
  .auth-contacts__row { justify-content: center; }
  .auth-trust { text-align: center; margin-top: 16px; }
  .brand-mark { gap: 12px; }
  .brand-mark__icon { width: 48px; height: 48px; border-radius: 13px; }
  .auth-body .brand-title { font-size: 26px; }
  .brand-reg { width: 15px; height: 15px; margin-left: 4px; }
  .auth-body .brand-tagline { font-size: 12.5px; margin-top: 4px; }
}

.login-card {
  background: #fff;
  border: 1px solid #ecedf4;
  border-radius: 22px;
  box-shadow: 0 26px 64px -26px rgba(45,38,95,.38), 0 2px 6px rgba(20,20,40,.05);
  animation: cardIn .5s cubic-bezier(.2,.75,.2,1) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: none; } }

.auth-body .card-body { padding: 30px 28px 22px; text-align: center; }

.brand-title { font-size: 25px; font-weight: 700; letter-spacing: -.01em; color: #1e1e2e; line-height: 1.1; }
.brand-title sup { color: #e24b4a; font-size: .5em; top: -.85em; margin-left: 2px; }
.brand-tagline { font-size: 13px; color: #8b90a0; margin-top: 5px; }

.auth-heading { font-size: 16px; font-weight: 600; color: #1e1e2e; margin-top: 16px; }
.auth-sub { font-size: 12.5px; color: #9298a8; margin-top: 3px; }

/* Form (left-aligned inside the centred card) */
.login-card form { text-align: left; margin-top: 18px; }
.auth-body .alert { margin-top: 14px; margin-bottom: 0; padding: 9px 12px; font-size: 12.5px; }
.auth-body .field { margin-bottom: .8rem; }
.auth-body .field label { color: #4b5563; text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; margin-bottom: 5px; }
.auth-body .field input {
  height: 46px;
  /* Declared explicitly (not inherited from .field input) so the text and the
     caret always start after the leading icon, never on the border. */
  padding: 0 14px 0 42px;
  text-indent: 0;
  caret-color: #1a1a2e;
  border: 1.5px solid #e6e8ef; border-radius: 12px; background: #f7f8fb;
  font-size: 14px; color: #1e1e2e; transition: border-color .15s, box-shadow .15s, background .15s;
}
/* Password field: keep room on the right for the show/hide eye */
.auth-body .field .input-wrap input[type="password"],
.auth-body .field .input-wrap input[type="text"] { padding-right: 42px; }
.auth-body .field input:focus { border-color: #1a1a2e; background: #fff; box-shadow: 0 0 0 4px rgba(26,26,46,.10); }
.auth-body .input-wrap > svg { color: #a3a8b8; }
.auth-body .pw-toggle { color: #a3a8b8; }
.auth-body .row-between { margin: -.1rem 0 .85rem; }

/* Remember me */
.remember {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 500; color: #4b5563; cursor: pointer; user-select: none;
}
.remember input {
  width: 15px; height: 15px; margin: 0; cursor: pointer;
  accent-color: #1a1a2e;
}

/* Caps Lock warning */
.caps-warn {
  display: none; align-items: center; gap: 5px;
  margin-top: 6px; font-size: 11.5px; font-weight: 600; color: #b9791c;
}
.caps-warn.show { display: flex; }
.caps-warn::before { content: '\26A0'; font-size: 12px; }   /* ⚠ */

.auth-body .btn {
  height: 48px; border-radius: 12px; font-size: 14.5px; letter-spacing: .01em; margin-top: 0;
  background: linear-gradient(135deg, #2a2a4c 0%, #1a1a2e 100%);
  box-shadow: 0 12px 26px -10px rgba(20,20,46,.55);
}
.auth-body .btn:hover { background: linear-gradient(135deg, #34345c 0%, #22223c 100%); }

.auth-body .link, .auth-body .card-foot-link a { color: #c0392b; }
.auth-body .card-footer {
  border-top: 1px solid #f0f1f6; color: #aeb3c2;
  padding: 12px 28px 14px; font-size: 11px;
}
.auth-body .card-foot-link { margin-top: 16px; font-size: 12px; }
