/* Salon Assistant · Panel
   Superficie OPERATE. Una sola idea de marca en el acceso; el resto,
   jerarquía, densidad y precisión. Sin fuentes externas ni build. */

:root {
  /* Tinta y superficies */
  --ink: #241b26;
  --ink-soft: #4b4050;
  --muted: #6e6270;
  --faint: #9a8f9b;
  --paper: #f5f1ec;
  --paper-deep: #ece5de;
  --surface: #ffffff;
  --surface-soft: #fbf8f5;
  --line: #e4dbd4;
  --line-strong: #cbbeb6;

  /* Acento del sector: berenjena profundo */
  --plum: #5c2a4e;
  --plum-deep: #3d1c34;
  --plum-soft: #f0e5eb;
  --plum-line: #dcc5d2;
  --focus: #7a3c69;

  /* Estados */
  --wine: #8b2f3f;
  --wine-soft: #f8e7ea;
  --wine-line: #ecc8ce;
  --sage: #2f6152;
  --sage-soft: #e5efea;
  --sage-line: #c3dccf;
  --amber: #7a571d;
  --amber-soft: #f7eeda;
  --amber-line: #e6d4ad;

  /* Radios con jerarquía: control < panel < pieza editorial */
  --radius-xs: 4px;
  --radius-sm: 7px;
  --radius-md: 12px;
  --radius-lg: 22px;

  /* Tipografía de sistema, sin CDN */
  --font-ui: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text",
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", ui-sans-serif, -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, "Liberation Mono",
    monospace;

  --shadow-hairline: 0 1px 0 rgb(36 27 38 / 4%);
  --shadow-float: 0 18px 50px rgb(36 27 38 / 16%);
  --ease: cubic-bezier(.2, .7, .3, 1);
}

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

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.no-scroll {
  overflow: hidden;
}

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

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

button {
  cursor: pointer;
}

a {
  color: var(--plum);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

::selection {
  background: var(--plum-soft);
  color: var(--plum-deep);
}

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.mono {
  font-family: var(--font-mono);
  font-size: .92em;
  font-variant-numeric: tabular-nums;
}

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

.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;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  background: var(--plum);
  color: #fff;
  font-size: 12.5px;
  font-weight: 620;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 120ms var(--ease);
}

.skip-link:focus {
  transform: none;
}

/* ------------------------------------------------------------------ login */

.login-page {
  background: var(--paper);
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(400px, .92fr);
  min-height: 100dvh;
}

.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(28px, 4.5vw, 64px);
  overflow: hidden;
  background:
    radial-gradient(720px 520px at 8% 4%, #522341 0%, transparent 58%),
    linear-gradient(152deg, #3d1c34 0%, #2e1628 100%);
  color: #f7eef3;
}

.login-wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.login-wordmark-text {
  font-size: 14px;
  font-weight: 620;
  letter-spacing: .01em;
}

.mark,
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--plum);
  color: #fff;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 720;
  letter-spacing: .06em;
}

.login-brand .mark {
  background: #f7eef3;
  color: var(--plum-deep);
}

.login-editorial {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 12vh;
  max-width: 620px;
}

.login-kicker {
  margin-bottom: 18px;
  color: #d9bfd0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.login-editorial h1 {
  font-family: var(--font-display);
  font-size: clamp(44px, 6.4vw, 82px);
  font-weight: 640;
  line-height: .96;
  letter-spacing: -.045em;
}

.login-lede {
  max-width: 34ch;
  margin-top: 26px;
  color: #d9c9d4;
  font-size: 15.5px;
  line-height: 1.55;
}

.login-foot {
  position: relative;
  z-index: 1;
  margin-top: clamp(32px, 6vh, 64px);
  color: #b795ad;
  font-size: 12px;
}

.login-scissors {
  position: absolute;
  right: clamp(16px, 2.5vw, 36px);
  bottom: clamp(18px, 3vh, 42px);
  width: min(460px, 62%);
  color: #eedbe7;
  opacity: .38;
  pointer-events: none;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 64px);
  background:
    linear-gradient(90deg, rgb(36 27 38 / 3%) 0 1px, transparent 1px) 0 0 / 64px 100%,
    var(--paper);
}

