/* VetCare UI — design system generated with ui-ux-pro-max (github.com/nextlevelbuilder/ui-ux-pro-max-skill):
   style "Minimalism & Swiss" (Medical Clinic profile), Veterinary teal palette, "Medical Clean" type (Figtree).
   Contrast-checked to WCAG AA. Self-hosted font + Lucide icon sprite: CSP stays 'self'. */

@font-face {
  font-family: "Figtree";
  src: url("fonts/figtree-latin-wght-normal.202cfb54d4e6.woff2") format("woff2-variations");
  font-weight: 300 900; font-style: normal; font-display: swap;
}

:root {
  /* color tokens */
  --color-primary: #0F766E; --color-primary-hover: #115E59; --color-on-primary: #fff;
  --color-primary-soft: #CCFBF1; --color-primary-tint: #F0FDFA;
  --color-accent: #C2410C; --color-accent-bright: #FB923C;
  --color-bg: #F5F7F7; --color-card: #fff; --color-fg: #0F172A; --color-fg-2: #334155; --color-muted: #526071;
  --color-border: #E2E8F0; --color-border-strong: #CBD5E1; --color-ring: #0F766E;
  --color-sidebar: #0B3A37; --color-sidebar-2: #1A4D49; --color-sidebar-fg: #CCE7E3; --color-sidebar-muted: #8FBDB7;
  --ok: #047857; --ok-bg: #ECFDF5; --warn: #92400E; --warn-bg: #FEF3C7; --err: #B91C1C; --err-bg: #FEF2F2; --info: #0369A1; --info-bg: #F0F9FF;
  /* type */
  --font: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* spacing (4pt) & shape */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --radius-sm: 8px; --radius: 12px; --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .10);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --sidebar-w: 248px; --bottom-nav-h: 64px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 16px/1.55 var(--font); background: var(--color-bg); color: var(--color-fg); -webkit-font-smoothing: antialiased; }
a { color: var(--color-primary); text-underline-offset: 3px; }
a:hover { color: var(--color-primary-hover); }
:focus-visible { outline: 2px solid var(--color-ring); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 0; z-index: 1000; background: var(--color-fg); color: #fff; padding: var(--s2) var(--s4); border-radius: var(--radius-sm); }
.skip:focus { left: var(--s2); top: var(--s2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }
.icon.sm { width: 16px; height: 16px; vertical-align: -3px; }
.icon.lg { width: 24px; height: 24px; }
h1, h2, h3 { font-weight: 650; line-height: 1.25; letter-spacing: -.015em; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(1.5rem, 1.25rem + 1vw, 1.875rem); }
h2 { font-size: 1.125rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 var(--s3); text-wrap: pretty; }
small, .muted { color: var(--color-muted); }
.num, td.num { font-variant-numeric: tabular-nums; text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- app shell: sidebar ≥1024px, bottom nav below ---------- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--color-sidebar); color: var(--color-sidebar-fg);
  display: flex; flex-direction: column; padding: var(--s5) var(--s3); z-index: 40; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; font-weight: 700; font-size: 1.25rem; letter-spacing: -.02em; padding: 0 var(--s2); }
.brand:hover { color: #fff; }
.brand img { width: 36px; height: 36px; }
.brand span b { color: var(--color-accent-bright); font-weight: 700; }
.nav-label { font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--color-sidebar-muted); margin: var(--s5) var(--s3) var(--s2); }
.side-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: var(--s3); min-height: 44px; padding: 0 var(--s3); border-radius: var(--radius-sm);
  color: var(--color-sidebar-fg); text-decoration: none; font-weight: 500; transition: background-color .15s var(--ease), color .15s var(--ease); }
