:root {
    --rosa: #b04a72;
    --rosa-claro: #d4708f;
    --rosa-bg: #fceef3;
    --rosa-borde: #f3d3de;
    --fondo: #faf7f8;
    --blanco: #fff;
    --texto: #2c2228;
    --gris-texto: #7d6f75;
    --gris-borde: #ece2e7;
    --gris-bg: #f4eef1;
    --gris-medio: #a89ba1;
    --verde: #0f766e;
    --verde-bg: #d7f2ee;
    --ambar: #b45309;
    --ambar-bg: #fdf0d5;
    --rojo: #b32424;
    --rojo-bg: #fce4e4;
    --violeta: #6d28d9;
    --violeta-bg: #ede9fe;
    --radio: 12px;
    --radio-chico: 8px;
    --sombra: 0 1px 3px rgba(44, 34, 40, .07), 0 1px 2px rgba(44, 34, 40, .04);
    --sombra-alta: 0 10px 30px rgba(44, 34, 40, .12);
}

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

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--fondo);
    color: var(--texto);
    line-height: 1.5;
}

a { color: var(--rosa); }

/* ---------- LOGIN / REGISTRO ---------- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(160deg, #b04a72 0%, #8d3a5c 55%, #6d2a46 100%);
}

.login-card {
    background: var(--blanco);
    width: 100%;
    max-width: 420px;
    border-radius: 16px;
    padding: 32px 30px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, .28);
}

.login-logo {
    width: 104px;
    height: 104px;
    border-radius: 24px;
    background: var(--blanco);
    box-shadow: var(--sombra-alta);
    padding: 12px;
    margin: 0 auto 16px;
}

.login-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }

.login-card h1 { font-size: 21px; text-align: center; margin-bottom: 4px; }
.login-card .sub { text-align: center; color: var(--gris-texto); font-size: 14px; margin-bottom: 22px; }

.tabs { display: flex; gap: 6px; background: var(--gris-bg); padding: 4px; border-radius: 10px; margin-bottom: 20px; }
.tabs button {
    flex: 1;
    padding: 8px 10px;
    border: none;
    border-radius: 7px;
    background: transparent;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--gris-texto);
    cursor: pointer;
}
.tabs button.activo { background: var(--blanco); color: var(--rosa); box-shadow: var(--sombra); }

/* ---------- FORMULARIOS ---------- */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--gris-texto); }

input, select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gris-borde);
    border-radius: var(--radio);
    font: inherit;
    font-size: 14px;
    background: var(--blanco);
    color: var(--texto);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--rosa-claro);
    box-shadow: 0 0 0 3px rgba(212, 112, 143, .16);
}

textarea { resize: vertical; min-height: 90px; line-height: 1.55; }

.campo { margin-bottom: 15px; }
.campo .ayuda { font-size: 12px; color: var(--gris-medio); margin-top: 4px; }
.campo-fila { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- BOTONES ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 16px;
    border: none;
    border-radius: var(--radio);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: var(--rosa);
    color: #fff;
    white-space: nowrap;
    transition: filter .12s;
}

