:root {
  --bg: #f6f2ea;
  --paper: #fffdf8;
  --ink: #23302e;
  --muted: #6b7672;
  --line: #e2dbcd;
  --accent: #1f6f63;
  --accent-ink: #ffffff;
  --accent-soft: #e3f0ec;
  --warn: #b5651d;
  --warn-soft: #fbeedd;
  --bad: #b03a2e;
  --bad-soft: #f8e1de;
  --ok: #2f7d4a;
  --ok-soft: #e1f2e6;
  --radius: 10px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* ---------- header */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.9rem 1.5rem;
  background: var(--ink); color: #f3efe6;
}
.brand { display: flex; align-items: center; gap: 0.6rem; font-family: var(--serif); font-size: 1.25rem; letter-spacing: 0.01em; }
.brand-mark { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-size: 1rem; }
.topbar nav a { color: #cfd8d5; text-decoration: none; margin-left: 1.2rem; font-size: 0.95rem; }
.topbar nav a:hover, .topbar nav a[aria-current="page"] { color: #fff; }

main { max-width: 920px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
main.wide { max-width: 1200px; }

h1 { font-family: var(--serif); font-weight: 600; font-size: 2rem; margin: 0 0 0.25rem; }
h2 { font-family: var(--serif); font-weight: 600; font-size: 1.3rem; margin: 0 0 1rem; }
h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 1.2rem 0 0.6rem; }
.lede { color: var(--muted); margin: 0 0 2rem; }

/* ---------- cards & sections */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.card.step { position: relative; padding-top: 1.75rem; }
.step-num {
  position: absolute; top: -0.85rem; left: 1.25rem;
  background: var(--accent); color: var(--accent-ink);
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.2rem 0.6rem; border-radius: 99px;
}

/* ---------- form grid */
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(12, 1fr); }
.col-12 { grid-column: span 12; } .col-8 { grid-column: span 8; } .col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; } .col-3 { grid-column: span 3; } .col-2 { grid-column: span 2; }
@media (max-width: 700px) {
  .col-8, .col-6, .col-4, .col-3 { grid-column: span 12; }
  .col-2 { grid-column: span 6; }
}

