/* ==========================================================================
   SNOOT. — veterinary & grooming practice dashboard.
   Design category: LIGHT & WARM, but structured as operations software —
   KPI strip, appointment schedule, patient records, team roster, revenue.
   Fraunces + Nunito Sans on a cream ground with a coral accent.
   ========================================================================= */

:root {
  --cream: #fff8f2;
  --cream-2: #fdeee1;
  --peach: #ffe0cf;
  --paper: #ffffff;
  --coral: #ff6b4a;
  --coral-deep: #e85535;
  --sage: #7fa88b;
  --sage-soft: #e4efe6;
  --sun: #ffc46b;
  --slate: #5f7d9c;
  --slate-soft: #e7eef4;
  --ink: #2e2420;
  --body: #5c4f48;
  --muted: #9b8b81;
  --line: rgba(46, 36, 32, 0.1);
  --line-soft: rgba(46, 36, 32, 0.06);

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --ui: "Nunito Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-pill: 999px;

  --gutter: 22px;
  --max: 1320px;

  --sh-1: 0 2px 10px -6px rgba(46, 36, 32, 0.2);
  --sh-2: 0 18px 42px -22px rgba(46, 36, 32, 0.32);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 15.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid rgba(255, 107, 74, 0.42); outline-offset: 2px; border-radius: 8px; }
::selection { background: var(--peach); color: var(--ink); }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* -------------------------------------------------------------------- TYPE */
.display { font-family: var(--display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.06; margin: 0; }

.kicker {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--coral);
  margin: 0;
}

.small { font-size: 13px; color: var(--muted); }
.lede { font-size: 16px; line-height: 1.6; color: var(--body); margin: 0; }

/* ------------------------------------------------------------------ BUTTON */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--ui); font-weight: 800; font-size: 14.5px;
  padding: 12px 20px;
  border: 0; border-radius: var(--r-pill);
  cursor: pointer;
  transition: transform 180ms cubic-bezier(0.2, 1.2, 0.4, 1), background-color 180ms ease,
              box-shadow 200ms ease;
}

.btn:active { transform: scale(0.97); }
.btn--coral { background: var(--coral); color: #fff; box-shadow: 0 8px 20px -12px rgba(255, 107, 74, 0.9); }
.btn--coral:hover { background: var(--coral-deep); transform: translateY(-1px); }
.btn--ghost { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1.5px rgba(46, 36, 32, 0.22); transform: translateY(-1px); }
.btn--sm { padding: 8px 14px; font-size: 13px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }

/* ------------------------------------------------------------------ TOPBAR */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--cream) 88%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar__inner { display: flex; align-items: center; gap: 20px; padding-block: 13px; }

.logo { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 700; font-size: 23px; }

.logo__mark {
  width: 30px; height: 30px; border-radius: 10px;
  background: var(--coral); color: #fff;
  display: grid; place-items: center;
}

.clinic {
  display: flex; flex-direction: column; gap: 1px;
  padding-left: 20px; border-left: 1px solid var(--line);
  font-size: 12.5px; line-height: 1.3;
}
.clinic b { font-weight: 800; font-size: 13.5px; }
.clinic span { color: var(--muted); }

.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.shiftpill {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 700;
  background: var(--sage-soft); color: #3f5c49;
  padding: 7px 13px; border-radius: var(--r-pill);
}

.shiftpill i { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); display: block; }

/* -------------------------------------------------------------------- HERO */
.hero { padding-block: 26px 8px; }

.hero__card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: 0;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: linear-gradient(145deg, var(--peach) 0%, var(--cream-2) 62%, #f6f1e6 100%);
  box-shadow: var(--sh-1);
}

.hero__copy { padding: clamp(24px, 3.4vw, 44px); }

.hero h1 {
  font-family: var(--display);
  font-size: clamp(30px, 3.6vw, 50px);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 12px 0 0;
  max-width: 20ch;
}
.hero h1 em { font-style: italic; color: var(--coral); }
.hero .lede { margin-top: 14px; max-width: 46ch; }

.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

.hero__media { position: relative; min-height: 260px; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero__media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(253, 238, 225, 0.9) 0%, rgba(253, 238, 225, 0) 34%);
}

/* -------------------------------------------------------------------- KPIs */
.kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  padding-block: 22px 8px;
}

.kpi {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 4px;
  box-shadow: var(--sh-1);
}

.kpi__label {
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--muted);
}

.kpi__value { font-family: var(--display); font-size: 30px; font-weight: 600; line-height: 1.05; }

.kpi__delta { font-size: 12.5px; font-weight: 700; color: var(--sage); }
.kpi__delta--warn { color: var(--coral); }

