/* ================================================================
   Arrival Point — Resident Portal
   Design system v3  ·  "Sharp"
   A single cohesive, professional UI language: near-black ink,
   one confident emerald accent, crisp hairlines, tabular numerics.
   ================================================================ */

/* Font is loaded via <link rel="preconnect"> + <link rel="stylesheet"> in each page <head>
   (faster than @import, which is render-blocking). */

/* ── tokens ───────────────────────────────────────────────────── */
:root {
  /* accent */
  --green:      #10b981;
  --green-dk:   #059669;
  --green-dkr:  #047857;
  --green-lt:   #ecfdf5;
  --green-glow: rgba(16,185,129,.16);

  /* danger (emergency SOS, destructive accents) */
  --danger:     #e5484d;

  /* ink (near-black, faintly blue) */
  --ink:        #0a0f1a;
  --navy:       #0a0f1a;
  --navy-hover: rgba(255,255,255,.06);

  /* neutrals */
  --bg:         #f4f6fa;
  --surface:    #ffffff;
  --surface-2:  #f8fafc;
  --border:     #e7ebf1;
  --border-dk:  #d3dae4;

  --text:       #0a0f1a;
  --text-500:   #475569;
  --text-muted: #64748b;
  --text-light: #98a4b5;

  /* v4 refresh — softer, more contemporary roundness */
  --radius:     14px;
  --radius-sm:  9px;
  --radius-lg:  18px;
  --radius-pill: 999px;

  /* v4 refresh — richer, more clearly layered elevation */
  --shadow-xs: 0 1px 2px rgba(15,23,42,.06);
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05), 0 2px 5px -1px rgba(15,23,42,.07);
  --shadow-md: 0 6px 18px -4px rgba(15,23,42,.10), 0 3px 8px -3px rgba(15,23,42,.07);
  --shadow-lg: 0 24px 56px -12px rgba(15,23,42,.22), 0 8px 20px -8px rgba(15,23,42,.12);

  --ring: 0 0 0 3px var(--green-glow);
  --ease: cubic-bezier(.2,.6,.2,1);
  --maxw: 1120px;

  /* spacing + type scale */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px;
  --fs-xs: 12px; --fs-sm: 13.5px; --fs-base: 14.5px; --fs-md: 16px; --fs-lg: 20px; --fs-xl: 26px;
}

/* ── dark theme ───────────────────────────────────────────────── */
:root[data-theme="dark"] {
  --bg:         #0b1220;
  --surface:    #141c2b;
  --surface-2:  #1c2536;
  --border:     #283449;
  --border-dk:  #3a4762;
  --text:       #e9eef6;
  --text-500:   #aebccd;
  --text-muted: #8593a6;
  --text-light: #697585;
  --green-lt:   rgba(16,185,129,.15);
  --green-glow: rgba(16,185,129,.28);
  --shadow-xs:  0 1px 2px rgba(0,0,0,.4);
  --shadow-sm:  0 1px 2px rgba(0,0,0,.4), 0 1px 3px rgba(0,0,0,.35);
  --shadow-md:  0 6px 16px -4px rgba(0,0,0,.55), 0 2px 6px -2px rgba(0,0,0,.4);
  --shadow-lg:  0 18px 44px -10px rgba(0,0,0,.65), 0 6px 16px -6px rgba(0,0,0,.5);
}
/* Printable documents stay light (so they look right on screen and when printed) */
:root[data-theme="dark"] .report,
:root[data-theme="dark"] .pass-card {
  --surface: #ffffff; --surface-2: #f8fafc; --border: #e7ebf1; --border-dk: #d3dae4;
  --text: #0a0f1a; --text-500: #475569; --text-muted: #64748b; --text-light: #98a4b5;
  --green-lt: #ecfdf5;
  background: #ffffff; color: #0a0f1a;
}
/* targeted fixes for a few hardcoded light values */
:root[data-theme="dark"] table.gv tbody tr:nth-child(even) td { background: rgba(255,255,255,.03); }
:root[data-theme="dark"] table.gv tbody tr.row-expired td,
:root[data-theme="dark"] table.gv tbody tr.row-expired:hover td { background-color: rgba(239,68,68,.10); }
:root[data-theme="dark"] .area-chart line { stroke: var(--border); }

/* ── reset / base ─────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.6;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}
a { color: var(--green-dk); text-decoration: none; transition: color .15s var(--ease); }
a:hover { color: var(--green-dkr); text-decoration: none; }
img { max-width: 100%; }
svg { flex-shrink: 0; }
input, select, textarea, button { font: inherit; color: inherit; }
::selection { background: var(--green-glow); color: var(--ink); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
h1,h2,h3 { letter-spacing: -0.02em; }

/* tasteful scrollbars on scrollable panels */
.table-wrap::-webkit-scrollbar { height: 10px; width: 10px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--border-dk); border-radius: 999px; border: 3px solid var(--surface); }
.table-wrap::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* ── shell (sidebar + content) ────────────────────────────────── */
.portal-shell { min-height: 100vh; display: flex; align-items: stretch; }
:root { --side-w: 248px; }