.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-gris { background: var(--blanco); color: var(--gris-texto); border: 1px solid var(--gris-borde); }
.btn-gris:hover { background: var(--gris-bg); filter: none; }
.btn-verde { background: var(--verde); }
.btn-verde:hover { filter: brightness(1.1); }
.btn-rojo { background: var(--rojo); }
.btn-rojo:hover { filter: brightness(1.1); }
.btn-ambar { background: var(--ambar); }
.btn-ambar:hover { filter: brightness(1.1); }
.btn-whats { background: #25d366; }
.btn-whats:hover { filter: brightness(1.05); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: var(--radio-chico); }
.btn-xs { padding: 4px 8px; font-size: 11.5px; border-radius: 6px; }

.alert {
    padding: 10px 13px;
    border-radius: var(--radio);
    font-size: 13.5px;
    margin-bottom: 15px;
    display: none;
    line-height: 1.5;
}

.alert.error { background: var(--rojo-bg); color: var(--rojo); border: 1px solid #f3c6c6; }
.alert.ok { background: var(--verde-bg); color: #0b5d56; border: 1px solid #a7e0d8; }
.alert.info { background: var(--rosa-bg); color: #8d3a5c; border: 1px solid var(--rosa-borde); }

/* ---------- ESTRUCTURA ---------- */
header.barra {
    background: var(--blanco);
    border-bottom: 1px solid var(--gris-borde);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 20;
}

.barra .marca { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; color: var(--rosa); }
.barra .marca > div { line-height: 1.25; }
.logo-marca { width: 38px; height: 38px; object-fit: contain; flex: 0 0 auto; }
.barra .rol { font-size: 12px; color: var(--gris-medio); display: block; font-weight: 400; }
.barra .acciones { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }

main { max-width: 1180px; margin: 0 auto; padding: 20px 16px 70px; }

.marca-publica { display: flex; justify-content: center; padding: 6px 0 18px; }
.marca-publica img { width: 84px; height: 84px; object-fit: contain; }

h2.seccion { font-size: 17px; margin: 28px 0 13px; }
h2.seccion:first-child { margin-top: 0; }
h3.sub { font-size: 14.5px; margin: 18px 0 9px; color: var(--gris-texto); }

.pista { font-size: 12.5px; color: var(--gris-medio); margin: 6px 0 10px; }

/* ---------- TARJETAS ---------- */
.card {
    background: var(--blanco);
    border: 1px solid var(--gris-borde);
    border-radius: var(--radio);
    padding: 18px;
    margin-bottom: 15px;
    box-shadow: var(--sombra);
}

.card h3 { font-size: 16px; margin-bottom: 6px; }
.card .desc { font-size: 13.5px; color: var(--gris-texto); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }

.stat {
    background: var(--blanco);
    border: 1px solid var(--gris-borde);
    border-radius: var(--radio);
    padding: 14px 15px;
}
.stat .n { font-size: 24px; font-weight: 700; color: var(--rosa); }
.stat .t { font-size: 12.5px; color: var(--gris-texto); margin-top: 2px; }

/* ---------- GRILLA DE SERVICIOS ---------- */
.servicios { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 13px; }

.servicio {
    background: var(--blanco);
    border: 1px solid var(--gris-borde);
    border-radius: var(--radio);
    padding: 15px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: box-shadow .12s, transform .12s;
}
.servicio:hover { box-shadow: var(--sombra-alta); transform: translateY(-2px); }
.servicio .nombre { font-weight: 700; font-size: 15px; }
.servicio .desc { font-size: 13px; color: var(--gris-texto); flex: 1; }
.servicio .precio { font-size: 18px; font-weight: 700; color: var(--rosa); }
.servicio .meta { font-size: 12.5px; color: var(--gris-medio); display: flex; gap: 10px; flex-wrap: wrap; }
.servicio .pie { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }

/* ---------- HORARIOS ---------- */
.horas { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }

.hora {
    padding: 9px 6px;
    border: 1px solid var(--gris-borde);
    border-radius: var(--radio-chico);
    background: var(--blanco);
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--texto);
    cursor: pointer;
    text-align: center;
}
.hora:hover:not(:disabled) { border-color: var(--rosa-claro); background: var(--rosa-bg); color: var(--rosa); }
.hora.elegida { background: var(--rosa); border-color: var(--rosa); color: #fff; }
.hora:disabled { opacity: .4; cursor: not-allowed; text-decoration: line-through; }

.dias { display: flex; flex-direction: column; gap: 10px; }
.dia-fila { display: flex; gap: 12px; align-items: flex-start; }
.dia-fila .et { width: 92px; font-size: 13.5px; font-weight: 600; padding-top: 8px; }

/* ---------- TURNOS ---------- */
.turno {
    background: var(--blanco);
    border: 1px solid var(--gris-borde);
    border-left: 4px solid var(--gris-medio);
    border-radius: var(--radio);
    padding: 14px 16px;
    margin-bottom: 10px;
}
.turno.reservado { border-left-color: var(--ambar); }
.turno.confirmado { border-left-color: var(--verde); }
.turno.cancelado, .turno.rechazado { border-left-color: var(--rojo); opacity: .75; }
.turno.completado { border-left-color: var(--rosa); }
.turno.no_asistio { border-left-color: var(--gris-medio); }

.turno .fila1 { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 5px; }
.turno .codigo { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; font-weight: 700; color: var(--rosa); }
.turno .titulo { font-weight: 600; font-size: 15px; }
.turno .meta { font-size: 12.5px; color: var(--gris-texto); display: flex; gap: 13px; flex-wrap: wrap; }
.turno .acciones { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 10px; }

/* ---------- BADGES ---------- */
.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}

.badge.est-reservado { background: var(--ambar-bg); color: var(--ambar); }
.badge.est-confirmado { background: var(--verde-bg); color: var(--verde); }
.badge.est-cancelado { background: var(--rojo-bg); color: var(--rojo); }
.badge.est-rechazado { background: var(--rojo-bg); color: var(--rojo); }
.badge.est-completado { background: var(--rosa-bg); color: var(--rosa); }
.badge.est-no_asistio { background: var(--gris-bg); color: var(--gris-texto); }
.badge.pg-no_aplica { background: var(--gris-bg); color: var(--gris-texto); }
.badge.pg-pendiente { background: var(--ambar-bg); color: var(--ambar); }
.badge.pg-acreditado { background: var(--verde-bg); color: var(--verde); }
.badge.pg-rechazado { background: var(--rojo-bg); color: var(--rojo); }
.badge.pg-reembolsado { background: var(--violeta-bg); color: var(--violeta); }
.badge.cat-manos, .badge.cat-unias, .badge.cat-pestanas,
.badge.cat-depilacion, .badge.cat-corporal, .badge.cat-otros {
    background: var(--rosa-bg); color: var(--rosa);
}

/* ---------- LISTAS / TABLAS ---------- */
.lista { display: flex; flex-direction: column; gap: 10px; }

.fila-dato {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--gris-bg);
    font-size: 14px;
    flex-wrap: wrap;
}
.fila-dato:last-child { border-bottom: none; }
.fila-dato .k { color: var(--gris-texto); font-size: 13px; }
.fila-dato .v { font-weight: 600; text-align: right; word-break: break-word; }

/* ---------- FORMULARIO EN MODAL ---------- */
.modal-fondo {
    position: fixed;
    inset: 0;
    background: rgba(44, 34, 40, .55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 50;
}
.modal-fondo.abierto { display: flex; }
.modal {
    background: var(--blanco);
    border-radius: 14px;
    padding: 22px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: auto;
}
.modal h3 { font-size: 17px; margin-bottom: 16px; }
.modal .pie { display: flex; gap: 9px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

.oculto { display: none !important; }
.vacio { text-align: center; padding: 42px 20px; color: var(--gris-medio); font-size: 14px; }
.vacio .icono { font-size: 34px; margin-bottom: 8px; }

/* ---------- TABS DEL PANEL ---------- */
.nav-secciones { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; border-bottom: 1px solid var(--gris-borde); padding-bottom: 10px; }
.nav-secciones button {
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--gris-texto);
    cursor: pointer;
}
.nav-secciones button:hover { background: var(--gris-bg); }
.nav-secciones button.activo { background: var(--rosa); color: #fff; }

/* ---------- SPINNER ---------- */
.spinner {
    display: inline-block;
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: girar .7s linear infinite;
}
.spinner.oscuro { border-color: rgba(176, 74, 114, .25); border-top-color: var(--rosa); }

@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- IMPRESION ---------- */
@media print {
    header.barra, .nav-secciones, .acciones, .btn { display: none !important; }
    body { background: #fff; }
    .turno { break-inside: avoid; }
}

@media (max-width: 620px) {
    .campo-fila { grid-template-columns: 1fr; }
    .barra .marca { font-size: 15px; }
    .dia-fila { flex-direction: column; gap: 4px; }
    .dia-fila .et { width: auto; padding-top: 0; }
    main { padding: 16px 12px 60px; }
}
