@font-face {
  font-family: "Living Archivo";
  src: url("./fonts/archivo-latin-variable.woff2") format("woff2-variations");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Living Hanken";
  src: url("./fonts/hanken-grotesk-latin-variable.woff2") format("woff2-variations");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #000;
  --ink-2: #161616;
  --paper: #f4f4f2;
  --paper-2: #ededeb;
  --card: #fff;
  --accent: #f8d529;
  --line: rgba(0, 0, 0, 0.14);
  --muted: rgba(0, 0, 0, 0.58);
  --radius: 20px;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.09), 0 3px 10px rgba(0, 0, 0, 0.04);
  --font-serif: "Living Archivo", Arial, sans-serif;
  --font-sans: "Living Hanken", "Segoe UI", sans-serif;
}

body {
  background: var(--paper);
  font-family: var(--font-sans);
  font-weight: 500;
}

h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 800;
  letter-spacing: -0.035em;
}

button,
input,
select,
textarea {
  font-family: var(--font-sans);
}

.wordmark {
  display: flex;
  align-items: center;
  font-family: var(--font-sans);
  gap: 12px;
}

.wordmark img {
  width: 108px;
  height: 54px;
  object-fit: contain;
}

.wordmark span {
  margin: 0;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--accent);
  color: #000;
  font-size: 0.54rem;
  font-weight: 850;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* Login */
.login {
  position: relative;
  isolation: isolate;
  background: var(--accent);
  overflow: hidden;
}

.login::before,
.login::after {
  position: absolute;
  z-index: -1;
  border: 2px solid rgba(0, 0, 0, 0.18);
  border-radius: 50%;
  content: "";
}

.login::before {
  top: -26vw;
  right: -12vw;
  width: 64vw;
  height: 64vw;
}

.login::after {
  bottom: -34vw;
  left: -18vw;
  width: 76vw;
  height: 76vw;
}

.login-card {
  width: min(460px, 100%);
  padding: 38px;
  border: 2px solid #000;
  border-radius: 24px;
  box-shadow: 9px 9px #000;
}

.login-card h1 {
  margin: 28px 0 8px;
  font-size: 2.35rem;
}

.login-card .muted {
  color: rgba(0, 0, 0, 0.58);
  line-height: 1.5;
}

.login-card form {
  margin-top: 28px;
  gap: 16px;
}

.login-card label,
.field-grid label {
  font-size: 0.71rem;
  font-weight: 780;
  letter-spacing: 0.02em;
}

.login-card input,
.field-grid input,
.field-grid select,
.field-grid textarea,
.search {
  min-height: 48px;
  border: 1.5px solid rgba(0, 0, 0, 0.22);
  border-radius: 12px;
  background: #fff;
}

.field-grid textarea {
  width: 100%;
  min-height: 88px;
  padding: 12px;
  font: inherit;
  font-weight: 400;
  line-height: 1.5;
  resize: vertical;
}

.login-card .btn-primary {
  min-height: 52px;
  margin-top: 4px;
  border-radius: 999px;
  background: #000;
  color: #fff;
}

/* Main catalog shell */
.topbar {
  min-height: 82px;
  padding: 10px clamp(20px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: #000;
}

.topbar .wordmark {
  color: #000;
}

.topbar-right {
  gap: 9px;
}

.chip-user {
  padding: 8px 12px;
  border-color: var(--line);
  background: var(--paper);
  color: rgba(0, 0, 0, 0.6);
  font-size: 0.72rem;
}

.btn {
  min-height: 44px;
  padding: 10px 17px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 780;
}

.btn-primary {
  background: #000;
  color: #fff;
}

.btn-accent {
  background: var(--accent);
  color: #000;
}

.btn-ghost,
.btn-ghost-dark {
  border-color: var(--line);
  background: #fff;
  color: #000;
}

.btn-ghost:hover:not(:disabled),
.btn-ghost-dark:hover {
  border-color: #000;
  background: #000;
  color: #fff;
}

.workspace {
  max-width: 1440px;
  padding: clamp(24px, 4vw, 56px);
}

.toolbar {
  margin-bottom: 26px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
}

.filters,
.toolbar-actions {
  gap: 8px;
}

.chip {
  min-height: 44px;
  padding-inline: 18px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 720;
}

.chip.is-active {
  border-color: #000;
  background: #000;
  color: #fff;
}

.search {
  min-width: 230px;
}

.summary {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.grid {
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 22px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: none;
}

.card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-5px);
}

