/* =============================================================================
   Tema visual — estilo panel moderno
   Se carga DESPUÉS de app.css y redefine la piel sin tocar la estructura.
   ========================================================================== */

:root {
    --teal: #17b39a;
    --teal-oscuro: #0f9c86;
    --teal-claro: #e2f7f2;
    --teal-medio: #35cfb3;

    --fondo: #f4f7fb;
    --superficie: #ffffff;
    --borde: #e8eef5;
    --borde-fuerte: #dbe4ee;

    --texto: #0f1f2e;
    --texto-suave: #5a7085;
    --texto-tenue: #93a5b8;

    --azul: #3b82f6;
    --azul-claro: #e8f1ff;
    --verde: #10b981;
    --verde-claro: #e3faf1;
    --dorado: #f59e0b;
    --dorado-claro: #fef4e2;
    --rojo: #ef4444;
    --rojo-claro: #fdecec;
    --morado: #8b5cf6;
    --morado-claro: #f1ecff;

    --radio: 18px;
    --radio-chico: 11px;

    --sombra: 0 8px 28px rgba(15, 31, 46, .05);
    --sombra-alta: 0 18px 46px rgba(15, 31, 46, .12);
    --sombra-teal: 0 12px 30px rgba(23, 179, 154, .26);

    --lateral: 280px;
    --barra: 76px;
}

body {
    background: var(--fondo);
    color: var(--texto);
    font-size: 14.5px;
}

/* ------------------------------------------------------------------ Lateral */
.lateral {
    left: 14px;
    top: 14px;
    bottom: 14px;
    width: 252px;
    border: 0;
    border-radius: 22px;
    background:
        radial-gradient(120% 60% at 110% 0%, rgba(255, 255, 255, .22) 0%, transparent 60%),
        linear-gradient(168deg, #2fd0b4 0%, #1ab9a0 42%, #109684 100%);
    box-shadow: 0 20px 44px rgba(16, 150, 132, .28);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.lateral::after {
    content: "";
    position: absolute;
    width: 320px;
    height: 320px;
    right: -170px;
    top: 34%;
    border-radius: 50%;
    background: rgba(255, 255, 255, .07);
    pointer-events: none;
}

.marca {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 22px 18px 16px;
    position: relative;
    z-index: 1;
}

.marca__logo {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    background: #fff;
    display: grid;
    place-items: center;
    color: var(--teal);
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(6, 74, 66, .18);
    overflow: hidden;
}

.marca__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.marca__texto { min-width: 0; line-height: 1.3; }

.marca__texto strong {
    display: block;
    color: #fff;
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: -.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.marca__texto small {
    display: block;
    color: rgba(255, 255, 255, .72);
    font-size: 11px;
    white-space: nowrap;
}

.marca__cerrar {
    display: none;
    margin-left: auto;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, .85);
    font-size: 16px;
    padding: 4px 6px;
}

/* Tarjeta de acción del lateral */
.cta-lateral {
    position: relative;
    z-index: 1;
    margin: 4px 16px 6px;
    padding: 15px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .17);
    border: 1px solid rgba(255, 255, 255, .16);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    transition: background .16s, transform .12s;
}

.cta-lateral:hover {
    background: rgba(255, 255, 255, .26);
    color: #fff;
    transform: translateY(-1px);
}

.cta-lateral__mas {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    color: var(--teal);
    display: grid;
    place-items: center;
    font-size: 13px;
    box-shadow: 0 6px 14px rgba(6, 74, 66, .16);
}

/* --------------------------------------------------------------------- Menú */
.menu {
    padding: 6px 12px 10px;
    gap: 0;
    position: relative;
    z-index: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .35) transparent;
}

.menu::-webkit-scrollbar { width: 5px; }
.menu::-webkit-scrollbar-track { background: transparent; }
.menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .32);
    border-radius: 5px;
}

.menu__grupo { margin-bottom: 6px; }

.menu__titulo {
    display: block;
    padding: 12px 10px 7px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .58);
}

.menu__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 11px;
    color: rgba(255, 255, 255, .86);
    font-size: 13.5px;
    font-weight: 500;
    transition: background .15s, color .15s;
}