/* ------------------------------------------------------------------ LAYOUT */
.main { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 22px; padding-block: 24px 34px; align-items: start; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  overflow: hidden;
}

.card + .card { margin-top: 22px; }

.card__head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-soft);
}

.card__head h2 { font-family: var(--display); font-size: 20px; font-weight: 600; margin: 0; }
.card__head .small { font-weight: 700; }

.card__body { padding: 8px 22px 18px; }

/* ------------------------------------------------------------- SCHEDULE */
.filters { display: flex; gap: 6px; }

.filter {
  font-size: 12px; font-weight: 800;
  padding: 6px 12px; border-radius: var(--r-pill);
  border: 1.5px solid var(--line);
  background: transparent; cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.filter:hover { border-color: var(--coral); color: var(--coral); }
.filter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--cream); }

.appt {
  display: grid;
  /* six cells: time, avatar, patient, service, staff, status */
  grid-template-columns: 54px 36px minmax(0, 1fr) 128px 106px auto;
  gap: 12px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  width: 100%;
  background: none; border-left: 0; border-right: 0; border-top: 0;
  cursor: pointer;
  transition: background-color 160ms ease;
}

.appt:last-child { border-bottom: 0; }
.appt:hover { background: rgba(46, 36, 32, 0.025); }

.appt__time { font-family: var(--display); font-size: 17px; font-weight: 600; }
.appt__time small { display: block; font-family: var(--ui); font-size: 11px; color: var(--muted); font-weight: 700; }

.appt__avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--cream-2); }

.appt__who b { display: block; font-size: 14.5px; font-weight: 800; }
.appt__who span { font-size: 12.5px; color: var(--muted); }

.appt__service { font-size: 13.5px; color: var(--body); }
.appt__staff { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

.ini {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--cream-2); color: var(--body);
  display: grid; place-items: center;
  font-size: 10px; font-weight: 800; flex: none;
}

/* status pills — filled, unmistakable */
.pill {
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase;
  padding: 6px 11px; border-radius: var(--r-pill);
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: block; }

