/* ============================================================
   PANEL DE MAI · Estilos
   ============================================================ */

:root {
  --cream: #fbf7f2;
  --cream-2: #f6eee6;
  --sand: #f0e2d6;
  --nude: #e8cfc3;
  --rose: #c08a7c;
  --rose-deep: #a96d5f;
  --rose-soft: #ecd4cc;
  --gold: #b08a5a;
  --gold-ink: #8a6235;
  --gold-light: #d9c4a6;
  --ink: #2e2622;
  --ink-2: #3b312b;
  --ink-soft: #4c4039;
  --muted: #6f6057;
  --white: #fffdfb;
  --line: rgba(46, 38, 34, 0.12);
  --line-soft: rgba(46, 38, 34, 0.075);
  --sage: #5f7355;
  --sage-bg: #eff3e9;
  --danger: #a9473a;
  --danger-bg: #fbefec;

  --font-serif: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --font-sans: "Jost", "Segoe UI", system-ui, -apple-system, sans-serif;

  --shadow-sm: 0 4px 18px rgba(74, 52, 40, 0.06);
  --shadow-md: 0 24px 60px -30px rgba(74, 52, 40, 0.4);
  --shadow-lg: 0 40px 90px -40px rgba(46, 38, 34, 0.5);
}

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

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

body.admin-body {
  margin: 0;
  min-height: 100vh;
  background: #f4ece4;
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.admin-body.no-scroll {
  overflow: hidden;
}

img,
svg,
iframe {
  max-width: 100%;
}

img {
  display: block;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--rose-soft);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  display: inline-block;
  vertical-align: -0.12em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------
   Botones y campos
   ------------------------------------------------------------ */
.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease,
    border-color 0.2s ease, transform 0.2s ease;
}

.admin-btn .icon {
  width: 15px;
  height: 15px;
}

.admin-btn:hover {
  transform: translateY(-1px);
}

.admin-btn:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.admin-btn--dark {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}

.admin-btn--dark:hover {
  background: var(--rose-deep);
  border-color: var(--rose-deep);
}

.admin-btn--outline {
  border-color: var(--line);
  background: var(--white);
  color: var(--ink-soft);
}

.admin-btn--outline:hover {
  border-color: var(--gold-ink);
  color: var(--gold-ink);
}

.admin-btn--ghost {
  border-color: transparent;
  color: var(--muted);
}

.admin-btn--ghost:hover {
  background: var(--cream-2);
  color: var(--ink);
}

.admin-btn--danger {
  border-color: transparent;
  background: transparent;
  color: var(--danger);
}

.admin-btn--danger:hover {
  background: var(--danger-bg);
}

.admin-btn--danger-solid {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.admin-btn--danger-solid:hover {
  background: #8f392e;
  border-color: #8f392e;
}

.admin-btn--full {
  width: 100%;
}

.admin-btn--small {
  min-height: 36px;
  padding: 0 13px;
  font-size: 10.5px;
}

.admin-btn--xs {
  min-height: 32px;
  padding: 0 11px;
  font-size: 10px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  color: var(--ink-soft);
  transition: background-color 0.2s ease, color 0.2s ease,
    border-color 0.2s ease;
}

.icon-btn .icon {
  width: 17px;
  height: 17px;
}

.icon-btn:hover {
  border-color: var(--gold-ink);
  color: var(--gold-ink);
}

.icon-btn--danger:hover {
  border-color: rgba(169, 71, 58, 0.4);
  background: var(--danger-bg);
  color: var(--danger);
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.admin-field > span:first-child {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-field input,
.admin-field select,
.admin-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--cream);
  color: var(--ink);
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.admin-field textarea {
  min-height: 64px;
  resize: vertical;
  line-height: 1.5;
}

.admin-field input:focus,
.admin-field select:focus,
.admin-field textarea:focus {
  outline: none;
  border-color: var(--rose);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(192, 138, 124, 0.12);
}

.admin-field input::placeholder,
.admin-field textarea::placeholder {
  color: #ab9c92;
}

.form-error {
  margin-top: 8px;
  color: var(--danger);
  font-size: 11.5px;
  line-height: 1.5;
}

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

/* Switch */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  user-select: none;
}

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

.switch__track {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #dcd0c6;
  transition: background-color 0.2s ease;
  flex: 0 0 auto;
}

.switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 3px rgba(46, 38, 34, 0.25);
  transition: transform 0.2s ease;
}