.card[data-status="review"],
.card[data-status="published"],
.card[data-status="draft"] {
  border-top-width: 1px;
}

.card-media {
  min-height: 218px;
  background: #f1f1ef;
}

.card-img {
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.12));
}

.status-pill {
  top: 14px;
  left: 14px;
  padding: 6px 10px;
  background: #000;
  color: var(--accent);
  font-size: 0.52rem;
  letter-spacing: 0.14em;
}

.card[data-status="review"] .status-pill {
  background: #000;
  color: #fff;
}

.card[data-status="published"] .status-pill {
  background: var(--accent);
  color: #000;
}

.card-body {
  padding: 20px;
  gap: 14px;
}

.card-name {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 800;
}

.card-code,
.card-meta,
.card-specs dt,
.card-specs dd {
  font-family: var(--font-sans);
}

.card-specs {
  border-color: var(--line);
}

.card-actions {
  gap: 7px;
}

.card-secondary {
  justify-content: space-between;
}

.card-note.is-review {
  background: #fff7cb;
  color: #000;
}

.empty-title {
  font-family: var(--font-serif);
  font-weight: 800;
}

/* Dialogs and edit tools */
.dialog {
  border: 2px solid #000;
  border-radius: 22px;
  box-shadow: 10px 10px #000;
}

.dialog::backdrop {
  background: rgba(0, 0, 0, 0.66);
}

.dialog form,
.dialog.dialog-wide,
.dialog.dialog-padded {
  padding: 28px;
}

.dialog.dialog-padded {
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}

.dialog-padded > .muted {
  margin: 0 0 20px;
  line-height: 1.5;
}

.dialog-padded input[type="file"] {
  width: 100%;
  min-width: 0;
  font-size: 0.82rem;
}

.dialog-padded input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.dialog h2 {
  font-size: 1.9rem;
}

