@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── VARIABLES ─────────────────────────────────────────────────────────────── */
:root {
  --primary:      #FF6B9D;
  --primary-dark: #e85a8a;
  --secondary:    #6C5CE7;
  --hero-gradient: linear-gradient(135deg, #FF6B9D 0%, #6C5CE7 100%);
  --fab-shadow:    0 4px 16px rgba(255,107,157,.45);
  --success:      #00B894;
  --warning:      #FDCB6E;
  --danger:       #E74C3C;
  --bg:           #FAFAFA;
  --surface:      #FFFFFF;
  --text:         #2D3436;
  --text-muted:   #636E72;
  --border:       #DFE6E9;
  --shadow:       0 2px 12px rgba(0,0,0,.08);
  --shadow-lg:    0 8px 32px rgba(0,0,0,.12);
  --radius:       12px;
  --radius-sm:    8px;
  --nav-h:        64px;
}

/* ── RESET ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-tap-highlight-color: transparent; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; }

/* ── TIPOGRAFÍA ─────────────────────────────────────────────────────────────── */
h1 { font-size: 1.5rem; font-weight: 700; line-height: 1.3; }
h2 { font-size: 1.25rem; font-weight: 600; line-height: 1.4; }
h3 { font-size: 1rem; font-weight: 600; }
p  { font-size: 0.875rem; }
small { font-size: 0.75rem; }

/* ── LAYOUT ─────────────────────────────────────────────────────────────────── */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: var(--bg);
}
@media (min-width: 768px) {
  .app-container { max-width: 100%; display: flex; }
}

/* ── SIDEBAR DESKTOP ─────────────────────────────────────────────────────────── */
.sidebar {
  display: none;
}
@media (min-width: 768px) {
  .sidebar {
    display: flex;
    flex-direction: column;
    width: 240px;
    min-height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 24px 0;
    position: fixed;
    top: 0; left: 0;
    z-index: 100;
  }
  .sidebar-logo {
    padding: 0 24px 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
  }
  .sidebar-logo span { font-size: 1.25rem; font-weight: 700; color: var(--primary); }
  .sidebar-logo small { display: block; color: var(--text-muted); font-size: 0.7rem; }
  .sidebar-nav { flex: 1; }
  .sidebar-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 24px;
    color: var(--text-muted);
    font-size: 0.875rem; font-weight: 500;
    transition: all .15s;
  }
  .sidebar-nav a:hover, .sidebar-nav a.active {
    color: var(--primary);
    background: rgba(255,107,157,.07);
  }
  .sidebar-nav a .nav-icon { font-size: 1.1rem; width: 20px; text-align: center; }
  .main-content {
    margin-left: 240px;
    flex: 1;
    max-width: calc(100% - 240px);
    padding-bottom: 0 !important;
  }
}

/* ── HEADER MÓVIL ───────────────────────────────────────────────────────────── */
.page-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
}
.page-header h1 { font-size: 1.1rem; }
.header-logo { font-size: 1.25rem; font-weight: 700; color: var(--primary); }

/* ── BOTTOM NAV (MÓVIL) ─────────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: var(--nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex; align-items: center;
  z-index: 100;
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 8px 4px;
  color: var(--text-muted); font-size: 0.65rem; font-weight: 500;
  transition: color .15s;
}
.bottom-nav a .nav-icon { font-size: 1.3rem; }
.bottom-nav a.active { color: var(--primary); }
@media (min-width: 768px) { .bottom-nav { display: none; } }

/* ── PÁGINA ─────────────────────────────────────────────────────────────────── */
.page-content {
  padding: 16px 16px calc(var(--nav-h) + 16px);
}
@media (min-width: 768px) {
  .page-content { padding: 24px 32px; max-width: 900px; }
}