.switch input:checked + .switch__track {
  background: var(--sage);
}

.switch input:checked + .switch__track::after {
  transform: translateX(16px);
}

.switch input:focus-visible + .switch__track {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.switch__label {
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.switch--sm .switch__track {
  width: 32px;
  height: 18px;
}

.switch--sm .switch__track::after {
  width: 12px;
  height: 12px;
  top: 3px;
  left: 3px;
}

.switch--sm input:checked + .switch__track::after {
  transform: translateX(14px);
}

/* ------------------------------------------------------------
   Login
   ------------------------------------------------------------ */
.login {
  min-height: 100vh;
  display: grid;
  background: radial-gradient(circle at 80% 10%, rgba(232, 207, 195, 0.7), transparent 42%),
    linear-gradient(160deg, #fbf7f2 0%, #f3e8df 100%);
}

.login__visual {
  display: none;
}

.login__panel {
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem 3rem;
}

.login__box {
  width: min(100%, 400px);
}

.login__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.05em;
  transition: color 0.2s ease;
}

.login__back:hover {
  color: var(--ink);
}

.login__logo {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 2.2rem 0 2rem;
}

.login__logo-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(176, 138, 90, 0.55);
  border-radius: 50%;
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 23px;
  font-style: italic;
  line-height: 1;
  padding-top: 2px;
}

.login__logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.login__logo-text strong {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink);
}

.login__logo-text small {
  margin-top: 3px;
  color: var(--gold-ink);
  font-size: 8px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.login h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 8vw, 3.1rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.login__intro {
  max-width: 34ch;
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.65;
}

.login__form {
  display: grid;
  gap: 1rem;
  margin-top: 1.8rem;
}

.login__form .admin-btn {
  min-height: 50px;
  margin-top: 0.3rem;
  font-size: 12px;
}

.password-wrap {
  position: relative;
  display: block;
}

.password-wrap input {
  padding-right: 58px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  padding: 6px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #8a5346;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  transform: translateY(-50%);
}

.password-toggle:hover {
  background: var(--cream-2);
}

.login__error {
  padding: 9px 12px;
  border: 1px solid rgba(169, 71, 58, 0.25);
  border-radius: 9px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 11.5px;
  line-height: 1.5;
}

.login__foot {
  margin-top: 1.6rem;
  color: #7a6b61;
  font-size: 9.5px;
  line-height: 1.6;
  text-align: center;
}

.demo-box {
  margin-top: 1.5rem;
  padding: 14px;
  border: 1px dashed rgba(176, 138, 90, 0.45);
  border-radius: 12px;
  background: rgba(246, 238, 230, 0.72);
}

.demo-box__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.demo-box__head strong {
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.demo-box__head span {
  color: var(--gold-ink);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.demo-box p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
}

.demo-box code {
  display: block;
  margin: 9px 0;
  padding: 7px 9px;
  border-radius: 7px;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.demo-box .admin-btn {
  margin-top: 2px;
}

@media (min-width: 920px) {
  .login {
    grid-template-columns: 1.02fr 1fr;
  }

  .login__visual {
    position: relative;
    display: block;
    overflow: hidden;
    min-height: 100vh;
    background: var(--ink);
  }

  .login__visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 35%;
  }

  .login__visual-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(30, 24, 21, 0.15), rgba(30, 24, 21, 0.72));
  }

  .login__brand {
    position: absolute;
    top: 32px;
    left: 34px;
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--cream);
  }

  .login__mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(217, 196, 166, 0.6);
    border-radius: 50%;
    color: var(--gold-light);
    font-family: var(--font-serif);
    font-size: 21px;
    font-style: italic;
    padding-top: 2px;
  }

  .login__brand strong {
    display: block;
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 500;
    line-height: 1.1;
  }

  .login__brand small {
    color: rgba(251, 247, 242, 0.55);
    font-size: 8px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
  }

  .login__quote {
    position: absolute;
    right: 36px;
    bottom: 34px;
    left: 36px;
    color: var(--cream);
  }

  .login__quote p {
    font-family: var(--font-serif);
    font-size: clamp(1.6rem, 2.4vw, 2.2rem);
    font-style: italic;
    line-height: 1.2;
  }

  .login__quote cite {
    display: block;
    margin-top: 10px;
    color: rgba(251, 247, 242, 0.55);
    font-size: 9px;
    font-style: normal;
    letter-spacing: 0.18em;
    text-transform: uppercase;
  }

  .login__panel {
    padding: 2.5rem;
  }

  .login__logo {
    margin-top: 2.6rem;
  }
}

