* {
  box-sizing: border-box;
}

:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-soft: #eef2f3;
  --text: #172026;
  --muted: #65737d;
  --line: #dde4e7;
  --primary: #263c45;
  --primary-soft: #e2eaed;
  --danger-soft: #fff1ed;
  --danger: #9d3e2b;
  --success-soft: #eaf8ee;
  --success: #2e6b3f;
  --radius: 18px;
  --shadow: 0 8px 28px rgba(33, 49, 58, .07);
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  padding-bottom: 90px;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  padding: 13px 20px;
}

.brand {
  width: min(1120px, 100%);
  margin: auto;
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  font-size: 29px;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.page {
  width: min(1120px, calc(100% - 30px));
  margin: 0 auto;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 22px;
  padding: 42px 0 24px;
}

.hero.compact {
  padding-top: 30px;
}

.hero h1,
.pet-hero h1 {
  margin: 4px 0 5px;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.05;
}

.hero p,
.pet-title p {
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: .11em;
  color: #71858f;
  font-size: 11px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 17px;
}

.stat strong {
  display: block;
  font-size: 25px;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
}

.section {
  margin: 28px 0;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 15px;
}

h2 {
  margin: 4px 0 13px;
  font-size: 22px;
}

h3 {
  margin: 0;
}

.appointment-list {
  display: grid;
  gap: 12px;
}

.appointment-card {
  display: grid;
  grid-template-columns: 85px 1fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.appointment-time {
  background: var(--primary);
  color: #fff;
  padding: 20px 15px;
  font-weight: 900;
  font-size: 16px;
}

.appointment-main {
  padding: 18px;
}

.appointment-main h3 {
  font-size: 21px;
}

.appointment-main p {
  margin: 4px 0;
  color: var(--muted);
}

.meta {
  color: var(--muted);
  font-size: 13px;
  margin-top: 7px;
}

.warning {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 14px;
}

.button {
  border: 0;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 15px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.button.primary {
  background: var(--primary);
  color: white;
}

.button.soft {
  background: var(--primary-soft);
  color: var(--primary);
}

.button.tiny {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 12px;
}

.large-button {
  width: 100%;
  min-height: 52px;
  font-size: 16px;
}

.grid.two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin: 20px 0;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 21px;
  box-shadow: var(--shadow);
}

.form {
  display: grid;
  gap: 14px;
}

.form label {
  color: #4a5a63;
  font-size: 13px;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 6px;
  border: 1px solid #cfdadd;
  background: white;
  border-radius: 11px;
  padding: 12px 13px;
  min-height: 45px;
  color: var(--text);
  font: inherit;
}

textarea {
  resize: vertical;
  min-height: 92px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #aac0c9;
  border-color: transparent;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.span-two {
  grid-column: 1 / -1;
}

.list {
  display: grid;
}

.list-row,
.booking-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.list-row:last-child,
.booking-row:last-child {
  border-bottom: 0;
}

.list-row strong,
.list-row small,
.booking-row strong,
.booking-row small {
  display: block;
}

.list-row small,
.booking-row small {
  color: var(--muted);
  margin-top: 3px;
}

.pet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 14px;
}

.pet-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.pet-card p {
  color: var(--muted);
  margin: 4px 0;
}

.pet-avatar {
  background: #edf2f3;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 27px;
  flex: 0 0 auto;
}

.pet-avatar.large {
  width: 72px;
  height: 72px;
  font-size: 38px;
}

.pet-hero {
  display: flex;
  align-items: center;
  gap: 17px;
  padding: 31px 0 20px;
}

.pet-title {
  flex: 1;
}

.safety-banner {
  background: var(--danger-soft);
  color: var(--danger);
  padding: 15px 17px;
  border: 1px solid #f3d0c8;
  border-radius: 14px;
  margin-bottom: 18px;
}

.safety-banner strong {
  display: block;
  margin-bottom: 3px;
}

.detail-list > div {
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
}

.detail-list span,
.detail-list strong {
  display: block;
}

.detail-list span {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 3px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.photo-card {
  overflow: hidden;
  border-radius: 15px;
  background: white;
  border: 1px solid var(--line);
}

.photo-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.photo-label {
  padding: 10px;
  font-size: 12px;
  color: var(--muted);
}

.timeline {
  display: grid;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 8px;
  padding: 0 0 20px;
}

.timeline-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 6px;
}

.timeline-item strong,
.timeline-item span {
  display: block;
}

.timeline-item span {
  color: var(--muted);
  margin-top: 2px;
}

.timeline-item p {
  margin: 7px 0 0;
}

.status {
  border-radius: 100px;
  padding: 5px 9px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  text-transform: capitalize;
  white-space: nowrap;
}

.status.completed,
.status.ready {
  background: var(--success-soft);
  color: var(--success);
}

.status.cancelled,
.status.no_show {
  background: var(--danger-soft);
  color: var(--danger);
}

.booking-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.empty {
  text-align: center;
  background: white;
  border: 1px dashed #c9d4d8;
  border-radius: var(--radius);
  padding: 45px 20px;
}

.empty.small {
  padding: 24px;
}

.empty-icon {
  font-size: 45px;
}

.empty h3 {
  margin: 8px 0 4px;
}

.empty p,
.muted {
  color: var(--muted);
}

.info-box,
.private-note {
  background: var(--surface-soft);
  padding: 15px;
  border-radius: 13px;
  margin: 10px 0 20px;
}

.note-text {
  font-size: 17px;
  line-height: 1.6;
}

.flash-stack {
  margin-top: 15px;
}

.flash {
  padding: 12px 15px;
  border-radius: 11px;
  background: var(--surface-soft);
}

.flash.success {
  background: var(--success-soft);
  color: var(--success);
}

.flash.error {
  background: var(--danger-soft);
  color: var(--danger);
}

.bottom-nav {
  display: none;
}

@media (max-width: 720px) {
  body {
    padding-bottom: 88px;
  }

  .topbar {
    padding: 11px 15px;
  }

  .page {
    width: min(100% - 22px, 1120px);
  }

  .hero {
    align-items: flex-start;
    padding-top: 25px;
  }

  .hero h1,
  .pet-hero h1 {
    font-size: 31px;
  }

  .hero > .button {
    flex: 0 0 auto;
  }

  .stats {
    gap: 7px;
  }

  .stat {
    padding: 13px;
  }

  .stat strong {
    font-size: 21px;
  }

  .grid.two {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .appointment-card {
    grid-template-columns: 67px 1fr;
  }

  .appointment-time {
    padding: 18px 10px;
    font-size: 14px;
  }

  .appointment-main {
    padding: 15px;
  }

  .panel {
    padding: 17px;
  }

  .pet-hero {
    align-items: center;
  }

  .pet-avatar.large {
    width: 60px;
    height: 60px;
    font-size: 30px;
  }

  .booking-row {
    align-items: flex-start;
  }

  .booking-actions {
    flex-direction: column;
    align-items: flex-end;
  }

  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: rgba(255,255,255,.97);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .bottom-nav a {
    min-height: 66px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #55656d;
    font-size: 10px;
    font-weight: 800;
  }

  .bottom-nav span {
    font-size: 20px;
    line-height: 1;
  }
}

/* Pawsh Puppies client portal */

.client-body {
  background: #f7f6f2;
}

.client-topbar {
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
  padding: 13px 18px;
}

.client-page {
  width: min(820px, calc(100% - 26px));
  margin: auto;
}

.client-welcome {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 38px 0 23px;
}

.client-welcome h1,
.client-pet-hero h1 {
  font-size: clamp(31px, 7vw, 44px);
  margin: 4px 0 6px;
}

.client-welcome p,
.client-pet-hero p {
  margin: 0;
  color: var(--muted);
}

.client-pet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.client-pet-card {
  display: block;
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.client-pet-photo,
.client-pet-placeholder {
  width: 100%;
  aspect-ratio: 16 / 10;
}

.client-pet-photo {
  object-fit: cover;
  display: block;
}

.client-pet-placeholder {
  display: grid;
  place-items: center;
  background: #edf1ef;
  font-size: 64px;
}

.client-pet-content {
  padding: 15px 17px 17px;
}

.client-pet-content h3 {
  font-size: 22px;
}

.client-pet-content p {
  margin: 4px 0 12px;
  color: var(--muted);
}

.client-pet-content span {
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.client-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0;
}

.client-pet-hero {
  padding: 28px 0 20px;
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--muted);
  font-weight: 700;
}

.photo-drop {
  position: relative;
  display: grid !important;
  place-items: center;
  text-align: center;
  min-height: 155px;
  border: 2px dashed #bdcbd0;
  border-radius: 16px;
  background: #f8faf9;
  padding: 20px;
  cursor: pointer;
}

.photo-drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.photo-drop-icon {
  font-size: 38px;
}

.photo-drop strong,
.photo-drop small {
  display: block;
}

.photo-drop small {
  color: var(--muted);
  margin-top: 4px;
}

.sms-choice {
  display: grid;
  gap: 12px;
}

.toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: var(--surface-soft);
  border-radius: 13px;
}

.toggle-row input {
  width: 22px;
  height: 22px;
  min-height: auto;
  margin: 0;
  flex: 0 0 auto;
}

.toggle-row strong,
.toggle-row small {
  display: block;
}

.toggle-row small {
  color: var(--muted);
  margin-top: 3px;
}

.sms-fineprint {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.client-form-panel {
  max-width: 600px;
  margin: 5px auto 30px;
}

.hero-actions {
  display: flex;
  gap: 8px;
}

@media (max-width: 720px) {
  .client-body {
    padding-bottom: 25px;
  }

  .client-welcome {
    padding-top: 25px;
    align-items: flex-start;
    flex-direction: column;
  }

  .client-welcome .button {
    width: 100%;
  }

  .client-grid {
    grid-template-columns: 1fr;
  }

  .client-pet-grid {
    grid-template-columns: 1fr;
  }

  .client-pet-card {
    display: grid;
    grid-template-columns: 115px 1fr;
  }

  .client-pet-photo,
  .client-pet-placeholder {
    height: 100%;
    min-height: 125px;
    aspect-ratio: auto;
  }

  .client-pet-placeholder {
    font-size: 44px;
  }

  .hero-actions {
    flex-direction: column;
  }
}

/* v0.3 workflow improvements */

.stat-link {
  display: block;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.stat-link small {
  display: block;
  margin-top: 7px;
  font-size: 11px;
  font-weight: 800;
  color: var(--primary);
}

.stat-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: #becbd0;
}

.booking-layout {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin: 20px 0;
}

.booking-column {
  display: grid;
  gap: 18px;
}

.quick-add-section {
  display: grid;
  gap: 12px;
  padding: 15px;
  border-radius: 14px;
  background: var(--surface-soft);
}

.quick-add-title {
  font-size: 14px;
}

.clickable-row {
  cursor: pointer;
  border-radius: 12px;
  padding-left: 10px;
  padding-right: 10px;
  transition: background .15s ease;
}

.clickable-row:hover {
  background: var(--surface-soft);
}

@media (max-width: 850px) {
  .booking-layout {
    grid-template-columns: 1fr;
  }
}

/* v0.4 booking search + working pet chart */

.pet-search-wrap {
  position: relative;
}

.pet-search-results {
  display: grid;
  margin-top: 6px;
  background: white;
  border-radius: 13px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(30, 49, 58, .14);
}

.pet-result {
  appearance: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: white;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.pet-result:last-child {
  border-bottom: 0;
}

.pet-result:hover {
  background: var(--surface-soft);
}

.pet-result-icon {
  font-size: 25px;
}

.pet-result strong,
.pet-result small {
  display: block;
}

.pet-result small {
  color: var(--muted);
  margin-top: 2px;
}

.pet-result-empty {
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
}


.selected-pet-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--primary-soft);
  border: 1px solid #cad9de;
  border-radius: 14px;
  padding: 13px 42px 13px 13px;
}

.selected-pet-card[hidden] {
  display: none;
}

.selected-pet-icon {
  font-size: 29px;
}

.selected-pet-card strong,
.selected-pet-card small {
  display: block;
}

.selected-pet-card small {
  color: var(--muted);
  margin-top: 2px;
}

.clear-pet {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  font-size: 25px;
  cursor: pointer;
  color: var(--muted);
}


.booking-details {
  display: grid;
  gap: 14px;
}

.booking-details[hidden] {
  display: none;
}


.service-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.service-summary[hidden] {
  display: none;
}

.service-summary > div {
  padding: 13px;
  border-radius: 12px;
  background: var(--surface-soft);
}

.service-summary span,
.service-summary strong {
  display: block;
}

.service-summary span {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 3px;
}


.input-with-suffix,
.input-with-prefix {
  position: relative;
}

.input-with-suffix span,
.input-with-prefix span {
  position: absolute;
  top: 50%;
  transform: translateY(-38%);
  color: var(--muted);
  font-size: 13px;
  pointer-events: none;
}

.input-with-suffix span {
  right: 13px;
}

.input-with-prefix span {
  left: 13px;
}

.input-with-prefix input {
  padding-left: 27px;
}

.input-with-suffix input {
  padding-right: 68px;
}

.field-help {
  margin-top: -5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}


.owner-contact-card {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: grid;
}

.owner-contact-card > div {
  padding: 9px 0;
}

.owner-contact-card span,
.owner-contact-card strong {
  display: block;
}

.owner-contact-card span {
  color: var(--muted);
  font-size: 11px;
}


.photo-workspace {
  display: grid;
  grid-template-columns: minmax(280px, .7fr) minmax(0, 1.3fr);
  gap: 18px;
}


@media (max-width: 720px) {
  .photo-workspace {
    grid-template-columns: 1fr;
  }

  .service-summary {
    grid-template-columns: 1fr 1fr;
  }
}

/* Pawsh Puppies v0.5 Automations */

.bottom-nav {
  grid-template-columns: repeat(5, 1fr);
}

.simulation-banner {
  padding: 14px 16px;
  margin-bottom: 22px;
  border: 1px solid #d8d1af;
  background: #fffbea;
  border-radius: 14px;
  color: #665d2d;
}

.simulation-banner strong {
  display: block;
  margin-bottom: 2px;
}

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

.automation-rule-heading {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: flex-start;
}

.automation-rule-heading h2 {
  margin: 5px 0;
}

.automation-rule-heading p {
  color: var(--muted);
  margin: 0 0 14px;
  line-height: 1.45;
}

.automation-icon {
  font-size: 31px;
}

.automation-toggle {
  min-width: 70px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 7px;
  border-radius: 100px;
  background: var(--surface-soft);
}

.automation-toggle input {
  width: 18px;
  height: 18px;
  min-height: auto;
  margin: 0;
}

.template-help {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
}

.template-help code {
  background: var(--surface-soft);
  padding: 2px 5px;
  border-radius: 5px;
}

.message-list {
  display: grid;
  gap: 13px;
}

.message-card {
  padding: 17px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 17px;
  box-shadow: var(--shadow);
}

.message-card-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.message-card-top strong,
.message-card-top small {
  display: block;
}

.message-card-top small {
  color: var(--muted);
  margin-top: 3px;
}

.sms-bubble {
  max-width: 620px;
  margin-top: 14px;
  padding: 13px 15px;
  border-radius: 16px 16px 16px 5px;
  background: var(--primary-soft);
  line-height: 1.5;
}

.coupon-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 14px;
  margin-top: 12px;
  font-size: 12px;
}

.coupon-inline small {
  color: var(--muted);
}

.message-meta {
  margin-top: 11px;
  font-size: 10px;
  color: var(--muted);
}

.status.simulated {
  background: #edf1ff;
  color: #405a91;
}

.coupon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
  gap: 13px;
}

.coupon-card {
  padding: 17px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 17px;
  box-shadow: var(--shadow);
}

.coupon-dog {
  font-weight: 800;
}

.coupon-value {
  margin: 15px 0 4px;
  font-size: 35px;
  font-weight: 900;
  line-height: 1;
}

.coupon-value span {
  display: block;
  font-size: 12px;
  letter-spacing: .12em;
  margin-top: 4px;
}

.coupon-card code {
  display: inline-block;
  margin: 10px 0;
  padding: 6px 8px;
  border-radius: 7px;
  background: var(--surface-soft);
  font-weight: 800;
}

.coupon-details {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 11px;
}

.coupon-card form {
  margin-top: 10px;
}

@media (max-width: 720px) {
  .automation-grid {
    grid-template-columns: 1fr;
  }

  .automation-hero {
    flex-direction: column;
  }

  .automation-hero form,
  .automation-hero button {
    width: 100%;
  }

  .bottom-nav a {
    font-size: 9px;
  }
}