.pill--booked { background: var(--slate-soft); color: #3f5f7d; }
.pill--checked { background: var(--sage-soft); color: #3f5c49; }
.pill--treatment { background: var(--peach); color: #a8381d; }
.pill--done { background: #efeae4; color: var(--muted); }
.pill--due { background: #fff0d4; color: #8a5a12; }

/* --------------------------------------------------------------- PATIENTS */
.patients { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.patient {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
  text-align: left;
  cursor: pointer;
  transition: transform 200ms cubic-bezier(0.2, 1.2, 0.4, 1), box-shadow 200ms ease, border-color 200ms ease;
}

.patient:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: rgba(255, 107, 74, 0.4); }

.patient img { width: 54px; height: 54px; border-radius: 14px; object-fit: cover; }
.patient b { display: block; font-size: 15px; font-weight: 800; }
.patient span { display: block; font-size: 12.5px; color: var(--muted); }
.patient__flag { margin-top: 5px; }

/* ------------------------------------------------------------------ TEAM */
.staffrow {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}
.staffrow:last-child { border-bottom: 0; }

.staffrow .ini { width: 40px; height: 40px; font-size: 13px; background: var(--peach); color: #a8381d; }
.staffrow b { display: block; font-size: 14px; font-weight: 800; }
.staffrow span { font-size: 12.5px; color: var(--muted); }
.staffrow__load { text-align: right; font-size: 12.5px; font-weight: 800; color: var(--body); }
.staffrow__load small { display: block; font-weight: 700; color: var(--muted); }

.loadbar { height: 5px; border-radius: 3px; background: var(--line-soft); margin-top: 5px; overflow: hidden; }
.loadbar span { display: block; height: 100%; width: 0; background: var(--coral); border-radius: 3px; transition: width 900ms cubic-bezier(0.2, 0.9, 0.3, 1); }

/* --------------------------------------------------------------- REVENUE */
.revbars { display: grid; gap: 10px; padding-top: 4px; }

.revrow { display: grid; grid-template-columns: 34px minmax(0, 1fr) 62px; gap: 12px; align-items: center; font-size: 12.5px; }
.revrow small { text-align: right; font-weight: 800; color: var(--body); }

.bar { height: 8px; border-radius: 4px; background: var(--line-soft); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, var(--sun), var(--coral)); transition: width 900ms cubic-bezier(0.2, 0.9, 0.3, 1); }
.revrow--today .bar span { background: linear-gradient(90deg, var(--coral), var(--coral-deep)); }

.split { display: grid; gap: 9px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.splitrow { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.splitrow i { width: 9px; height: 9px; border-radius: 3px; display: block; flex: none; }
.splitrow b { margin-left: auto; font-weight: 800; }

/* --------------------------------------------------------------- ALERTS */
.alert {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px;
  align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line-soft);
}
.alert:last-child { border-bottom: 0; }

.alert__icon {
  width: 34px; height: 34px; border-radius: 11px;
  display: grid; place-items: center;
  background: #fff0d4; color: #8a5a12;
}
.alert--coral .alert__icon { background: var(--peach); color: #a8381d; }
.alert--sage .alert__icon { background: var(--sage-soft); color: #3f5c49; }
.alert b { display: block; font-size: 14px; font-weight: 800; }
.alert span { font-size: 12.5px; color: var(--muted); }

/* ------------------------------------------------------------------ MODAL */
.modal { position: fixed; inset: 0; z-index: 70; display: none; }
.modal[data-open="true"] { display: block; }

.modal__scrim { position: absolute; inset: 0; background: rgba(46, 36, 32, 0.44); backdrop-filter: blur(4px); animation: fade 200ms ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal__panel {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 28px));
  max-height: 88vh; overflow-y: auto;
  background: var(--paper);
  border-radius: var(--r-lg);
  box-shadow: 0 40px 90px -34px rgba(46, 36, 32, 0.55);
  animation: bloom 260ms cubic-bezier(0.2, 1.3, 0.4, 1);
}
@keyframes bloom {
  from { opacity: 0; transform: translate(-50%, -48%) scale(0.96); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.modal__top { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 18px; padding: 24px 24px 18px; align-items: center; }
.modal__top img { width: 84px; height: 84px; border-radius: 20px; object-fit: cover; }
.modal__top h3 { font-family: var(--display); font-size: 26px; font-weight: 600; margin: 0 0 4px; }
.modal__top p { margin: 0; font-size: 13.5px; color: var(--muted); }

.record { padding: 0 24px 8px; }

.reclabel { font-size: 10.5px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }

.recgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.recitem { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px 13px; }
.recitem b { display: block; font-size: 15px; font-weight: 800; }
.recitem span { font-size: 12px; color: var(--muted); }

.reclist { display: grid; gap: 0; }
.recline { display: flex; align-items: baseline; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: 13.5px; }
.recline time { font-weight: 800; color: var(--body); min-width: 74px; }
.recline span { color: var(--muted); margin-left: auto; }

.modal__foot { display: flex; gap: 10px; padding: 18px 24px 24px; }

/* ------------------------------------------------------------------ TOAST */
.toast {
  position: fixed; left: 50%; bottom: 26px;
  transform: translate(-50%, 16px) scale(0.96);
  z-index: 90;
  background: var(--ink); color: var(--cream);
  font-weight: 800; font-size: 14px;
  padding: 13px 22px; border-radius: var(--r-pill);
  box-shadow: 0 22px 46px -22px rgba(46, 36, 32, 0.7);
  opacity: 0; pointer-events: none;
  transition: opacity 200ms ease, transform 260ms cubic-bezier(0.2, 1.3, 0.4, 1);
}
.toast[data-show="true"] { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* ------------------------------------------------------------------ FOOTER */
.foot { border-top: 1px solid var(--line); padding-block: 26px 40px; }
.foot__row { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; font-size: 12.5px; color: var(--muted); }

/* ----------------------------------------------------------------- REVEAL */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 620ms ease, transform 620ms cubic-bezier(0.2, 1, 0.3, 1); }
.reveal[data-shown="true"] { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* -------------------------------------------------------------- RESPONSIVE */
@media (max-width: 1120px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .main { grid-template-columns: 1fr; }
  .hero__card { grid-template-columns: 1fr; }
  .hero__media { min-height: 200px; order: -1; }
  .hero__media::after { background: linear-gradient(180deg, rgba(253, 238, 225, 0) 40%, rgba(253, 238, 225, 0.95) 100%); }
}

@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .clinic { display: none; }
  .patients { grid-template-columns: 1fr; }
  .appt {
    grid-template-columns: 50px 36px minmax(0, 1fr);
    row-gap: 6px;
    align-items: start;
  }
  .appt__time, .appt__avatar { grid-row: 1 / span 3; }
  .appt__avatar { align-self: center; }
  .appt__who { grid-column: 3; grid-row: 1; }
  .appt__service { grid-column: 3; grid-row: 2; }
  .appt__staff { grid-column: 3; grid-row: 3; }
  .appt .pill { grid-column: 3; grid-row: 4; justify-self: start; }
  .recgrid { grid-template-columns: 1fr; }
  .foot__row { flex-direction: column; gap: 8px; }
}