/* ------------------------------------------------------------
   Estructura del panel
   ------------------------------------------------------------ */
.admin-app {
  min-height: 100vh;
}

.sidebar {
  display: none;
}

.admin-main {
  min-width: 0;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1rem 0.9rem;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(244, 236, 228, 0.92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.admin-topbar__date {
  color: var(--gold-ink);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.admin-topbar h1 {
  margin-top: 3px;
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 5vw, 2.3rem);
  font-weight: 500;
  line-height: 1.05;
  color: var(--ink);
}

.admin-topbar__sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.admin-topbar__right {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}

.admin-user {
  display: none;
  max-width: 180px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-chip {
  padding: 3px 8px;
  border: 1px solid rgba(176, 138, 90, 0.4);
  border-radius: 999px;
  background: var(--cream-2);
  color: var(--gold-ink);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.admin-content {
  width: min(100%, 1220px);
  margin-inline: auto;
  padding: 1rem 1rem calc(92px + env(safe-area-inset-bottom));
}

.demo-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 1rem;
  padding: 9px 12px;
  border: 1px solid rgba(176, 138, 90, 0.28);
  border-radius: 10px;
  background: rgba(255, 253, 251, 0.7);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.demo-banner strong {
  color: var(--ink);
  font-weight: 600;
}

.demo-banner__dot {
  width: 6px;
  height: 6px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--gold);
  flex: 0 0 auto;
}

.view-panel {
  animation: fadeIn 0.28s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}

.stat {
  position: relative;
  overflow: hidden;
  padding: 13px 15px;
  border: 1px solid rgba(176, 138, 90, 0.18);
  border-radius: 14px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.stat::after {
  content: "";
  position: absolute;
  top: -30px;
  right: -30px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.05;
}

.stat--gold {
  color: var(--gold);
}

.stat--sage {
  color: var(--sage);
}

.stat--rose {
  color: var(--rose-deep);
}

.stat--ink {
  color: var(--ink);
}

.stat__label {
  display: block;
  color: var(--muted);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stat__value {
  display: block;
  margin-top: 2px;
  font-family: var(--font-serif);
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
}

.stat__hint {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 8.5px;
}

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 0.85rem;
}

.filter-chips {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 3px;
  scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease,
    border-color 0.2s ease;
}

.filter-chip span {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--cream-2);
  color: var(--muted);
  font-size: 8px;
}

.filter-chip:hover {
  border-color: var(--gold);
}

.filter-chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}

.filter-chip.is-active span {
  background: rgba(251, 247, 242, 0.16);
  color: var(--cream);
}

/* ------------------------------------------------------------
   Turnos
   ------------------------------------------------------------ */
.appointments {
  display: grid;
  gap: 0.55rem;
}

.appt {
  position: relative;
  display: grid;
  grid-template-columns: 55px minmax(0, 1fr);
  gap: 12px;
  padding: 13px;
  border: 1px solid rgba(176, 138, 90, 0.17);
  border-left: 3px solid var(--gold);
  border-radius: 14px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.appt:hover {
  box-shadow: 0 16px 36px -26px rgba(74, 52, 40, 0.4);
}

.appt--confirmed {
  border-left-color: var(--sage);
}

.appt--cancelled {
  border-left-color: #c9b9ae;
  opacity: 0.72;
}

.appt.is-past {
  background: rgba(255, 253, 251, 0.65);
}

.appt__date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 7px 3px;
  border-radius: 10px;
  background: var(--cream-2);
  text-align: center;
  line-height: 1;
}

.appt__date > span {
  color: var(--gold-ink);
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.appt__date > strong {
  margin: 2px 0;
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--ink);
}

.appt__date > small {
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.appt__body {
  min-width: 0;
}

.appt__title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.appt__title-row h3 {
  overflow: hidden;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 7.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status--pending {
  background: #f7edda;
  color: #7f5c22;
}

.status--confirmed {
  background: var(--sage-bg);
  color: #4e6244;
}

.status--cancelled {
  background: #f3ebe7;
  color: #9a7f73;
}

.appt__service {
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appt__service span {
  margin: 0 3px;
  color: var(--gold);
}

.appt__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 7px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9.5px;
}

.appt__meta a {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #8a5346;
}

.appt__meta a:hover {
  text-decoration: underline;
}

.appt__meta .icon {
  width: 11px;
  height: 11px;
}

.appt__meta-sep {
  color: #c9bbb1;
}

.appt__past-tag {
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--cream-2);
  color: #9c8d83;
  font-size: 7px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.appt__actions {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  gap: 5px;
  padding-top: 2px;
}

/* Estado vacío */
.empty-state {
  padding: 2.4rem 1.2rem;
  border: 1px dashed rgba(46, 38, 34, 0.15);
  border-radius: 16px;
  background: rgba(255, 253, 251, 0.55);
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.empty-state__icon {
  display: block;
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 18px;
}

.empty-state h3 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--ink);
}

.empty-state p {
  margin-top: 4px;
  font-size: 11px;
}

.empty-state--sm {
  padding: 1.4rem 1rem;
}

/* ------------------------------------------------------------
   Paneles
   ------------------------------------------------------------ */
.panel {
  margin-bottom: 1rem;
  padding: 16px;
  border: 1px solid rgba(176, 138, 90, 0.18);
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 1rem;
}

.panel__head h2 {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--ink);
}

.panel__head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.panel__hint {
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.6;
}

/* Disponibilidad */
.admin-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line-soft);
}