.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field > label, .label { font-size: 0.85rem; font-weight: 600; color: #3d4a47; }
.req::after { content: " *"; color: var(--bad); }
.hint { font-size: 0.8rem; color: var(--muted); font-weight: 400; }

input[type=text], input[type=tel], input[type=email], input[type=date], input[type=number],
input[type=password], input[type=search], select, textarea {
  width: 100%;
  font: inherit; color: inherit;
  padding: 0.6rem 0.7rem;
  border: 1px solid #cfc6b5; border-radius: 8px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31,111,99,.15);
}
.invalid input, .invalid select, .invalid textarea, .invalid .sig-wrap { border-color: var(--bad); }
.error-msg { color: var(--bad); font-size: 0.8rem; min-height: 0; }

/* ---------- segmented / chip controls */
.seg { display: inline-flex; border: 1px solid #cfc6b5; border-radius: 8px; overflow: hidden; background: #fff; }
.seg label { padding: 0.5rem 1rem; cursor: pointer; font-size: 0.95rem; border-right: 1px solid #cfc6b5; user-select: none; }
.seg label:last-child { border-right: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--accent); color: var(--accent-ink); }
.seg label:has(input:focus-visible) { box-shadow: inset 0 0 0 2px var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.8rem; border: 1px solid #cfc6b5; border-radius: 99px; background: #fff; cursor: pointer; font-size: 0.92rem; user-select: none; }
.chip input { accent-color: var(--accent); margin: 0; }
.chip:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }

.check { display: flex; gap: 0.6rem; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 0.3rem; accent-color: var(--accent); width: 18px; height: 18px; }

.yn-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 0.5rem 0; }

/* ---------- release */
.release {
  max-height: 260px; overflow: auto;
  background: #faf6ee; border: 1px solid var(--line); border-radius: 8px;
  padding: 1rem 1.2rem; font-size: 0.92rem; color: #3a4542;
}
.release p { margin: 0 0 0.8rem; }

/* ---------- signature */
.sig-wrap { position: relative; border: 1px dashed #b9ae99; border-radius: 8px; background: #fff; touch-action: none; }
.sig-wrap canvas { display: block; width: 100%; height: 160px; cursor: crosshair; }
.sig-wrap .sig-line { position: absolute; left: 1rem; right: 1rem; bottom: 34px; border-bottom: 1px solid #d8d0c0; pointer-events: none; }
.sig-wrap .sig-x { position: absolute; left: 1rem; bottom: 36px; color: #b9ae99; pointer-events: none; font-family: var(--serif); }
.sig-actions { display: flex; justify-content: space-between; margin-top: 0.3rem; }
.sig-img { max-height: 60px; max-width: 200px; }

/* ---------- vaccine rows */
.vax-list { display: flex; flex-direction: column; gap: 0.5rem; }
.vax-row { display: flex; gap: 0.5rem; align-items: center; }
.vax-row input { max-width: 220px; }

/* ---------- buttons */
button, .btn {
  font: inherit; cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.65rem 1.2rem; border-radius: 8px; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-ink); font-weight: 600;
  text-decoration: none;
}
button:hover, .btn:hover { filter: brightness(1.08); }
button:disabled { opacity: .55; cursor: progress; }
.btn-ghost { background: transparent; color: var(--accent); border-color: transparent; padding: 0.3rem 0.5rem; font-weight: 500; }
.btn-outline { background: #fff; color: var(--ink); border-color: #cfc6b5; }
.btn-small { padding: 0.35rem 0.7rem; font-size: 0.85rem; }
.btn-danger { color: var(--bad); }
.actions { display: flex; justify-content: flex-end; gap: 0.75rem; align-items: center; margin-top: 1.5rem; }

/* ---------- alerts / badges */
.alert { padding: 0.8rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.95rem; }
.alert-bad { background: var(--bad-soft); color: #7d2a20; }
.alert-ok { background: var(--ok-soft); color: #1f5733; }
.alert-warn { background: var(--warn-soft); color: #7a4413; }

.badge { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 0.15rem 0.55rem; border-radius: 99px; white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-soon { background: var(--warn-soft); color: var(--warn); }
.badge-expired, .badge-missing { background: var(--bad-soft); color: var(--bad); }
.badge-neutral { background: #ece6da; color: #4d5754; }

/* ---------- success screen */
.success { text-align: center; padding: 3rem 1.5rem; }
.success .tick { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; font-size: 2rem; margin: 0 auto 1rem; }

/* ---------- groomer layout */
.split { display: grid; grid-template-columns: 340px 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.list { list-style: none; margin: 0; padding: 0; max-height: 70vh; overflow: auto; }
.list li button {
  width: 100%; text-align: left; background: none; color: var(--ink); font-weight: 400;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0.75rem 0.5rem;
  display: block;
}
.list li button:hover { background: #f4efe4; filter: none; }
.list li button[aria-selected="true"] { background: var(--accent-soft); }
.list .pname { font-weight: 600; }
.list .sub { font-size: 0.83rem; color: var(--muted); }

.kv { display: grid; grid-template-columns: 140px 1fr; gap: 0.35rem 1rem; font-size: 0.95rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 700px) { .two { grid-template-columns: 1fr; } }

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
td.num { text-align: right; white-space: nowrap; }
.empty { color: var(--muted); padding: 1.5rem 0; text-align: center; }

.login { max-width: 380px; margin: 4rem auto; }

.hidden { display: none !important; }
.row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

@media print {
  .topbar, .no-print, .split > aside { display: none !important; }
  body { background: #fff; }
  .split { display: block; }
  .card { border: 0; padding: 0; }
}

/* ---------- polish */
.field .seg { align-self: flex-start; }
a { color: var(--accent); }
.vax-status { display: grid; grid-template-columns: minmax(110px, auto) auto auto; gap: 0.4rem 0.75rem; align-items: center; justify-content: start; }
@media (max-width: 560px) {
  .topbar { padding: 0.75rem 1rem; }
  .brand { font-size: 1.05rem; white-space: nowrap; }
  .topbar nav a { margin-left: 0.8rem; font-size: 0.88rem; }
  h1 { font-size: 1.6rem; }
}

/* ---------- sign-in */
.signin-page { min-height: 100vh; display: grid; place-items: center; background:
  radial-gradient(1200px 600px at 10% -10%, #e3f0ec 0%, transparent 60%),
  radial-gradient(900px 500px at 110% 110%, #efe4d0 0%, transparent 60%), var(--bg); }
.signin { width: 100%; max-width: 400px; padding: 2rem 1.25rem; }
.signin-brand { text-align: center; margin-bottom: 1.5rem; }
.brand-mark.big { width: 56px; height: 56px; font-size: 1.6rem; margin: 0 auto 0.6rem; color: #fff; }
.signin-title { font-family: var(--serif); font-size: 1.7rem; font-weight: 600; }
.signin-card { padding: 1.75rem; box-shadow: 0 10px 30px rgba(35,48,46,.08); }
.signin-card h1 { font-size: 1.4rem; margin-bottom: 1.2rem; }
.signin-foot { text-align: center; margin-top: 1rem; }
.btn-block { width: 100%; justify-content: center; margin-top: 1.5rem; padding: 0.8rem; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 4.5rem; }
.pw-toggle { position: absolute; right: 0.35rem; top: 50%; transform: translateY(-50%); font-size: 0.85rem; }

/* ---------- nav user + home tiles */
a.brand { color: inherit; text-decoration: none; }
.topbar nav { display: flex; align-items: center; }
.who { margin-left: 1.2rem; padding-left: 1.2rem; border-left: 1px solid #45524f; color: #9fb0ab; font-size: 0.9rem; }
.who:empty { display: none; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.tile { display: flex; flex-direction: column; gap: 0.5rem; text-decoration: none; color: var(--ink); transition: transform .12s, box-shadow .12s, border-color .12s; margin: 0; }
.tile:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 8px 20px rgba(35,48,46,.08); }
.tile-icon { font-size: 2rem; }
.tile-title { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; }
@media (max-width: 560px) { .who { display: none; } }

/* ---------- home screen buttons */
.home-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; margin-top: 0.5rem; }
.home-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.75rem;
  min-height: 190px; padding: 1.5rem;
  background: var(--accent); color: #fff; text-decoration: none;
  border-radius: 16px; border: 0;
  box-shadow: 0 6px 0 #16514a, 0 12px 24px rgba(31,111,99,.25);
  transition: transform .08s, box-shadow .08s, filter .15s;
  -webkit-tap-highlight-color: transparent;
}
.home-btn-alt { background: #b5651d; box-shadow: 0 6px 0 #864a14, 0 12px 24px rgba(181,101,29,.25); }
.home-btn:hover { filter: brightness(1.07); }
.home-btn:active { transform: translateY(5px); box-shadow: 0 1px 0 #16514a, 0 4px 10px rgba(31,111,99,.25); }
.home-btn-alt:active { box-shadow: 0 1px 0 #864a14, 0 4px 10px rgba(181,101,29,.25); }
.home-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
.home-btn-icon { font-size: 3rem; line-height: 1; }
.home-btn-label { font-size: 1.5rem; font-weight: 700; letter-spacing: 0.01em; }
.topbar nav a { white-space: nowrap; }
@media (max-width: 420px) { .topbar nav a { margin-left: 0.6rem; font-size: 0.82rem; } .brand { font-size: 0.95rem; } }

/* ---------- nav (shared) */
@media (max-width: 760px) { .topbar nav .nav-link:not([href="/"]) { display: none; } }

/* ---------- home: four buttons */
.home-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .home-buttons { grid-template-columns: 1fr; } }
.home-btn-blue { background: #2f5d9e; box-shadow: 0 6px 0 #21426f, 0 12px 24px rgba(47,93,158,.25); }
.home-btn-blue:active { box-shadow: 0 1px 0 #21426f, 0 4px 10px rgba(47,93,158,.25); }
.home-btn-plum { background: #7a3e6e; box-shadow: 0 6px 0 #57294e, 0 12px 24px rgba(122,62,110,.25); }
.home-btn-plum:active { box-shadow: 0 1px 0 #57294e, 0 4px 10px rgba(122,62,110,.25); }
.home-btn .home-btn-sub { font-size: 0.95rem; opacity: .85; font-weight: 500; }

/* ---------- appointments */
.datebar { gap: 0.5rem; }
.datebar .seg label { padding: 0.35rem 0.8rem; font-size: 0.9rem; }
.appt-counts { margin-top: 0.6rem; }
.appt-day h3 { margin-top: 1.4rem; }
.appt { display: grid; grid-template-columns: 110px 1fr auto; gap: 1rem; padding: 0.9rem 0.25rem; border-bottom: 1px solid var(--line); align-items: start; }
.appt-time { display: flex; flex-direction: column; }
.appt-time strong { font-size: 1.05rem; }
.appt-body { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.appt-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: flex-end; max-width: 330px; }
.appt-done { opacity: .62; }
@media (max-width: 760px) {
  .appt { grid-template-columns: 1fr; gap: 0.4rem; }
  .appt-time { flex-direction: row; gap: 0.5rem; align-items: baseline; }
  .appt-actions { justify-content: flex-start; max-width: none; }
}
.picker { position: relative; }
.picker-list { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); list-style: none; margin: 0; padding: 0.25rem;
  background: #fff; border: 1px solid #cfc6b5; border-radius: 8px; box-shadow: 0 10px 24px rgba(0,0,0,.1); max-height: 320px; overflow: auto; }
.picker-list button { width: 100%; text-align: left; background: none; color: var(--ink); font-weight: 400; border-radius: 6px; padding: 0.5rem 0.6rem; display: block; }
.picker-list button:hover, .picker-list button:focus { background: var(--accent-soft); filter: none; outline: none; }

/* ---------- reports */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.stat .stat-label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.stat .stat-value { font-family: var(--serif); font-size: 1.9rem; font-weight: 600; line-height: 1.2; margin-top: 0.25rem; font-variant-numeric: tabular-nums; }
.stat .stat-sub { font-size: 0.82rem; color: var(--muted); }
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: 240px; overflow: visible; }
.chart-tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: 0.82rem; padding: 0.4rem 0.6rem; border-radius: 6px;
  transform: translate(-50%, calc(-100% - 8px)); white-space: nowrap; opacity: 0; transition: opacity .1s; }
.chart-tip.on { opacity: 1; }
.presets { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.presets button[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
@media print {
  .presets, #rangeForm, .report-actions { display: none !important; }
  .stat { break-inside: avoid; }
}

/* ---------- logo (from business card) */
img.brand-mark { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #fff; border: 2px solid #fff; display: block; box-shadow: 0 0 0 1px rgba(255,255,255,.15); }
img.brand-mark.big { width: 112px; height: 112px; border: 3px solid #fff; box-shadow: 0 6px 18px rgba(35,48,46,.15); margin: 0 auto 0.75rem; }
/* full business-card logo needs a bit more room */
img.brand-mark { width: 52px; height: 52px; }
img.brand-mark.big { width: 160px; height: 160px; }
.topbar { padding-top: 0.6rem; padding-bottom: 0.6rem; }
@media (max-width: 560px) { img.brand-mark { width: 44px; height: 44px; } }

/* ---------- left-hand button column (all signed-in pages) */
.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 0; align-items: start; }
.layout-main { min-width: 0; }
.layout-main > main { padding-top: 1.5rem; }
.sidebar {
  position: sticky; top: 0; align-self: start;
  display: flex; flex-direction: column; gap: 0.75rem;
  padding: 1.5rem 0 1.5rem 1.25rem; max-height: 100vh; overflow-y: auto;
}
.side-btn {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.85rem 1rem; border-radius: 12px;
  color: #fff; text-decoration: none; font-weight: 700; font-size: 1rem; line-height: 1.2;
  transition: transform .08s, box-shadow .08s, filter .15s;
  -webkit-tap-highlight-color: transparent;
}
.side-btn:hover { filter: brightness(1.08); }
.side-btn:active { transform: translateY(3px); }
.side-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.side-icon { font-size: 1.5rem; line-height: 1; flex: none; }
.side-home   { background: #3d4a47; box-shadow: 0 4px 0 #262f2d; color: #fff; }
.side-green  { background: var(--accent); box-shadow: 0 4px 0 #16514a; }
.side-orange { background: #b5651d; box-shadow: 0 4px 0 #864a14; }
.side-blue   { background: #2f5d9e; box-shadow: 0 4px 0 #21426f; }
.side-plum   { background: #7a3e6e; box-shadow: 0 4px 0 #57294e; }
.side-btn:active { box-shadow: 0 1px 0 rgba(0,0,0,.25); }
/* the page you're on: pressed-in look with a ring */
.side-btn[aria-current="page"] { transform: translateY(3px); box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px currentColor; }
.side-home[aria-current="page"]   { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px #3d4a47; }
.side-green[aria-current="page"]  { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--accent); }
.side-orange[aria-current="page"] { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px #b5651d; }
.side-blue[aria-current="page"]   { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px #2f5d9e; }
.side-plum[aria-current="page"]   { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px #7a3e6e; }

/* groomer page's own client list sits beside the column: give it a little less width */
.layout .split { grid-template-columns: 300px 1fr; }

/* tablets / phones: buttons become a row across the top */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky; top: 0; z-index: 10; flex-direction: row; overflow-x: auto; max-height: none;
    padding: 0.75rem 1rem; gap: 0.6rem; background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .side-btn { flex: 0 0 auto; padding: 0.6rem 0.9rem; font-size: 0.9rem; }
  .side-icon { font-size: 1.2rem; }
  .layout .split { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .side-label { display: none; }               /* icons only on phones */
  .side-btn { padding: 0.6rem 0.8rem; }
  .side-icon { font-size: 1.4rem; }
  .who { display: inline; }
}
@media print { .sidebar { display: none !important; } .layout { display: block; } }

/* ---------- configuration colour (slate) */
.home-btn-slate { background: #4a5568; box-shadow: 0 6px 0 #2f3746, 0 12px 24px rgba(74,85,104,.25); }
.home-btn-slate:active { box-shadow: 0 1px 0 #2f3746, 0 4px 10px rgba(74,85,104,.25); }
.side-slate { background: #4a5568; box-shadow: 0 4px 0 #2f3746; }
.side-slate[aria-current="page"] { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px #4a5568; }
.side-btn.hidden, .home-btn.hidden { display: none !important; }

/* ---------- configuration page */
.cfg-table td, .cfg-table th { vertical-align: middle; }
.cfg-table select, .cfg-table input { padding: 0.35rem 0.5rem; font-size: 0.9rem; }
.role-badge { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 0.15rem 0.55rem; border-radius: 99px; }
.role-admin { background: #e5e7eb; color: #374151; }
.role-manager { background: #f3e3ef; color: #7a3e6e; }
.role-groomer { background: var(--accent-soft); color: var(--accent); }
.loc-card { border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem; background: #fff; }
.loc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.staff-list { list-style: none; margin: 0.5rem 0; padding: 0; }
.staff-list li { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0; border-bottom: 1px dashed var(--line); }
.staff-list li:last-child { border-bottom: 0; }
.inline-form { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.inline-form select, .inline-form input { width: auto; flex: 1; min-width: 140px; }
.toast { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 0.7rem 1.1rem; border-radius: 8px; font-size: 0.92rem; box-shadow: 0 8px 24px rgba(0,0,0,.2); z-index: 50; }
.loc-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.loc-card > .row:first-child { flex-wrap: nowrap; }
.loc-card > .row:first-child strong { flex: 1; min-width: 0; }
.loc-card > .row:first-child .spacer { display: none; }

.btn-schedule { background: #2f5d9e; }
.role-register { background: #e8f0fb; color: #2f5d9e; }

/* ---------- vaccination records + viewer */
.vrec { margin-top: 1rem; padding-top: 0.75rem; border-top: 1px dashed var(--line); }
.vrec-head { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; justify-content: space-between; }
.vrec-list { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.vrec-list li { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.vrec-list li:last-child { border-bottom: 0; }
.vrec-name { font-weight: 600; word-break: break-all; }
.eye { margin-left: auto; background: #fff; color: var(--ink); border: 1px solid #cfc6b5; padding: 0.15rem 0.5rem; font-size: 1rem; line-height: 1.4; border-radius: 6px; font-weight: 400; }
.eye:hover { background: var(--accent-soft); border-color: var(--accent); filter: none; }
.viewer-bg { position: fixed; inset: 0; z-index: 80; background: rgba(20,28,36,.6); display: grid; place-items: center; padding: 1rem; }
.viewer { background: var(--paper); border-radius: 14px; width: min(980px, 100%); height: min(92vh, 1100px); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.viewer-bar { display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); background: #fff; }
.viewer-bar strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.viewer-body { flex: 1; min-height: 0; background: #e9ecef; display: grid; place-items: center; overflow: auto; }
.viewer-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.viewer-body img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
@media print { .viewer-bg { display: none !important; } }
.vrec-list li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.6rem; }
.vrec-list li.hint { display: block; }
.vrec-info { display: flex; flex-direction: column; min-width: 0; }
.vrec-info .hint { font-size: 0.8rem; }
.vrec-list .eye { margin-left: 0; }

/* ---------- pages stay hidden until sign-in (and role) is confirmed */
html:not(.auth-ok) body:not(.signin-page) main { visibility: hidden; }