.side-nav a:hover { background: var(--color-sidebar-2); color: #fff; }
.side-nav a[aria-current="page"] { background: var(--color-sidebar-2); color: #fff; box-shadow: inset 3px 0 0 var(--color-accent-bright); }
.side-nav a .count { margin-left: auto; font-size: .75rem; font-weight: 700; background: var(--color-accent-bright); color: #3B1704; border-radius: 999px; padding: 0 7px; line-height: 20px; }
.side-user { margin-top: auto; border-top: 1px solid rgba(255,255,255,.12); padding: var(--s4) var(--s2) 0; display: flex; align-items: center; gap: var(--s3); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font-weight: 700; font-size: .8rem;
  background: var(--color-primary-soft); color: var(--color-primary-hover); }
.side-user .avatar { background: var(--color-sidebar-2); color: #fff; }
.side-user .who { min-width: 0; flex: 1; line-height: 1.3; }
.side-user .who b { display: block; color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user .who small { color: var(--color-sidebar-muted); }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-sm); border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0; }
.side-user .icon-btn:hover { background: var(--color-sidebar-2); color: #fff; }

.shell { margin-left: var(--sidebar-w); min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(245, 247, 247, .92); backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--color-border); display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s6); min-height: 64px; }
.topbar .brand { display: none; color: var(--color-fg); }
.topbar .brand:hover { color: var(--color-fg); }
.topbar .brand span b { color: var(--color-accent); }
.global-search { position: relative; flex: 1; max-width: 420px; }
.global-search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--color-muted); pointer-events: none; }
.global-search input { padding-left: 40px; background: var(--color-card); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: var(--s2); }
.today-chip { color: var(--color-muted); font-size: .9rem; white-space: nowrap; }
main { width: 100%; max-width: 1280px; margin: 0 auto; padding: var(--s6) var(--s6) var(--s7); flex: 1; }
main:focus { outline: none; }

.more-menu { position: relative; display: none; }
.more-menu summary { list-style: none; }
.more-menu summary::-webkit-details-marker { display: none; }
.more-menu .menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--color-card); border: 1px solid var(--color-border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: var(--s2); z-index: 100; }
.more-menu .menu a, .more-menu .menu button { display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 44px; padding: 0 var(--s3); border-radius: var(--radius-sm);
  color: var(--color-fg); text-decoration: none; font: inherit; font-weight: 500; background: none; border: 0; cursor: pointer; }
.more-menu .menu a:hover, .more-menu .menu button:hover { background: var(--color-bg); }
.more-menu .menu hr { border: 0; border-top: 1px solid var(--color-border); margin: var(--s2) 0; }
.more-menu .menu .danger { color: var(--err); }

.bottom-nav { display: none; }

/* ---------- page header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); }
.page-head .eyebrow { margin-bottom: var(--s1); }
.page-head p.sub { margin: var(--s1) 0 0; color: var(--color-muted); }
.eyebrow { display: block; font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--color-muted); }
.crumbs { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; font-size: .875rem; color: var(--color-muted); margin-bottom: var(--s2); }
.crumbs a { color: var(--color-muted); text-decoration: none; }
.crumbs a:hover { color: var(--color-primary); text-decoration: underline; }
.actions-row { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* ---------- buttons ---------- */
.btn, button.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s4);
  border-radius: var(--radius-sm); border: 1px solid var(--color-border-strong); background: var(--color-card); color: var(--color-fg);
  font: 600 .9375rem/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease), transform .1s var(--ease); }
.btn:hover { background: var(--color-bg); color: var(--color-fg); border-color: var(--color-muted); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-on-primary); box-shadow: var(--shadow-sm); }
.btn.primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--color-primary); }
.btn.ghost:hover { background: var(--color-primary-tint); }
.btn.sm { min-height: 36px; padding: 0 var(--s3); font-size: .875rem; }
.btn[aria-busy="true"] { opacity: .7; cursor: progress; }
.btn.block { width: 100%; }