.admin-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 8.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.legend-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.legend-dot--free {
  background: var(--sage);
}

.legend-dot--busy {
  background: var(--rose-deep);
}

.legend-dot--blocked {
  background: var(--gold);
}

.legend-dot--closed {
  background: #cfc0b5;
}

.avail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

.avail-day {
  padding: 11px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--cream);
}

.avail-day.is-closed {
  opacity: 0.55;
  background: var(--cream-2);
}

.avail-day.is-blocked {
  border-color: rgba(176, 138, 90, 0.35);
  background: #fbf4ed;
}

.avail-day__head {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.avail-day__wd {
  color: var(--gold-ink);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.avail-day__num {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
}

.avail-day__mo {
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
}

.avail-day__count {
  display: block;
  margin: 2px 0 7px;
  color: var(--muted);
  font-size: 8px;
}

.avail-day__closed {
  margin: 8px 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.avail-day__reason {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 9px;
}

.avail-day.is-blocked .admin-btn {
  margin-top: 2px;
}

.avail-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  margin-bottom: 7px;
}

.avail-slot {
  display: block;
  width: 100%;
  padding: 5px 2px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  text-align: center;
}

.avail-slot.is-free {
  border-color: #dbe3d1;
  background: var(--sage-bg);
  color: #526247;
  cursor: pointer;
}

.avail-slot.is-free:hover {
  background: var(--sage);
  border-color: var(--sage);
  color: #fff;
}

.avail-slot.is-busy {
  border-color: #edd9d2;
  background: #f8eeea;
  color: #a9786d;
  cursor: not-allowed;
  text-decoration: line-through;
}

.avail-slot.is-blocked {
  border-color: rgba(176, 138, 90, 0.3);
  background: #f4e7d8;
  color: #8a6a42;
}

button.avail-slot.is-blocked {
  cursor: pointer;
}

button.avail-slot.is-blocked:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}

.avail-slot.is-past {
  background: var(--cream-2);
  color: #b6a79c;
  cursor: default;
  text-decoration: line-through;
}

/* Bloqueos */
.blocked-list {
  display: grid;
  gap: 6px;
}

.blocked-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--cream);
}

.blocked-row__date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--cream-2);
  line-height: 1;
}

.blocked-row__date span {
  color: var(--gold-ink);
  font-size: 7px;
  text-transform: uppercase;
}

.blocked-row__date strong {
  margin-top: 2px;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--ink);
}

.blocked-row__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.blocked-row__body strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blocked-row__body span {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------------------------------------------
   Horarios
   ------------------------------------------------------------ */
.hours-editor {
  display: grid;
  border-top: 1px solid var(--line-soft);
}

.hour-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 11px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  transition: opacity 0.2s ease;
}

.hour-row:last-child {
  border-bottom: 0;
  padding-bottom: 4px;
}