.dialog-actions {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible,
.chip:focus-visible,
.card-media:focus-visible,
.button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.toast,
.booking-toast {
  border: 1px solid #000;
  border-left: 6px solid var(--accent);
  border-radius: 14px;
  background: #000;
  color: #fff;
  box-shadow: var(--shadow);
}

/* SelectBox compartilhado com o padrão operacional dos outros produtos. */
.smart-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.smart-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.smart-select-trigger {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 0 15px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  background: linear-gradient(#fff, #fdfdfb);
  color: #000;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 560;
  text-align: left;
  gap: 12px;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.smart-select-trigger:hover {
  border-color: #000;
  background: #fff;
}

.smart-select-trigger:focus-visible,
.smart-select-open .smart-select-trigger {
  border-color: #000;
  outline: 0;
  box-shadow: 0 0 0 4px rgba(248, 213, 41, 0.52);
}

.smart-select-trigger:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.smart-select-trigger svg {
  width: 18px;
  flex: none;
  fill: none;
  stroke: #000;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform 0.18s;
}

.smart-select-open .smart-select-trigger svg {
  transform: rotate(180deg);
}

.smart-select-options {
  position: absolute;
  z-index: 120;
  top: calc(100% + 7px);
  right: 0;
  left: 0;
  max-height: 280px;
  padding: 6px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.17), 0 3px 10px rgba(0, 0, 0, 0.08);
  overflow: auto;
}

.smart-select-options > button {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  padding: 9px 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #000;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  text-align: left;
  gap: 10px;
}

.smart-select-options > button:hover,
.smart-select-options > button:focus-visible {
  background: #f4f4f2;
  outline: 0;
}

.smart-select-options > button.selected {
  background: #fff4a8;
}

.smart-select-options > button strong {
  display: grid;
  width: 24px;
  height: 24px;
  flex: none;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
}

/* Checkboxes com alvo consistente; impede o input gigante visto no modal. */
input[type="checkbox"] {
  width: 22px !important;
  min-width: 22px !important;
  height: 22px !important;
  min-height: 22px !important;
  flex: 0 0 22px !important;
  padding: 0 !important;
  border: 1.5px solid rgba(0, 0, 0, 0.42) !important;
  border-radius: 6px !important;
  appearance: none;
  background: #fff;
  cursor: pointer;
  vertical-align: middle;
}

input[type="checkbox"]:checked {
  border-color: #000 !important;
  background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.4' d='m4 10 4 4 8-9'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 17px;
}

input[type="checkbox"]:focus-visible {
  outline: 3px solid rgba(248, 213, 41, 0.72);
  outline-offset: 2px;
}

.field-grid .check {
  display: flex !important;
  min-height: 44px;
  align-items: center;
  grid-template-columns: none;
  gap: 10px;
}

.field-grid input[type="color"] {
  width: 52px;
  min-height: 44px;
}

/* Agenda */
.booking-app {
  min-height: 100vh;
  padding: 0 0 80px;
  background: var(--paper);
  font-family: var(--font-sans);
}

.booking-topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  max-width: none;
  min-height: 82px;
  margin: 0;
  padding: 10px clamp(20px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.booking-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.booking-brand img {
  width: 108px;
  height: 54px;
  object-fit: contain;
}

.booking-brand span {
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--accent);
  font-size: 0.54rem;
  font-weight: 850;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.booking-topbar nav a,
.booking-topbar nav button {
  min-height: 44px;
  padding: 10px 17px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.75rem;
}

.booking-topbar nav .active {
  border-color: #000;
  background: #000;
  color: #fff;
}

.booking-hero {
  position: relative;
  max-width: 1440px;
  margin: 0 auto 34px;
  padding: clamp(58px, 7vw, 96px) clamp(22px, 4vw, 56px);
  background: var(--accent);
  overflow: hidden;
}

.booking-hero::after {
  position: absolute;
  right: -9vw;
  bottom: -18vw;
  width: 48vw;
  height: 48vw;
  border: 2px solid rgba(0, 0, 0, 0.14);
  border-radius: 50%;
  content: "";
}

.booking-hero h1 {
  position: relative;
  max-width: 820px;
  font-family: var(--font-serif);
  font-size: clamp(3rem, 6vw, 5.8rem);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 0.92;
}

.booking-hero > p:last-child {
  position: relative;
  max-width: 620px;
  margin-top: 24px;
  color: rgba(0, 0, 0, 0.64);
  line-height: 1.6;
}

.eyebrow {
  color: #000;
  font-size: 0.64rem;
  letter-spacing: 0.17em;
}

.booking-grid {
  max-width: 1440px;
  padding-inline: clamp(22px, 4vw, 56px);
  gap: 20px;
}

.booking-panel {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: none;
}

.booking-panel h2 {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  font-weight: 800;
}

.settings-panel .stack-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-panel .button {
  grid-column: 1 / -1;
}

.stack-form input,
.stack-form select,
.stack-form textarea,
.inline-form input,
.inline-form select {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.button {
  min-height: 46px;
  border: 1px solid #000;
  border-radius: 999px;
  background: #000;
  color: #fff;
  font-weight: 800;
}

.button.secondary {
  background: #fff;
  color: #000;
}

.button.danger {
  border-color: #9b1c1c;
  background: #fff;
  color: #9b1c1c;
}

.button.danger:hover {
  background: #fff0ef;
}

.availability-row,
.appointment-row,
.service-row {
  min-height: 64px;
  border-color: var(--line);
}

.availability-row-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.availability-row-actions > span {
  min-width: 48px;
  font-size: 0.72rem;
  font-weight: 760;
  text-align: right;
}

.availability-row-actions .button {
  min-height: 38px;
  padding: 7px 14px;
}

.service-list {
  display: grid;
  margin-bottom: 22px;
}

.service-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.service-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.service-row > span {
  padding: 5px 9px;
  border-radius: 999px;
  background: #fff4a8;
  font-size: 0.65rem;
  font-weight: 800;
}

.service-create {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.service-create h3 {
  margin: 0;
  font-size: 1.15rem;
}

.management-list-panel {
  overflow: visible;
}

.management-card-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  margin-top: 22px;
  gap: 14px;
}

.management-list-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.045);
}

.management-list-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.management-list-card header small {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 760;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.management-list-card h3 {
  margin: 0;
  font-size: 1.25rem;
}

.management-list-card > p {
  min-height: 42px;
  margin: 16px 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.management-state {
  flex: none;
  padding: 6px 9px;
  border-radius: 999px;
  background: #ececea;
  color: #3f3f3b;
  font-size: 0.61rem;
  font-weight: 820;
}

.management-state.active {
  background: #fff2a0;
  color: #000;
}

.management-list-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: auto 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  gap: 12px 16px;
}

.management-list-card dl div {
  min-width: 0;
}

.management-list-card dt {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.54rem;
  font-weight: 760;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.management-list-card dd {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.45;
}

.management-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.management-card-actions .button {
  min-height: 40px;
  padding: 8px 18px;
}

.management-list-empty {
  display: flex;
  min-height: 145px;
  grid-column: 1 / -1;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
  border: 1px dashed rgba(0, 0, 0, 0.22);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
  gap: 5px;
}

.management-list-empty strong {
  color: #000;
}

.management-create {
  margin-top: 20px;
  border-top: 1px solid var(--line);
}

.management-create summary {
  position: relative;
  min-height: 62px;
  display: flex;
  align-items: center;
  padding-right: 46px;
  cursor: pointer;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 800;
  list-style: none;
}

.management-create summary::-webkit-details-marker {
  display: none;
}

.management-create summary::after {
  position: absolute;
  top: 50%;
  right: 0;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: #000;
  color: #fff;
  content: "+";
  font-family: var(--font-sans);
  font-size: 1.2rem;
  line-height: 1;
  transform: translateY(-50%);
}

.management-create[open] summary::after {
  content: "−";
}

.management-create form {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}

.block-create {
  grid-template-columns: 1fr;
}

.booking-error {
  border: 1px solid #8d1212;
  border-radius: 14px;
}

/* Agenda operacional */
.appointment-panel {
  overflow: visible;
}

.appointment-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 24px 0 18px;
  padding: 16px 0;
  border-block: 1px solid var(--line);
  gap: 18px;
}

.period-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.period-filters button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #000;
  cursor: pointer;
  font-weight: 740;
}

.period-filters button.active {
  border-color: #000;
  background: #000;
  color: #fff;
}

.appointment-status-filter {
  width: min(240px, 100%);
}

.appointment-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.appointment-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.045);
}