.login-card {
  width: min(420px, 100%);
  padding: clamp(26px, 3.6vw, 42px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-hairline);
}

.login-card-head {
  margin-bottom: 26px;
}

.login-card-kicker {
  color: var(--plum);
  font-size: 12px;
  font-weight: 650;
}

.login-card-head h2 {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 640;
  letter-spacing: -.03em;
}

.login-card-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13.5px;
}

.login-help {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.form--login {
  gap: 16px;
}

.form--login .btn {
  margin-top: 4px;
}

/* ------------------------------------------------------------------- app */

.app {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding: 20px 16px 16px;
  border-right: 1px solid var(--line);
  background: var(--surface-soft);
}

.sidebar-head {
  padding: 2px 6px 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-text {
  display: grid;
  gap: 1px;
}

.brand-name {
  font-size: 13.5px;
  font-weight: 680;
  letter-spacing: -.01em;
}

.brand-sub {
  color: var(--muted);
  font-size: 11.5px;
}

.nav {
  display: grid;
  gap: 3px;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 550;
  transition: background 120ms var(--ease), color 120ms var(--ease);
}

.nav-link:hover {
  background: var(--paper-deep);
  color: var(--ink);
}

.nav-link.is-active {
  background: var(--plum-soft);
  color: var(--plum-deep);
  font-weight: 650;
  box-shadow: inset 3px 0 0 var(--plum);
}

.nav-icon {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  color: var(--muted);
}

.nav-icon svg {
  width: 19px;
  height: 19px;
}

.nav-link.is-active .nav-icon {
  color: var(--plum);
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.session-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
}

.session-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--plum-line);
  border-radius: 50%;
  background: var(--plum-soft);
  color: var(--plum-deep);
  font-size: 10.5px;
  font-weight: 720;
  letter-spacing: .04em;
}

.session-text {
  display: grid;
  min-width: 0;
}

.session-caption {
  color: var(--muted);
  font-size: 10.5px;
}

.session-name {
  font-size: 12.5px;
  font-weight: 620;
}

.session-exit {
  margin-left: auto;
}

.sidebar-note {
  padding: 8px 6px 0;
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.4;
}

.app-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 0 clamp(16px, 3vw, 36px);
  border-bottom: 1px solid var(--line);
  background: rgb(245 241 236 / 96%);
}

.topbar-menu {
  display: none;
}

.topbar .topbar-menu {
  display: none;
}

