:root {
  color-scheme: light;
  --bg: #f7f3f8;
  --bg-soft: #eef8f1;
  --surface: #fffdfb;
  --surface-strong: #fff3f6;
  --surface-mint: #eaf7ef;
  --ink: #2f2630;
  --muted: #776775;
  --line: #eadde5;
  --coral: #dd6f7d;
  --coral-dark: #b84d5a;
  --sage: #477d63;
  --sage-soft: #dff1e7;
  --butter: #f7d978;
  --plum: #71516f;
  --cocoa: #563b42;
  --warning: #a46224;
  --shadow: 0 18px 42px rgba(84, 57, 72, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 7% 8%, rgba(221, 111, 125, 0.14) 0 80px, transparent 82px),
    radial-gradient(circle at 95% 12%, rgba(71, 125, 99, 0.16) 0 96px, transparent 98px),
    linear-gradient(135deg, var(--bg), var(--bg-soft));
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(86, 59, 66, 0.08) 0 4px, transparent 5px),
    radial-gradient(circle, rgba(221, 111, 125, 0.12) 0 3px, transparent 4px);
  background-position:
    24px 32px,
    76px 88px;
  background-size:
    136px 136px,
    150px 150px;
  content: "";
  opacity: 0.72;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0 24px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar h1,
.panel-heading h2,
.dashboard-heading h2 {
  margin: 0;
}

.topbar h1 {
  font-size: clamp(1.9rem, 3vw, 3.2rem);
  line-height: 1;
  color: var(--cocoa);
}

.cat-logo {
  position: relative;
  width: 72px;
  height: 66px;
  flex: 0 0 auto;
}

.cat-face {
  position: absolute;
  inset: 14px 5px 0;
  border: 2px solid rgba(86, 59, 66, 0.18);
  border-radius: 24px 24px 20px 20px;
  background:
    radial-gradient(circle at 72% 24%, rgba(247, 217, 120, 0.85) 0 9px, transparent 10px),
    linear-gradient(150deg, #fff7ec, #ffe2e9 55%, #eaf7ef);
  box-shadow: 0 14px 26px rgba(86, 59, 66, 0.16);
}

.cat-ear {
  position: absolute;
  top: 4px;
  width: 24px;
  height: 24px;
  border: 2px solid rgba(86, 59, 66, 0.18);
  background: #ffe2e9;
  transform: rotate(45deg);
}

.cat-ear.left {
  left: 12px;
}

.cat-ear.right {
  right: 12px;
}

.cat-eye {
  position: absolute;
  top: 18px;
  width: 6px;
  height: 10px;
  border-radius: 999px;
  background: var(--cocoa);
}

.cat-eye.left {
  left: 20px;
}

.cat-eye.right {
  right: 20px;
}

.cat-nose {
  position: absolute;
  top: 30px;
  left: 50%;
  width: 8px;
  height: 6px;
  border-radius: 999px;
  background: var(--coral);
  transform: translateX(-50%);
}

.cat-whisker {
  position: absolute;
  top: 31px;
  width: 17px;
  height: 2px;
  border-radius: 999px;
  background: rgba(86, 59, 66, 0.45);
}

.cat-whisker.left {
  left: 1px;
}

.cat-whisker.right {
  right: 1px;
}

.cat-whisker.left.top,
.cat-whisker.right.bottom {
  transform: rotate(12deg);
}

.cat-whisker.left.bottom,
.cat-whisker.right.top {
  transform: rotate(-12deg);
}

.cat-whisker.bottom {
  top: 38px;
}

.topbar-stack {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.backend-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 251, 0.9);
  color: var(--muted);
  padding: 0 12px;
  font-size: 0.8rem;
  font-weight: 900;
}

.backend-pill.connected {
  border-color: rgba(71, 125, 99, 0.35);
  background: var(--sage-soft);
  color: var(--sage);
}

.backend-pill.warning {
  border-color: rgba(180, 106, 33, 0.35);
  background: #fff4e6;
  color: var(--warning);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--sage);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  background: rgba(255, 253, 251, 0.86);
  border-radius: var(--radius);
  padding: 4px;
  box-shadow: 0 10px 24px rgba(84, 57, 72, 0.08);
  backdrop-filter: blur(12px);
}

.view-tab {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 14px;
  font-weight: 800;
  white-space: nowrap;
}

.view-tab.active {
  background: var(--cocoa);
  color: #fff;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-size: 0.78rem;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.booking-layout,
.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 20px;
  align-items: start;
}

.tool-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.tool-panel::before {
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--coral), var(--butter), var(--sage));
  content: "";
}

.tool-panel > * {
  position: relative;
  z-index: 1;
}

.booking-form,
.availability-panel,
.settings-panel,
.dashboard-layout > .tool-panel {
  padding: 24px;
}

.panel-heading,
.dashboard-heading {
  margin-bottom: 20px;
}

.panel-heading h2,
.dashboard-heading h2 {
  font-size: 1.45rem;
  line-height: 1.1;
}

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

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

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(71, 125, 99, 0.15);
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.92rem;
  font-weight: 800;
}