.appointment-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.appointment-card > header small {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.appointment-card h3 {
  margin: 0;
  font-size: 1.3rem;
}

.appointment-status {
  flex: none;
  padding: 6px 9px;
  border-radius: 999px;
  background: #ececea;
  font-size: 0.62rem;
  font-weight: 820;
}

.status-requested { background: #fff2a0; }
.status-confirmed { background: #dcefdc; color: #174d1e; }
.status-checked_in,
.status-in_service { background: #dceafb; color: #194d79; }
.status-completed { background: #000; color: #fff; }
.status-canceled,
.status-no_show,
.status-expired { background: #f4dfdf; color: #7d1f1f; }

.appointment-time {
  display: flex;
  align-items: baseline;
  margin: 18px 0;
  padding: 16px 0;
  border-block: 1px solid var(--line);
  gap: 14px;
}

.appointment-time strong {
  font-family: var(--font-serif);
  font-size: 1.7rem;
}

.appointment-time span {
  color: var(--muted);
  font-size: 0.78rem;
}

.appointment-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
}

.appointment-details > span,
.appointment-details > a {
  display: flex;
  min-width: 0;
  flex-direction: column;
  color: #000;
  font-size: 0.77rem;
  line-height: 1.45;
  text-decoration: none;
}

.appointment-details b,
.appointment-notes-preview b {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.appointment-wide {
  grid-column: 1 / -1;
}

.appointment-notes-preview {
  display: flex;
  flex-direction: column;
  margin: 16px 0 0;
  padding: 12px;
  border-radius: 11px;
  background: var(--paper);
  font-size: 0.76rem;
  line-height: 1.5;
}

.appointment-more {
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.appointment-more summary {
  padding: 14px 0 4px;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
}

.appointment-all-data {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
  padding: 16px;
  border-radius: 12px;
  background: var(--paper);
  gap: 14px 18px;
}

.appointment-all-data > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  font-size: 0.76rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.appointment-all-data b {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.54rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.appointment-card > footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: auto;
  padding-top: 18px;
  gap: 8px;
}

.appointment-card > footer a,
.appointment-card > footer button {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border: 1px solid #000;
  border-radius: 999px;
  background: #fff;
  color: #000;
  cursor: pointer;
  font-weight: 780;
  text-align: center;
  text-decoration: none;
}

.appointment-card > footer .appointment-whatsapp {
  border-color: var(--accent);
  background: var(--accent);
}

.appointment-empty {
  display: flex;
  min-height: 150px;
  grid-column: 1 / -1;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
  border: 1px dashed rgba(0, 0, 0, 0.22);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
  gap: 5px;
}

.appointment-empty strong {
  color: #000;
}

.booking-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 2px solid #000;
  border-radius: 22px;
  box-shadow: 10px 10px #000;
  overflow: visible;
}

.booking-dialog::backdrop {
  background: rgba(0, 0, 0, 0.68);
}

.booking-dialog form {
  max-height: calc(100dvh - 38px);
  padding: 28px;
  overflow: auto;
}

.booking-dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.booking-dialog-heading h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 2rem;
}

.dialog-close {
  display: grid;
  width: 42px;
  height: 42px;
  flex: none;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 1.5rem;
}

.appointment-reference {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff4a8;
  gap: 10px;
}

.appointment-reference span {
  font-size: 0.62rem;
  font-weight: 780;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.booking-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.booking-edit-grid label,
.appointment-notes {
  display: grid;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 760;
}

.booking-edit-grid input,
.booking-edit-grid textarea,
.appointment-notes textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.booking-edit-grid textarea {
  resize: vertical;
}

.booking-edit-grid .field-wide {
  grid-column: 1 / -1;
}

.management-check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
  padding: 16px;
  border-radius: 14px;
  background: var(--paper);
  gap: 14px;
}

.management-check-grid .check {
  font-size: 0.72rem;
  font-weight: 760;
}

.appointment-notes {
  margin-top: 14px;
}

.appointment-edit-help {
  margin: 14px 0 0;
  padding: 11px 13px;
  border-left: 3px solid var(--accent);
  background: var(--paper);
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
}

.booking-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  gap: 9px;
}

.booking-dialog-actions .danger {
  margin-right: auto;
}

.gallery-upload {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  margin: 18px 0;
  gap: 12px;
}

.gallery-upload label {
  display: grid;
  min-width: 180px;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 750;
}

.gallery-upload input,
.gallery-upload select {
  min-height: 44px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.gallery-admin-list {
  display: grid;
  max-height: 340px;
  overflow-y: auto;
  gap: 8px;
}

.gallery-admin-item {
  display: grid;
  grid-template-columns: 82px minmax(100px, 1fr) auto;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  gap: 12px;
}

.gallery-admin-item img {
  width: 82px;
  height: 62px;
  object-fit: contain;
  background: #fff;
}

.gallery-admin-item small {
  display: block;
  color: var(--muted);
}

.gallery-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.gallery-admin-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.gallery-admin-actions button:disabled { opacity: .4; cursor: default; }

.gallery-presentation {
  display: grid;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  gap: 12px;
}

.gallery-presentation h3,
.gallery-presentation p { margin: 0; }

.gallery-presentation label {
  display: grid;
  grid-template-columns: 120px 45px 1fr;
  align-items: center;
  gap: 10px;
}

.gallery-preview {
  display: grid;
  height: 220px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.gallery-preview img {
  width: 78%;
  height: 180px;
  object-fit: contain;
}

@media (max-width: 600px) {
  .gallery-admin-item { grid-template-columns: 70px 1fr; }
  .gallery-admin-actions { grid-column: 1 / -1; }
  .gallery-presentation label { grid-template-columns: 90px 40px 1fr; }
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-right {
    width: 100%;
    flex-wrap: wrap;
  }

  .chip-user {
    width: 100%;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-actions {
    flex-wrap: wrap;
  }

  .search {
    width: 100%;
  }

  .booking-topbar {
    position: relative;
    align-items: flex-start;
    flex-direction: column;
    padding-block: 12px;
  }

  .booking-topbar nav {
    width: 100%;
    flex-wrap: wrap;
  }

  .booking-topbar nav a,
  .booking-topbar nav button {
    flex: 1;
  }

  .booking-hero {
    padding-top: 54px;
  }

  .appointment-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .appointment-status-filter {
    width: 100%;
  }

  .appointment-list {
    grid-template-columns: 1fr;
  }

  .settings-panel .stack-form,
  .management-check-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .login-card {
    padding: 28px 22px;
  }

  .wordmark img,
  .booking-brand img {
    width: 94px;
  }

  .workspace,
  .booking-grid {
    padding-inline: 16px;
  }

  .toolbar {
    padding: 16px;
  }

  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .chip {
    flex: none;
  }

  .card-actions {
    grid-template-columns: 1fr;
  }

  .booking-panel {
    padding: 20px;
  }

  .period-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .period-filters button {
    flex: none;
  }

  .appointment-details,
  .appointment-all-data,
  .booking-edit-grid,
  .appointment-card > footer {
    grid-template-columns: 1fr;
  }

  .settings-panel .stack-form,
  .management-check-grid {
    grid-template-columns: 1fr;
  }

  .management-card-list,
  .management-list-card dl {
    grid-template-columns: 1fr;
  }

  .availability-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .availability-row-actions {
    width: 100%;
    justify-content: space-between;
  }

  .booking-dialog form {
    padding: 22px 18px;
  }

  .booking-dialog-actions .danger {
    width: 100%;
    margin-right: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .btn,
  .toast {
    transition: none;
    animation: none;
  }
}
