
@import url('tokens.css');
@import url('layout.css');

:root {
  --bg:           var(--bg-deep);
  --card-bg:      var(--bg-card);
  --text:         var(--text-main);
  --text-2:       var(--text-muted);
  --text-3:       var(--text-subtle);
  --primary:      var(--accent);
  --border-2:     var(--border-input);

  --radius:       24px;
  --radius-sm:    14px;
  --radius-xs:    10px;
  --radius-pill:  999px;
  --radius-card:  24px;
  --blur-glass:   22px;
  --space-card:   36px;
  --space-stack:  28px;
  --ease-plata:   cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast: 0.2s;

  --shadow:       0 1px 2px rgba(var(--shadow-color), 0.04), 0 8px 32px rgba(var(--shadow-color), 0.06);
  --shadow-md:    0 16px 48px rgba(var(--shadow-color), 0.10);
  --shadow-sm:    0 2px 8px rgba(var(--shadow-color), 0.05);
  --shadow-hover: 0 20px 56px rgba(var(--shadow-color), 0.12);

  --font:         'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --sidebar-w:    260px;
  --topbar-h:     60px;
  --bottom-nav-h: 64px;
  --transition:   0.18s cubic-bezier(0.22, 1, 0.36, 1);
  --page-pad:     16px;
  --section-gap:  32px;

  /* Typography scale — xs → 2xl */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  clamp(1.5rem, 3vw, 2rem);

  /* Spacing — 4px grid */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text-main);
  font-size: var(--text-base);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse 80% 50% at 50% -10%, var(--body-glow), transparent 70%);
}

body.modal-open { overflow: hidden; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition), opacity var(--transition);
}
a:hover { color: var(--accent-hover); }

img { max-width: 100%; display: block; }
button { font-family: var(--font); cursor: pointer; border: none; outline: none; min-height: 44px; }
input, select, textarea { font-family: var(--font); font-size: var(--text-base); }
h1, h2, h3, h4, h5 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.03em; line-height: 1.25; }

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

.btn:focus:not(:focus-visible),
.tab-btn:focus:not(:focus-visible),
.auth-tab:focus:not(:focus-visible),
.nav-item:focus:not(:focus-visible) {
  outline: none;
}

.icon-wrap, .icon-svg { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; vertical-align: middle; }
.icon-wrap svg { display: block; }

.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.sidebar {
  width: var(--sidebar-w);
  background: rgba(255, 255, 255, 0.96);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 2px 0 24px rgba(0, 0, 0, 0.03);
}

.sidebar-logo {
  padding: 20px var(--page-pad);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.03em;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo .logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.nav-section-title {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  min-height: 44px;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  text-decoration: none;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: rgba(249,115,22,0.06);
  color: var(--text-main);
}

.nav-item.active {
  background: rgba(249,115,22,0.08);
  color: var(--text-main);
  border-left-color: var(--accent);
  font-weight: 600;
}

.nav-item .nav-icon { width: 20px; height: 20px; color: currentColor; }

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8125rem;
  flex-shrink: 0;
  border: 1px solid rgba(249,115,22,0.25);
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 0.8125rem; font-weight: 600; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.75rem; color: var(--text-muted); }

.btn-logout {
  background: none;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  color: var(--text-muted);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition), background var(--transition);
}

.btn-logout:hover { color: var(--danger); background: rgba(239,68,68,0.1); }

.bottom-nav {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 190;
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.04);
}

.bottom-nav-inner {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  max-width: 420px;
  margin: 0 auto;
  height: var(--bottom-nav-h);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 44px;
  min-height: 44px;
  color: var(--text-muted);
  font-size: 0.625rem;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition);
  padding: 6px 4px;
}

.bottom-nav-item .icon-wrap { color: currentColor; }
.bottom-nav-item.active { color: var(--accent); }
.bottom-nav-item.active .icon-wrap { color: var(--accent); }

.main-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.topbar {
  height: var(--topbar-h);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--page-pad);
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow var(--transition);
}