.menu__item i {
    width: 20px;
    font-size: 14px;
    color: rgba(255, 255, 255, .78);
    text-align: center;
}

.menu__item:hover {
    background: rgba(255, 255, 255, .14);
    color: #fff;
}

.menu__item.activo {
    background: #fff;
    color: var(--teal-oscuro);
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(6, 74, 66, .16);
}

.menu__item.activo i { color: var(--teal); }

.menu__punto {
    margin-left: auto;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ffd166;
}

.lateral__pie {
    margin-top: auto;
    padding: 12px 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, .16);
    position: relative;
    z-index: 1;
}

.usuario {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    color: #fff;
}

.usuario:hover { color: #fff; }

.usuario__avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .22);
    border: 1.5px solid rgba(255, 255, 255, .45);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 12.5px;
    font-weight: 700;
    flex-shrink: 0;
}

.usuario strong { font-size: 12.5px; color: #fff; }
.usuario small { font-size: 10.5px; color: rgba(255, 255, 255, .66); }

.btn-salir {
    background: rgba(255, 255, 255, .16);
    color: #fff;
    border-radius: 9px;
}

.btn-salir:hover { background: rgba(255, 255, 255, .3); color: #fff; }

/* -------------------------------------------------------------------- Barra */
.contenido { margin-left: var(--lateral); }

.barra {
    height: var(--barra);
    padding: 0 26px;
    gap: 14px;
    background: rgba(244, 247, 251, .88);
    backdrop-filter: blur(12px);
    border-bottom: 0;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.barra__menu {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--borde);
    background: #fff;
    color: var(--texto);
    box-shadow: var(--sombra);
}

.barra__busqueda {
    position: relative;
    flex: 1;
    max-width: 520px;
}

.barra__busqueda input {
    width: 100%;
    height: 44px;
    border: 0;
    border-radius: 30px;
    background: #fff;
    padding: 0 46px 0 20px;
    font-size: 13.5px;
    color: var(--texto);
    box-shadow: var(--sombra);
    outline: none;
}

.barra__busqueda input::placeholder { color: #a9b8c8; }
.barra__busqueda input:focus { box-shadow: 0 0 0 3px rgba(23, 179, 154, .16), var(--sombra); }

.barra__busqueda i {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #9fb0c2;
    font-size: 15px;
    pointer-events: none;
}

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

.barra__tasa {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 34px;
    padding: 0 13px;
    border-radius: 20px;
    background: var(--teal-claro);
    color: var(--teal-oscuro);
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}

.barra__icono {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #7d90a3;
    background: transparent;
    font-size: 16px;
    transition: background .15s, color .15s;
}

.barra__icono:hover {
    background: #fff;
    color: var(--teal);
    box-shadow: var(--sombra);
}

.barra__badge {
    position: absolute;
    top: 3px;
    right: 3px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--teal);
    color: #fff;
    font-size: 9.5px;
    font-weight: 700;
    font-style: normal;
    display: grid;
    place-items: center;
    border: 2px solid var(--fondo);
}

.barra__divisor {
    width: 1px;
    height: 26px;
    background: var(--borde);
    margin: 0 6px;
}

.barra__usuario {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 4px 10px 4px 4px;
    border-radius: 30px;
    color: var(--texto);
}

.barra__usuario:hover { background: #fff; box-shadow: var(--sombra); color: var(--texto); }

.barra__usuario .usuario__avatar {
    background: linear-gradient(140deg, #4fd8bd, #14a08a);
    border: 0;
    width: 34px;
    height: 34px;
    box-shadow: 0 6px 14px rgba(20, 160, 138, .28);
}

.barra__usuario-texto { display: flex; flex-direction: column; line-height: 1.25; }
.barra__usuario-texto strong { font-size: 12.5px; }
.barra__usuario-texto small { font-size: 10.5px; color: var(--texto-tenue); }

/* ------------------------------------------------------------------- Página */
.pagina { padding: 6px 26px 100px; }

.pagina__cab {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.pagina__titulo h1 {
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.pagina__titulo p {
    margin: 3px 0 0;
    font-size: 12.5px;
    color: var(--texto-tenue);
}

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

/* ------------------------------------------------------------------ Tarjetas */
.tarjeta {
    background: var(--superficie);
    border: 0;
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    margin-bottom: 18px;
}

.tarjeta--plana { box-shadow: var(--sombra); }

.tarjeta__cab {
    padding: 17px 22px;
    border-bottom: 1px solid #f2f6fa;
}

.tarjeta__cab h2,
.tarjeta__cab h3 {
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: -.01em;
}

.tarjeta__cab h2 i,
.tarjeta__cab h3 i {
    color: var(--teal);
    font-size: 13px;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--teal-claro);
    display: inline-grid;
    place-items: center;
    margin-right: 2px;
}

.tarjeta__cuerpo { padding: 22px; }

.tarjeta--angosta,
.tarjeta--angosta-suelta {
    max-width: 520px;
    margin: 0 auto;
}

.rejilla-2 > .tarjeta--angosta-suelta { max-width: none; margin: 0; }

/* ------------------------------------------------------------------ Métricas */
.metricas { gap: 16px; margin-bottom: 18px; }

.metrica {
    border: 0;
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    padding: 18px;
    gap: 14px;
    position: relative;
    overflow: hidden;
}

.metrica__icono {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    font-size: 17px;
}

.metrica__icono--azul { background: var(--azul-claro); color: var(--azul); }
.metrica__icono--verde { background: var(--verde-claro); color: var(--verde); }
.metrica__icono--dorado { background: var(--dorado-claro); color: var(--dorado); }
.metrica__icono--rojo { background: var(--rojo-claro); color: var(--rojo); }
.metrica__icono--morado { background: var(--morado-claro); color: var(--morado); }

.metrica div { gap: 2px; }
.metrica strong { font-size: 22px; font-weight: 700; line-height: 1.1; }
.metrica span {
    font-size: 11.5px;
    color: var(--texto-tenue);
    white-space: normal;
    line-height: 1.3;
}

.metrica__delta {
    display: inline-flex;
    white-space: nowrap;
    max-width: 100%;
    align-items: center;
    gap: 4px;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    margin-top: 3px;
    width: fit-content;
}

.metrica__delta--sube { background: var(--verde-claro); color: #0a8a63; }
.metrica__delta--baja { background: var(--rojo-claro); color: #b42318; }
.metrica__delta--neutro { background: #f1f5f9; color: var(--texto-suave); }

/* --------------------------------------------------------------- Botones */
.btn-principal {
    background: linear-gradient(135deg, #2ec9ae 0%, #14a08a 100%);
    box-shadow: 0 8px 18px rgba(20, 160, 138, .24);
    border-radius: 11px;
    font-weight: 600;
}

.btn-principal:hover { background: linear-gradient(135deg, #28bda4 0%, #0f8a77 100%); }

.btn-secundario {
    background: #fff;
    border: 1px solid var(--borde-fuerte);
    color: var(--texto-suave);
    border-radius: 11px;
    box-shadow: 0 2px 6px rgba(15, 31, 46, .04);
}

.btn-secundario:hover { border-color: var(--teal-medio); color: var(--teal-oscuro); background: #fff; }

.btn-icono {
    border-radius: 9px;
    border: 1px solid var(--borde);
    color: #7d90a3;
}

.btn-icono:hover { background: var(--teal-claro); border-color: #bfe9df; color: var(--teal-oscuro); }

.btn-icono--marca { background: var(--teal-claro); border-color: #bfe9df; color: var(--teal-oscuro); }

.enlace { color: var(--teal-oscuro); font-weight: 600; }
a { color: var(--teal-oscuro); }

/* ------------------------------------------------------------------- Campos */
.form-control,
.form-select {
    border-radius: 11px;
    border: 1px solid var(--borde-fuerte);
    background-color: #fbfdff;
    font-size: 13.5px;
    padding: 9px 12px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--teal-medio);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(23, 179, 154, .15);
}

.campo label { font-size: 12px; color: var(--texto-suave); font-weight: 600; }

.buscador input { border-radius: 30px; background: #fff; border-color: var(--borde); }

.pestanas { border-bottom: 0; gap: 4px; padding: 4px; background: #eef3f9; border-radius: 12px; width: fit-content; max-width: 100%; }
.pestanas .nav-link { border: 0; border-radius: 9px; padding: 8px 12px; font-size: 12px; font-weight: 600; color: var(--texto-suave); }
.pestanas .nav-link:hover { background: rgba(255, 255, 255, .7); color: var(--teal-oscuro); }
.pestanas .nav-link.active {
    background: #fff;
    color: var(--teal-oscuro);
    box-shadow: 0 4px 12px rgba(15, 31, 46, .08);
    border: 0;
}

/* -------------------------------------------------------------------- Tablas */
.tabla thead th {
    background: transparent;
    border-bottom: 1px solid var(--borde);
    color: #9aabbd;
    font-size: 10.5px;
    letter-spacing: .08em;
    padding: 12px 18px;
}

.tabla tbody td { padding: 13px 18px; border-bottom: 1px solid #f4f7fb; }
.tabla tbody tr:hover { background: #fafcff; }
.tabla tbody tr:last-child td { border-bottom: 0; }

.celda-paciente strong { font-size: 13px; font-weight: 600; }
.celda-paciente small { font-size: 11px; }

/* ----------------------------------------------------------------- Pastillas */
.pastilla {
    border-radius: 7px;
    font-size: 10.5px;
    letter-spacing: .01em;
    padding: 4px 9px;
    font-weight: 700;
}

.pastilla--pendiente,
.pastilla--borrador { background: var(--dorado-claro); color: #b26a00; }
.pastilla--confirmada,
.pastilla--enviado,
.pastilla--en_proceso { background: var(--azul-claro); color: #1d5fd0; }
.pastilla--atendida,
.pastilla--aprobado,
.pastilla--pagado,
.pastilla--realizado { background: var(--verde-claro); color: #0a8a63; }
.pastilla--cancelada,
.pastilla--rechazado { background: var(--rojo-claro); color: #b42318; }
.pastilla--no_asistio,
.pastilla--planificado { background: #eef2f7; color: #5a7085; }

/* ------------------------------------------------------------- Listas suaves */
.agenda-lista li,
.lista-simple li,
.lista-pacientes li { border-bottom: 1px solid #f4f7fb; }

.agenda-lista li:hover,
.lista-pacientes li:hover { background: #fafcff; }

.agenda-lista__hora {
    background: var(--teal-claro);
    color: var(--teal-oscuro);
    border-radius: 8px;
    font-size: 11.5px;
}

.lista-simple__fecha { background: #f4f7fb; border-radius: 9px; }

.acceso {
    background: #fbfdff;
    border: 1px solid var(--borde);
    border-radius: 12px;
}

.acceso:hover {
    background: var(--teal-claro);
    border-color: #bfe9df;
    color: var(--teal-oscuro);
}

/* ------------------------------------------------------------------- Avisos */
.aviso { border-radius: 12px; font-size: 12.5px; }
.aviso--info { background: var(--azul-claro); color: #1d4ed8; }
.aviso--alerta { background: var(--dorado-claro); color: #92400e; }
.aviso-error { border-radius: 11px; }

.ayuda--arriba { margin: 0 0 16px; }

/* --------------------------------------------------------------------- Ficha */
.ficha__cab {
    border: 0;
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    padding: 20px 22px;
}

.ficha__avatar {
    background: linear-gradient(140deg, #4fd8bd, #14a08a);
    box-shadow: 0 8px 18px rgba(20, 160, 138, .26);
}

.tab-content > .tarjeta { margin-bottom: 0; }

/* --------------------------------------------------------------- Odontograma */
.odontograma .pieza {
    border-radius: 10px;
    border: 1.5px solid var(--borde-fuerte);
    box-shadow: 0 1px 2px rgba(15, 31, 46, .04);
}

.odontograma .pieza:hover { border-color: var(--teal-medio); }

.leyenda span { background: #f8fbfe; border-color: var(--borde); }

/* ---------------------------------------------------------------- Plan / KPIs */
.plan-resumen__caja--costo { background: var(--teal-claro); }
.plan-resumen__caja--costo strong,
.plan-resumen__caja--costo span { color: var(--teal-oscuro); }

.diente-chip { background: var(--teal-claro); color: var(--teal-oscuro); border-radius: 7px; }

/* ------------------------------------------------------------------ Modales */
.modal-content { border-radius: 18px; box-shadow: 0 30px 70px rgba(15, 31, 46, .22); }
.modal-header { border-bottom: 1px solid #f2f6fa; padding: 17px 22px; }
.modal-body { padding: 22px; }
.modal-footer { border-top: 1px solid #f2f6fa; padding: 15px 22px; }
.modal-title { font-size: 15px; font-weight: 700; }

/* ------------------------------------------------------------------- Avisos flotantes */
.toast-propio { border-radius: 12px; }

.instalar {
    border-radius: 14px;
    background: #0f1f2e;
}

.instalar__boton { background: var(--teal-medio); color: #04211f; border-radius: 9px; }

/* ============================================================================
   Gráficos del panel
   ========================================================================== */

.panel-rejilla {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 16px;
    margin-bottom: 18px;
    align-items: stretch;
}

.grafico__cuerpo { padding: 8px 22px 20px; }

.grafico__barras {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 190px;
    padding-top: 18px;
}

.grafico__columna {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    height: 100%;
    justify-content: flex-end;
}

.grafico__barra {
    width: 100%;
    max-width: 34px;
    border-radius: 8px 8px 4px 4px;
    background: linear-gradient(180deg, #4fd8bd 0%, #17b39a 100%);
    min-height: 4px;
    transition: height .4s ease;
    position: relative;
}

.grafico__barra--vacia { background: #eef3f9; }

.grafico__etiqueta {
    font-size: 10.5px;
    color: var(--texto-tenue);
    font-weight: 600;
}

.grafico__pie {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 0 22px 18px;
    font-size: 11.5px;
    color: var(--texto-tenue);
}

.grafico__total { font-size: 24px; font-weight: 700; color: var(--texto); letter-spacing: -.02em; }

/* Medidor semicircular */
.medidor {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 20px 20px;
    gap: 4px;
}

.medidor svg { width: 100%; max-width: 230px; height: auto; }

.medidor__valor {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -.03em;
    color: var(--texto);
    margin-top: -34px;
}

.medidor__texto {
    font-size: 11.5px;
    color: var(--texto-tenue);
    text-align: center;
    margin-top: 14px;
    line-height: 1.5;
}

.medidor__cifras {
    display: flex;
    gap: 22px;
    margin-top: 12px;
    justify-content: center;
}

.medidor__cifra { text-align: center; }
.medidor__cifra strong { display: block; font-size: 16px; }
.medidor__cifra span { font-size: 10.5px; color: var(--texto-tenue); }

/* Barra de progreso simple */
.progreso {
    height: 8px;
    border-radius: 6px;
    background: #eef3f9;
    overflow: hidden;
    margin-top: 10px;
}

.progreso__relleno {
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, #4fd8bd, #14a08a);
}

/* ------------------------------------------------------------------ Login */
.cuerpo-login {
    background:
        radial-gradient(900px 480px at 8% -6%, #d9f6ef 0%, transparent 58%),
        radial-gradient(760px 420px at 104% 106%, #e6f0ff 0%, transparent 56%),
        #f4f7fb;
}

.login {
    border-radius: 24px;
    border: 0;
    box-shadow: 0 30px 80px rgba(15, 31, 46, .14);
    max-width: 880px;
}

.login__lado {
    background:
        radial-gradient(120% 60% at 110% 0%, rgba(255, 255, 255, .2) 0%, transparent 60%),
        linear-gradient(165deg, #2fd0b4 0%, #1ab9a0 45%, #109684 100%);
    padding: 46px 42px;
    justify-content: center;
    gap: 24px;
}

.login__lema {
    margin: 0;
    font-size: 23px;
    font-weight: 700;
    line-height: 1.32;
    color: #fff;
    letter-spacing: -.015em;
    max-width: 300px;
}

.login__lista { margin-top: 2px; }
.login__version { margin-top: 18px; }

/* Identidad arriba del formulario: logo, nombre y subtítulo.
   En móvil el panel izquierdo se oculta, así que esta es la única marca. */
.login__marca-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    margin-bottom: 24px;
}

.login__marca-logo {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    background: linear-gradient(140deg, #4fd8bd, #14a08a);
    color: #fff;
    font-size: 26px;
    display: grid;
    place-items: center;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(20, 160, 138, .28);
    margin-bottom: 8px;
}

.login__marca-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
    padding: 7px;
}

.login__marca-form h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.25;
}

.login__marca-sub {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--texto-tenue);
}

.login__form { padding: 40px 40px 42px; }
.login__form h2 { font-size: 17px; font-weight: 700; }
.login__sub { margin: 3px 0 20px; }
.login__form .btn-principal { width: 100%; padding: 12px; margin-top: 8px; }
.login__pie { color: var(--texto-tenue); }

/* --------------------------------------------------------------- Adaptable */
@media (max-width: 1180px) {
    .panel-rejilla { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
    :root { --lateral: 0px; }

    .lateral {
        left: 0;
        top: 0;
        bottom: 0;
        width: 264px;
        border-radius: 0 22px 22px 0;
        transform: translateX(-105%);
    }

    .lateral.abierto { transform: translateX(0); }
    .marca__cerrar { display: block; }
    .contenido { margin-left: 0; }

    .barra {
        height: auto;
        padding: 10px 14px;
        gap: 10px;
        flex-wrap: wrap;
    }

    .barra__menu { display: grid; place-items: center; }
    .barra__busqueda { order: 3; flex-basis: 100%; max-width: none; }
    .barra__busqueda input { height: 40px; }
    .barra__acciones { gap: 2px; }
    .barra__icono { width: 36px; height: 36px; font-size: 15px; }
    .barra__divisor { display: none; }
    .barra__usuario-texto { display: none; }
    .barra__usuario { padding: 2px; }
    .barra__tasa { padding: 0 9px; font-size: 10.5px; height: 30px; }

    .pagina { padding: 4px 14px 100px; }
    .pagina__titulo h1 { font-size: 18px; }
    .pagina__cab { margin-bottom: 14px; }

    .grafico__barras { height: 150px; gap: 6px; }
    .medidor svg { max-width: 190px; }
    .medidor__valor { font-size: 26px; margin-top: -28px; }
}

@media (max-width: 520px) {
    .grafico__etiqueta { font-size: 9px; }
    .grafico__total { font-size: 20px; }
    .metrica strong { font-size: 19px; }
    .metrica__icono { width: 40px; height: 40px; font-size: 15px; }
}


/* En pantallas de poca altura el menú se compacta para que quepa completo */
@media (max-height: 760px) and (min-width: 861px) {
    .marca { padding: 16px 16px 12px; }
    .marca__logo { width: 40px; height: 40px; font-size: 17px; border-radius: 11px; }
    .cta-lateral { padding: 10px 12px; margin-bottom: 2px; }
    .cta-lateral__mas { width: 26px; height: 26px; font-size: 11px; }
    .cta-lateral__texto { font-size: 11.5px; }
    .menu__titulo { padding: 9px 10px 5px; }
    .menu__item { padding: 8px 12px; font-size: 13px; }
    .lateral__pie { padding: 10px 14px 12px; }
}


/* Con el menú abierto el aviso de instalación estorba */
body.menu-abierto .instalar { display: none; }


@media (max-width: 900px) {
    .login__marca-form { margin-bottom: 20px; }
    .login__marca-logo { width: 56px; height: 56px; border-radius: 16px; font-size: 23px; }
    .login__marca-form h1 { font-size: 18.5px; }
    .login__form { padding: 32px 24px 34px; }
}


/* El login puede ser más alto que la ventana: nunca se recorta por arriba.
   'safe center' centra mientras quepa y alinea arriba cuando no. */
.cuerpo-login {
    align-items: safe center;
    justify-items: center;
    overflow-y: auto;
    padding: 20px;
}

@media (max-height: 720px) and (min-width: 901px) {
    .login__marca-form { margin-bottom: 18px; }
    .login__marca-logo { width: 54px; height: 54px; font-size: 22px; border-radius: 15px; margin-bottom: 6px; }
    .login__marca-form h1 { font-size: 18.5px; }
    .login__form { padding: 30px 36px 32px; }
    .login__sub { margin-bottom: 16px; }
    .login__pie { margin-top: 14px; }
    .il { margin-top: 16px; padding-top: 14px; }
    .login__lado { padding: 34px 36px; }
    .login__lema { font-size: 20px; }
}