/* ── sidebar ──────────────────────────────────────────────────── */
.sidebar {
  width: var(--side-w); flex-shrink: 0;
  background: var(--navy);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid rgba(255,255,255,.06);
}
.sidebar .brand {
  display: flex; align-items: center; gap: 11px;
  padding: 20px 20px 18px; color: #fff;
  white-space: nowrap; flex-shrink: 0;
}
.sidebar .brand:hover { opacity: .92; color: #fff; }
.sidebar .brand img { height: 30px; filter: brightness(0) invert(1); }
.sidebar .brand .name { font-weight: 700; font-size: 15.5px; letter-spacing: -0.02em; }
.sidebar .brand-sub {
  font-size: 9.5px; font-weight: 700; color: var(--green);
  letter-spacing: .14em; text-transform: uppercase; margin-top: 1px;
}
.sidenav { flex: 1; overflow-y: auto; padding: 6px 12px 12px; scrollbar-width: thin; }
.sidenav::-webkit-scrollbar { width: 6px; }
.sidenav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 10px; }
.nav-group {
  font-size: 10px; font-weight: 700; color: rgba(255,255,255,.32);
  text-transform: uppercase; letter-spacing: .12em;
  padding: 16px 12px 7px;
}
.sidenav a {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: var(--radius-sm); margin-bottom: 1px;
  color: rgba(255,255,255,.66);
  font-size: 13.5px; font-weight: 500; letter-spacing: -0.01em;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.sidenav a svg { width: 18px; height: 18px; opacity: .85; }
.sidenav a:hover { background: var(--navy-hover); color: #fff; }
.sidenav a.active {
  background: rgba(16,185,129,.14); color: #fff;
}
.sidenav a.active svg { color: var(--green); opacity: 1; }
.sidenav a.active::before {
  content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
  background: var(--green); border-radius: 0 3px 3px 0;
}
.nav-signout { color: rgba(255,255,255,.5) !important; }
.nav-sos { color: var(--danger, #e5484d) !important; font-weight: 600; }
.nav-sos svg { color: var(--danger, #e5484d) !important; opacity: 1 !important; }
.nav-sos:hover { background: color-mix(in srgb, var(--danger, #e5484d) 14%, transparent); }
.nav-sos.active::before { background: var(--danger, #e5484d); }
.side-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.side-user { min-width: 0; }
.side-user .user-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-sub { font-size: 11px; color: rgba(255,255,255,.45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(140deg, var(--green) 0%, var(--green-dkr) 100%);
  color: #fff; font-weight: 700; font-size: 12px; letter-spacing: .02em;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 2px 6px rgba(16,185,129,.35);
  flex-shrink: 0;
}

/* ── content area + slim topbar ───────────────────────────────── */
.content-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px;
}
.topbar-brand { display: none; align-items: center; }
.topbar-brand img { height: 26px; }
.topbar-addr {
  display: flex; align-items: center; gap: 8px; min-width: 0; margin-right: 16px;
  color: var(--text-500); font-size: 15px; font-weight: 600;
}
.topbar-addr svg { width: 17px; height: 17px; color: var(--green-dk); flex-shrink: 0; }
.topbar-addr > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.topbar-sep { width: 1px; height: 22px; background: var(--border); margin: 0 2px; }

/* language dropdown (custom, app-styled) */
.lang-dd { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 10px 7px 11px; border-radius: var(--radius-sm);
  font: inherit; font-size: 13px; font-weight: 600; color: var(--text-500);
  border: 1px solid var(--border-dk); background: var(--surface);
  box-shadow: var(--shadow-xs); cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.lang-btn:hover { background: var(--surface-2); border-color: #b9c2cf; color: var(--text); }
.lang-btn > svg { width: 16px; height: 16px; }
.lang-btn .chev { width: 13px; height: 13px; color: var(--text-light); transition: transform .15s var(--ease); }
.lang-dd.open .lang-btn .chev { transform: rotate(180deg); }
.lang-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 200;
  min-width: 172px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .14s var(--ease), transform .14s var(--ease), visibility .14s;
}
.lang-dd.open .lang-menu { opacity: 1; visibility: visible; transform: none; }
.lang-opt {
  display: flex; align-items: center; width: 100%;
  padding: 9px 11px; border-radius: var(--radius-sm);
  font: inherit; font-size: 13.5px; font-weight: 500; color: var(--text-500);
  background: none; border: none; text-align: left; cursor: pointer;
  transition: background .12s var(--ease), color .12s var(--ease);
}
.lang-opt:hover { background: var(--surface-2); color: var(--text); }
.lang-opt.active { color: var(--green-dk); font-weight: 700; }
.lang-opt.active::after { content: '\2713'; margin-left: auto; color: var(--green); font-weight: 800; }

/* profile / sign-out buttons */
.topbar-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; color: var(--text-500);
  border: 1px solid var(--border-dk); background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.topbar-btn svg { width: 16px; height: 16px; }
.topbar-btn:hover { background: var(--surface-2); border-color: #b9c2cf; color: var(--text); text-decoration: none; }
.topbar-btn-out:hover { background: #fef2f2; border-color: #f3c0c0; color: #b91c1c; }

/* theme toggle */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 34px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-dk); background: var(--surface); color: var(--text-500);
  cursor: pointer; box-shadow: var(--shadow-xs);
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.theme-toggle:hover { background: var(--surface-2); border-color: var(--text-light); color: var(--text); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .ic-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .ic-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .ic-sun { display: inline; }

/* ── main content ─────────────────────────────────────────────── */
.main-content {
  flex: 1;
  max-width: 1180px; margin: 0 auto;
  width: 100%; padding: 30px 28px 64px;
}

/* ── page header ──────────────────────────────────────────────── */
.page-hd {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 26px; gap: 16px; flex-wrap: wrap;
}
.page-hd h1 {
  font-size: 25px; font-weight: 700; color: var(--text); line-height: 1.15;
}
.page-hd .sub { color: var(--text-muted); font-size: 14px; margin-top: 5px; }

/* ── cards ────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
  overflow: hidden;
}
.card-hd {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.balance-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.balance-amount {
  font-size: 32px; font-weight: 800; color: var(--text); margin-top: 4px;
}
.inline-form { display: inline-block; margin: 0; }
.appeal-form { display: flex; gap: 6px; align-items: center; margin: 0; }
.appeal-form input[type="text"] { width: 160px; padding: 6px 8px; font-size: 13px; }
.assignee-tag { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.sr-photo { margin-top: 8px; }
.sr-photo img { max-width: 90px; max-height: 90px; border-radius: 8px; border: 1px solid var(--border); object-fit: cover; }
.sr-timeline { margin-top: 8px; font-size: 12.5px; }
.sr-timeline summary { cursor: pointer; color: var(--text-light); }
.sr-timeline ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sr-timeline-date { color: var(--text-light); margin-right: 8px; }
/* command palette (ported from VmsAdminCore command-palette.js) */
.cmdk-overlay{position:fixed;inset:0;z-index:4000;display:none;align-items:flex-start;justify-content:center;
    padding:12vh 16px 16px;background:rgba(15,23,42,.45);backdrop-filter:blur(2px);}
.cmdk-overlay.open{display:flex;}
body.cmdk-lock{overflow:hidden;}
.cmdk-box{width:100%;max-width:560px;background:var(--surface,#fff);border:1px solid var(--border,#e2e8f0);
    border-radius:14px;box-shadow:0 24px 60px -12px rgba(2,6,23,.45);overflow:hidden;}
.cmdk-inputwrap{display:flex;align-items:center;gap:10px;padding:14px 16px;
    border-bottom:1px solid var(--border,#e2e8f0);color:var(--text-light,#64748b);}
.cmdk-input{flex:1;border:0;outline:0;background:transparent;font:inherit;font-size:16px;color:var(--text,#0f172a);}
.cmdk-kbd{font-size:11px;font-weight:600;color:var(--text-light,#64748b);
    border:1px solid var(--border,#e2e8f0);border-radius:6px;padding:2px 6px;}
.cmdk-results{max-height:52vh;overflow:auto;padding:6px;}
.cmdk-group{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;
    color:var(--text-light,#64748b);padding:10px 10px 4px;}
.cmdk-item{display:flex;align-items:center;gap:11px;padding:9px 10px;border-radius:9px;cursor:pointer;color:var(--text,#0f172a);}
.cmdk-item.sel{background:var(--green,#6366f1);color:#fff;}
.cmdk-item.sel .cmdk-sub,.cmdk-item.sel .cmdk-ic{color:rgba(255,255,255,.85);}
.cmdk-ic{display:flex;color:var(--text-light,#64748b);}
.cmdk-text{display:flex;flex-direction:column;min-width:0;}
.cmdk-title{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.cmdk-sub{font-size:12px;color:var(--text-light,#64748b);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.cmdk-empty{padding:24px;text-align:center;color:var(--text-light,#64748b);font-size:14px;}
.cmdk-sk{display:flex;align-items:center;gap:12px;padding:9px 12px;}
.cmdk-sk-ic{width:18px;height:18px;border-radius:5px;flex-shrink:0;}
.cmdk-sk-ln{height:11px;border-radius:5px;flex:1;max-width:62%;}

.push-prompt {
  position: fixed; bottom: 20px; right: 20px; z-index: 1000; max-width: 340px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,.12)); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; color: var(--text);
}
.push-prompt > div { display: flex; gap: 8px; justify-content: flex-end; }
.card-hd h2 {
  font-size: 15px; font-weight: 700; margin: 0; color: var(--text);
  display: flex; align-items: center; gap: 9px;
}
.card-hd h2::before {
  content: ''; width: 3px; height: 15px; border-radius: 2px;
  background: var(--green); flex-shrink: 0;
}
.card-body { padding: 22px; }
.card-body.flush { padding: 0; }

/* ── stat cards ───────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 28px;
}
.stat-card {
  position: relative; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .2s var(--ease);
  container-type: inline-size;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--border-dk); }
.stat-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px; flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(10,15,26,.04);
}
.stat-icon.green  { background: #e9fbf3; color: #047857; }
.stat-icon.blue   { background: #eaf2ff; color: #2563eb; }
.stat-icon.amber  { background: #fff5e6; color: #c2680c; }
.stat-icon.purple { background: #f4ecff; color: #7c3aed; }
.stat-icon svg { width: 19px; height: 19px; }
.stat-label {
  font-size: 12px; color: var(--text-muted);
  font-weight: 600; letter-spacing: .01em;
}
.stat-value {
  /* Shrink-to-fit: large values (5-7 digits, currency) scale down with the card
     so they never overflow; small numbers stay at the full 30px. */
  font-size: clamp(20px, 16cqi, 30px);
  font-weight: 800; line-height: 1.05;
  color: var(--text); letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stat-sub {
  font-size: 11.5px; color: var(--text-muted); margin-top: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.stat-link {
  display: inline-block; margin-top: 8px; position: relative; z-index: 1;
  font-size: 12.5px; font-weight: 600; color: var(--green-dk);
}
.stat-link:hover { color: var(--green-dkr); }
.stat-spark {
  position: absolute; right: 14px; bottom: 12px; z-index: 0;
  width: 116px; height: 34px; opacity: .45; pointer-events: none;
}
.stat-spark .spark { display: block; }

/* ── dashboard header ─────────────────────────────────────────── */
.dash-hd { align-items: flex-start; margin-bottom: 22px; }
.eyebrow {
  font-size: 11px; font-weight: 700; color: var(--green-dk);
  letter-spacing: .1em; text-transform: uppercase; margin-bottom: 4px;
}
.dash-hd h1 { display: flex; align-items: center; gap: 12px; }
.live-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
  color: var(--green-dk); background: var(--green-lt);
  border: 1px solid #bbf0d9; border-radius: var(--radius-pill);
  padding: 3px 9px; text-transform: uppercase;
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 0 rgba(16,185,129,.5); animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(16,185,129,.5); }
  70%  { box-shadow: 0 0 0 6px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}
.weather-dd { position: relative; display: inline-flex; }
.weather-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--text-light);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: 3px 11px 3px 9px;
  cursor: pointer; font-family: inherit;
}
.weather-pill:hover { border-color: var(--green); }
.weather-dd.open .weather-pill { border-color: var(--green); }
.weather-pill svg { width: 15px; height: 15px; color: #f59e0b; flex-shrink: 0; }
.weather-pill b { color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
.weather-precip { color: #3b82f6; font-weight: 700; margin-left: 2px; }
.weather-menu {
  display: none; position: absolute; top: calc(100% + 8px); left: 0; z-index: 60;
  min-width: 330px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,.14));
  padding: 10px; text-align: left;
}
.weather-dd.open .weather-menu { display: block; }
.weather-menu-h {
  font-size: 11.5px; font-weight: 700; color: var(--text-light); text-transform: uppercase;
  letter-spacing: .04em; padding: 4px 6px 8px; border-bottom: 1px solid var(--border); margin-bottom: 6px;
}
.weather-day {
  display: grid; grid-template-columns: 40px 22px 1fr 46px 60px; align-items: center; gap: 8px;
  padding: 6px; border-radius: 8px; font-size: 13px;
}
.weather-day:hover { background: var(--surface-2); }
.weather-day-name { font-weight: 700; color: var(--text); }
.weather-day-icon svg { width: 17px; height: 17px; color: #f59e0b; }
.weather-day-desc { color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.weather-day-precip { color: #3b82f6; font-weight: 600; text-align: right; }
.weather-day-temps { text-align: right; color: var(--text-light); font-variant-numeric: tabular-nums; }
.weather-day-temps b { color: var(--text); }
.dash-clock {
  font-size: 19px; font-weight: 700; color: var(--text);
  letter-spacing: -0.01em; font-variant-numeric: tabular-nums;
  white-space: nowrap; padding-top: 18px;
}

/* ── chart cards ──────────────────────────────────────────────── */
.chart-row {
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; margin-bottom: 22px;
}
.chart-card { margin-bottom: 0; }
.card-hd-note { font-size: 12px; font-weight: 500; color: var(--text-light); margin-left: 2px; }
.card-hd h2 .card-hd-note { text-transform: none; letter-spacing: normal; }
.chart-legend { display: flex; gap: 14px; }
.legend-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--text-500); font-weight: 500;
}
.legend-item .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.area-chart { width: 100%; height: auto; display: block; }
.area-chart .ax { font-size: 11px; fill: var(--text-light); font-family: inherit; }

.donut-body { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut-wrap { flex-shrink: 0; }
.donut { width: 168px; height: 168px; display: block; }
.donut-num { font-size: 34px; font-weight: 800; fill: var(--text); font-family: inherit; }
.donut-cap { font-size: 12px; fill: var(--text-light); font-family: inherit; letter-spacing: .04em; }
.donut-legend { flex: 1; min-width: 130px; display: flex; flex-direction: column; gap: 9px; }
.donut-legend .legend-item { display: flex; width: 100%; font-size: 13px; }
.donut-legend .legend-item b { margin-left: auto; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.legend-empty { font-size: 13px; color: var(--text-muted); padding: 8px 0; }

/* ── forms ────────────────────────────────────────────────────── */
.field { margin-bottom: 17px; }
.field label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--text-500); margin-bottom: 7px;
}
.field input[type=text],
.field input[type=password],
.field input[type=email],
.field input[type=tel],
.field input[type=date],
.field input[type=time],
.field input[type=datetime-local],
.field input[type=number],
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border-dk);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  font-size: 14px; outline: none;
  background: var(--surface); color: var(--text);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-light); }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #b9c2cf; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--green);
  box-shadow: var(--ring);
}
.field input[readonly] { background: var(--surface-2); color: var(--text-muted); cursor: default; }
.field textarea { resize: vertical; min-height: 80px; }
.field-row { display: flex; gap: 16px; }
.field-row .field { flex: 1; min-width: 0; }
.field-check { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; }
.field-check input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--green); cursor: pointer; }
.field-check label { font-size: 14px; cursor: pointer; margin: 0; font-weight: 500; }
.field-hint { font-size: 12px; color: var(--text-light); margin-top: 5px; }
.form-actions {
  display: flex; gap: 10px;
  margin-top: 24px; padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ── guest weekly schedule editor ─────────────────────────────── */
.guest-sched { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.guest-sched .sched-title { font-weight: 600; margin-bottom: 12px; }
.guest-sched .sched-hint { display: block; font-weight: 400; font-size: 13px; color: var(--muted, #6b7280); margin-top: 2px; }
.guest-sched .sched-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.guest-sched .sched-day { display: flex; align-items: center; gap: 8px; width: 140px; cursor: pointer; }
.guest-sched .sched-time {
  max-width: 150px;
  border: 1px solid var(--border-dk);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  font-size: 14px; outline: none;
  background: var(--surface); color: var(--text);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.guest-sched .sched-time:hover { border-color: #b9c2cf; }
.guest-sched .sched-time:focus { border-color: var(--green); box-shadow: var(--ring); }
.guest-sched .sched-sep { color: var(--muted, #6b7280); font-size: 13px; }

/* ── buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 17px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer; letter-spacing: -0.01em;
  border: 1px solid transparent; line-height: 1.4;
  transition: background .15s var(--ease), border-color .15s var(--ease),
              box-shadow .15s var(--ease), transform .08s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(.5px); }
.btn-primary {
  background: var(--green-dk); color: #fff;
  box-shadow: 0 1px 2px rgba(5,150,105,.4), inset 0 1px 0 rgba(255,255,255,.14);
}
.btn-primary:hover { background: var(--green-dkr); color: #fff; box-shadow: 0 4px 12px -2px rgba(5,150,105,.45); }
.btn-ghost {
  background: var(--surface); color: var(--text-500);
  border-color: var(--border-dk);
  box-shadow: var(--shadow-xs);
}
.btn-ghost:hover { background: var(--surface-2); border-color: #b9c2cf; color: var(--text); }
.btn-danger { background: var(--surface); color: #dc2626; border-color: #f3c0c0; box-shadow: var(--shadow-xs); }
.btn-danger:hover { background: #fef2f2; border-color: #ef9b9b; color: #b91c1c; }
.btn-sm { padding: 6px 12px; font-size: 13px; gap: 5px; }
.btn svg { width: 16px; height: 16px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* ── tables (data grid) ───────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.gv { width: 100%; border-collapse: collapse; text-align: left; }
table.gv th {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em;
  padding: 6px 16px;
  background: transparent;
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap; user-select: none;
}
table.gv th.sortable { cursor: pointer; transition: color .15s var(--ease), background .15s var(--ease); }
table.gv th.sortable:hover { color: var(--text); background: #eef2f7; }
table.gv th.sort-asc, table.gv th.sort-desc { color: var(--green-dk); }
table.gv th.sort-asc .sort-ind,
table.gv th.sort-desc .sort-ind { color: var(--green); font-weight: 800; }
.sort-ind { font-size: 11px; margin-left: 5px; color: var(--text-light); }
/* server-side sortable headers render a link inside the <th> */
table.gv th > a { color: inherit; text-decoration: none; cursor: pointer; display: inline-flex; align-items: center; white-space: nowrap; }
table.gv th > a:hover { color: var(--green-dk); }
table.gv th.sort-asc > a .sort-ind, table.gv th.sort-desc > a .sort-ind { color: var(--green); font-weight: 800; }
table.gv td {
  padding: 6px 16px; border-bottom: 1px solid var(--border);
  vertical-align: middle; font-size: 14px;
  font-variant-numeric: tabular-nums;
}
table.gv tbody tr { transition: background .12s var(--ease); }
/* plain rows (no zebra) to match the modern grid look */
table.gv tbody tr:nth-child(even) td { background: transparent; }
table.gv tbody tr:hover td { background: var(--green-lt); }
table.gv tr:last-child td { border-bottom: none; }
/* expired guest rows — red diagonal-striped highlight */
table.gv tbody tr.row-expired td,
table.gv tbody tr.row-expired:hover td {
  background-image: repeating-linear-gradient(45deg,
      rgba(239,68,68,.06) 0, rgba(239,68,68,.06) 9px,
      rgba(239,68,68,.13) 9px, rgba(239,68,68,.13) 18px);
  background-color: #fff5f5;
  color: #b91c1c;
}
table.gv tbody tr.row-expired td:first-child { box-shadow: inset 3px 0 0 #ef4444; }
/* expired rows hidden until "Show expired" is ticked (overrides the search filter) */
.hide-expired tr.row-expired { display: none !important; }
.actions { display: flex; gap: 7px; flex-wrap: wrap; }
/* Inline editable inputs inside grids match the form fields */
table.gv input[type=text], table.gv input[type=tel], table.gv input[type=email] {
  border: 1px solid var(--border-dk); border-radius: var(--radius-sm);
  padding: 9px 13px; font-size: 14px; outline: none;
  background: var(--surface); color: var(--text); max-width: 100%;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
table.gv input[type=text]:hover, table.gv input[type=tel]:hover, table.gv input[type=email]:hover { border-color: #b9c2cf; }
table.gv input[type=text]:focus, table.gv input[type=tel]:focus, table.gv input[type=email]:focus {
  border-color: var(--green); box-shadow: var(--ring);
}

.empty-state { text-align: center; padding: 56px 24px; color: var(--text-500); }
.empty-state svg {
  width: 38px; height: 38px; margin: 0 auto 14px;
  display: block; color: var(--text-light);
}
.empty-state p { margin-bottom: 18px; font-size: 14px; color: var(--text-muted); }

/* ── grid toolbar ─────────────────────────────────────────────── */
.grid-toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.grid-search {
  display: flex; align-items: center; flex: 1;
  min-width: 160px; max-width: 340px;
  background: var(--surface-2); border: 1px solid var(--border-dk);
  border-radius: var(--radius-sm); padding: 0 11px; gap: 8px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
.grid-search:focus-within { border-color: var(--green); box-shadow: var(--ring); background: var(--surface); }
.grid-search svg { width: 16px; height: 16px; color: var(--text-light); }
.grid-search input {
  border: none; background: transparent; outline: none;
  font: inherit; font-size: 14px; color: var(--text);
  width: 100%; padding: 8px 0;
}
.grid-search input::placeholder { color: var(--text-light); }
.toolbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
/* live match-count next to the grid filter box (e.g. "3 / 24") */
.grid-count { font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* column show/hide menu injected by the grid engine */
.gv-colwrap { position: relative; }
.gv-colmenu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; min-width: 190px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px; box-shadow: var(--shadow-lg); max-height: 300px; overflow: auto;
}
.gv-colmenu label {
  display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: var(--radius-sm);
  font-size: 13.5px; color: var(--text-500); cursor: pointer; white-space: nowrap;
}
.gv-colmenu label:hover { background: var(--surface-2); }
.gv-colmenu input { width: 15px; height: 15px; accent-color: var(--green); cursor: pointer; }
.toolbar-check { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.toolbar-check input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--green); cursor: pointer; }
.toolbar-check label { font-size: 13.5px; font-weight: 500; color: var(--text-500); cursor: pointer; }

/* ── filter bar ───────────────────────────────────────────────── */
.filter-bar {
  display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
  padding: 16px; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.filter-field { display: flex; flex-direction: column; gap: 6px; }
.filter-field.grow { flex: 1; min-width: 180px; }
.filter-field > label {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em;
}
.filter-field input[type=date], .filter-field select {
  border: 1px solid var(--border-dk); border-radius: var(--radius-sm);
  padding: 9px 12px; font-size: 14px; background: var(--surface);
  color: var(--text); outline: none; transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.filter-field input[type=date]:focus, .filter-field select:focus {
  border-color: var(--green); box-shadow: var(--ring);
}
.filter-bar .grid-search { margin: 0; max-width: none; background: var(--surface); }
.filter-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.filter-summary {
  padding: 11px 16px; font-size: 13px; color: var(--text-500);
  background: var(--green-lt); border-bottom: 1px solid var(--border);
}

/* ── license plate ────────────────────────────────────────────── */
.plate {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 5px 12px;
  background: linear-gradient(180deg, #fff 0%, #f1f4f8 100%);
  border: 1px solid var(--border-dk);
  border-radius: 5px;
  box-shadow: inset 0 1px 0 #fff, var(--shadow-xs);
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px; font-weight: 700; color: var(--ink);
  letter-spacing: .08em; text-transform: uppercase; line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.plate-state { display: block; font-size: 9px; font-weight: 700; color: var(--text-muted); margin-top: 2px; letter-spacing: .1em; }
.plate-empty { color: var(--text-light); font-style: italic; }

/* ── badges ───────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--radius-pill);
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  white-space: nowrap; border: 1px solid transparent;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge-ok   { background: #e9fbf3; color: #047857; border-color: #bbf0d9; }
.badge-warn { background: #fff5e6; color: #b45309; border-color: #fcdfac; }
.badge-bad  { background: #fef2f2; color: #b91c1c; border-color: #f6cfcf; }
.badge-gray { background: var(--surface-2); color: var(--text-500); border-color: var(--border-dk); }
.badge-blue { background: #eaf2ff; color: #1d4ed8; border-color: #c4d9ff; }

/* ── alerts ───────────────────────────────────────────────────── */
.alert {
  padding: 13px 16px; border-radius: var(--radius-sm);
  font-size: 14px; display: flex; align-items: flex-start;
  gap: 11px; margin-bottom: 18px; border: 1px solid transparent;
  border-left-width: 3px;
}
.alert svg { width: 19px; height: 19px; flex-shrink: 0; margin-top: 1px; }
.alert.ok   { background: #e9fbf3; color: #065f46; border-color: #bbf0d9; border-left-color: var(--green); }
.alert.bad  { background: #fef2f2; color: #991b1b; border-color: #f6cfcf; border-left-color: #ef4444; }
.alert.info { background: #eaf2ff; color: #1e40af; border-color: #c4d9ff; border-left-color: #3b82f6; }

/* ── pagination ───────────────────────────────────────────────── */
.pager {
  display: flex; align-items: center; gap: 5px;
  padding: 14px 16px; border-top: 1px solid var(--border);
  background: var(--surface);
}
.pager a, .pager span {
  min-width: 34px; padding: 6px 11px; border-radius: var(--radius-sm); font-size: 13px;
  border: 1px solid var(--border-dk); text-align: center;
  color: var(--text-500); transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
  background: var(--surface); font-variant-numeric: tabular-nums; font-weight: 500;
}
.pager a:hover { background: var(--surface-2); color: var(--text); border-color: #b9c2cf; }
.pager .current {
  background: var(--green-dk); color: #fff; border-color: var(--green-dk); font-weight: 700;
  box-shadow: 0 1px 3px rgba(5,150,105,.4);
}

/* ── auth pages ───────────────────────────────────────────────── */
.auth-bg {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(60% 50% at 50% -10%, rgba(16,185,129,.10), transparent 70%),
    var(--bg);
}
.auth-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px;
  width: 100%; max-width: 410px;
  box-shadow: var(--shadow-lg);
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.auth-brand img { height: 32px; }
.auth-brand-text .name { font-weight: 700; font-size: 16px; color: var(--text); letter-spacing: -0.02em; }
.auth-brand-text .sub {
  font-size: 10px; color: var(--green-dk); font-weight: 600;
  text-transform: uppercase; letter-spacing: .12em;
}
.auth-box h1 { font-size: 23px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.auth-box .lead { color: var(--text-muted); font-size: 14px; margin-bottom: 26px; }
.auth-links { text-align: center; margin-top: 24px; font-size: 13px; color: var(--text-muted); }
.auth-links a { color: var(--green-dk); font-weight: 600; }
.auth-links a:hover { text-decoration: underline; }

/* ── split sign-in (Login) ────────────────────────────────────── */
.auth-split {
  display: flex; width: 100%; max-width: 880px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: riseIn .4s var(--ease) both;
}
.auth-aside {
  position: relative; flex: 0 0 44%;
  padding: 40px 38px; color: #fff;
  background: linear-gradient(165deg, #0a0f1a 0%, #0f1b2d 55%, #0a2a22 150%);
  display: flex; flex-direction: column; overflow: hidden;
}
.auth-aside::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(58% 46% at 82% 8%, rgba(16,185,129,.30), transparent 60%),
    radial-gradient(50% 42% at 8% 96%, rgba(16,185,129,.16), transparent 60%);
}
.auth-aside > * { position: relative; z-index: 1; }
.a-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 46px; }
.a-brand img { height: 30px; filter: brightness(0) invert(1); }
.a-brand .name { font-weight: 700; font-size: 16px; letter-spacing: -0.02em; }
.a-brand .sub { font-size: 9.5px; font-weight: 700; color: var(--green); letter-spacing: .14em; text-transform: uppercase; }
.a-hero { flex: 1; }
.a-hero h2 { font-size: 27px; font-weight: 700; line-height: 1.22; letter-spacing: -0.025em; }
.a-hero p { color: rgba(255,255,255,.58); font-size: 14px; margin: 12px 0 30px; max-width: 30ch; }
.a-features { list-style: none; display: flex; flex-direction: column; gap: 15px; }
.a-features li { display: flex; align-items: center; gap: 12px; font-size: 13.5px; font-weight: 500; color: rgba(255,255,255,.84); }
.a-feat-ic {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  background: rgba(16,185,129,.16); border: 1px solid rgba(16,185,129,.28);
  display: flex; align-items: center; justify-content: center;
}
.a-feat-ic svg { width: 17px; height: 17px; color: #6ee7b7; }
.a-foot { font-size: 11.5px; color: rgba(255,255,255,.38); margin-top: 34px; }

.auth-main { flex: 1; padding: 48px 44px; min-width: 0; }
.auth-main h1 { font-size: 24px; font-weight: 700; margin-bottom: 8px; color: var(--text); letter-spacing: -0.02em; }
.auth-main .lead { color: var(--text-muted); font-size: 14px; margin-bottom: 26px; }
.auth-brand-compact { display: none; margin-bottom: 26px; }
.auth-brand-compact img { height: 30px; }

.btn-block { width: 100%; justify-content: center; font-size: 15px; padding: 11px; }

@media (max-width: 720px) {
  .auth-aside { display: none; }
  .auth-split { max-width: 430px; }
  .auth-main { padding: 38px 30px; }
  .auth-brand-compact { display: flex; align-items: center; gap: 12px; }
}

/* ── misc ─────────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.text-muted { color: var(--text-muted); }
.mt-4 { margin-top: 4px; }
.section-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted); margin-bottom: 12px;
}

/* ── pet gallery ──────────────────────────────────────────────── */
.pet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(224px, 1fr));
  gap: 18px;
}
.pet-card {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .2s var(--ease);
}
.pet-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--border-dk); }
.pet-photo {
  position: relative; height: 168px;
  background: linear-gradient(135deg, #eef2f7, #e3e9f1);
  overflow: hidden;
}
.pet-photo img { width: 100%; height: 100%; object-fit: contain; display: block; image-orientation: from-image; }
.pet-avatar {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 52px; color: #fff; letter-spacing: -0.02em;
  background: linear-gradient(140deg, hsl(var(--h,160) 55% 56%), hsl(calc(var(--h,160) + 26) 58% 42%));
  text-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.pet-type-chip {
  position: absolute; top: 12px; left: 12px;
  padding: 4px 10px; border-radius: var(--radius-pill);
  font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  background: rgba(10,15,26,.72); color: #fff; backdrop-filter: blur(6px);
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.pet-type-chip:empty { display: none; }
.pet-info { padding: 16px; }
.pet-name { font-size: 16.5px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.pet-meta { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.pet-notes {
  font-size: 13px; color: var(--text-500); margin-top: 12px;
  padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm);
  border-left: 3px solid var(--border-dk);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.pet-actions { display: flex; gap: 8px; margin-top: 16px; }

/* ── pet edit ─────────────────────────────────────────────────── */
.pet-edit-layout { display: flex; gap: 32px; align-items: flex-start; flex-wrap: wrap; }
.pet-edit-photo { width: 200px; flex-shrink: 0; }
.pet-edit-fields { flex: 1; min-width: 280px; }
.pet-photo-preview {
  width: 200px; height: 200px; border-radius: var(--radius-lg);
  overflow: hidden; margin-bottom: 14px;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  background: linear-gradient(135deg, #eef2f7, #e3e9f1);
}
.pet-photo-preview img { width: 100%; height: 100%; object-fit: contain; display: block; image-orientation: from-image; }
.pet-photo-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--text-light);
}
.pet-photo-placeholder svg { width: 50px; height: 50px; }
.pet-file {
  width: 100%; font-size: 13px;
  border: 1px dashed var(--border-dk); border-radius: var(--radius-sm);
  padding: 11px; background: var(--surface-2); cursor: pointer; color: var(--text-500);
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.pet-file:hover { border-color: var(--green); background: var(--green-lt); }
.pet-file::-webkit-file-upload-button {
  border: none; background: var(--green-dk); color: #fff;
  padding: 6px 13px; border-radius: var(--radius-sm); margin-right: 12px;
  font-weight: 600; cursor: pointer;
}

/* ── guest gate pass ──────────────────────────────────────────── */
.pass-actions { display: flex; gap: 10px; }
.pass-sheet { display: flex; justify-content: center; }
.pass-card {
  width: 100%; max-width: 640px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  overflow: hidden; -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.pass-head {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 22px; background: var(--navy); color: #fff;
}
.pass-logo { height: 30px; filter: brightness(0) invert(1); }
.pass-head-text { flex: 1; min-width: 0; }
.pass-community { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.pass-kicker { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--green); }
.pass-status {
  padding: 5px 12px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
.pass-status.ok  { background: rgba(16,185,129,.18); color: #6ee7b7; border: 1px solid rgba(16,185,129,.4); }
.pass-status.bad { background: rgba(239,68,68,.18); color: #fca5a5; border: 1px solid rgba(239,68,68,.4); }
.pass-status.soon{ background: rgba(245,158,11,.18); color: #fcd34d; border: 1px solid rgba(245,158,11,.4); }
.pass-body { display: flex; gap: 24px; padding: 24px; flex-wrap: wrap; align-items: flex-start; }
.pass-main { flex: 1; min-width: 230px; display: flex; flex-direction: column; gap: 16px; }
.pass-field label {
  display: block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-light); margin-bottom: 4px;
}
.pass-guest { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pass-company { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.pass-dest, .pass-valid { font-size: 15px; color: var(--text); font-weight: 500; }
.pass-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 20px; font-weight: 700; letter-spacing: .12em; color: var(--text); }
.pass-qr { flex-shrink: 0; text-align: center; }
.pass-qr #qr { width: 148px; height: 148px; }
.pass-qr svg { width: 148px; height: 148px; display: block; }
.pass-qr-cap { font-size: 10.5px; font-weight: 700; color: var(--text-muted); margin-top: 8px; text-transform: uppercase; letter-spacing: .05em; }
.pass-foot { padding: 12px 22px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 12px; color: var(--text-muted); text-align: center; }

/* ── pass verification page (public) ──────────────────────────── */
.verify-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 420px; overflow: hidden;
}
.verify-status { padding: 34px 28px 26px; text-align: center; color: #fff; }
.verify-status.ok   { background: linear-gradient(160deg, #10b981, #047857); }
.verify-status.warn { background: linear-gradient(160deg, #f59e0b, #b45309); }
.verify-status.bad  { background: linear-gradient(160deg, #ef4444, #b91c1c); }
.vicon { width: 54px; height: 54px; margin: 0 auto 12px; display: block; }
.verify-heading { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.verify-reason { font-size: 13.5px; opacity: .92; margin-top: 6px; }
.verify-details { padding: 22px 28px; }
.verify-name { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; text-align: center; }
.verify-meta { font-size: 12.5px; color: var(--text-muted); text-align: center; margin-top: 3px; text-transform: uppercase; letter-spacing: .04em; }
.verify-dl { margin-top: 20px; display: grid; grid-template-columns: auto 1fr; gap: 11px 16px; align-items: center; }
.verify-dl dt { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-light); }
.verify-dl dd { font-size: 14.5px; font-weight: 600; color: var(--text); text-align: right; }
.verify-foot { padding: 14px 28px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 12px; color: var(--text-muted); text-align: center; }

/* ── motion ───────────────────────────────────────────────────── */
@keyframes riseIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.stat-card, .card, .pet-card { animation: riseIn .35s var(--ease) both; }
.stat-card:nth-child(2) { animation-delay: .04s; }
.stat-card:nth-child(3) { animation-delay: .08s; }
.stat-card:nth-child(4) { animation-delay: .12s; }
.pet-card:nth-child(2) { animation-delay: .04s; }
.pet-card:nth-child(3) { animation-delay: .08s; }
.pet-card:nth-child(4) { animation-delay: .12s; }
.pet-card:nth-child(5) { animation-delay: .16s; }
.pet-card:nth-child(6) { animation-delay: .20s; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ── responsive ───────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .chart-row { grid-template-columns: 1fr; }
}

/* Sidebar collapses to a horizontal top bar */
@media (max-width: 880px) {
  .portal-shell { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: sticky; top: 0; z-index: 100;
    flex-direction: row; align-items: center; gap: 6px;
    border-right: none; border-bottom: 1px solid rgba(255,255,255,.08);
    padding: 0 12px;
  }
  .sidebar .brand { padding: 12px 8px; }
  .sidebar .brand > div { display: none; }
  .sidenav {
    flex-direction: row; display: flex; gap: 2px; padding: 8px 4px;
    overflow-x: auto; overflow-y: hidden; flex: 1;
  }
  .sidenav a { white-space: nowrap; margin-bottom: 0; }
  .sidenav a span { display: none; }
  .sidenav a svg { width: 20px; height: 20px; }
  .sidenav a.active::before { display: none; }
  .nav-group { display: none; }
  .side-foot { border-top: none; padding: 8px 10px; }
  .side-user { display: none; }
  /* keep the slim topbar for the language picker; the sidebar already has Profile/Sign out */
  .topbar { height: 48px; padding: 0 14px; }
  .topbar-brand, .topbar-sep, .topbar-btn { display: none; }
}
@media (max-width: 680px) {
  .stats-grid   { grid-template-columns: 1fr 1fr; gap: 12px; }
  .field-row    { flex-direction: column; gap: 0; }
  .main-content { padding: 22px 16px 48px; }
  .page-hd h1   { font-size: 22px; }
  .dash-clock   { display: none; }
  .topbar-addr  { display: none; }
  .auth-box     { padding: 32px 22px; }
  .grid-search  { max-width: none; }
  .filter-actions { margin-left: 0; width: 100%; }
  .pet-edit-photo { width: 100%; }
  .pet-photo-preview { width: 100%; height: 240px; }
  .stat-spark   { display: none; }
}
@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr; }
  .toolbar-right { width: 100%; }
}

/* ── printable reports ────────────────────────────────────────── */
.report-sheet { display: flex; justify-content: center; }
.report {
  width: 100%; max-width: 820px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); overflow: hidden;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.report-head { display: flex; align-items: center; gap: 14px; padding: 22px 24px; border-bottom: 2px solid var(--ink); }
.report-logo { height: 34px; }
.report-title { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.report-meta { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.report-spacer { flex: 1; }
.report-gen { font-size: 12px; color: var(--text-muted); text-align: right; white-space: nowrap; }
.report-filters { padding: 10px 24px; font-size: 12.5px; color: var(--text-500); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.report-foot { display: flex; justify-content: space-between; padding: 14px 24px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-muted); }

/* ── toasts ───────────────────────────────────────────────────── */
.toast-host {
  position: fixed; top: 70px; right: 20px; z-index: 1000;
  display: flex; flex-direction: column; gap: 10px; max-width: 360px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--green); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 12px 14px;
  font-size: 13.5px; font-weight: 500; color: var(--text);
  opacity: 0; transform: translateX(16px);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast.in { opacity: 1; transform: none; }
.toast-ok  { border-left-color: var(--green); }
.toast-bad { border-left-color: #ef4444; }
.toast-msg { flex: 1; }
.toast-x { background: none; border: none; color: var(--text-light); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; }
.toast-x:hover { color: var(--text); }

/* ── confirm modal ────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(10,15,26,.5); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; visibility: hidden; transition: opacity .18s var(--ease), visibility .18s;
}
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 400px; overflow: hidden;
  transform: translateY(8px) scale(.98); transition: transform .18s var(--ease);
}
.modal-backdrop.open .modal { transform: none; }
.modal-top { display: flex; gap: 14px; padding: 24px 24px 8px; }
.modal-ic {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #fef2f2; color: #dc2626;
}
.modal-ic svg { width: 22px; height: 22px; }
.modal-msg { font-size: 15px; font-weight: 600; color: var(--text); align-self: center; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px 20px; }
.btn.is-busy { opacity: .65; cursor: wait; }

/* ── print (gate pass) ────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .content-area { display: block; }
  .main-content { max-width: none; margin: 0; padding: 0; }
  body { background: #fff; }
  .pass-sheet { display: block; }
  .pass-card {
    max-width: none; box-shadow: none; border: 1px solid #cbd5e1;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .report-sheet { display: block; }
  .report { max-width: none; box-shadow: none; border: none; }
  table.gv tr { page-break-inside: avoid; }
}
@page { margin: 1.4cm; }

/* ================================================================
   Resident Portal — 2026 feature additions
   ================================================================ */

/* amber badge (used by announcements, packages, service, reservations) */
.badge-amber { background: #fff5e6; color: #b45309; border-color: #fcdfac; }

/* skip link (a11y) */
.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 2000;
  background: var(--surface); color: var(--text); padding: 10px 16px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
}
.skip-link:focus { left: 12px; }

/* topbar global search */
.topbar-search { position: relative; display: flex; align-items: center; }
.topbar-search svg { position: absolute; left: 10px; width: 16px; height: 16px; color: var(--text-light); pointer-events: none; }
.topbar-search input {
  width: 190px; max-width: 38vw; padding: 8px 12px 8px 32px; font-size: 13px;
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--surface-2); color: var(--text); transition: width .18s var(--ease), border-color .15s;
}
.topbar-search input:focus { width: 240px; border-color: var(--green); background: var(--surface); outline: none; }
@media (max-width: 860px) { .topbar-search { display: none; } }

/* nav badge counter */
.nav-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; border-radius: var(--radius-pill);
  background: #ef4444; color: #fff;
}

/* global search results */
.search-results { display: flex; flex-direction: column; gap: 2px; }
.search-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 10px;
  border-radius: var(--radius-sm); color: var(--text);
}
.search-row:hover { background: var(--surface-2); }
.search-ic {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--green-lt); color: var(--green-dk);
}
.search-ic svg { width: 19px; height: 19px; }
.search-ic.vehicle { background: #eaf2ff; color: #1d4ed8; }
.search-ic.pet { background: #f3eaff; color: #7c3aed; }
.search-ic.contact { background: #fff5e6; color: #b45309; }
.search-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.search-title { font-weight: 600; }
.search-sub { font-size: 12.5px; color: var(--text-muted); }
.search-go { width: 18px; height: 18px; color: var(--text-light); }

/* household summary (reuses .report .report-head .report-foot) */
.report-head-text { display: flex; flex-direction: column; }
.report-section { padding: 18px 24px; border-bottom: 1px solid var(--border); }
.report-section h2 { font-size: 15px; font-weight: 700; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.report-count { font-size: 12px; font-weight: 600; color: var(--text-muted); background: var(--surface-2); border-radius: var(--radius-pill); padding: 1px 9px; }
.report-empty { font-size: 13px; color: var(--text-muted); margin: 0; }
.report-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report-table th { text-align: left; font-weight: 600; color: var(--text-muted); padding: 6px 10px; border-bottom: 1px solid var(--border); }
.report-table td { padding: 7px 10px; border-bottom: 1px solid var(--surface-2); color: var(--text); }

/* dashboard alerts banner */
.dash-alert { flex-direction: column; align-items: stretch; }
.dash-alert-hd { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 4px; }
.dash-alert-hd svg { width: 18px; height: 18px; }
.dash-alert-list { margin: 0; padding-left: 26px; }
.dash-alert-list li { margin: 3px 0; }

/* dashboard "today at the gate" strip */
.today-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-xs); padding: 14px 18px; margin-bottom: 18px;
}
.today-hd { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.today-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-glow); }
.today-nums { display: flex; gap: 18px; }
.today-num { font-size: 13.5px; color: var(--text-500); }
.today-num b { font-size: 17px; color: var(--text); margin-right: 4px; }
.today-num.ok b { color: var(--green-dk); }
.today-num.bad b { color: #dc2626; }
.today-last { margin-left: auto; font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }

/* dashboard announcements widget */
.dash-announce-list { display: flex; flex-direction: column; }
.dash-announce { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--surface-2); color: var(--text); }
.dash-announce:last-child { border-bottom: none; }
.dash-announce-title { font-weight: 600; flex: 1; }
.dash-announce-date { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; }

/* announcements feed */
.announce.pinned { border-color: #fcdfac; }
.announce-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.announce-date { margin-left: auto; font-size: 12.5px; color: var(--text-muted); }
.announce-title { font-size: 18px; font-weight: 700; margin: 0 0 8px; }
.announce-body { color: var(--text-500); font-size: 14px; line-height: 1.6; }
.announce-body p { margin: 0 0 10px; }

/* documents list */
.doc-list { display: flex; flex-direction: column; }
.doc-item { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--surface-2); }
.doc-item:last-child { border-bottom: none; }
.doc-ic { width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--green-lt); color: var(--green-dk); }
.doc-ic svg { width: 20px; height: 20px; }
.doc-text { flex: 1; min-width: 0; }
.doc-title { font-weight: 600; }
.doc-desc { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

/* messages thread */
.msg-card { margin-bottom: 14px; }
.msg-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.msg-subject { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.msg-body { color: var(--text-500); font-size: 14px; line-height: 1.55; }
.msg-reply { margin-top: 12px; padding: 12px 14px; background: var(--green-lt); border-radius: var(--radius-sm); }
.msg-reply-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--green-dk); margin-bottom: 4px; }

/* bulk action bar (guests) */
.bulk-bar { display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-pill); }
.bulk-count { font-size: 12.5px; font-weight: 600; color: var(--text-500); padding: 0 4px; }
table.gv tbody tr.row-pending td { background-color: rgba(245,158,11,.07); }

/* account info grid (profile) */
.info-grid { display: flex; flex-wrap: wrap; gap: 26px; margin-bottom: 18px; }
.info-item { display: flex; flex-direction: column; gap: 2px; }
.info-label { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.info-value { font-size: 15px; font-weight: 600; color: var(--text); }

/* password tools (strength meter + show/hide) */
.pw-wrap { position: relative; display: block; }
.pw-eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-light); cursor: pointer; padding: 4px; line-height: 0; }
.pw-eye svg { width: 18px; height: 18px; }
.pw-eye.on, .pw-eye:hover { color: var(--text-500); }
.pw-meter { display: flex; gap: 4px; margin-top: 8px; }
.pw-meter span { height: 4px; flex: 1; border-radius: 2px; background: var(--border); transition: background .15s; }
.pw-meter.lvl-1 span:nth-child(-n+1) { background: #ef4444; }
.pw-meter.lvl-2 span:nth-child(-n+2) { background: #f59e0b; }
.pw-meter.lvl-3 span:nth-child(-n+3) { background: #3b82f6; }
.pw-meter.lvl-4 span:nth-child(-n+4) { background: var(--green); }
.pw-meter-cap { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; min-height: 14px; }

/* office resolution note on a resident's service request */
.resolution-note {
  margin-top: 8px; padding: 9px 11px; border-radius: var(--radius-sm);
  background: var(--green-lt); border: 1px solid transparent;
  display: flex; flex-direction: column; gap: 3px; max-width: 520px;
}
.resolution-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--green-dk);
}
.resolution-label svg { width: 13px; height: 13px; }
.resolution-text { font-size: 13px; color: var(--text-500); line-height: 1.5; }

/* ── help page ────────────────────────────────────────────────── */
.help-toc .card-body { padding-top: 6px; padding-bottom: 14px; }
.help-toc-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 18px;
}
.help-toc-list a {
  display: block; padding: 6px 8px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500; color: var(--text-500);
}
.help-toc-list a:hover { background: var(--surface-2); color: var(--green-dk); }

.help-section { margin-bottom: 12px; padding: 0; scroll-margin-top: 80px; }
.help-section > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; font-size: 16px; font-weight: 700; color: var(--text);
}
.help-section > summary::-webkit-details-marker { display: none; }
.help-section > summary::after {
  content: ''; margin-left: auto; width: 9px; height: 9px;
  border-right: 2px solid var(--text-light); border-bottom: 2px solid var(--text-light);
  transform: rotate(45deg); transition: transform .18s var(--ease);
}
.help-section[open] > summary::after { transform: rotate(-135deg); }
.help-section > summary:hover { color: var(--green-dk); }
.help-ic {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--green-lt); font-size: 17px; line-height: 1;
}
.help-body { padding: 0 20px 18px 66px; color: var(--text-500); font-size: 14px; line-height: 1.6; }
.help-body p { margin: 0 0 10px; }
.help-body ul { margin: 0 0 10px; padding-left: 18px; }
.help-body li { margin: 5px 0; }
.help-body strong { color: var(--text); }
.help-body em { font-style: normal; font-weight: 600; color: var(--text); }
.help-tip {
  margin-top: 12px; padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--green-lt); border-left: 3px solid var(--green);
  font-size: 13.5px; color: var(--text-500);
}
@media (max-width: 560px) { .help-body { padding-left: 20px; } }

/* ── dashboard personalization (Customize) ───────────────────── */
.dash-hd-right { display: flex; align-items: center; gap: 12px; }
/* Section bar carries the section title + the Customize action, grouped with the
   widgets it controls (instead of crowding the clock in the page header). */
.section-bar { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 14px; }
.section-title { font-size: 14px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin: 0; }
.dash-customize-btn { flex-shrink: 0; }
#dashCustomize.on { background: var(--green-lt); color: var(--green-dk); border-color: var(--green); }
.dash-editing [data-widget].w-edit {
  position: relative;
  outline: 2px dashed var(--border-dk); outline-offset: 3px; border-radius: var(--radius);
}
.dash-editing [data-widget].w-off { opacity: .4; }
.wctl { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; z-index: 6; }
.wctl-btn {
  width: 27px; height: 27px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-500);
  border-radius: 7px; cursor: pointer; box-shadow: var(--shadow-sm); padding: 0;
}
.wctl-btn:hover { color: var(--text); border-color: var(--border-dk); }
.wctl-eye { color: var(--green-dk); }

/* ── grid: client-side filter "no matches" row (auto-enhanced grids) ── */
td.gv-noresults { text-align: center; padding: 22px 16px; color: var(--text-light); font-style: italic; }

/* ================================================================
   Design upgrades — responsive cards · toasts
   ================================================================ */

/* ── data grids become stacked cards on phones ──────────────────
   Labels come from the column headers, stamped onto each <td> by portal.js. */
@media (max-width: 640px) {
  table.gv thead { display: none; }
  table.gv, table.gv tbody, table.gv tr, table.gv td { display: block; width: 100%; }
  table.gv tr {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    margin: 0 0 10px; padding: 4px 0; background: var(--surface);
  }
  table.gv td {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 9px 14px; border: none; text-align: right;
  }
  table.gv td::before {
    content: attr(data-label); font-weight: 600; color: var(--text-muted);
    text-align: left; flex-shrink: 0;
  }
  table.gv td:empty { display: none; }
  table.gv td.gv-noresults { justify-content: center; }
  table.gv td.gv-noresults::before { content: none; }
}

/* ── toast notifications ────────────────────────────────────────
   portal.js promotes transient .alert.ok / .alert.bad banners into these,
   and exposes window.Toast.show(message, 'ok'|'bad'|'info'). */
.toast-wrap {
  position: fixed; z-index: 3000; right: 18px; bottom: 18px;
  display: flex; flex-direction: column; gap: 10px;
  max-width: min(380px, calc(100vw - 36px)); pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-left: 4px solid var(--text-light);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  padding: 12px 14px; font-size: 14px; line-height: 1.4;
  opacity: 0; transform: translateY(12px); transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.toast.in { opacity: 1; transform: translateY(0); }
.toast-ok  { border-left-color: var(--green); }
.toast-bad { border-left-color: #ef4444; }
.toast-info{ border-left-color: #3b82f6; }
.toast-msg { flex: 1; }
.toast-x {
  background: none; border: none; cursor: pointer; font-size: 18px; line-height: 1;
  color: var(--text-light); padding: 0 2px; flex-shrink: 0;
}
.toast-x:hover { color: var(--text); }
@media (max-width: 480px) {
  .toast-wrap { left: 12px; right: 12px; bottom: 12px; max-width: none; }
}

/* ===================================================================
 * UX-ENHANCE LAYER (paired with ux-enhance.js) — a11y, touch, saving
 * feedback, inline validation, responsive tables. Additive only.
 * =================================================================== */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
    clip:rect(0,0,0,0);white-space:nowrap;border:0;}

#ux-bar{position:fixed;top:0;left:0;height:3px;width:0;z-index:5000;
    background:var(--green-dk,#059669);box-shadow:0 0 8px rgba(5,150,105,.6);opacity:1;transition:width .25s ease;}
#ux-bar.go{transition:width 9s cubic-bezier(.1,.7,.2,1);}
#ux-bar.done{width:100%!important;opacity:0;transition:width .2s ease,opacity .35s ease .15s;}

.ux-spin{display:inline-block;width:14px;height:14px;margin-right:7px;vertical-align:-2px;
    border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:ux-spin .6s linear infinite;}
@keyframes ux-spin{to{transform:rotate(360deg);}}
.btn.is-busy{opacity:.8;pointer-events:none;}

.field-error{color:#dc2626;font-size:12px;font-weight:600;margin-top:5px;}
.has-error{border-color:#dc2626!important;box-shadow:0 0 0 3px rgba(220,38,38,.12)!important;}

a:focus-visible,button:focus-visible,.btn:focus-visible,[tabindex]:focus-visible{
    outline:2px solid var(--green-dk,#059669);outline-offset:2px;border-radius:6px;}

@media (pointer:coarse){
    .btn{min-height:44px;}
    .btn-sm{min-height:38px;}
    input,select,textarea{min-height:44px;}
}

@media (prefers-reduced-motion: reduce){ #ux-bar,#ux-bar.go{transition:none;} .ux-spin{animation:none;} }

/* Responsive card collapse for data tables */
@media (max-width:760px){
    table.gv:not(.gv-noenhance) thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);}
    table.gv:not(.gv-noenhance) tbody tr{display:block;margin:0 0 12px;padding:4px 0;
        border:1px solid var(--line,#e5e7eb);border-radius:12px;background:var(--surface,#fff);}
    table.gv:not(.gv-noenhance) tbody td{display:flex;justify-content:space-between;gap:14px;align-items:center;
        padding:8px 14px;border:0;border-bottom:1px solid var(--line,#eee);text-align:right;}
    table.gv:not(.gv-noenhance) tbody tr td:last-child{border-bottom:0;}
    table.gv:not(.gv-noenhance) tbody td::before{content:attr(data-label);font-weight:600;font-size:11px;
        letter-spacing:.03em;text-transform:uppercase;color:var(--text-light,#9ca3af);text-align:left;flex:0 0 auto;}
    table.gv:not(.gv-noenhance) tbody td:not([data-label])::before{content:"";}
}

/* ---- usability.js (shared with admin) ---- */
.ux-spin{display:inline-block;width:13px;height:13px;margin-right:7px;vertical-align:-2px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:ux-spin .6s linear infinite;}
@keyframes ux-spin{to{transform:rotate(360deg);}}
.btn.is-busy{opacity:.8;pointer-events:none;}
[data-copy],.js-copy{cursor:copy;}
[data-copy]:hover,.js-copy:hover{text-decoration:underline dotted;text-underline-offset:2px;}
.copied{outline:2px solid var(--ok-600,#059669);outline-offset:1px;border-radius:4px;}
.ux-help-overlay{position:fixed;inset:0;background:rgba(15,23,42,.45);z-index:9000;display:grid;place-items:center;}
.ux-help-card{background:var(--surface,#fff);color:var(--text-900,#0f172a);border-radius:14px;padding:18px 20px;width:min(440px,92vw);box-shadow:var(--shadow-lg,0 16px 40px -8px rgba(15,23,42,.25));}
.ux-help-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;font-size:15px;}
.ux-help-head .ux-help-x{font-size:11px;color:#94a3b8;border:1px solid var(--line,#e6e8f0);border-radius:5px;padding:1px 6px;}
.ux-help-card table{width:100%;border-collapse:collapse;font-size:13.5px;}
.ux-help-card td{padding:6px 4px;border-bottom:1px solid var(--line,#e6e8f0);color:var(--text-700,#334155);}
.ux-help-card tr:last-child td{border-bottom:none;}
.ux-help-card td:first-child{white-space:nowrap;width:46%;}
.ux-help-foot{margin-top:10px;font-size:12.5px;color:#64748b;}
.skeleton{position:relative;overflow:hidden;background:var(--surface-2,#f1f5f9);border-radius:6px;color:transparent !important;}
.skeleton::after{content:'';position:absolute;inset:0;transform:translateX(-100%);background:linear-gradient(90deg,transparent,rgba(255,255,255,.5),transparent);animation:sk 1.2s infinite;}
@keyframes sk{to{transform:translateX(100%);}}
kbd{display:inline-block;font-family:inherit;font-size:11.5px;font-weight:700;background:#f1f5f9;border:1px solid #cbd5e1;border-bottom-width:2px;border-radius:6px;padding:1px 7px;color:#0f172a;}

/* ---- usability2.js (shared with admin) ---- */
.ux-tip{position:absolute;z-index:9500;max-width:320px;background:#0f172a;color:#fff;font-size:12.5px;line-height:1.4;padding:6px 10px;border-radius:8px;pointer-events:none;display:none;box-shadow:0 8px 24px -8px rgba(0,0,0,.5);}
.ux-lightbox{position:fixed;inset:0;z-index:9600;background:rgba(8,12,24,.92);display:grid;place-items:center;overflow:hidden;}
.ux-lightbox img{max-width:94vw;max-height:92vh;border-radius:8px;cursor:zoom-in;transition:transform .15s ease;}
.ux-lb-x{position:fixed;top:16px;right:20px;font-size:30px;line-height:1;background:none;border:none;color:#fff;cursor:pointer;opacity:.8;}
.ux-cc{font-size:11.5px;color:#94a3b8;text-align:right;margin-top:3px;}
.ux-cc.near{color:#b45309;font-weight:600;}
.ux-offline{position:fixed;left:0;right:0;top:0;z-index:9700;background:#b45309;color:#fff;font-size:13px;font-weight:600;text-align:center;padding:8px 14px;transform:translateY(-100%);transition:transform .25s ease;}
.ux-offline.show{transform:none;}
.ux-drop{position:relative;}
.ux-drop.over{outline:2px dashed var(--brand-500,#4f46e5);outline-offset:3px;border-radius:10px;}
.ux-drop-hint{font-size:12px;color:#94a3b8;margin-bottom:5px;}
.ux-drop-preview{display:flex;align-items:center;gap:9px;margin-top:8px;font-size:12.5px;color:#475569;}
.ux-drop-preview img{width:54px;height:54px;object-fit:cover;border-radius:8px;border:1px solid var(--line,#e6e8f0);}
.ux-sticky-actions{position:sticky;bottom:0;z-index:30;background:var(--surface,#fff);border-top:1px solid var(--line,#e6e8f0);box-shadow:0 -6px 16px -10px rgba(15,23,42,.25);padding:12px 4px;}
.skip-link{position:absolute;left:-9999px;top:0;z-index:9999;background:var(--green,#059669);color:#fff;padding:10px 16px;font-weight:700;}
.skip-link:focus{left:0;}

/* ── v4 additions: stat deltas · live search dropdown · grid density ───────── */

/* KPI trend deltas under the stat value */
/* Own line, above the sparkline; the link then wraps to its own line below it. */
.stat-delta{display:flex;width:fit-content;position:relative;z-index:1;align-items:center;gap:4px;margin-top:5px;font-size:11.5px;font-weight:700;letter-spacing:.01em;line-height:1;}
.stat-delta.up{color:var(--green-dk);}
.stat-delta.down{color:#dc2626;}
.stat-delta.flat{color:var(--text-light);font-weight:600;}

/* Live type-ahead dropdown anchored to the topbar search box */
.topbar-suggest{
  position:absolute;top:calc(100% + 8px);right:0;width:360px;max-width:78vw;max-height:62vh;overflow:auto;
  background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);
  box-shadow:var(--shadow-lg);padding:6px;z-index:1200;display:none;
}
.topbar-suggest.open{display:block;animation:suggIn .14s var(--ease);}
@keyframes suggIn{from{opacity:0;transform:translateY(-5px);}to{opacity:1;transform:none;}}
.topbar-suggest .search-row{cursor:pointer;}
.topbar-suggest .search-row.sel,.topbar-suggest .search-row:hover{background:var(--green-lt);}
.suggest-empty{padding:16px;text-align:center;color:var(--text-muted);font-size:13px;}
.suggest-loading{padding:4px;}
.suggest-loading .sk-row{display:flex;align-items:center;gap:12px;padding:11px 10px;}
.suggest-loading .sk-ic{width:34px;height:34px;border-radius:9px;flex-shrink:0;}
.suggest-loading .sk-ln{height:12px;flex:1;border-radius:6px;}

/* Compact row density (grid engine toggle), remembered per browser */
table.gv.gv-compact th{padding:3px 12px;}
table.gv.gv-compact td{padding:3px 12px;font-size:13px;}
.toolbar-right .btn.on{background:var(--green-lt);border-color:transparent;color:var(--green-dk);}
@media (prefers-reduced-motion: reduce){ *{animation-duration:.001ms !important;animation-iteration-count:1 !important;transition-duration:.001ms !important;} }
@media print{ .sidebar,.topbar,.nav,.btn,.no-print{display:none !important;} body{background:#fff !important;} .card,.panel{box-shadow:none !important;border:1px solid #ccc !important;} a{color:#000 !important;} thead{display:table-header-group;} *{-webkit-print-color-adjust:exact;print-color-adjust:exact;} }

/* ============================================================
   Collapsible icon-rail sidebar (mirrors the admin console).
   Collapsed = 64px fixed rail (its width reserved on the shell)
   that floats to full width on hover. Cookie-persisted via an
   early <head> script; #navToggle flips it.
   ============================================================ */
.sidebar { transition: width .18s var(--ease); }
#navToggle {
  position: absolute; top: 68px; right: -12px; z-index: 60;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border-dk);
  color: var(--text-500); display: grid; place-items: center; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: transform .18s, color .15s, border-color .15s;
}
#navToggle:hover { color: var(--green-dk); border-color: var(--green); transform: scale(1.08); }
#navToggle svg { width: 14px; height: 14px; transition: transform .2s; }
html.nav-collapsed #navToggle svg { transform: rotate(180deg); }

html.nav-collapsed .sidebar { position: fixed; left: 0; top: 0; height: 100vh; width: 64px; z-index: 60; }
html.nav-collapsed .portal-shell { padding-left: 64px; }
html.nav-collapsed .sidebar .brand .name,
html.nav-collapsed .sidebar .brand-sub,
html.nav-collapsed .nav-group,
html.nav-collapsed .side-user { display: none; }
html.nav-collapsed .sidebar .brand { justify-content: center; padding: 20px 0 18px; }
html.nav-collapsed .side-foot { justify-content: center; padding: 14px 0; }
html.nav-collapsed .sidenav { padding: 6px 8px 12px; }
html.nav-collapsed .sidenav a { justify-content: center; padding: 10px 0; gap: 0; font-size: 0; }
html.nav-collapsed .sidenav a.active::before { left: 0; }
html.nav-collapsed .sidenav a .nav-badge { display: none; }
html.nav-collapsed .sidenav a:has(.nav-badge)::after {
  content: ''; position: absolute; top: 6px; right: 12px; width: 7px; height: 7px;
  border-radius: 50%; background: #ef4444; border: 2px solid var(--navy);
}

html.nav-collapsed .sidebar:hover { width: var(--side-w); box-shadow: 10px 0 40px -10px rgba(2,6,23,.5); }
html.nav-collapsed .sidebar:hover .brand .name,
html.nav-collapsed .sidebar:hover .brand-sub,
html.nav-collapsed .sidebar:hover .nav-group,
html.nav-collapsed .sidebar:hover .side-user { display: block; }
html.nav-collapsed .sidebar:hover .brand { justify-content: flex-start; padding: 20px 20px 18px; }
html.nav-collapsed .sidebar:hover .side-foot { justify-content: flex-start; padding: 14px 16px; }
html.nav-collapsed .sidebar:hover .sidenav { padding: 6px 12px 12px; }
html.nav-collapsed .sidebar:hover .sidenav a { justify-content: flex-start; padding: 9px 12px; gap: 11px; font-size: 13.5px; }
html.nav-collapsed .sidebar:hover .sidenav a .nav-badge { display: inline-flex; }
html.nav-collapsed .sidebar:hover .sidenav a:has(.nav-badge)::after { display: none; }

/* Vehicle manufacturer logo (Vehicles list + address vehicle rows) */
.car-logo { height: 18px; width: auto; max-width: 32px; vertical-align: middle; margin-right: 6px; object-fit: contain; }