.topbar.nav-scrolled { box-shadow: 0 4px 24px rgba(var(--shadow-color), 0.05); }
.topbar.nav-hidden { transform: translateY(-100%); }

.topbar-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  flex: 1;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1.25;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle[data-mode="auto"] { box-shadow: inset 0 0 0 2px var(--accent-dim); }

.theme-toggle-floating {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 120;
}

.nav-theme-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.hamburger {
  display: none;
  background: none;
  padding: 10px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  position: relative;
}

.hamburger::before,
.hamburger::after {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  transition: var(--transition);
}

.hamburger::before { top: 14px; box-shadow: 0 7px 0 currentColor; }
.hamburger::after { top: 28px; }

.hamburger:hover { background: rgba(249,115,22,0.08); color: var(--text-main); }

.page-content {
  padding: var(--space-6) var(--page-pad) var(--space-12);
  flex: 1;
  max-width: 1400px;
  width: 100%;
  animation: pageIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: var(--section-gap);
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.15;
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

.page-header p {
  font-size: var(--text-base);
  color: var(--text-muted);
  margin-top: var(--space-2);
  line-height: 1.6;
  font-weight: 400;
  max-width: 52ch;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  padding: var(--space-card);
  box-shadow: var(--shadow);
  transition: border-color var(--duration-fast) ease, box-shadow 0.3s var(--ease-plata), transform 0.3s var(--ease-plata);
}

@media (hover: hover) {
  .card:hover {
    border-color: rgba(249, 115, 22, 0.25);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
  }
}

.card-sm { padding: 16px; }
.card-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  letter-spacing: -0.02em;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-stack);
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  padding: 22px var(--space-card);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-fast) ease-in-out, box-shadow 0.35s var(--ease-plata), transform 0.35s var(--ease-plata);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient);
}

@media (hover: hover) {
  .stat-card:hover {
    border-color: rgba(249, 115, 22, 0.25);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
  }
}

.stat-icon { color: var(--accent); margin-bottom: 4px; }

.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.4;
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-5); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition), color var(--transition);
  white-space: nowrap;
  line-height: 1.3;
  text-transform: none;
  will-change: transform;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 4px 16px rgba(249, 115, 22, 0.28);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: scale(1.03);
  box-shadow: 0 8px 28px rgba(249, 115, 22, 0.38);
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-secondary:hover {
  background: var(--accent-dim);
  transform: scale(1.02);
}

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-input);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
  transform: scale(1.02);
}

.btn-danger {
  background: rgba(239,68,68,0.1);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.25);
}

.btn-danger:hover { background: rgba(239,68,68,0.16); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover { background: var(--surface); color: var(--text-main); }

.btn-sm { padding: 10px 16px; min-height: 44px; font-size: var(--text-sm); }
.btn-lg { padding: 14px 24px; min-height: 48px; font-size: var(--text-base); }
.btn[disabled], .btn.loading { opacity: 0.45; pointer-events: none; }
.btn .spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin 0.6s linear infinite; }

.form-group { margin-bottom: var(--space-5); }

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: var(--space-2);
  line-height: 1.4;
}

.form-input {
  width: 100%;
  padding: 12px var(--space-4);
  border: 1px solid var(--border-input) !important;
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  color: var(--text-main) !important;
  background: var(--bg-card) !important;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  outline: none;
  line-height: 1.5;
  min-height: 48px;
}

.form-input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.form-input:focus-visible {
  outline: none;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.form-input:hover:not(:focus) { border-color: var(--border-input) !important; }
.form-input::placeholder { color: var(--text-subtle); }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }
.form-error { font-size: 0.75rem; color: var(--danger); margin-top: 6px; }