.field-label-row span:last-child {
  color: var(--muted);
  font-weight: 700;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
  min-height: 104px;
  align-content: start;
}

.slot-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--ink);
  font-weight: 800;
  box-shadow: inset 0 -2px 0 rgba(86, 59, 66, 0.05);
}

.slot-button:hover {
  border-color: var(--sage);
  background: var(--surface-mint);
}

.slot-button.selected {
  border-color: var(--sage);
  background: var(--sage);
  color: #fff;
}

.empty-state {
  grid-column: 1 / -1;
  display: grid;
  min-height: 104px;
  align-items: center;
  border: 1px dashed rgba(221, 111, 125, 0.45);
  border-radius: var(--radius);
  color: var(--muted);
  padding: 16px;
  text-align: center;
}

.upload-box {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px dashed rgba(221, 111, 125, 0.75);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.65), transparent 44%),
    var(--surface-strong);
  padding: 16px;
}

.paw-mark {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #fffdfb;
  box-shadow: inset 0 0 0 1px rgba(221, 111, 125, 0.22);
}

.paw-mark span {
  position: absolute;
  display: block;
  border-radius: 999px;
  background: var(--coral);
}

.paw-mark span:nth-child(1) {
  left: 13px;
  bottom: 8px;
  width: 16px;
  height: 13px;
}

.paw-mark span:nth-child(2),
.paw-mark span:nth-child(3),
.paw-mark span:nth-child(4),
.paw-mark span:nth-child(5) {
  width: 8px;
  height: 10px;
}

.paw-mark span:nth-child(2) {
  top: 8px;
  left: 8px;
}

.paw-mark span:nth-child(3) {
  top: 5px;
  left: 18px;
}

.paw-mark span:nth-child(4) {
  top: 8px;
  right: 8px;
}

.paw-mark span:nth-child(5) {
  top: 18px;
  right: 5px;
  transform: rotate(18deg);
}

.upload-box input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-box strong,
.upload-box span {
  display: block;
}

.upload-box span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.upload-box.dragging {
  outline: 3px solid rgba(221, 111, 125, 0.18);
}

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

.photo-preview {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.photo-preview::after,
.booking-photo::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  content: "";
}

.photo-preview img,
.booking-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.remove-photo {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: rgba(23, 33, 47, 0.85);
  color: #fff;
  font-weight: 900;
}

.form-actions,
.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 44px;
  border-radius: var(--radius);
  padding: 0 16px;
  font-weight: 900;
}

.primary-button {
  border: 1px solid var(--coral);
  background: linear-gradient(135deg, var(--coral), #c85f8d);
  color: #fff;
  box-shadow: 0 12px 22px rgba(221, 111, 125, 0.22);
}

.primary-button:hover {
  background: var(--coral-dark);
}

.secondary-button {
  border: 1px solid var(--cocoa);
  background: var(--cocoa);
  color: #fff;
}

.secondary-button:hover {
  background: #442d34;
}

.ghost-button {
  border: 1px solid var(--line);
  background: #fffdfb;
  color: var(--ink);
}

.ghost-button:hover {
  border-color: rgba(221, 111, 125, 0.45);
  background: var(--surface-strong);
}

.full-width {
  width: 100%;
}

.availability-panel {
  position: sticky;
  top: 18px;
  padding-top: 92px;
}

.shelf-cat {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 104px;
  height: 70px;
}

.shelf-cat-head {
  position: absolute;
  right: 16px;
  bottom: 0;
  width: 64px;
  height: 50px;
  border: 2px solid rgba(86, 59, 66, 0.14);
  border-radius: 26px 26px 22px 22px;
  background: linear-gradient(145deg, #fff7ec, #ffdfe7);
}

.shelf-cat-ear {
  position: absolute;
  top: 11px;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(86, 59, 66, 0.14);
  background: #ffdfe7;
  transform: rotate(45deg);
}

.shelf-cat-ear.left {
  right: 58px;
}

.shelf-cat-ear.right {
  right: 24px;
}

.shelf-cat-eye {
  position: absolute;
  top: 21px;
  width: 6px;
  height: 8px;
  border-radius: 999px;
  background: var(--cocoa);
}

.shelf-cat-eye.left {
  left: 21px;
}

.shelf-cat-eye.right {
  right: 21px;
}

.shelf-cat-mouth {
  position: absolute;
  left: 50%;
  bottom: 12px;
  width: 14px;
  height: 7px;
  border-bottom: 2px solid rgba(86, 59, 66, 0.52);
  border-radius: 0 0 999px 999px;
  transform: translateX(-50%);
}

.shelf-cat-tail {
  position: absolute;
  left: 6px;
  bottom: 6px;
  width: 42px;
  height: 42px;
  border: 7px solid #ffdfe7;
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 999px;
  transform: rotate(-18deg);
}

.availability-meter {
  display: grid;
  align-items: center;
  justify-items: center;
  min-height: 170px;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 22% 24%, rgba(247, 217, 120, 0.5) 0 34px, transparent 36px),
    linear-gradient(135deg, rgba(221, 111, 125, 0.14), transparent 42%),
    linear-gradient(225deg, rgba(71, 125, 99, 0.16), transparent 48%),
    #fffdfb;
}

.availability-meter span {
  font-size: 4rem;
  font-weight: 950;
  line-height: 1;
}

.availability-meter p {
  margin: -22px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.detail-list {
  display: grid;
  gap: 10px;
}

.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 0 0 10px;
}

.detail-list span {
  color: var(--muted);
}

.detail-list strong {
  text-align: right;
}

.mini-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.day-pill {
  display: grid;
  gap: 4px;
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  padding: 8px 6px;
  text-align: center;
}

.day-pill:hover {
  border-color: rgba(221, 111, 125, 0.42);
  background: #fff8f9;
}

.day-pill strong {
  font-size: 0.9rem;
}

.day-pill span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.day-pill.open {
  border-color: rgba(71, 125, 99, 0.35);
  background: var(--surface-mint);
}

.dashboard-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.auth-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: end;
  margin-bottom: 20px;
  padding: 20px;
}

