/* ============================================================
   Platino Massage — Panel de administración
   ============================================================ */

:root {
    --rojo-900: #4d0810;
    --rojo-700: #9c1122;
    --rojo: #c8102e;
    --rojo-500: #e11d34;
    --rojo-soft: #fdeef0;

    --tinta: #14161a;
    --tinta-2: #23262d;
    --gris: #6b7280;
    --gris-claro: #9aa0aa;
    --linea: #e6e7ea;
    --crema: #f6f7f9;
    --blanco: #fff;

    --verde: #1a9c56;
    --ambar: #c47f0b;

    --sombra-sm: 0 1px 2px rgba(20, 22, 26, .06), 0 1px 3px rgba(20, 22, 26, .08);
    --sombra: 0 8px 24px -10px rgba(20, 22, 26, .25);
    --radio: 12px;

    --fuente: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --lateral: 250px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--fuente);
    font-size: 15px;
    line-height: 1.6;
    color: var(--tinta);
    background: var(--crema);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--rojo); text-decoration: none; }
a:hover { color: var(--rojo-700); }

h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.25; font-weight: 700; }

img { max-width: 100%; display: block; }

/* ---------- Layout ---------- */
.admin {
    display: grid;
    grid-template-columns: var(--lateral) 1fr;
    min-height: 100vh;
}