.form-input.input-invalid {
  border-color: var(--danger) !important;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237C7F9E' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

select.form-input option { background: var(--bg-card); color: var(--text-main); }
textarea.form-input { resize: vertical; min-height: 96px; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: rgba(249,115,22,0.04); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-green  { background: var(--badge-success-bg); color: var(--badge-success-fg); }
.badge-red    { background: var(--badge-danger-bg); color: var(--badge-danger-fg); }
.badge-yellow { background: var(--badge-warn-bg); color: var(--badge-warn-fg); }
.badge-blue   { background: var(--badge-info-bg); color: var(--badge-info-fg); }
.badge-gray   { background: rgba(23, 28, 38, 0.06); color: var(--text-muted); }
.badge-purple { background: var(--badge-accent-bg); color: var(--badge-accent-fg); }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-5);
  text-align: center;
  gap: var(--space-3);
}

.empty-state .empty-icon {
  color: var(--text-subtle);
  margin-bottom: var(--space-1);
  opacity: 0.7;
}

.empty-state h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.empty-state p {
  font-size: var(--text-sm);
  color: var(--text-muted);
  max-width: 340px;
  line-height: 1.6;
}

#toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  left: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  align-items: flex-end;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: 0.875rem;
  font-weight: 500;
  pointer-events: all;
  animation: toastIn 0.25s ease;
  max-width: min(360px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  backdrop-filter: blur(12px);
}

.toast-success { border-left: 3px solid var(--success); }
.toast-success .toast-icon { color: var(--success); animation: checkBounce 0.45s ease; }
.toast-error   { border-left: 3px solid var(--danger); }
.toast-info    { border-left: 3px solid var(--accent); }
.toast-warn    { border-left: 3px solid var(--warn); }
.toast.hide    { animation: toastOut 0.22s ease forwards; }

@keyframes toastIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(12px); } }
@keyframes checkBounce {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 20, 22, 0.45);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  padding: 20px;
  animation: fadeIn 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.25s ease;
  box-shadow: var(--shadow-md);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-title {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border-radius: var(--radius-pill);
  margin-bottom: 24px;
  border: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  flex: 1;
  min-width: max-content;
  padding: 10px 16px;
  min-height: 44px;
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  font-weight: 600;
  background: transparent;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
  text-align: center;
  white-space: nowrap;
}

.tab-btn.active {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 4px 16px rgba(249, 115, 22, 0.28);
}

.tab-btn:hover:not(.active) { color: var(--text-main); background: rgba(249,115,22,0.06); }
.tab-panel { display: none; animation: pageIn 0.25s ease; }
.tab-panel.active { display: block; }

/* Underline tabs (client, masters pages) */
.tabs-wrap { margin-top: var(--space-5); }

.tabs-wrap .tab-list {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-5);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tabs-wrap .tab-list::-webkit-scrollbar { display: none; }

.tabs-wrap .tab-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: var(--space-3) var(--space-4);
  min-height: 44px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  box-shadow: none;
}

.tabs-wrap .tab-btn:hover:not(.active) {
  color: var(--text-main);
  background: rgba(249, 115, 22, 0.04);
}

.tabs-wrap .tab-btn.active {
  color: var(--accent);
  background: transparent;
  border-bottom-color: var(--accent);
  box-shadow: none;
}

.tabs-wrap .tab-panel { display: none; }
.tabs-wrap .tab-panel.active { display: block; }

.alert-glass, .owner-hint, .glass-alert {
  background: rgba(249,115,22,0.06);
  border: 1px solid rgba(249,115,22,0.15);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.cal-header {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-subtle);
  padding: 8px 0;
  text-transform: uppercase;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  color: var(--text-main);
  min-height: 44px;
}

.cal-day:hover { background: var(--accent-dim); color: var(--accent-soft); }
.cal-day.today { background: var(--gradient); color: var(--on-accent); font-weight: 700; }
.cal-day.selected { background: var(--cal-selected-bg); color: var(--accent-soft); font-weight: 600; border: 1px solid var(--cal-selected-border); }
.cal-day.other-month { color: var(--text-subtle); }

.page-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  flex-shrink: 0;
}

.spinner-lg { width: 32px; height: 32px; border-width: 2.5px; }