.hour-row.is-closed {
  opacity: 0.55;
}

.hour-row .switch {
  grid-column: 1 / -1;
}

.hour-row__day {
  grid-column: 1 / -1;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--ink);
}

.hour-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.hour-field > span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hour-field input,
.hour-field select {
  width: 100%;
  min-height: 38px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  color: var(--ink);
  font-size: 12px;
}

.hour-field input:disabled,
.hour-field select:disabled {
  cursor: not-allowed;
}

.hour-field:last-child {
  grid-column: 1 / -1;
}

/* ------------------------------------------------------------
   Servicios
   ------------------------------------------------------------ */
.services-editor {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.service-edit {
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--cream);
}

.service-edit__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.service-edit__num {
  color: var(--gold-ink);
  font-family: var(--font-serif);
  font-size: 1rem;
  font-style: italic;
}

.service-edit .admin-field {
  margin-bottom: 8px;
}

.service-edit .admin-field > span:first-child {
  font-size: 8.5px;
}

.service-edit .admin-field input,
.service-edit .admin-field textarea {
  min-height: 38px;
  padding: 8px 10px;
  background: var(--white);
  font-size: 12.5px;
}

.service-edit .admin-field textarea {
  min-height: 56px;
}

.service-edit__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: end;
}

.service-edit__row .service-edit__delete {
  grid-column: 1 / -1;
  justify-self: start;
  margin-top: 2px;
}

.service-edit__delete {
  padding: 3px 0;
  border: 0;
  border-bottom: 1px solid rgba(169, 71, 58, 0.3);
  background: none;
  color: var(--danger);
  font-size: 9.5px;
  letter-spacing: 0.04em;
}

.service-edit__delete:hover {
  border-color: var(--danger);
}

.add-service {
  width: 100%;
  margin-top: 0.8rem;
}

/* ------------------------------------------------------------
   Navegación mobile
   ------------------------------------------------------------ */
.mobile-tabs {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  padding: 7px 4px calc(7px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-soft);
  background: rgba(255, 253, 251, 0.96);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.mobile-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 2px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.03em;
}

.mobile-tab .icon {
  width: 19px;
  height: 19px;
}

.mobile-tab.is-active {
  background: var(--cream-2);
  color: #8a5346;
}

/* ------------------------------------------------------------
   Modales
   ------------------------------------------------------------ */
.modal {
  position: relative;
  width: min(100% - 2rem, 540px);
  max-height: 90vh;
  padding: 24px;
  overflow-y: auto;
  border: 1px solid rgba(176, 138, 90, 0.28);
  border-radius: 20px;
  background: var(--cream);
  color: var(--ink-soft);
  box-shadow: var(--shadow-lg);
}

.modal::backdrop {
  background: rgba(30, 24, 21, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.modal--sm {
  width: min(100% - 2rem, 420px);
  text-align: center;
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  color: var(--ink);
}

.modal__close .icon {
  width: 15px;
  height: 15px;
}

.modal__eyebrow {
  color: var(--gold-ink);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.modal h2 {
  margin-top: 5px;
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 600;
  line-height: 1.05;
  color: var(--ink);
}

.modal__meta {
  margin-top: 6px;
  margin-bottom: 1.1rem;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.modal__field {
  margin-top: 1rem;
}

.modal__label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-chips {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.admin-chip {
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink-soft);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.2s ease, color 0.2s ease,
    border-color 0.2s ease;
}

.admin-chip:hover {
  border-color: var(--rose);
}

.admin-chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}

.modal__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 1.3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
}

.modal--sm .modal__actions {
  justify-content: center;
}

.confirm-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--sage-bg);
  color: var(--sage);
}

.confirm-icon.is-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.confirm-icon .icon {
  width: 22px;
  height: 22px;
}

/* ------------------------------------------------------------
   Toast
   ------------------------------------------------------------ */