/* ---------- cards ---------- */
.card { background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--color-border); }
.card-head h2 { display: flex; align-items: center; gap: var(--s2); }
.card-head h2 .icon { color: var(--color-primary); }
.card-body { padding: var(--s5); }
.card + .card, .card + section, section + section, section + .card { margin-top: var(--s5); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--s5); align-items: start; }
.grid-2 > * { margin-top: 0 !important; }
.stack > * + * { margin-top: var(--s5); }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); margin-bottom: var(--s5); }
.kpi { display: flex; gap: var(--s4); align-items: center; padding: var(--s5); text-decoration: none; color: var(--color-fg);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
a.kpi:hover { border-color: var(--color-primary); box-shadow: var(--shadow-lg); color: var(--color-fg); }
.kpi-icon { width: 48px; height: 48px; border-radius: var(--radius); display: grid; place-items: center; flex: none; background: var(--color-primary-tint); color: var(--color-primary); }
.kpi-icon.warn { background: var(--warn-bg); color: var(--warn); }
.kpi-icon.info { background: var(--info-bg); color: var(--info); }
.kpi-icon.accent { background: #FFF7ED; color: var(--color-accent); }
.kpi .value { display: block; font-size: 1.75rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .label { display: block; font-size: .875rem; color: var(--color-muted); }
.kpi .meta { display: block; font-size: .8rem; font-weight: 600; color: var(--warn); margin-top: 2px; }

/* lists (schedule, vaccines, visits) */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: var(--s4); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--color-border); }
.list > li:last-child { border-bottom: 0; }
.list .main { flex: 1; min-width: 0; }
.list .title { font-weight: 600; color: var(--color-fg); text-decoration: none; }
.list a.title:hover { color: var(--color-primary); text-decoration: underline; }
.list .sub { display: block; font-size: .875rem; color: var(--color-muted); overflow-wrap: anywhere; }
.list .side { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; justify-content: flex-end; }
.time { width: 64px; flex: none; font-variant-numeric: tabular-nums; font-weight: 700; line-height: 1.2; }
.time small { display: block; font-weight: 500; font-size: .8rem; }
li.is-done .title, li.is-done .time { color: var(--color-muted); }
li.is-cancelled .title { text-decoration: line-through; color: var(--color-muted); }
.pet { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--color-primary-tint); color: var(--color-primary); }
.pet.lg { width: 72px; height: 72px; border-radius: var(--radius-lg); }
.pet.lg .icon { width: 36px; height: 36px; }

/* status pills: dot + text, never color alone */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; background: #F1F5F9; color: var(--color-fg-2); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.err { background: var(--err-bg); color: var(--err); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.brand { background: var(--color-primary-tint); color: var(--color-primary); }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--radius-sm); background: var(--color-bg); border: 1px solid var(--color-border); font-size: .85rem; color: var(--color-fg-2); }

/* empty states */
.empty { text-align: center; padding: var(--s6) var(--s5); color: var(--color-muted); }
.empty > .icon { width: 40px; height: 40px; color: var(--color-border-strong); margin-bottom: var(--s2); }
.empty p { margin: 0 0 var(--s3); }

/* definition lists */
dl.props { display: grid; grid-template-columns: max-content 1fr; gap: var(--s3) var(--s5); margin: 0; }
dl.props dt { color: var(--color-muted); font-size: .875rem; }
dl.props dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

/* ---------- tables ---------- */
.table-card { overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: var(--s3) var(--s5); border-bottom: 1px solid var(--color-border); vertical-align: middle; }
thead th { background: #F8FAFC; font-size: .75rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--color-muted); white-space: nowrap; }
tbody tr { transition: background-color .15s var(--ease); }
tbody tr:hover { background: #F8FAFC; }
tbody tr:last-child td { border-bottom: 0; }
td .cell { display: flex; align-items: center; gap: var(--s3); }
td .cell a { font-weight: 600; text-decoration: none; }
td .cell a:hover { text-decoration: underline; }
tfoot td, tfoot th { border-bottom: 0; padding-top: var(--s2); padding-bottom: var(--s2); }
tfoot tr.total th, tfoot tr.total td { font-size: 1.125rem; font-weight: 700; border-top: 1px solid var(--color-border); padding-top: var(--s4); }
th.num { text-align: right; }

/* ---------- forms ---------- */
.form-card { max-width: 760px; }
.form-card form > div, .line > div { margin-bottom: var(--s4); }
label { display: block; font-weight: 600; font-size: .875rem; margin-bottom: 6px; color: var(--color-fg); }
.required > label::after { content: " *"; color: var(--err); }
input, select, textarea { font: inherit; width: 100%; min-height: 44px; padding: 10px var(--s3); border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm);
  background: var(--color-card); color: var(--color-fg); transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
input:hover, select:hover, textarea:hover { border-color: var(--color-muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(15, 118, 110, .2); }
input[type=checkbox] { width: 20px; height: 20px; min-height: 0; accent-color: var(--color-primary); vertical-align: middle; margin: 0 var(--s2) 0 0; }
textarea { line-height: 1.5; min-height: 96px; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--err); }
.helptext { display: block; font-size: .8125rem; color: var(--color-muted); margin-top: 6px; }
.errorlist { list-style: none; margin: 6px 0 0; padding: 0; color: var(--err); font-size: .875rem; font-weight: 600; }
.error-summary { border: 1px solid #FECACA; background: var(--err-bg); color: var(--err); border-radius: var(--radius-sm); padding: var(--s3) var(--s4); margin-bottom: var(--s5); }
.error-summary h2 { font-size: 1rem; display: flex; gap: var(--s2); align-items: center; margin-bottom: var(--s1); }
.error-summary ul { margin: 0; padding-left: 1.75rem; }
.error-summary a { color: var(--err); font-weight: 600; }
fieldset { border: 1px solid var(--color-border); border-radius: var(--radius); margin: var(--s5) 0; padding: var(--s4) var(--s5); }
legend { font-weight: 650; padding: 0 var(--s2); }
.line { display: grid; grid-template-columns: 1fr; gap: 0 var(--s4); padding: var(--s3) 0; border-bottom: 1px dashed var(--color-border); }
.line:last-of-type { border-bottom: 0; }
@media (min-width: 768px) { .line { grid-template-columns: 3fr 1fr 1fr auto; align-items: end; } .line > div { margin-bottom: 0; } }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); padding-top: var(--s4); margin-top: var(--s2); border-top: 1px solid var(--color-border); }
.search-row { display: flex; gap: var(--s2); margin-bottom: var(--s4); max-width: 560px; }
.search-row .global-search { max-width: none; display: block; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 52px; }
.password-wrap .icon-btn { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); color: var(--color-muted); }
.password-wrap .icon-btn:hover { color: var(--color-fg); }