.skeleton-line {
  height: 14px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.skeleton-line-lg { height: 28px; width: 45%; }
.skeleton-line-md { height: 16px; width: 65%; }

.skeleton-card {
  margin-top: 8px;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.stagger-children > * {
  animation: pageIn 0.3s ease backwards;
}
.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }

.upgrade-banner {
  text-align: center;
  padding: 32px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.upgrade-banner-title { font-size: 1.125rem; font-weight: 700; margin-bottom: 8px; }
.upgrade-banner-text { color: var(--text-muted); font-size: 0.875rem; margin: 0 0 20px; line-height: 1.5; }

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.search-wrap { position: relative; flex: 1; min-width: 0; width: 100%; }
.search-wrap .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  pointer-events: none;
  display: flex;
}

.search-wrap .form-input { padding-left: 42px; }

.auth-page {
  min-height: 100vh;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--page-pad);
  position: relative;
}

.auth-page::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 70% 40% at 50% -5%, rgba(249,115,22,0.12), transparent);
}

.auth-card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  padding: var(--space-8) var(--space-6);
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
  isolation: isolate;
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--duration-fast) ease-in-out, transform 0.55s var(--ease-plata);
}

.auth-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  backdrop-filter: blur(var(--blur-glass));
  -webkit-backdrop-filter: blur(var(--blur-glass));
  opacity: 0.25;
  transition: opacity 0.5s var(--ease-plata);
}

.auth-card > * { position: relative; z-index: 1; }

.auth-card.reveal.in-view,
.auth-card:not(.reveal) {
  animation: pageIn 0.55s var(--ease-plata);
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: var(--space-2);
  letter-spacing: -0.04em;
  font-family: var(--font-display);
  line-height: 1.15;
}

.auth-logo-mark,
.book-logo-mark {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.auth-subtitle {
  font-size: var(--text-base);
  color: var(--text-muted);
  margin-bottom: var(--space-6);
  line-height: 1.6;
  font-weight: 400;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 28px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
}

.auth-tab {
  flex: 1;
  padding: 10px 12px;
  min-height: 44px;
  font-size: 0.875rem;
  font-weight: 600;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--duration-fast) ease-in-out;
}

.auth-tab.active {
  background: var(--accent);
  color: var(--on-accent);
}

.booking-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition), transform var(--transition);
}

@media (hover: hover) {
  .booking-card:hover {
    border-color: rgba(249, 115, 22, 0.25);
    background: var(--bg-card);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
  }
}

.booking-time {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 48px;
  text-align: center;
  background: var(--accent-dim);
  border-radius: var(--radius-xs);
  padding: 6px 8px;
  line-height: 1.25;
}

.booking-info { flex: 1; min-width: 0; }
.booking-name { font-size: 0.875rem; font-weight: 600; color: var(--text-main); }
.booking-meta { font-size: 0.8125rem; color: var(--text-muted); margin-top: 4px; }
.booking-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }

.master-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-fast) ease-in-out, box-shadow 0.35s var(--ease-plata), transform 0.35s var(--ease-plata);
}

@media (hover: hover) {
  .master-card:hover {
    border-color: rgba(249, 115, 22, 0.25);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
  }
}

.master-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  font-weight: 700;
  border: 2px solid rgba(249,115,22,0.25);
}

.master-name { font-size: 0.9375rem; font-weight: 700; color: var(--text-main); }
.master-spec { font-size: 0.8125rem; color: var(--text-muted); }

.service-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition), transform var(--transition);
}

.service-row:hover {
  border-color: rgba(249, 115, 22, 0.25);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.service-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-dim);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}

.service-name { font-size: 0.875rem; font-weight: 600; flex: 1; color: var(--text-main); }
.service-price { font-size: 0.875rem; font-weight: 700; color: var(--accent-2); white-space: nowrap; }
.service-dur { font-size: 0.75rem; color: var(--text-muted); }

.slot-grid { display: flex; flex-wrap: wrap; gap: 8px; }

.slot-btn {
  padding: 10px 14px;
  min-height: 44px;
  border-radius: var(--radius-xs);
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid var(--border-input);
  background: var(--bg-card);
  color: var(--text-main);
  transition: all var(--transition);
}