.topbar-local {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.topbar-caption {
  color: var(--muted);
  font-size: 10.5px;
}

.topbar-name {
  overflow: hidden;
  max-width: 42vw;
  font-size: 13px;
  font-weight: 640;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.business-picker {
  margin-left: auto;
}

.nav-scrim {
  display: none;
}

.view {
  width: 100%;
  max-width: 1320px;
  padding: clamp(20px, 3vw, 34px) clamp(16px, 3vw, 36px) 64px;
  margin: 0 auto;
}

/* ------------------------------------------------------------- page head */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.page-head-text h1 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 650;
  line-height: 1.05;
  letter-spacing: -.035em;
}

.page-head-text p {
  max-width: 66ch;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13.5px;
}

.page-actions {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

/* --------------------------------------------------------------- stats */

.stat-strip {
  display: flex;
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.stat {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 13px 20px;
  flex: 1 1 0;
}

.stat + .stat {
  border-left: 1px solid var(--line);
}

.stat-label {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 550;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 630;
  line-height: 1.1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- panel */

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

.panel + .panel {
  margin-top: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-head--stack {
  flex-wrap: wrap;
  align-items: flex-end;
}

.panel-head h2 {
  font-size: 16px;
  font-weight: 660;
  letter-spacing: -.015em;
}

.panel-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.panel-empty {
  padding: 28px 20px;
  color: var(--muted);
  font-size: 13px;
}

/* --------------------------------------------------------------- tables */

.table-wrap {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.data-table {
  width: 100%;
  min-width: 660px;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 620;
  letter-spacing: .02em;
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr {
  transition: background 100ms var(--ease);
}

.data-table tbody tr:hover {
  background: #fcfaf8;
}

.data-table th.num,
.data-table td.num {
  text-align: right;
}

.data-table .actions-col {
  width: 1%;
  text-align: right;
}

.cell-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  white-space: nowrap;
}

.cell-title {
  display: block;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -.005em;
}

.cell-sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
}

.strong-num {
  font-weight: 640;
}

.time-sep {
  padding: 0 2px;
  color: var(--faint);
}

.person {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--plum-soft);
  color: var(--plum-deep);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: .02em;
}

.text-preview {
  max-width: 46ch;
  color: var(--ink-soft);
  font-size: 12.5px;
}

.data-table--texts td {
  vertical-align: top;
}

/* -------------------------------------------------------------- badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 8px;
  border-radius: 999px;
  background: var(--paper-deep);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 640;
  line-height: 1.3;
  white-space: nowrap;
}

.badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.badge--active,
.badge--confirmed,
.badge--open,
.badge--available,
.badge--extra {
  background: var(--sage-soft);
  color: var(--sage);
}

.badge--inactive,
.badge--original {
  background: var(--paper-deep);
  color: var(--muted);
}

.badge--cancelled,
.badge--no_show,
.badge--closed,
.badge--blocked,
.badge--sick {
  background: var(--wine-soft);
  color: var(--wine);
}

.badge--completed {
  background: #e9e4ec;
  color: #52415a;
}

.badge--vacation,
.badge--training,
.badge--custom {
  background: var(--plum-soft);
  color: var(--plum);
}

.badge--other {
  background: var(--amber-soft);
  color: var(--amber);
}

/* -------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 13px;
  font-weight: 610;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 120ms var(--ease),
    border-color 120ms var(--ease),
    color 120ms var(--ease),
    transform 80ms var(--ease);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.btn--primary {
  background: var(--plum);
  color: #fff;
  border-color: var(--plum);
}

.btn--primary:hover:not(:disabled) {
  background: var(--plum-deep);
  border-color: var(--plum-deep);
}

.btn--ghost {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
}

.btn--ghost:hover:not(:disabled) {
  border-color: var(--ink-soft);
  background: var(--surface-soft);
  color: var(--ink);
}

.btn--quiet {
  color: var(--muted);
}

.btn--quiet:hover:not(:disabled) {
  background: var(--paper-deep);
  color: var(--ink);
}

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

.btn--danger:hover:not(:disabled) {
  background: #742433;
}

.btn--danger-quiet {
  color: var(--wine);
}

.btn--danger-quiet:hover:not(:disabled) {
  background: var(--wine-soft);
}

.btn--sm {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.btn--block {
  width: 100%;
  min-height: 42px;
}

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

.btn.is-busy {
  opacity: .6;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  transition: background 120ms var(--ease), color 120ms var(--ease);
}

.icon-btn:hover {
  background: var(--paper-deep);
  color: var(--ink);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

/* ---------------------------------------------------------------- forms */

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

.form--tight {
  gap: 10px;
  margin-top: 10px;
}

.field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

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

.field__label {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 630;
}

.field__hint {
  margin-left: 3px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 500;
}

.field__help {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.field__input,
.select {
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 14px;
  transition: border-color 120ms var(--ease), box-shadow 120ms var(--ease);
}

.field__input::placeholder {
  color: var(--faint);
}

.field__input:hover,
.select:hover {
  border-color: #b8a8a0;
}

.field__input:focus,
.select:focus {
  border-color: var(--plum);
  outline: none;
  box-shadow: 0 0 0 3px rgb(92 42 78 / 13%);
}

.field__input[aria-invalid="true"],
.select[aria-invalid="true"] {
  border-color: var(--wine);
  box-shadow: 0 0 0 3px rgb(139 47 63 / 10%);
}

.field__input:disabled,
.select:disabled {
  background: var(--paper-deep);
  color: var(--muted);
  cursor: not-allowed;
}

.field__input--code {
  min-height: 150px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  resize: vertical;
}

textarea.field__input {
  resize: vertical;
}

.select {
  appearance: none;
  padding-right: 34px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% + 1px),
    calc(100% - 11px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.select--compact {
  width: auto;
  min-width: 150px;
  min-height: 34px;
  padding: 5px 32px 5px 10px;
  font-size: 12.5px;
  font-weight: 560;
}

.fieldset {
  padding: 0;
  border: 0;
  margin: 0;
}

.fieldset legend {
  margin-bottom: 6px;
}

.field-error {
  color: var(--wine);
  font-size: 11.5px;
}

.input-suffix {
  position: relative;
}

.input-suffix .field__input {
  padding-right: 46px;
  font-variant-numeric: tabular-nums;
}

.input-suffix__text {
  position: absolute;
  top: 50%;
  right: 11px;
  transform: translateY(-50%);
  color: var(--faint);
  font-size: 11.5px;
  pointer-events: none;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  cursor: pointer;
}

.check input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 2px 0 0;
  accent-color: var(--plum);
  flex: 0 0 auto;
}

.check--muted {
  color: var(--muted);
}

.check--switch {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.check-note {
  color: var(--faint);
  font-size: 11px;
}

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

.inline-filter,
.range-filter,
.filter-bar {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.field--inline {
  gap: 3px;
}

.field--inline .field__label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
}

.field--inline .field__input,
.field--inline .select {
  min-height: 34px;
  padding-top: 5px;
  padding-bottom: 5px;
  font-size: 12.5px;
}

.range-filter .field__input {
  width: 132px;
}

/* --------------------------------------------------------------- notices */

.notice {
  display: grid;
  gap: 2px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.45;
}

.notice strong {
  font-weight: 650;
}

.notice--error {
  border-color: var(--wine-line);
  border-left-color: var(--wine);
  background: var(--wine-soft);
  color: #712431;
}

.notice--warn {
  border-color: var(--amber-line);
  border-left-color: var(--amber);
  background: var(--amber-soft);
  color: #6a4a16;
}

.notice--ok {
  border-color: var(--sage-line);
  border-left-color: var(--sage);
  background: var(--sage-soft);
  color: var(--sage);
}

/* ---------------------------------------------------------- empty state */

.empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: clamp(38px, 6vw, 64px) 24px;
  text-align: center;
}

.empty-art {
  width: 54px;
  height: 54px;
  margin-bottom: 4px;
  color: var(--plum);
  opacity: .5;
}

.empty-state h2 {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -.02em;
}

.empty-state p {
  max-width: 46ch;
  color: var(--muted);
  font-size: 13px;
}

.empty-state .btn {
  margin-top: 8px;
}

/* ---------------------------------------------------------------- pager */

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}

.pager-text {
  color: var(--muted);
  font-size: 12px;
}

/* ---------------------------------------------------------------- drawer */

.drawer {
  width: min(560px, 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  padding: 0;
  margin: 0 0 0 auto;
  border: 0;
  border-left: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-float);
}

.drawer[open] {
  animation: drawer-in 180ms var(--ease);
}

.drawer::backdrop {
  background: rgb(36 27 38 / 42%);
}

@keyframes drawer-in {
  from {
    opacity: .7;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.drawer-body {
  height: 100%;
}

.drawer-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.drawer-inner > .form {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.drawer-inner > .form > .drawer-body-scroll {
  flex: 1;
  min-height: 0;
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.drawer-head h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -.03em;
}

.drawer-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
}

.drawer-body-scroll {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding: 20px 24px 28px;
}

.drawer-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.drawer-foot--split {
  justify-content: space-between;
}

.drawer-foot-group {
  display: flex;
  gap: 8px;
}

.drawer-foot--flush {
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
  background: transparent;
}

.drawer-section {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.drawer-section h3 {
  margin-bottom: 4px;
  font-size: 13.5px;
  font-weight: 660;
}

.action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* --------------------------------------------------- detalle de reserva */

.appointment-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.appointment-time {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 640;
  letter-spacing: -.03em;
}

.appointment-end {
  color: var(--muted);
  font-size: 16px;
  font-weight: 500;
}

.appointment-service {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.5px;
}

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

.detail-grid dt {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
}

.detail-grid dd {
  margin-top: 2px;
  font-size: 13px;
}

.mini-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.mini-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.mini-table th,
.mini-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.mini-table th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
}

.mini-table tr:last-child td {
  border-bottom: 0;
}

.mini-table .num {
  text-align: right;
}

/* ------------------------------------------------------------ textos */

.text-key-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.text-key-actions {
  flex: 0 0 auto;
}

.chips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.chip {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--plum-soft);
  color: var(--plum-deep);
  font-family: var(--font-mono);
  font-size: 11px;
}

.text-meta {
  display: grid;
  gap: 5px;
}

.text-default {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--muted);
  font-size: 12.5px;
}

.text-default summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink-soft);
}

.text-default p {
  margin-top: 8px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.text-meta-line {
  color: var(--faint);
  font-size: 11.5px;
}

.reset-form {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* ---------------------------------------------------------------- toast */

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 14px;
  border: 1px solid #3b2d3d;
  border-radius: var(--radius-md);
  background: var(--ink);
  color: #f8f3f6;
  font-size: 12.5px;
  line-height: 1.4;
  box-shadow: 0 10px 30px rgb(36 27 38 / 22%);
  animation: toast-in 160ms var(--ease);
}

.toast-dot {
  width: 7px;
  height: 7px;
  margin-top: 5px;
  border-radius: 50%;
  background: #8fc9af;
  flex: 0 0 auto;
}

.toast--error .toast-dot {
  background: #e796a1;
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 180ms var(--ease), transform 180ms var(--ease);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 1120px) {
  .app {
    grid-template-columns: 224px minmax(0, 1fr);
  }

  .stat {
    padding: 12px 16px;
  }

  .stat-value {
    font-size: 19px;
  }
}

@media (max-width: 960px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(84vw, 300px);
    transform: translateX(-102%);
    transition: transform 200ms var(--ease);
    box-shadow: 0 0 60px rgb(36 27 38 / 22%);
  }

  .app.nav-open .sidebar {
    transform: none;
  }

  .nav-scrim {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    z-index: 25;
    border: 0;
    background: rgb(36 27 38 / 40%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms var(--ease);
  }

  .app.nav-open .nav-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .topbar-menu {
    display: inline-flex;
  }

  .topbar .topbar-menu {
    display: inline-flex;
  }

  .topbar {
    gap: 10px;
    min-height: 58px;
  }

  .topbar-local {
    display: none;
  }

  .business-picker {
    margin-left: auto;
  }

  .stat-strip {
    overflow: hidden;
  }

  .stat {
    flex: 1 1 0;
    min-width: 0;
    padding: 10px 12px;
  }

  .stat-label {
    font-size: 10.5px;
  }

  .stat-value {
    font-size: 18px;
  }
}

@media (max-width: 760px) {
  .page-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .btn--primary {
    flex: 1;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .panel-head .inline-filter,
  .panel-head .range-filter {
    width: 100%;
  }

  .range-filter .field {
    flex: 1 1 120px;
  }

  .range-filter .field__input {
    width: 100%;
  }

  .field-row {
    grid-template-columns: minmax(0, 1fr);
  }

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

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

  .drawer {
    width: 100vw;
    border-left: 0;
  }

  .drawer-head,
  .drawer-body-scroll,
  .drawer-foot {
    padding-left: 18px;
    padding-right: 18px;
  }

  .drawer-foot {
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }

  .drawer-foot--split {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .drawer-foot-group {
    justify-content: space-between;
  }

  .toast-stack {
    right: 12px;
    bottom: 12px;
  }

  .data-table {
    min-width: 0;
  }

  .data-table thead {
    display: none;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 16px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
  }

  .data-table tbody tr:last-child {
    border-bottom: 0;
  }

  .data-table td {
    padding: 2px 0;
    border: 0;
    min-width: 0;
  }

  .data-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 1px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 620;
    letter-spacing: .01em;
  }

  .data-table td:first-child {
    grid-column: 1 / -1;
  }

  .data-table td:first-child::before {
    display: none;
  }

  .data-table th.num,
  .data-table td.num {
    text-align: left;
  }

  .data-table .cell-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-top: 8px;
  }

  .data-table .cell-actions::before {
    display: none;
  }

  .data-table .text-preview {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .login-shell {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    min-height: 100dvh;
  }

  .login-brand {
    min-height: auto;
    padding: 24px 20px 20px;
  }

  .login-editorial {
    margin-top: 28px;
    padding-top: 0;
  }

  .login-editorial h1 {
    font-size: clamp(34px, 10vw, 44px);
  }

  .login-editorial h1 br {
    display: none;
  }

  .login-lede,
  .login-scissors,
  .login-foot {
    display: none;
  }

  .login-panel {
    padding: 20px 16px 40px;
    background: var(--paper);
  }

  .login-card {
    padding: 24px 20px;
    border-radius: var(--radius-md);
  }

  .login-card-head h2 {
    font-size: 26px;
  }

  .view {
    padding-bottom: 48px;
  }

  .stat-value {
    font-size: 20px;
  }
}

/* ------------------------------------------------------- datos y negocios */

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  min-width: 0;
}

.business-picker {
  margin-left: 0;
}

.topbar-new {
  white-space: nowrap;
}

.data-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.data-head-text {
  flex: 1;
  min-width: 0;
}

.data-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 650;
  letter-spacing: -.03em;
}

.data-head p {
  max-width: 62ch;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.data-head > .btn--primary {
  margin-left: auto;
}

.data-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.data-search {
  display: flex;
  flex: 1;
  gap: 8px;
  align-items: center;
  max-width: 620px;
}

.data-search .field__input {
  height: 36px;
}

.data-count {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 12px;
  padding-bottom: 4px;
}

.data-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: background 120ms var(--ease), border-color 120ms var(--ease);
}

.data-card:hover {
  border-color: var(--plum-line);
  background: var(--surface-soft);
}

.data-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.data-card-name {
  font-size: 14.5px;
  font-weight: 660;
}

.data-card-count {
  color: var(--plum);
  font-size: 18px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.data-card-desc {
  min-height: 2.9em;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.data-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  margin-top: auto;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.data-card-go {
  color: var(--plum);
  font-weight: 620;
}

.system-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0 24px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.system-list li {
  display: grid;
  gap: 3px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.system-list strong {
  font-size: 12.5px;
  font-weight: 650;
}

.system-list span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.readonly-list {
  display: grid;
  margin: 0 0 4px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.readonly-list > div {
  display: grid;
  grid-template-columns: minmax(110px, 150px) minmax(0, 1fr);
  gap: 12px;
  padding: 9px 12px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
  font-size: 12.5px;
}

.readonly-list > div:first-child {
  border-top: 0;
}

.readonly-list dt {
  color: var(--muted);
}

.readonly-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.notice--info {
  border-color: var(--plum-line);
  border-left-color: var(--plum);
  background: var(--plum-soft);
  color: var(--plum-deep);
}

.notice-list {
  display: grid;
  gap: 4px;
  padding-left: 18px;
  margin: 8px 0 0;
  font-weight: 400;
}

.data-table tr.is-muted td {
  color: var(--muted);
}

.check--error {
  color: var(--wine);
}

@media (max-width: 960px) {
  .topbar-tools {
    margin-left: auto;
  }

  .topbar-new {
    padding-inline: 10px;
    font-size: 12px;
  }

  .data-head > .btn--primary {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 760px) {
  .data-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .data-search {
    flex-wrap: wrap;
  }

  .data-search .field__input {
    flex: 1 1 100%;
  }

  .data-toolbar {
    align-items: flex-start;
  }

  .system-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