/* ── CARDS ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}
.card-title { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .05em; }
.card-value { font-size: 1.5rem; font-weight: 700; }
.card-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.stat-card .icon { font-size: 1.5rem; margin-bottom: 8px; }
.stat-card .label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.stat-card .value { font-size: 1.25rem; font-weight: 700; line-height: 1.2; }
.stat-card .change { font-size: 0.75rem; margin-top: 4px; }
.change.up { color: var(--success); }
.change.down { color: var(--danger); }

/* ── BOTONES ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 20px;
  height: 48px;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem; font-weight: 500;
  transition: all .15s; cursor: pointer;
  border: none;
}
.btn-primary {
  background: var(--primary); color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary {
  background: rgba(108,92,231,.1); color: var(--secondary);
}
.btn-success { background: var(--success); color: #fff; }
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-outline {
  background: transparent; border: 1.5px solid var(--border); color: var(--text);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--primary); padding: 0; height: auto; }
.btn-full { width: 100%; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 0.8125rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── FORMULARIOS ─────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.8125rem; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s;
  outline: none;
  appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
}
.form-input.error { border-color: var(--danger); }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 0.75rem; color: var(--danger); margin-top: 4px; }
.form-textarea { min-height: 80px; resize: vertical; }
.form-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23636E72' d='M6 8L0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

/* ── BADGES / CHIPS ─────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 100px;
  font-size: 0.6875rem; font-weight: 600;
}
.badge-pending  { background: rgba(253,203,110,.2); color: #d4830a; }
.badge-approved { background: rgba(0,184,148,.15);  color: #00856b; }
.badge-completed{ background: rgba(99,110,114,.15); color: var(--text-muted); }
.badge-cancelled{ background: rgba(231,76,60,.15);  color: var(--danger); }
.badge-rejected { background: rgba(231,76,60,.15);  color: var(--danger); }

/* ── CITA CARD ──────────────────────────────────────────────────────────────── */
.cita-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 10px;
  border-left: 4px solid var(--border);
}
.cita-card.pending  { border-left-color: var(--warning); }
.cita-card.approved { border-left-color: var(--success); }
.cita-card.completed{ border-left-color: var(--border); }
.cita-card.rejected,
.cita-card.cancelled{ border-left-color: var(--danger); }

.cita-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.cita-service { font-weight: 600; font-size: 0.9375rem; }
.cita-client  { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 4px; }
.cita-time    { font-size: 0.8125rem; font-weight: 500; color: var(--secondary); }
.cita-price   { font-weight: 600; color: var(--primary); }
.cita-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ── LOADING / SKELETON ─────────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, #f0f0f0 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.2s infinite;
  border-radius: 6px;
}
@keyframes skeleton-loading {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── TOAST ──────────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: calc(var(--nav-h) + 16px); left: 50%;
  transform: translateX(-50%);
  z-index: 1000; width: calc(100% - 32px); max-width: 448px;
}
.toast {
  background: var(--text); color: #fff;
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 500;
  margin-bottom: 8px;
  animation: toast-in .25s ease;
  display: flex; align-items: center; gap: 8px;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── MODAL ──────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  z-index: 200; display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 20px 16px 32px;
  width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
  transform: translateY(100%); transition: transform .25s ease;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-handle {
  width: 40px; height: 4px; background: var(--border);
  border-radius: 2px; margin: 0 auto 20px;
}
.modal-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 16px; }
@media (min-width: 768px) {
  .modal-overlay { align-items: center; }
  .modal { border-radius: var(--radius); transform: scale(.95); max-height: 80vh; }
  .modal-overlay.open .modal { transform: scale(1); }
}

/* ── AUTH ────────────────────────────────────────────────────────────────────── */
.auth-container {
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 32px 24px;
  max-width: 420px; margin: 0 auto;
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo h1 { font-size: 2rem; color: var(--primary); }
.auth-logo p { color: var(--text-muted); font-size: 0.875rem; margin-top: 4px; }
.auth-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 24px;
}
.auth-footer { text-align: center; margin-top: 20px; font-size: 0.875rem; color: var(--text-muted); }
.auth-footer a { color: var(--primary); font-weight: 500; }

/* ── SECTION TITLE ──────────────────────────────────────────────────────────── */
.section-title {
  font-size: 1rem; font-weight: 600;
  margin-bottom: 12px;
  display: flex; align-items: center; justify-content: space-between;
}