.slot-btn:hover:not([disabled]) { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.slot-btn.selected { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.slot-btn[disabled] { opacity: 0.3; cursor: not-allowed; }

.plan-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
  background: var(--bg-card);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.plan-card.featured {
  border-color: rgba(249,115,22,0.5);
  box-shadow: 0 0 0 1px rgba(249,115,22,0.25), 0 16px 40px rgba(249,115,22,0.12);
}

.plan-name { font-size: 1rem; font-weight: 700; color: var(--text-main); }
.plan-price {
  font-size: 1.875rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 8px 0;
  letter-spacing: -0.04em;
}
.plan-price span { font-size: 0.875rem; font-weight: 400; color: var(--text-muted); }
.plan-features { list-style: none; margin: 14px 0; display: flex; flex-direction: column; gap: 8px; }
.plan-features li { font-size: 0.8125rem; color: var(--text-muted); display: flex; gap: 8px; align-items: flex-start; }
.plan-features li::before { content: ''; width: 6px; height: 6px; margin-top: 7px; border-radius: 50%; background: var(--accent-2); flex-shrink: 0; }

.toggle { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border-input);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background var(--transition);
}
.toggle input:checked + .toggle-track { background: var(--gradient); }
.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--on-accent);
  border-radius: 50%;
  transition: transform var(--transition);
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.35);
}
.toggle input:checked ~ .toggle-thumb { transform: translateX(20px); }