.admin-toast {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 1200;
  max-width: min(92vw, 440px);
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.admin-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.admin-toast--success {
  background: #3d5340;
}

.admin-toast--error {
  background: #8e3f35;
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (min-width: 560px) {
  .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

  .appt {
    grid-template-columns: 60px minmax(0, 1fr);
  }

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

@media (min-width: 760px) {
  .admin-topbar {
    padding: 1.4rem 2rem 1rem;
    align-items: center;
  }

  .admin-user {
    display: block;
  }

  .admin-content {
    padding: 1.3rem 2rem 3rem;
  }

  .appt {
    grid-template-columns: 68px minmax(0, 1fr) auto;
    gap: 15px;
    padding: 15px;
  }

  .appt__actions {
    grid-column: auto;
    align-self: center;
    justify-content: flex-end;
    padding-top: 0;
  }

  .appt__date {
    padding: 9px 3px;
  }

  .appt__date > strong {
    font-size: 1.7rem;
  }

  .appt__title-row h3 {
    font-size: 1.4rem;
  }

  .appt__service {
    font-size: 11.5px;
  }

  .appt__actions {
    max-width: 260px;
  }

  .avail-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hour-row {
    grid-template-columns: auto 1.1fr 1fr 1fr 0.9fr;
    align-items: center;
    gap: 10px;
    padding: 11px 0;
  }

  .hour-row .switch,
  .hour-row__day,
  .hour-field:last-child {
    grid-column: auto;
  }

  .hour-row__day {
    font-size: 1.2rem;
  }

  .hour-field {
    grid-column: auto;
  }

  .modal {
    padding: 28px;
  }
}

@media (min-width: 980px) {
  .admin-app {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
  }

  .sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 22px 16px;
    background: linear-gradient(170deg, #352b25 0%, #241d19 100%);
    color: var(--cream);
    overflow-y: auto;
  }

  .sidebar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 3px 6px 0;
  }

  .sidebar__mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(217, 196, 166, 0.5);
    border-radius: 50%;
    color: var(--gold-light);
    font-family: var(--font-serif);
    font-size: 20px;
    font-style: italic;
    padding-top: 2px;
  }

  .sidebar__brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
  }

  .sidebar__brand-text strong {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 500;
  }

  .sidebar__brand-text small {
    margin-top: 3px;
    color: rgba(217, 196, 166, 0.65);
    font-size: 7.5px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
  }

  .sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 2.2rem;
  }

  .side-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: rgba(251, 247, 242, 0.6);
    font-size: 11.5px;
    text-align: left;
    transition: background-color 0.2s ease, color 0.2s ease;
  }

  .side-link .icon {
    width: 17px;
    height: 17px;
    color: rgba(217, 196, 166, 0.55);
  }

  .side-link:hover {
    background: rgba(251, 247, 242, 0.06);
    color: var(--cream);
  }

  .side-link.is-active {
    background: rgba(251, 247, 242, 0.1);
    color: var(--cream);
    box-shadow: inset 2px 0 0 var(--gold);
  }

  .side-link.is-active .icon {
    color: var(--gold-light);
  }

  .side-link__badge {
    min-width: 18px;
    margin-left: auto;
    padding: 1px 5px;
    border-radius: 999px;
    background: var(--gold);
    color: var(--ink);
    font-size: 8px;
    font-weight: 600;
    text-align: center;
  }

  .sidebar__foot {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(251, 247, 242, 0.1);
  }

  .sidebar__foot a,
  .sidebar__foot button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(251, 247, 242, 0.5);
    font-size: 10px;
    text-align: left;
    transition: background-color 0.2s ease, color 0.2s ease;
  }

  .sidebar__foot a:hover,
  .sidebar__foot button:hover {
    background: rgba(251, 247, 242, 0.06);
    color: var(--cream);
  }

  .sidebar__foot .icon {
    width: 14px;
    height: 14px;
  }

  .admin-topbar {
    padding: 1.6rem 2.5rem 1.1rem;
  }

  .admin-topbar h1 {
    font-size: 2.2rem;
  }

  .admin-content {
    padding: 1.4rem 2.5rem 3rem;
  }

  .mobile-tabs {
    display: none;
  }

  .admin-toast {
    bottom: 26px;
  }

  .admin-user {
    display: block;
  }

  .panel {
    padding: 20px;
  }

  .stats {
    gap: 0.75rem;
  }

  .stat {
    padding: 15px 17px;
  }

  .stat__value {
    font-size: 2.2rem;
  }

  .avail-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .admin-app {
    grid-template-columns: 264px minmax(0, 1fr);
  }

  .avail-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .services-editor {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 979px) {
  .admin-field input,
  .admin-field select,
  .admin-field textarea,
  .hour-field input,
  .hour-field select,
  .service-edit .admin-field input,
  .service-edit .admin-field textarea {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