/* ── TOGGLE (día activo/inactivo) ──────────────────────────────────────────── */
.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.toggle {
  position: relative; width: 44px; height: 24px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--border); border-radius: 12px;
  cursor: pointer; transition: background .15s;
}
.toggle-slider:before {
  content: ''; position: absolute;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px;
  transition: transform .15s;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.toggle input:checked ~ .toggle-slider { background: var(--primary); }
.toggle input:checked ~ .toggle-slider:before { transform: translateX(20px); }

/* ── TIME INPUTS ────────────────────────────────────────────────────────────── */
.time-row {
  display: flex; gap: 8px; align-items: center;
  font-size: 0.8125rem;
}
.time-row input[type=time] {
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 10px; font-size: 0.875rem; font-family: inherit;
  outline: none; background: var(--surface);
}
.time-row input[type=time]:focus { border-color: var(--primary); }

/* ── CALENDARIO ─────────────────────────────────────────────────────────────── */
.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; margin-bottom: 8px;
}
.cal-header h3 { font-size: 1rem; font-weight: 600; }
.cal-btn { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--border); font-size: 1rem; transition: all .15s; }
.cal-btn:hover { border-color: var(--primary); color: var(--primary); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day-name { text-align: center; font-size: 0.7rem; font-weight: 600; color: var(--text-muted); padding: 4px 0; }
.cal-day {
  text-align: center; padding: 8px 4px; border-radius: var(--radius-sm);
  font-size: 0.8125rem; cursor: pointer; position: relative;
  min-height: 40px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: all .15s;
}
.cal-day:hover:not(.disabled):not(.empty) { background: rgba(255,107,157,.1); }
.cal-day.today { font-weight: 700; color: var(--primary); }
.cal-day.selected { background: var(--primary); color: #fff; font-weight: 600; }
.cal-day.disabled { color: var(--border); cursor: default; }
.cal-day.empty { cursor: default; }
.cal-day .dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--primary); margin-top: 2px;
}
.cal-day.selected .dot { background: #fff; }

/* ── BOOKING STEPS ──────────────────────────────────────────────────────────── */
.step-indicator {
  display: flex; justify-content: center; gap: 6px;
  margin-bottom: 24px;
}
.step-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border); transition: all .2s;
}
.step-dot.active { background: var(--primary); transform: scale(1.3); }
.step-dot.done   { background: var(--success); }

.step { display: none; }
.step.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.service-option {
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 10px; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  transition: all .15s;
}
.service-option:hover, .service-option.selected {
  border-color: var(--primary); background: rgba(255,107,157,.05);
}
.service-option.selected { background: rgba(255,107,157,.08); }
.service-name { font-weight: 600; font-size: 0.9375rem; }
.service-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.service-price { font-weight: 700; color: var(--primary); font-size: 1rem; }

.time-slot {
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 14px; cursor: pointer; text-align: center;
  font-size: 0.875rem; font-weight: 500;
  transition: all .15s;
}
.time-slot:hover, .time-slot.selected {
  border-color: var(--primary); background: rgba(255,107,157,.08);
}
.time-slot.selected { background: var(--primary); color: #fff; border-color: var(--primary); }
.time-slot-end { font-size: 0.7rem; opacity: .75; }
.slots-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

/* ── PERFIL PÚBLICO ─────────────────────────────────────────────────────────── */
.pro-hero {
  background: var(--hero-gradient);
  color: #fff; padding: 40px 24px 32px;
  text-align: center;
  position: relative; overflow: hidden;
}
/* Círculos decorativos en el hero */
.pro-hero::before, .pro-hero::after {
  content: ''; position: absolute; border-radius: 50%;
  background: rgba(255,255,255,.1);
  pointer-events: none;
}
.pro-hero::before { width: 220px; height: 220px; top: -80px; right: -60px; }
.pro-hero::after  { width: 130px; height: 130px; bottom: -50px; left: -30px; }
.hero-circle-sm {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,.07);
  pointer-events: none;
  width: 80px; height: 80px; top: 20px; left: -20px;
}
.pro-avatar {
  width: 88px; height: 88px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.5);
  margin: 0 auto 12px;
  object-fit: cover;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  font-weight: 700;
  letter-spacing: -.5px;
}
.pro-hero h1 { font-size: 1.4rem; color: #fff; }
.pro-hero .category { opacity: .85; font-size: 0.875rem; margin-top: 4px; }
.pro-hero .address { opacity: .75; font-size: 0.8125rem; margin-top: 6px; }

.public-content { padding: 20px 16px 80px; }

/* ── EMPTY STATE ─────────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 48px 24px; color: var(--text-muted);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { font-size: 0.875rem; }

/* ── FAB ─────────────────────────────────────────────────────────────────────── */
.fab {
  position: fixed; bottom: calc(var(--nav-h) + 16px); right: 16px;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--primary); color: #fff;
  box-shadow: var(--fab-shadow);
  font-size: 1.5rem; display: flex; align-items: center; justify-content: center;
  transition: transform .15s, box-shadow .15s; z-index: 90;
}
.fab:hover { transform: scale(1.05); box-shadow: 0 6px 20px rgba(255,107,157,.55); }
@media (min-width: 768px) { .fab { bottom: 24px; right: 24px; } }