/* ---------- toasts / alerts ---------- */
.toasts { position: fixed; right: var(--s5); bottom: var(--s5); z-index: 200; display: grid; gap: var(--s2); max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--radius); background: var(--color-fg); color: #fff; box-shadow: var(--shadow-lg);
  animation: toast-in .25s var(--ease); }
.toast .icon { color: #6EE7B7; }
.toast.error .icon, .toast.warning .icon { color: #FCA5A5; }
.toast.hide { opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.alert { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--radius-sm); margin-bottom: var(--s5); font-weight: 500; }
.alert.err { background: var(--err-bg); color: var(--err); border: 1px solid #FECACA; }
.alert.warn { background: var(--warn-bg); color: var(--warn); border: 1px solid #FDE68A; }
.alert.info { background: var(--info-bg); color: var(--info); border: 1px solid #BAE6FD; }

/* ---------- patient profile ---------- */
.profile { display: flex; gap: var(--s5); align-items: center; padding: var(--s5); flex-wrap: wrap; }
.profile .who { flex: 1; min-width: 220px; }
.profile h1 { margin-bottom: var(--s2); }
.timeline { list-style: none; margin: 0; padding: var(--s2) var(--s5) var(--s4); }
.timeline li { position: relative; padding: var(--s3) 0 var(--s3) var(--s5); border-left: 2px solid var(--color-border); margin-left: 8px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 18px; width: 12px; height: 12px; border-radius: 50%; background: var(--color-card); border: 2px solid var(--color-primary); }
.timeline .when { font-size: .8125rem; color: var(--color-muted); }
.prose p:last-child { margin-bottom: 0; }

/* ---------- calendar ---------- */
.calendar { table-layout: fixed; }
.calendar th { text-align: center; padding: var(--s3) var(--s1); }
.calendar td { height: 116px; vertical-align: top; padding: var(--s2); border: 1px solid var(--color-border); background: var(--color-card); }
.calendar tbody tr:hover { background: transparent; }
.calendar td.other { background: #F8FAFC; }
.calendar td.other .day { color: #94A3B8; }
.calendar .day { display: inline-grid; place-items: center; min-width: 30px; height: 30px; border-radius: 50%; font-weight: 600; text-decoration: none; color: var(--color-fg); font-variant-numeric: tabular-nums; }
.calendar .day:hover { background: var(--color-primary-tint); color: var(--color-primary); }
.calendar td.today .day { background: var(--color-primary); color: #fff; }
.calendar ul { list-style: none; margin: var(--s1) 0 0; padding: 0; display: grid; gap: 3px; }
.calendar li { font-size: .78rem; padding: 2px 6px; border-radius: 6px; background: var(--color-primary-tint); color: var(--color-primary-hover); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.calendar li.more { background: transparent; color: var(--color-muted); }

/* ---------- landing / sign-in ---------- */
body.landing { background: var(--color-card); }
.auth { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); min-height: 100dvh; }
.auth-hero { position: relative; overflow: hidden; color: #fff; padding: var(--s7) clamp(32px, 6vw, 88px); display: flex; flex-direction: column;
  background: radial-gradient(900px 500px at 85% -10%, rgba(45, 212, 191, .30), transparent 60%),
              radial-gradient(700px 500px at -10% 110%, rgba(251, 146, 60, .22), transparent 60%),
              url("pattern.f293dc0300c6.svg"), var(--color-sidebar); }
.auth-hero .brand { padding: 0; font-size: 1.4rem; }
.auth-hero .brand img { width: 44px; height: 44px; }
.auth-hero .copy { margin: auto 0; max-width: 560px; padding: var(--s7) 0; }
.auth-hero .kicker { display: inline-flex; align-items: center; gap: var(--s2); font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: #99F6E4; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); padding: 6px 12px; border-radius: 999px; margin-bottom: var(--s5); }
.auth-hero h1 { font-size: clamp(2rem, 1.2rem + 2.8vw, 3.25rem); line-height: 1.1; letter-spacing: -.03em; font-weight: 700; margin-bottom: var(--s4); }
.auth-hero h1 em { font-style: normal; color: var(--color-accent-bright); }
.auth-hero .lede { font-size: 1.125rem; color: var(--color-sidebar-fg); max-width: 480px; margin-bottom: var(--s6); }
.features { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s4); }
.features li { display: flex; gap: var(--s3); align-items: flex-start; }
.features .f-icon { width: 40px; height: 40px; border-radius: var(--radius-sm); display: grid; place-items: center; flex: none; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); color: #99F6E4; }
.features b { display: block; color: #fff; font-weight: 600; }
.features span { color: var(--color-sidebar-muted); font-size: .9rem; }
.trust { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); color: var(--color-sidebar-muted); font-size: .85rem; border-top: 1px solid rgba(255,255,255,.12); padding-top: var(--s5); }
.trust span { display: inline-flex; align-items: center; gap: 6px; }
.trust .icon { color: #99F6E4; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: var(--s7) var(--s5); }
.auth-form .inner { width: 100%; max-width: 400px; }
.auth-form h2 { font-size: 1.75rem; letter-spacing: -.02em; margin-bottom: var(--s1); }
.auth-form .sub { color: var(--color-muted); margin-bottom: var(--s6); }
.auth-form .field { margin-bottom: var(--s4); }
.auth-form .foot { margin-top: var(--s5); font-size: .875rem; color: var(--color-muted); display: flex; gap: var(--s2); }

/* ---------- responsive (375 / 768 / 1024 / 1280) ---------- */
@media (max-width: 1279px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
  .sidebar { display: none; }
  .shell { margin-left: 0; }
  .topbar { padding: var(--s2) var(--s4); }
  .topbar .brand { display: flex; padding: 0; }
  .topbar .brand img { width: 32px; height: 32px; }
  .today-chip { display: none; }
  .more-menu { display: block; }
  main { padding: var(--s5) var(--s4) calc(var(--bottom-nav-h) + var(--s6)); }
  .bottom-nav { display: block; position: fixed; inset: auto 0 0 0; z-index: 40; background: var(--color-card); border-top: 1px solid var(--color-border);
    padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 16px rgba(15,23,42,.06); }
  .bottom-nav ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); height: var(--bottom-nav-h); }
  .bottom-nav a { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none;
    color: var(--color-muted); font-size: .7rem; font-weight: 600; }
  .bottom-nav a[aria-current="page"] { color: var(--color-primary); }
  .bottom-nav a[aria-current="page"] .icon { stroke-width: 2.4; }
  .grid-2 { grid-template-columns: 1fr; }
  .toasts { bottom: calc(var(--bottom-nav-h) + var(--s4)); }
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: var(--s5) var(--s5) var(--s6); }
  .auth-hero .copy { padding: var(--s6) 0 0; margin: 0; }
  .auth-hero .features, .auth-hero .trust { display: none; }
  .auth-hero .lede { margin-bottom: 0; }
}
@media (max-width: 767px) {
  .global-search { display: none; }
  .page-head { align-items: stretch; flex-direction: column; }
  .page-head .actions-row .btn { flex: 1; }
  .kpis { gap: var(--s3); }
  .kpi { padding: var(--s4); gap: var(--s3); flex-direction: column; align-items: flex-start; }
  .kpi-icon { width: 40px; height: 40px; }
  .card-head, .list > li { padding-left: var(--s4); padding-right: var(--s4); }
  .card-body { padding: var(--s4); }
  dl.props { grid-template-columns: 1fr; gap: 0; }
  dl.props dd { margin-bottom: var(--s3); }
  /* tables → stacked rows */
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--color-border); }
  table.stack td { border: 0; padding: 3px 0 3px 112px; position: relative; min-height: 28px; text-align: left; }
  table.stack td::before { content: attr(data-label); position: absolute; left: 0; top: 5px; width: 104px; font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--color-muted); }
  table.stack td:not([data-label]), table.stack td[data-label=""] { padding-left: 0; }
  table.stack td:not([data-label])::before, table.stack td[data-label=""]::before { content: none; }
  .calendar td { height: 56px; padding: 4px; text-align: center; }
  .calendar ul { display: none; }
  .calendar td.has-appts .day { box-shadow: inset 0 -3px 0 var(--color-accent-bright); }
  .calendar th { font-size: .65rem; letter-spacing: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  .sidebar, .topbar, .bottom-nav, .actions-row, .toasts, .skip { display: none !important; }
  .shell { margin: 0; }
  body { background: #fff; }
  .card { box-shadow: none; }
}
#status-filter { margin-bottom: var(--s4); }
details summary { cursor: pointer; color: var(--color-primary); font-weight: 600; }
pre { white-space: pre-wrap; font: .8rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; margin: var(--s2) 0 0; max-width: 520px; overflow-wrap: anywhere; }
.kpis > .card { margin-top: 0; }
.card { container-type: inline-size; }
.kpis > .card { container-type: normal; }
@container (max-width: 460px) {
  .list > li { flex-wrap: wrap; }
  .list .side { width: 100%; justify-content: flex-start; padding-left: 56px; }
  .list > li .time + .pet { display: none; }
  .list > li:has(.time) .side { padding-left: 80px; }
}
.auth-hero { background-size: auto, auto, 160px 160px, auto; }
.profile + .alert, .profile { margin-bottom: var(--s5); }
.profile + .alert { margin-top: calc(-1 * var(--s2)); }
.has-error { display: flex; flex-direction: column; }
.has-error > .errorlist { order: 3; }
.has-error > .helptext { order: 4; }

/* ---------- additions: grooming, inventory, files ---------- */
.mt { margin-top: var(--s4); }
img.pet { object-fit: cover; background: var(--color-primary-tint); }
.pill .icon { width: 14px; height: 14px; vertical-align: -2px; }
.pill:has(.icon)::before { display: none; }
.kpi .meta.brand { color: var(--color-primary); }
.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.filter-chips { margin-bottom: var(--s4); }
b.neg { color: var(--err); }
b.pos { color: var(--ok); }
/* checkbox groups (grooming services) */
.form-card div:has(> div > label > input[type=checkbox]) { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--s2); }
.form-card div > div > label:has(input[type=checkbox]) { display: flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s3);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); font-weight: 500; cursor: pointer; margin: 0; }
.form-card label:has(input[type=checkbox]:checked) { border-color: var(--color-primary); background: var(--color-primary-tint); }
.form-card label:has(input[type=checkbox]) input { margin: 0; }
input[type=file] { padding: var(--s3); border-style: dashed; background: var(--color-primary-tint); cursor: pointer; }
/* file gallery */
.file-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s4); }
.file { border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; background: var(--color-card); display: flex; flex-direction: column; }
.file-thumb { aspect-ratio: 4 / 3; display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; background: #F1F5F9; color: var(--color-muted);
  text-decoration: none; font-size: .75rem; font-weight: 700; letter-spacing: .05em; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-thumb:hover { color: var(--color-primary); }
.file-meta { padding: var(--s2) var(--s3) var(--s3); display: grid; gap: 2px; min-width: 0; }
.file-title { font-weight: 600; font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta small { font-size: .75rem; }
.file-notes { overflow-wrap: anywhere; }
.file-actions { display: flex; gap: 2px; margin-top: 2px; }
.file-actions form { margin: 0; }
.files-layout { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.card-head .chips { justify-content: flex-end; }
@media (max-width: 1023px) { .files-layout { grid-template-columns: 1fr; } .files-layout > :last-child { order: -1; } .kpis-3 { grid-template-columns: 1fr; } }