.fab {
  position: fixed;
  right: 20px;
  bottom: calc(var(--bottom-nav-h) + 16px + env(safe-area-inset-bottom, 0px));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 28px rgba(249, 115, 22, 0.38);
  z-index: 120;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.fab:hover {
  transform: scale(1.06);
  background: var(--accent-hover);
  box-shadow: 0 12px 36px rgba(249, 115, 22, 0.45);
}

.drawer { border-left: 1px solid var(--border); background: var(--bg-card); }
.drawer-header { background: var(--bg-card); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(18, 20, 22, 0.35);
  backdrop-filter: blur(4px);
  z-index: 150;
}

.sidebar-overlay.open { display: block; }

.glass {
  background: rgba(249,115,22,0.06);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(249,115,22,0.15);
  border-radius: var(--radius);
}

.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 0;
  border: none;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-accent { color: var(--accent); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

@media (min-width: 768px) {
  :root { --page-pad: 24px; }
  .page-content { padding: var(--space-8) var(--page-pad) var(--space-12); }
}

@media (min-width: 1024px) {
  :root { --page-pad: 28px; --section-gap: 40px; }
  .page-content { padding: var(--space-8) 36px var(--space-12); }
  .page-header { margin-bottom: var(--section-gap); }
}

@media (min-width: 1440px) {
  :root { --page-pad: 36px; }
  .page-content { padding: 40px var(--page-pad) 56px; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: min(280px, 88vw);
  }
  .sidebar.open { transform: translateX(0); }

  :root { --bottom-nav-h: 68px; }

  .bottom-nav { display: block; }
  .has-bottom-nav .main-area { padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px)); }
  .has-bottom-nav .page-content { padding-bottom: 24px; }

  .bottom-nav-item {
    position: relative;
    min-height: 52px;
    min-width: 52px;
    font-size: 0.6875rem;
    gap: 5px;
    padding: 8px 6px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  .bottom-nav-item .icon-wrap {
    width: 24px;
    height: 24px;
  }
  .bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--accent);
  }
  .bottom-nav-item:active:not(.active) {
    background: var(--accent-lt);
  }

  .app-layout { overflow-x: clip; max-width: 100%; }
  .main-area { margin-left: 0; overflow-x: clip; max-width: 100%; }
  .hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 48px;
  }

  .page-content {
    padding: var(--page-pad);
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }

  .topbar {
    padding: 0 var(--page-pad);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }
  .topbar-title { font-size: 1rem; }

  .btn,
  .form-input,
  select.form-input,
  .filter-bar .btn {
    min-height: 48px;
  }
  .btn-sm { min-height: 44px; }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .filter-bar .search-wrap,
  .filter-bar .form-input,
  .filter-bar .filter-160 {
    width: 100%;
    max-width: 100%;
  }

  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .auth-card { padding: 24px var(--page-pad); max-width: 420px; }
  .page-header { flex-direction: column; gap: var(--space-3); align-items: stretch; }
  .page-header .btn { width: 100%; justify-content: center; }
  .page-header h1 { font-size: var(--text-xl); }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
    animation: sheetUp 0.28s ease;
  }

  @keyframes sheetUp {
    from { opacity: 0; transform: translateY(100%); }
    to { opacity: 1; transform: translateY(0); }
  }

  .table-wrap { overflow-x: auto; max-width: 100%; }

  .service-row {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .service-row > .d-flex {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .card > .d-flex.align-center.gap-2 {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .card > .d-flex.align-center.gap-2 > .d-flex[style*="flex-direction:column"] {
    width: 100%;
    align-items: stretch !important;
  }
  .card > .d-flex.align-center.gap-2 .d-flex.gap-1 {
    flex-wrap: wrap;
  }
  .table-mobile-cards thead { display: none; }
  .table-mobile-cards tbody tr {
    display: block;
    margin-bottom: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
  }
  .table-mobile-cards tbody tr:hover { background: var(--bg-card); }
  .table-mobile-cards td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    border: none;
    font-size: 0.875rem;
  }
  .table-mobile-cards td::before {
    content: attr(data-label);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
  }
  .table-mobile-cards td:last-child { padding-bottom: 0; }
  .table-mobile-cards td:first-child { padding-top: 0; }

  #toast-container { left: var(--page-pad); right: var(--page-pad); align-items: stretch; }
  .toast { max-width: 100%; }

  .fab { right: var(--page-pad); }
}

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

/* ── Scroll reveal animations ── */
.reveal,
.reveal-pending {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1), transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.reveal.in-view,
.reveal-pending.in-view {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.06s; }
.reveal-delay-2 { transition-delay: 0.12s; }
.reveal-delay-3 { transition-delay: 0.18s; }
.reveal-delay-4 { transition-delay: 0.24s; }
.reveal-delay-5 { transition-delay: 0.30s; }
.reveal-delay-6 { transition-delay: 0.36s; }

.hidden { display: none !important; }
.is-hidden { display: none !important; }

/* ── Layout utilities (replace inline styles) ── */
.flex-wrap { flex-wrap: wrap; }
.flex-col { flex-direction: column; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }
.grid-col-full { grid-column: 1 / -1; }
.w-full-max { width: 100%; max-width: 540px; }
.w-150 { width: 150px; }
.opacity-muted { opacity: 0.35; }
.spinner-center { margin: 8px auto; }
.spinner-block { margin: 0 auto 12px; }
.mt-neg-12 { margin: -12px 0 16px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mt-24 { margin-top: 24px; }
.mt-8 { margin-top: 8px; }
.ml-auto { margin-left: auto; }
.font-mono { font-family: monospace; }
.font-mono-sm { font-family: monospace; font-size: 0.82rem; }
.fs-11 { font-size: 0.6875rem; }
.fs-72 { font-size: 0.72rem; }
.fs-75 { font-size: 0.75rem; }
.fs-78 { font-size: 0.78rem; }
.fs-80 { font-size: 0.8rem; }
.fs-82 { font-size: 0.82rem; }
.fs-85 { font-size: 0.85rem; }
.fs-88 { font-size: 0.88rem; }
.fs-11rem { font-size: 1.1rem; }
.fs-105 { font-size: 1.05rem; }
.fw-400 { font-weight: 400; }
.lh-16 { line-height: 1.6; }
.lh-15 { line-height: 1.5; }
.p-0 { padding: 0; }
.p-8-0 { padding: 8px 0; }
.p-12-16 { padding: 12px 16px; }
.p-14 { padding: 14px; }
.p-40 { padding: 40px; }
.card-flat-bg { background: var(--bg); }
.card-surface-bg { background: var(--surface); }
.mono-box {
  background: var(--bg);
  padding: 12px 16px;
  border-radius: 10px;
  font-family: monospace;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  text-align: center;
}
.mono-box-sm {
  background: var(--bg);
  padding: 12px 16px;
  border-radius: 10px;
  font-family: monospace;
}
.public-url-field {
  flex: 1;
  min-width: 220px;
  font-family: monospace;
  font-size: 0.82rem;
  background: var(--bg);
}
.booking-qr-wrap {
  margin-top: var(--space-4);
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.booking-qr-preview {
  width: 200px;
  height: 200px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  object-fit: contain;
}
.booking-qr-actions {
  flex: 1;
  min-width: 200px;
}
.rank-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-bar { width: calc(var(--bar-pct, 0) * 1%); }
.table-compact { font-size: 0.88rem; }
.avatar-32 { width: 32px; height: 32px; font-size: 0.8rem; }
.avatar-36 { width: 36px; height: 36px; font-size: 0.85rem; }
.avatar-52 { width: 52px; height: 52px; font-size: 1.3rem; }
.badge-sm { font-size: 0.75rem; }
.badge-md { font-size: 0.8rem; margin-bottom: 8px; }
.badge-lg { font-size: 0.85rem; }
.card-title-flush { margin: 0; }
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.row-between-pad {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.summary-box {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 0.85rem;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}
.summary-row:last-child { margin-bottom: 0; }
.book-loading { text-align: center; padding: 40px; }
.book-legal-footer {
  margin-top: 24px;
  font-size: 0.75rem;
  color: var(--text-2);
  text-align: center;
  line-height: 1.6;
}
.book-legal-footer-sm {
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--text-3);
  text-align: center;
  line-height: 1.6;
  max-width: 540px;
}
.consent-details-nested { margin: 8px 0 0 28px; font-size: 0.8rem; color: var(--text-muted); }
.consent-details-nested summary { cursor: pointer; }
.consent-details-nested p { margin-top: 8px; line-height: 1.5; }
.btn-danger-outline { color: var(--danger); border-color: var(--danger); }
.section-pad-zero { padding: 0 0 120px; }
.section-pad-zero-top { padding: 0 0 0; }
.pricing-compare-title {
  font-size: var(--fs-h2);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 48px;
}
.pricing-compare-scroll { overflow-x: auto; }
.col-w-40 { width: 40%; }
.col-w-20 { width: 20%; }
.text-main { color: var(--text-main); }
.onboarding-logout-hint { text-align: center; font-size: 0.78rem; margin: -12px 0 16px; }
.onboarding-logout-hint a { color: var(--text-2); }
.horizon-hint { margin-top: 8px; font-size: 0.85rem; color: var(--text-2); margin-bottom: 12px; }
.horizon-label { font-size: 0.85rem; color: var(--text-2); }
.calendar-grid-7 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.work-week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.day-empty-hint { font-size: 0.7rem; color: var(--text-3); text-align: center; padding: 8px 0; }
.day-center { text-align: center; }
.badge-block-center { display: block; justify-content: center; }
.schedule-input-compact { padding: 0.3rem 0.5rem; }
.drawer-backdrop-hidden { display: none; }
.link-primary { color: var(--primary); }
.empty-pad { padding: 8px 0; }
.stat-flex { flex: 1; min-width: 160px; }
.stat-big { font-size: 1.6rem; font-weight: 700; }
.plan-title { font-size: 1.1rem; }
.plan-features-list { margin: 8px 0 0 0; padding-left: 18px; }
.pricing-note { text-align: center; margin-top: 40px; font-size: 14px; color: var(--text-muted); }
.footer-legal { font-size: 0.78rem; color: var(--text-muted); margin-top: 8px; line-height: 1.5; }
.btn-reset-outline { background: var(--surface); color: var(--accent); border: 2px solid var(--accent); }
.sum-price { font-weight: 700; color: var(--accent); }
.sum-value { font-weight: 600; color: var(--text); }
.reveal-d1 { transition-delay: 0.05s; }
.reveal-d2 { transition-delay: 0.1s; }
.reveal-d3 { transition-delay: 0.15s; }
.reveal-d4 { transition-delay: 0.2s; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.align-end { align-items: flex-end; }
.align-self-center { align-self: center; }
.px-8 { padding: 0 8px; }
.mb-14 { margin-bottom: 14px; }
.mb-22 { margin-bottom: 22px; }
.mt-3px { margin-top: 3px; }
.mt-4px { margin-top: 4px; }
.onb-step-title { font-size: 1.15rem; font-weight: 700; margin: 0 0 6px; }
.onb-step-title-lg { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.onb-step-sub { margin-bottom: 22px; }
.onb-spinner-wrap { text-align: center; padding: 32px 0; }
.salon-desc-toggle { font-size: 0.83rem; color: var(--text-2); margin-top: 8px; }
.salon-desc-toggle.is-hidden { display: none; }
.filter-160 { max-width: 160px; }
.stats-grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-2-gap { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group-flush { flex: 1; margin-bottom: 0; }
.empty-state-pad { padding: 24px 0; text-align: center; color: var(--text-2); }
.empty-state-icon { margin-bottom: 8px; }
.branch-icon-lg { font-size: 1.5rem; }
.branch-title { font-size: 1rem; }
.branch-actions-col { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.mpc-avatar-sm { width: 38px; height: 38px; font-size: 0.9rem; }
.svc-list-scroll { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow-y: auto; }
.salon-id-display { background: var(--bg); flex: 1; font-family: monospace; font-size: 0.85rem; }
.textarea-mono { font-family: monospace; }
.embed-code-block { white-space: pre-wrap; word-break: break-all; }
.textarea-resize-v { resize: vertical; }
.stars-row { display: flex; gap: 8px; font-size: 1.8rem; justify-content: center; margin: 16px 0; }
.star-btn { cursor: pointer; opacity: 0.4; transition: opacity 0.15s; }
.star-btn.is-active, .star-btn:hover { opacity: 1; }
.complaint-link { font-size: 10px; color: var(--text-3); display: inline-block; margin-top: 4px; }
.experience-hint { font-size: 0.78rem; color: var(--text-2); margin-top: 3px; }
.cookie-save-btn.is-hidden { display: none; }
.cookie-save-btn { background: var(--success); }
.min-w-0 { min-width: 0; }

/* ── Page transitions ── */
html:not(.page-ready) body { opacity: 0; }
html.page-ready body {
  opacity: 1;
  transition: opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

body.page-exit {
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* ── Auth boot skeleton ── */
.auth-boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: var(--bg-deep);
  display: flex;
  align-items: stretch;
  padding: 0;
}

.auth-boot-inner {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

.auth-boot-sidebar {
  width: var(--sidebar-w);
  padding: 24px 16px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
}

.auth-boot-main {
  flex: 1;
  padding: 32px 36px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Auth extras ── */
.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
}

.consent-row input[type="checkbox"] { margin-top: 3px; flex-shrink: 0; }
.consent-row + .consent-row { margin-top: 10px; }
.consent-row.is-optional { opacity: 0.9; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.try-btn {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  transition: all var(--duration-fast) ease-in-out;
  min-height: 44px;
}

.try-btn:hover {
  background: var(--accent-dim);
  transform: translateY(-2px);
  color: var(--accent-hover);
}

.auth-legal {
  margin-top: 20px;
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

.auth-legal a {
  text-decoration: underline;
  color: var(--text-muted);
}

.auth-back-link {
  text-align: center;
  margin-top: 12px;
}

.auth-back-link a {
  font-size: 0.82rem;
  color: var(--text-2);
}

.auth-loading-title {
  font-size: 2rem;
  font-family: var(--font-display);
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--text-main);
}

.auth-loading-spinner { margin: 0 auto 12px; }

.auth-loading-text {
  color: var(--text-2);
  font-size: 0.875rem;
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-pending,
  .card, .stat-card, .master-card, .btn,
  .topbar, body, html.page-ready body {
    transition: none !important;
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

@media (max-width: 768px) {
  .auth-boot-sidebar { display: none; }
  .auth-boot-main { padding: var(--page-pad); }
}