.auth-panel h2 {
  margin: 0;
  font-size: 1.25rem;
}

.auth-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.auth-session {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.notification-strip {
  border: 1px solid var(--line);
  border-left: 4px solid var(--coral);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--muted);
  padding: 12px 14px;
  margin-bottom: 14px;
  font-weight: 700;
}

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

.booking-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdfb;
  padding: 14px;
}

.booking-card.new {
  border-color: rgba(217, 95, 89, 0.5);
  box-shadow: 0 0 0 3px rgba(217, 95, 89, 0.08);
}

.booking-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.booking-card h3 {
  margin: 0 0 4px;
  font-size: 1.08rem;
}

.booking-card p {
  margin: 0;
  color: var(--muted);
}

.status-chip {
  align-self: flex-start;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--coral-dark);
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.status-chip.confirmed {
  background: var(--surface-mint);
  color: var(--sage);
}

.status-chip.completed {
  background: #ece7f0;
  color: var(--plum);
}

.booking-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.booking-meta div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff8fa, #fffdfb);
  padding: 10px;
}

.booking-meta span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.booking-meta strong {
  display: block;
  margin-top: 4px;
}

.booking-notes {
  color: var(--ink);
  margin: 12px 0;
}

.booking-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.booking-photo {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.card-actions button {
  min-height: 36px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fffdfb;
  color: var(--ink);
  padding: 0 12px;
  font-weight: 800;
}

.card-actions button:hover {
  border-color: rgba(71, 125, 99, 0.4);
  background: var(--surface-mint);
}

.weekly-editor {
  display: grid;
  gap: 10px;
}

.day-row {
  display: grid;
  grid-template-columns: 78px 1fr 1fr auto;
  gap: 8px;
  align-items: center;
}

.day-row strong {
  font-size: 0.92rem;
}

.day-row label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: #fffdfb;
}

.day-row input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  height: 18px;
  accent-color: var(--coral);
}

.blockout-editor {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  margin: 20px 0 12px;
}

.blockout-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
  margin-bottom: 18px;
}

.blockout-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  padding: 6px 8px 6px 12px;
  color: var(--ink);
  font-weight: 800;
}

.muted-inline {
  color: var(--muted);
  font-weight: 700;
}

.blockout-chip button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  z-index: 10;
  width: min(360px, calc(100vw - 36px));
}

.toast {
  border: 1px solid rgba(221, 111, 125, 0.32);
  border-radius: var(--radius);
  background: #fffdfb;
  box-shadow: var(--shadow);
  padding: 14px 16px;
  color: var(--ink);
  font-weight: 800;
}

@media (max-width: 920px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .topbar-stack {
    justify-items: stretch;
  }

  .topbar-actions {
    width: 100%;
  }

  .booking-layout,
  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .availability-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 1240px);
    padding-top: 12px;
  }

  .topbar h1 {
    font-size: 2rem;
  }

  .topbar-actions,
  .form-grid.two,
  .booking-meta,
  .blockout-editor {
    grid-template-columns: 1fr;
  }

  .booking-form,
  .availability-panel,
  .settings-panel,
  .dashboard-layout > .tool-panel {
    padding: 16px;
  }

  .upload-box {
    grid-template-columns: auto 1fr;
  }

  .upload-box .secondary-button {
    grid-column: 1 / -1;
  }

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

  .auth-session {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-heading,
  .booking-card header {
    flex-direction: column;
  }

  .mini-calendar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .day-row {
    grid-template-columns: 58px 1fr 1fr 48px;
    gap: 6px;
  }

  .day-row input[type="time"] {
    padding-inline: 6px;
  }
}

@media (max-width: 420px) {
  .brand-lockup {
    gap: 10px;
  }

  .cat-logo {
    width: 58px;
    height: 58px;
  }

  .topbar h1 {
    font-size: 1.72rem;
  }

  .view-tab {
    min-height: 46px;
    white-space: normal;
  }

  .day-row {
    grid-template-columns: 1fr 1fr;
  }

  .day-row strong,
  .day-row label {
    grid-column: 1 / -1;
  }
}