.lateral {
    background: var(--tinta);
    color: rgba(255, 255, 255, .78);
    padding: 1.4rem 1rem;
    display: flex; flex-direction: column; gap: 1.4rem;
    position: sticky; top: 0; height: 100vh;
}
.lateral__marca { display: flex; align-items: center; gap: .7rem; padding: .3rem .5rem 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .1); }
.lateral__marca img { height: 42px; border-radius: 7px; }
.lateral__marca strong { display: block; color: #fff; font-size: 1rem; letter-spacing: .05em; }
.lateral__marca span { font-size: .62rem; letter-spacing: .3em; text-transform: uppercase; color: var(--rojo-500); }

.menu { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .25rem; }
.menu a {
    display: flex; align-items: center; gap: .75rem;
    padding: .68rem .85rem; border-radius: 9px;
    color: rgba(255, 255, 255, .74); font-size: .92rem; font-weight: 500;
    transition: background .15s, color .15s;
}
.menu a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.menu a.activo { background: var(--rojo); color: #fff; box-shadow: 0 8px 18px -10px rgba(200, 16, 46, .9); }
.menu a svg { flex: none; opacity: .9; }

.lateral__pie { margin-top: auto; padding-top: 1rem; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .8rem; }
.lateral__usuario { color: rgba(255, 255, 255, .6); margin-bottom: .5rem; }

.principal { padding: 2rem 2.2rem 3rem; max-width: 1180px; width: 100%; }

.cabecera-pagina {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 1rem; margin-bottom: 1.6rem;
}
.cabecera-pagina h1 { font-size: 1.6rem; margin: 0; }
.cabecera-pagina p { color: var(--gris); margin: .2rem 0 0; font-size: .92rem; }
.cabecera-pagina__acciones { display: flex; gap: .6rem; flex-wrap: wrap; }

/* ---------- Tarjetas ---------- */
.tarjeta {
    background: #fff; border: 1px solid var(--linea); border-radius: var(--radio);
    box-shadow: var(--sombra-sm); padding: 1.5rem; margin-bottom: 1.5rem;
}
.tarjeta > h2 { font-size: 1.05rem; margin-bottom: 1rem; padding-bottom: .75rem; border-bottom: 1px solid var(--linea); }
.tarjeta__pie { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.4rem; padding-top: 1.3rem; border-top: 1px solid var(--linea); }

/* ---------- Botones ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .6rem 1.15rem; border-radius: 9px; border: 1px solid transparent;
    font-family: inherit; font-size: .89rem; font-weight: 600; cursor: pointer;
    transition: background .15s, color .15s, border-color .15s, transform .1s;
    white-space: nowrap; text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn--rojo { background: var(--rojo); color: #fff; }
.btn--rojo:hover { background: var(--rojo-700); color: #fff; }
.btn--gris { background: #fff; color: var(--tinta-2); border-color: var(--linea); }
.btn--gris:hover { background: var(--crema); color: var(--tinta); }
.btn--peligro { background: #fff; color: var(--rojo); border-color: #f0c3ca; }
.btn--peligro:hover { background: var(--rojo); color: #fff; border-color: var(--rojo); }
.btn--verde { background: var(--verde); color: #fff; }
.btn--verde:hover { background: #147a43; color: #fff; }
.btn--sm { padding: .42rem .8rem; font-size: .8rem; }
.btn--bloque { width: 100%; }

/* ---------- Formularios ---------- */
.campo { margin-bottom: 1.2rem; }
.campo label { display: block; font-weight: 600; font-size: .87rem; margin-bottom: .4rem; }
.campo .ayuda { display: block; font-size: .79rem; color: var(--gris-claro); margin-top: .35rem; }
.campo input[type=text], .campo input[type=number], .campo input[type=password],
.campo input[type=email], .campo input[type=tel], .campo input[type=url],
.campo textarea, .campo select {
    width: 100%; padding: .68rem .85rem; border: 1px solid var(--linea);
    border-radius: 9px; font-family: inherit; font-size: .93rem; background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.campo input:focus, .campo textarea:focus, .campo select:focus {
    outline: none; border-color: var(--rojo);
    box-shadow: 0 0 0 3px rgba(200, 16, 46, .14);
}
.campo textarea { resize: vertical; min-height: 110px; }
.campo input[type=file] { width: 100%; font-size: .88rem; }
.rejilla-2 { display: grid; gap: 0 1.2rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .rejilla-2 { grid-template-columns: 1fr 1fr; } }

/* ---------- Tabla ---------- */
.tabla { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tabla th {
    text-align: left; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
    color: var(--gris); font-weight: 700; padding: .7rem .8rem; border-bottom: 1px solid var(--linea);
}
.tabla td { padding: .85rem .8rem; border-bottom: 1px solid var(--linea); vertical-align: middle; }
.tabla tr:last-child td { border-bottom: none; }
.tabla tr:hover td { background: #fcfcfd; }
.tabla__foto { width: 46px; height: 58px; object-fit: cover; border-radius: 8px; background: var(--crema); }
.tabla__nombre { font-weight: 600; }
.tabla__sub { font-size: .8rem; color: var(--gris); }
.acciones { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Interruptor (switch) ---------- */
.interruptor { display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; }
.interruptor input { position: absolute; opacity: 0; width: 0; height: 0; }
.interruptor__pista {
    width: 46px; height: 26px; border-radius: 999px; background: #cbd0d8;
    position: relative; transition: background .2s; flex: none;
}
.interruptor__pista::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
    border-radius: 50%; background: #fff; transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.interruptor input:checked + .interruptor__pista { background: var(--verde); }
.interruptor input:checked + .interruptor__pista::after { transform: translateX(20px); }
.interruptor input:focus-visible + .interruptor__pista { box-shadow: 0 0 0 3px rgba(200, 16, 46, .25); }
.interruptor__texto { font-size: .82rem; font-weight: 600; color: var(--gris); }
.interruptor input:checked ~ .interruptor__texto { color: var(--verde); }

/* ---------- Etiquetas de estado ---------- */
.pastilla {
    display: inline-flex; align-items: center; gap: .35rem;
    font-size: .74rem; font-weight: 700; padding: .22rem .6rem; border-radius: 999px;
}
.pastilla--activa { background: #e7f7ee; color: #0f7a41; }
.pastilla--inactiva { background: #f1f2f4; color: #6b7280; }

/* ---------- Avisos (flash) ---------- */
.avisos { margin-bottom: 1.4rem; display: flex; flex-direction: column; gap: .6rem; }
.aviso {
    display: flex; align-items: flex-start; gap: .7rem;
    padding: .85rem 1rem; border-radius: 10px; font-size: .9rem; border: 1px solid;
}
.aviso--ok { background: #e9f8f0; border-color: #b6e6cb; color: #0f7a41; }
.aviso--error { background: var(--rojo-soft); border-color: #f3c3ca; color: var(--rojo-900); }
.aviso--info { background: #eef4ff; border-color: #c8dbff; color: #1b4fa8; }

/* ---------- Galería en el formulario ---------- */
.galeria-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: .8rem; }
.galeria-admin__item {
    position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--linea);
    background: var(--crema); aspect-ratio: 3 / 4;
}
.galeria-admin__item img { width: 100%; height: 100%; object-fit: cover; }
.galeria-admin__borrar {
    position: absolute; top: 5px; right: 5px; width: 28px; height: 28px; border-radius: 50%;
    background: rgba(20, 22, 26, .8); color: #fff; border: none; cursor: pointer;
    font-size: .95rem; line-height: 1; display: grid; place-items: center;
}
.galeria-admin__borrar:hover { background: var(--rojo); }

/* ---------- Vista previa de la foto de perfil ---------- */
.perfil-preview { display: flex; align-items: flex-start; gap: 1.2rem; flex-wrap: wrap; }
.perfil-preview img {
    width: 120px; height: 152px; object-fit: cover; border-radius: 10px;
    border: 1px solid var(--linea); background: var(--crema);
}

/* ---------- Login ---------- */
.login-pantalla {
    min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
    background:
        radial-gradient(1000px 500px at 12% 8%, rgba(200, 16, 46, .28), transparent 60%),
        linear-gradient(140deg, #14161a 0%, #240409 100%);
}
.login-caja {
    width: 100%; max-width: 400px; background: #fff; border-radius: 18px;
    box-shadow: 0 30px 60px -18px rgba(0, 0, 0, .6); padding: 2.2rem; text-align: center;
}
.login-caja img { height: 76px; margin: 0 auto 1rem; border-radius: 10px; }
.login-caja h1 { font-size: 1.3rem; margin-bottom: .2rem; }
.login-caja p.sub { color: var(--gris); font-size: .88rem; margin: 0 0 1.6rem; }
.login-caja .campo { text-align: left; }

.vacio-admin {
    text-align: center; padding: 3rem 1rem; color: var(--gris);
    border: 2px dashed var(--linea); border-radius: var(--radio); background: #fff;
}

/* ---------- Utilidades ---------- */
.texto-gris { color: var(--gris); }
.mb-0 { margin-bottom: 0 !important; }
.mt-1 { margin-top: 1rem; }
.oculto { display: none !important; }

@media (max-width: 860px) {
    .admin { grid-template-columns: 1fr; }
    .lateral { position: static; height: auto; }
    .lateral__pie { margin-top: 0; }
    .principal { padding: 1.4rem 1.1rem 2.5rem; }
    .tabla thead { display: none; }
    .tabla tr { display: block; border: 1px solid var(--linea); border-radius: 10px; margin-bottom: .8rem; background: #fff; padding: .6rem; }
    .tabla td { display: flex; justify-content: space-between; gap: 1rem; border: none; padding: .35rem .2rem; }
    .tabla td::before { content: attr(data-etiqueta); font-weight: 600; color: var(--gris); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
    .acciones { justify-content: flex-end; }
}