/* ── UTILS ───────────────────────────────────────────────────────────────────── */
.text-primary { color: var(--primary); }
.text-muted   { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.flex  { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.text-center { text-align: center; }
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ── MEJORAS VISUALES GENERALES (activas con cualquier tema) ───────────────── */

/* Botones con gradiente */
[data-theme] .btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border: none;
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
}
[data-theme] .btn-primary:hover {
  filter: brightness(1.06);
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

/* Logo con gradiente de texto */
[data-theme] .sidebar-logo span,
[data-theme] .header-logo,
[data-theme] .auth-logo h1 {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Línea de acento en header móvil */
[data-theme] .page-header::after {
  content: ''; position: absolute;
  bottom: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}
.page-header { position: sticky; top: 0; overflow: hidden; }

/* Stat cards con borde superior de color */
[data-theme] .stat-card {
  border-top: 3px solid var(--primary);
}
[data-theme] .stat-card .value {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Slots de hora: seleccionado con gradiente */
[data-theme] .time-slot.selected {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-color: transparent;
}
[data-theme] .time-slot:hover:not(.selected) {
  border-color: var(--primary);
  background: rgba(0,0,0,.03);
}

/* Indicador activo en bottom nav */
[data-theme] .bottom-nav a.active::before {
  content: '';
  display: block;
  width: 20px; height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  margin: 0 auto 4px;
}
[data-theme] .bottom-nav a { flex-direction: column; padding-top: 4px; }

/* Servicio seleccionado con gradiente en agendar */
[data-theme] .service-option.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(0,0,0,.02), rgba(0,0,0,.01));
  box-shadow: inset 0 0 0 1.5px var(--primary);
}

/* Step dots con gradiente */
[data-theme] .step-dot.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}
[data-theme] .step-dot.done { background: var(--success); }

/* ── TEMAS POR CATEGORÍA ────────────────────────────────────────────────────── */

/* 💅 UÑAS — Magenta glam + púrpura vibrante */
[data-theme="unas"] {
  --primary:       #E91E8C;
  --primary-dark:  #C2185B;
  --secondary:     #9C27B0;
  --bg:            #FFF0F8;
  --hero-gradient: linear-gradient(135deg, #E91E8C 0%, #9C27B0 100%);
  --fab-shadow:    0 4px 16px rgba(233,30,140,.45);
}
[data-theme="unas"] body {
  background-color: #FFF0F8;
  background-image: radial-gradient(rgba(233,30,140,.09) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
}
[data-theme="unas"] .sidebar-nav a:hover,
[data-theme="unas"] .sidebar-nav a.active { color: #E91E8C; background: rgba(233,30,140,.08); }
[data-theme="unas"] .bottom-nav a.active  { color: #E91E8C; }
[data-theme="unas"] .sidebar { background: linear-gradient(180deg,rgba(233,30,140,.04) 0%,#fff 60%); }

/* ✂️ BARBERÍA — Rojo barber pole + carbón */
[data-theme="barberia"] {
  --primary:       #D32F2F;
  --primary-dark:  #B71C1C;
  --secondary:     #37474F;
  --bg:            #FFF5F5;
  --hero-gradient: linear-gradient(135deg, #D32F2F 0%, #37474F 100%);
  --fab-shadow:    0 4px 16px rgba(211,47,47,.45);
}
[data-theme="barberia"] body {
  background-color: #FFF5F5;
  background-image:
    repeating-linear-gradient(45deg,rgba(211,47,47,.05) 0,rgba(211,47,47,.05) 1px,transparent 0,transparent 50%),
    repeating-linear-gradient(-45deg,rgba(55,71,79,.04) 0,rgba(55,71,79,.04) 1px,transparent 0,transparent 50%);
  background-size: 14px 14px;
}
[data-theme="barberia"] .sidebar-nav a:hover,
[data-theme="barberia"] .sidebar-nav a.active { color: #D32F2F; background: rgba(211,47,47,.07); }
[data-theme="barberia"] .bottom-nav a.active  { color: #D32F2F; }
[data-theme="barberia"] .sidebar { background: linear-gradient(180deg,rgba(211,47,47,.04) 0%,#fff 60%); }

/* 💇 PELUQUERÍA — Ámbar cálido + caoba */
[data-theme="peluqueria"] {
  --primary:       #E8A020;
  --primary-dark:  #C8880A;
  --secondary:     #8D4E25;
  --bg:            #FFFBF0;
  --hero-gradient: linear-gradient(135deg, #E8A020 0%, #8D4E25 100%);
  --fab-shadow:    0 4px 16px rgba(232,160,32,.45);
}
[data-theme="peluqueria"] body {
  background-color: #FFFBF0;
  background-image: radial-gradient(ellipse, rgba(232,160,32,.1) 1px, transparent 1px);
  background-size: 18px 18px;
}
[data-theme="peluqueria"] .sidebar-nav a:hover,
[data-theme="peluqueria"] .sidebar-nav a.active { color: #E8A020; background: rgba(232,160,32,.08); }
[data-theme="peluqueria"] .bottom-nav a.active  { color: #E8A020; }
[data-theme="peluqueria"] .sidebar { background: linear-gradient(180deg,rgba(232,160,32,.05) 0%,#fff 60%); }

/* 💄 MAQUILLAJE — Rosa profundo + plum luxury */
[data-theme="maquillaje"] {
  --primary:       #AD1457;
  --primary-dark:  #880E4F;
  --secondary:     #6A1B9A;
  --bg:            #FFF5F9;
  --hero-gradient: linear-gradient(135deg, #AD1457 0%, #6A1B9A 100%);
  --fab-shadow:    0 4px 16px rgba(173,20,87,.45);
}
[data-theme="maquillaje"] body {
  background-color: #FFF5F9;
  background-image: radial-gradient(circle, rgba(173,20,87,.08) 1px, transparent 1px);
  background-size: 16px 16px;
}
[data-theme="maquillaje"] .sidebar-nav a:hover,
[data-theme="maquillaje"] .sidebar-nav a.active { color: #AD1457; background: rgba(173,20,87,.07); }
[data-theme="maquillaje"] .bottom-nav a.active  { color: #AD1457; }
[data-theme="maquillaje"] .sidebar { background: linear-gradient(180deg,rgba(173,20,87,.04) 0%,#fff 60%); }

/* 🌿 ESTÉTICA — Teal spa + azul wellness */
[data-theme="estetica"] {
  --primary:       #00897B;
  --primary-dark:  #00695C;
  --secondary:     #1565C0;
  --bg:            #F0FAFA;
  --hero-gradient: linear-gradient(135deg, #00897B 0%, #1565C0 100%);
  --fab-shadow:    0 4px 16px rgba(0,137,123,.45);
}
[data-theme="estetica"] body {
  background-color: #F0FAFA;
  background-image: radial-gradient(circle, rgba(0,137,123,.09) 1.5px, transparent 1.5px);
  background-size: 20px 20px;
}
[data-theme="estetica"] .sidebar-nav a:hover,
[data-theme="estetica"] .sidebar-nav a.active { color: #00897B; background: rgba(0,137,123,.08); }
[data-theme="estetica"] .bottom-nav a.active  { color: #00897B; }
[data-theme="estetica"] .sidebar { background: linear-gradient(180deg,rgba(0,137,123,.05) 0%,#fff 60%); }

/* ── MÁS MENU (nav móvil) ───────────────────────────────────────────────────── */
.mas-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 98;
}
.mas-overlay.open { display: block; }
.mas-menu {
  position: fixed; bottom: calc(var(--nav-h) + 8px); left: 50%;
  transform: translateX(-50%) translateY(20px);
  width: calc(100% - 32px); max-width: 448px;
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 8px 0;
  z-index: 99; opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.mas-menu.open { opacity: 1; pointer-events: all; transform: translateX(-50%) translateY(0); }
.mas-menu a, .mas-menu button {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; width: 100%;
  font-size: .9375rem; font-weight: 500; color: var(--text);
  background: none; border: none; cursor: pointer; text-align: left;
  transition: background .12s;
}
.mas-menu a:hover, .mas-menu button:hover { background: rgba(0,0,0,.04); }
.mas-menu a.active { color: var(--primary); }
.mas-divider { border: none; border-top: 1px solid var(--border); margin: 4px 0; }
@media (min-width: 768px) { .mas-menu, .mas-overlay { display: none !important; } }

/* ── SIDEBAR: nav group title ────────────────────────────────────────────────── */
.nav-group-title {
  padding: 16px 24px 4px;
  font-size: .65rem; font-weight: 700; letter-spacing: .08em;
  color: var(--text-muted); text-transform: uppercase;
}

/* ── MENSAJE DEL DÍA ────────────────────────────────────────────────────────── */
.mensaje-dia-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
  display: flex; align-items: flex-start; gap: 12px;
  color: #fff;
}
.mensaje-dia-icon { font-size: 1.5rem; flex-shrink: 0; margin-top: 1px; }
.mensaje-dia-label { font-size: .65rem; font-weight: 700; letter-spacing: .06em; opacity: .8; text-transform: uppercase; margin-bottom: 3px; }
.mensaje-dia-text { font-size: .875rem; line-height: 1.5; font-style: italic; opacity: .95; }

/* ── MOTIVACIONAL HOY ───────────────────────────────────────────────────────── */
.motiv-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}
.motiv-top { display: flex; align-items: center; justify-content: space-between; }
.motiv-circle {
  position: relative; width: 64px; height: 64px; flex-shrink: 0;
}
.motiv-circle svg { width: 64px; height: 64px; transform: rotate(-90deg); }
.motiv-circle-bg { fill: none; stroke: var(--border); stroke-width: 6; }
.motiv-circle-fill { fill: none; stroke: var(--primary); stroke-width: 6; stroke-linecap: round;
  stroke-dasharray: 163; stroke-dashoffset: 163; transition: stroke-dashoffset .8s ease; }
.motiv-circle-pct {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700; color: var(--primary);
}
.motiv-progress-track {
  height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; margin-top: 12px;
}
.motiv-progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 3px; width: 0%; transition: width .8s ease;
}
.motiv-labels {
  display: flex; justify-content: space-between;
  font-size: .7rem; color: var(--text-muted); margin-top: 5px;
}

/* ── CLIENTES: cards ─────────────────────────────────────────────────────────── */
.client-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  flex-direction: column;
  align-items: stretch;
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; transition: transform .12s, box-shadow .12s;
  border-left: 4px solid var(--border);
}
.client-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.client-card.activo  { border-left-color: var(--success); }
.client-card.riesgo  { border-left-color: var(--warning); }
.client-card.perdido { border-left-color: var(--danger); }
.client-card.nuevo   { border-left-color: var(--secondary); }

.client-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 700; color: #fff; flex-shrink: 0;
  font-style: normal;
}
.client-info { flex: 1; min-width: 0; }
.client-name { font-weight: 600; font-size: .9375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-meta { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }
.client-stats { text-align: right; flex-shrink: 0; }
.client-spent { font-weight: 700; font-size: .9rem; color: var(--primary); }
.client-visits { font-size: .7rem; color: var(--text-muted); }

.status-chip {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 100px;
  font-size: .65rem; font-weight: 700; letter-spacing: .03em;
}
.status-chip.activo  { background: rgba(0,184,148,.15);  color: #00856b; }
.status-chip.riesgo  { background: rgba(253,203,110,.25); color: #9a6c00; }
.status-chip.perdido { background: rgba(231,76,60,.12);  color: var(--danger); }
.status-chip.nuevo   { background: rgba(108,92,231,.12); color: var(--secondary); }

/* ── CLIENTES: tabs ──────────────────────────────────────────────────────────── */
.tab-bar {
  display: flex; background: var(--bg);
  border-radius: var(--radius-sm); padding: 3px; gap: 3px;
  margin-bottom: 16px;
}
.tab-btn {
  flex: 1; height: 36px; border-radius: 6px;
  font-size: .8125rem; font-weight: 500; color: var(--text-muted);
  background: none; border: none; cursor: pointer; transition: all .15s;
}
.tab-btn.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); font-weight: 600; }

/* ── CLIENTES: ranking ───────────────────────────────────────────────────────── */
.rank-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.rank-item:last-child { border-bottom: none; }
.rank-num {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; flex-shrink: 0;
  background: var(--bg); color: var(--text-muted);
}
.rank-num.gold   { background: #FFD700; color: #7a5c00; }
.rank-num.silver { background: #C0C0C0; color: #444; }
.rank-num.bronze { background: #CD7F32; color: #fff; }
.rank-info { flex: 1; }
.rank-name { font-weight: 600; font-size: .875rem; }
.rank-sub  { font-size: .75rem; color: var(--text-muted); }
.rank-value { font-weight: 700; font-size: .9rem; color: var(--primary); }

/* ── CLIENTE DETALLE (bottom sheet) ──────────────────────────────────────────── */
.detail-stat-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0;
}
.detail-stat {
  background: var(--bg); border-radius: var(--radius-sm); padding: 10px 12px;
}
.detail-stat-label { font-size: .65rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 3px; }
.detail-stat-value { font-size: 1rem; font-weight: 700; }

/* ── SEARCH BAR ──────────────────────────────────────────────────────────────── */
/* ── PREFIJO TELÉFONO +56 ────────────────────────────────────────────────────── */
.phone-wrap { display: flex; }
.phone-prefix {
  display: flex; align-items: center;
  padding: 0 12px;
  background: var(--bg);
  border: 1.5px solid var(--border); border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  font-size: .9rem; font-weight: 600; color: var(--text-muted);
  white-space: nowrap; flex-shrink: 0;
}
.phone-wrap .form-input {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.phone-wrap .form-input:focus { border-color: var(--primary); }
.phone-wrap .form-input:focus + .phone-prefix,
.phone-wrap:focus-within .phone-prefix { border-color: var(--primary); }

.search-wrap {
  position: relative; margin-bottom: 14px;
}
.search-wrap input {
  padding-left: 36px;
}
.search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: .9rem; pointer-events: none;
}

/* ── TEMAS: nuevas categorías ─────────────────────────────────────────────────── */
[data-theme="kinesiologo"],[data-theme="nutricion"],[data-theme="psicologia"],[data-theme="masajes"],[data-theme="medico"] {
  --primary: #0288D1; --primary-dark: #01579B; --secondary: #00897B;
  --bg: #F0F8FF; --hero-gradient: linear-gradient(135deg,#0288D1,#00897B);
  --fab-shadow: 0 4px 16px rgba(2,136,209,.4);
}
[data-theme="entrenador"],[data-theme="yoga"],[data-theme="deportes"] {
  --primary: #E65100; --primary-dark: #BF360C; --secondary: #2E7D32;
  --bg: #FFF8F5; --hero-gradient: linear-gradient(135deg,#E65100,#2E7D32);
  --fab-shadow: 0 4px 16px rgba(230,81,0,.4);
}
[data-theme="abogado"],[data-theme="contador"],[data-theme="arquitecto"] {
  --primary: #1A237E; --primary-dark: #0D1259; --secondary: #37474F;
  --bg: #F5F6FF; --hero-gradient: linear-gradient(135deg,#1A237E,#37474F);
  --fab-shadow: 0 4px 16px rgba(26,35,126,.4);
}
[data-theme="fotografo"],[data-theme="disenador"] {
  --primary: #6A1B9A; --primary-dark: #4A148C; --secondary: #E65100;
  --bg: #FBF5FF; --hero-gradient: linear-gradient(135deg,#6A1B9A,#E65100);
  --fab-shadow: 0 4px 16px rgba(106,27,154,.4);
}
[data-theme="profesor"],[data-theme="coach"],[data-theme="musica"] {
  --primary: #00695C; --primary-dark: #004D40; --secondary: #1565C0;
  --bg: #F0FFF8; --hero-gradient: linear-gradient(135deg,#00695C,#1565C0);
  --fab-shadow: 0 4px 16px rgba(0,105,92,.4);
}

/* Aplicar sidebar hover para nuevos temas */
[data-theme="kinesiologo"] .sidebar-nav a:hover,[data-theme="kinesiologo"] .sidebar-nav a.active,
[data-theme="nutricion"] .sidebar-nav a:hover,[data-theme="nutricion"] .sidebar-nav a.active,
[data-theme="psicologia"] .sidebar-nav a:hover,[data-theme="psicologia"] .sidebar-nav a.active,
[data-theme="masajes"] .sidebar-nav a:hover,[data-theme="masajes"] .sidebar-nav a.active,
[data-theme="medico"] .sidebar-nav a:hover,[data-theme="medico"] .sidebar-nav a.active
{ color: #0288D1; background: rgba(2,136,209,.08); }

[data-theme="entrenador"] .sidebar-nav a:hover,[data-theme="entrenador"] .sidebar-nav a.active,
[data-theme="yoga"] .sidebar-nav a:hover,[data-theme="yoga"] .sidebar-nav a.active,
[data-theme="deportes"] .sidebar-nav a:hover,[data-theme="deportes"] .sidebar-nav a.active
{ color: #E65100; background: rgba(230,81,0,.08); }

[data-theme="abogado"] .sidebar-nav a:hover,[data-theme="abogado"] .sidebar-nav a.active,
[data-theme="contador"] .sidebar-nav a:hover,[data-theme="contador"] .sidebar-nav a.active,
[data-theme="arquitecto"] .sidebar-nav a:hover,[data-theme="arquitecto"] .sidebar-nav a.active
{ color: #1A237E; background: rgba(26,35,126,.08); }

/* ── LÁPIZ ASISTENTE ─────────────────────────────────────────────────────────── */
.lapiz-btn {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  right: 16px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--hero-gradient);
  box-shadow: 0 4px 16px rgba(108,92,231,.4), 0 2px 6px rgba(0,0,0,.15);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  border: none;
  z-index: 200;
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
  opacity: 1;
  padding: 0;
}
.lapiz-btn svg { display: block; overflow: visible; filter: drop-shadow(0 1px 2px rgba(0,0,0,.18)); }
.lapiz-btn:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(108,92,231,.5), 0 2px 8px rgba(0,0,0,.2); }
.lapiz-btn.hidden { transform: scale(0); opacity: 0; pointer-events: none; }

.lapiz-bubble {
  position: fixed;
  bottom: calc(var(--nav-h) + 80px);
  right: 16px;
  width: 268px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px 16px 4px 16px;
  padding: 14px 16px 14px;
  box-shadow: var(--shadow-lg);
  font-size: .8125rem;
  line-height: 1.55;
  color: var(--text);
  z-index: 201;
  transform-origin: bottom right;
  transform: scale(0);
  opacity: 0;
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), opacity .18s ease;
  pointer-events: none;
  position: fixed;
}
.lapiz-bubble.visible {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}
.lapiz-bubble .lapiz-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border);
  border: none;
  cursor: pointer;
  font-size: .7rem;
  color: var(--text-muted);
  line-height: 1;
  padding: 0;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.lapiz-bubble .lapiz-close:hover { background: var(--danger); color: #fff; }
#lapiz-msg { display: block; padding-right: 20px; }
.lapiz-bubble .lapiz-type-success { color: var(--success); font-weight: 600; }
.lapiz-bubble .lapiz-type-error   { color: var(--danger);  font-weight: 600; }
.lapiz-bubble .lapiz-type-info    { color: var(--secondary); }

/* En desktop, posicionarlo sobre el contenido sin bloquear la sidebar */
@media (min-width: 768px) {
  .lapiz-btn  { bottom: 28px; right: 36px; }
  .lapiz-bubble { bottom: 92px; right: 36px; }
}
