/* =====================================================================
   TUBOUTIQUE · Hoja principal
   Glassmorphism claro · rosa (#d6336c) y dorado (#c9a227)
   ===================================================================== */

:root {
    /* Marca */
    --rosa:          #d6336c;
    --rosa-osc:      #b02a5b;
    --rosa-claro:    #f06595;
    --rosa-suave:    rgba(214, 51, 108, .10);
    --dorado:        #c9a227;
    --dorado-claro:  #e8c766;
    --dorado-suave:  rgba(201, 162, 39, .12);

    /* Superficies */
    --fondo:         #fdf6f8;
    --cristal:       rgba(255, 255, 255, .66);
    --cristal-fuerte: rgba(255, 255, 255, .84);
    --borde:         rgba(255, 255, 255, .85);
    --linea:         rgba(43, 27, 37, .08);

    /* Texto */
    --texto:         #2b1b25;
    --suave:         #7c6470;
    --suave-2:       #a08d97;

    /* Estados */
    --verde:         #2f9e6b;
    --verde-suave:   rgba(47, 158, 107, .12);
    --ambar:         #c98a12;
    --ambar-suave:   rgba(201, 138, 18, .14);
    --rojo:          #c0392b;
    --rojo-suave:    rgba(192, 57, 43, .12);

    /* Formas */
    --radio:         20px;
    --radio-sm:      13px;
    --sombra:        0 20px 44px -28px rgba(122, 45, 80, .45);
    --sombra-alta:   0 30px 60px -30px rgba(122, 45, 80, .55);
    --blur:          blur(18px) saturate(150%);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--texto);
    background: var(--fondo);
    min-height: 100vh;
    overflow-x: clip;
}

/* Malla de color fija detrás de todo */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(900px 620px at 8% -8%, #ffe3ee 0%, transparent 60%),
        radial-gradient(820px 560px at 100% 0%, #fff1d8 0%, transparent 55%),
        radial-gradient(760px 600px at 78% 100%, #ffe7f2 0%, transparent 62%),
        linear-gradient(160deg, #fdf6f8 0%, #fff8fb 55%, #fdf3f6 100%);
}

h1, h2, h3, h4 { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 600; letter-spacing: -.3px; margin: 0 0 6px; }
h1 { font-size: 1.85rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.12rem; }

a { color: var(--rosa); text-decoration: none; }
a:hover { color: var(--rosa-osc); }

[hidden] { display: none !important; }
.oculto { display: none !important; }

/* =====================================================================
   VIDRIO Y TARJETAS
   ===================================================================== */
.cristal {
    background: var(--cristal);
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    box-shadow: var(--sombra), inset 0 1px 0 rgba(255, 255, 255, .9);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
}

.tarjeta { padding: 20px 22px; }
.tarjeta--compacta { padding: 14px 16px; }

.seccion {
    font-family: 'Poppins', sans-serif;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--suave-2);
    margin: 26px 0 12px;
}

/* =====================================================================
   BOTONES
   ===================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border: 0;
    border-radius: 13px;
    font-family: inherit;
    font-size: .87rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, var(--rosa-claro), var(--rosa) 55%, var(--rosa-osc));
    box-shadow: 0 14px 26px -16px rgba(214, 51, 108, .9);
    transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
    white-space: nowrap;
}

.btn:hover { filter: brightness(1.04); color: #fff; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.btn--claro {
    background: rgba(255, 255, 255, .8);
    color: var(--texto);
    border: 1px solid rgba(43, 27, 37, .1);
    box-shadow: 0 8px 20px -16px rgba(43, 27, 37, .5);
}
.btn--claro:hover { background: #fff; color: var(--texto); }

.btn--dorado {
    background: linear-gradient(135deg, var(--dorado-claro), var(--dorado) 60%, #a9841a);
    color: #2b1b25;
    box-shadow: 0 14px 26px -16px rgba(201, 162, 39, .85);
}
.btn--dorado:hover { color: #2b1b25; }

.btn--peligro { background: linear-gradient(135deg, #e06a5e, var(--rojo)); color: #fff; }

.btn--mini { padding: 8px 13px; font-size: .8rem; border-radius: 11px; }
.btn--bloque { width: 100%; }

.btn-icono {
    width: 36px; height: 36px;
    display: inline-grid; place-items: center;
    border: 1px solid var(--linea);
    border-radius: 11px;
    background: rgba(255, 255, 255, .7);
    color: var(--suave);
    font-size: 1rem;
    cursor: pointer;
    transition: all .14s ease;
}
.btn-icono:hover { background: #fff; color: var(--rosa); border-color: rgba(214, 51, 108, .3); }
.btn-icono--rojo:hover { color: var(--rojo); border-color: rgba(192, 57, 43, .35); }

.acciones-fila { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* =====================================================================
   FORMULARIOS
   ===================================================================== */
.campo { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }

.etiqueta {
    font-size: .78rem;
    font-weight: 600;
    color: var(--suave);
}

.etiqueta .req { color: var(--rosa); }

.input, .campo input, .campo select, .campo textarea, select.input {
    width: 100%;
    padding: 11px 14px;
    font-family: inherit;
    font-size: .9rem;
    color: var(--texto);
    background: rgba(255, 255, 255, .82);
    border: 1px solid rgba(43, 27, 37, .12);
    border-radius: var(--radio-sm);
    transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}

.input:focus, .campo input:focus, .campo select:focus, .campo textarea:focus {
    outline: none;
    background: #fff;
    border-color: rgba(214, 51, 108, .55);
    box-shadow: 0 0 0 4px rgba(214, 51, 108, .12);
}

.input::placeholder { color: var(--suave-2); }

select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--suave) 50%), linear-gradient(135deg, var(--suave) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }

.form-rejilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 4px 16px; }
.campo--ancho { grid-column: 1 / -1; }

.ayuda { font-size: .74rem; color: var(--suave-2); }
.valor-calculado { font-variant-numeric: tabular-nums; font-weight: 600; }

input[type="checkbox"], input[type="radio"] { accent-color: var(--rosa); }

/* =====================================================================
   LOGIN
   ===================================================================== */
.acceso {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
}

.acceso__caja {
    width: 100%;
    max-width: 420px;
    padding: 34px 30px 28px;
    text-align: center;
}

.acceso__marca {
    width: 88px; height: 88px;
    margin: 0 auto 16px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff, #ffe9f1);
    border: 1px solid rgba(214, 51, 108, .18);
    box-shadow: 0 16px 34px -22px rgba(214, 51, 108, .7);
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--rosa);
}

.acceso__marca img { max-width: 66px; max-height: 66px; object-fit: contain; }

.acceso h1 { font-size: 1.6rem; margin-bottom: 4px; }
.acceso__sub { color: var(--suave); font-size: .85rem; margin: 0 0 22px; }

.acceso form { text-align: left; }

.acceso__pie { margin-top: 18px; font-size: .74rem; color: var(--suave-2); }

/* =====================================================================
   ESTRUCTURA DEL PANEL
   ===================================================================== */
.panel { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }

.lateral {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .82), rgba(255, 246, 250, .9));
    border-right: 1px solid rgba(255, 255, 255, .9);
    box-shadow: 1px 0 0 rgba(43, 27, 37, .04);
}

.marca { display: flex; flex-direction: column; gap: 2px; margin-bottom: 18px; padding: 0 6px; }
.marca__logo { height: 34px; width: auto; object-fit: contain; }
.marca__nombre { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 1.35rem; font-weight: 700; color: var(--texto); line-height: 1.1; }
.marca__sub { font-size: .64rem; text-transform: uppercase; letter-spacing: .16em; color: var(--suave-2); font-weight: 600; }

.lateral__menu { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; margin: 0 -4px; padding: 0 4px; }
.lateral__menu::-webkit-scrollbar { width: 6px; }
.lateral__menu::-webkit-scrollbar-thumb { background: rgba(214, 51, 108, .25); border-radius: 999px; }

.menu-titulo { font-size: .62rem; text-transform: uppercase; letter-spacing: .14em; color: var(--suave-2); font-weight: 700; margin: 16px 10px 6px; }

.menu-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 13px;
    font-size: .87rem;
    font-weight: 500;
    color: var(--texto);
    border: 1px solid transparent;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.menu-item i { font-size: 1.05rem; color: var(--suave); transition: color .15s ease; }

.menu-item:hover { background: rgba(214, 51, 108, .07); color: var(--rosa-osc); }
.menu-item:hover i { color: var(--rosa); }

.menu-item.activo {
    background: linear-gradient(120deg, rgba(214, 51, 108, .14), rgba(201, 162, 39, .1));
    border-color: rgba(214, 51, 108, .22);
    color: var(--rosa-osc);
    font-weight: 600;
}
.menu-item.activo i { color: var(--rosa); }

.menu-num {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: var(--rosa);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
}

.lateral__pie { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--linea); }

.usuario-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .7);
    border: 1px solid var(--linea);
}

.usuario-chip__avatar {
    width: 34px; height: 34px;
    flex: 0 0 34px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rosa-claro), var(--rosa));
    color: #fff;
    font-weight: 700;
    font-size: .8rem;
}

.usuario-chip__datos { min-width: 0; line-height: 1.2; }
.usuario-chip__datos strong { display: block; font-size: .8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usuario-chip__datos small { font-size: .68rem; color: var(--suave-2); text-transform: capitalize; }

.contenido { padding: 24px 28px 46px; min-width: 0; max-width: 100%; }

.encabezado {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.encabezado h1 { margin: 0 0 2px; }
.encabezado p { margin: 0; color: var(--suave); font-size: .85rem; }

.encabezado__acciones { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* =====================================================================
   INDICADORES
   ===================================================================== */
.rejilla { display: grid; gap: 14px; }
.rejilla--4 { grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.rejilla--3 { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.rejilla--2 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }

.kpi { display: flex; align-items: center; gap: 14px; }

.kpi__icono {
    width: 46px; height: 46px;
    flex: 0 0 46px;
    display: grid; place-items: center;
    border-radius: 14px;
    font-size: 1.15rem;
    background: var(--rosa-suave);
    color: var(--rosa);
}

.kpi__icono--dorado { background: var(--dorado-suave); color: var(--dorado); }
.kpi__icono--verde { background: var(--verde-suave); color: var(--verde); }
.kpi__icono--ambar { background: var(--ambar-suave); color: var(--ambar); }
.kpi__icono--rojo { background: var(--rojo-suave); color: var(--rojo); }

.kpi__valor { font-size: 1.5rem; font-weight: 700; letter-spacing: -.6px; line-height: 1.1; }
.kpi__nombre { font-size: .74rem; color: var(--suave); font-weight: 500; }
.kpi__nota { font-size: .7rem; color: var(--suave-2); margin-top: 2px; }

/* =====================================================================
   TABLAS
   ===================================================================== */
.tabla-caja { min-width: 0; max-width: 100%; overflow: hidden; }

.tabla { width: 100%; border-collapse: collapse; font-size: .87rem; }

.tabla thead th {
    text-align: left;
    padding: 10px 12px;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--suave-2);
    font-weight: 700;
    border-bottom: 1px solid var(--linea);
    white-space: nowrap;
}

.tabla tbody td { padding: 11px 12px; border-bottom: 1px solid var(--linea); vertical-align: middle; }
.tabla tbody tr:last-child td { border-bottom: 0; }
.tabla tbody tr:hover { background: rgba(214, 51, 108, .035); }

.tabla .num { text-align: right; font-variant-numeric: tabular-nums; }
.tabla .empresa { font-weight: 600; }

/* Fila con miniatura */
.prod-celda { display: flex; align-items: center; gap: 11px; min-width: 0; }

.prod-mini {
    width: 42px; height: 42px;
    flex: 0 0 42px;
    border-radius: 11px;
    object-fit: cover;
    background: #fff;
    border: 1px solid var(--linea);
}

.prod-celda__datos { min-width: 0; }
.prod-celda__datos strong { display: block; font-weight: 600; font-size: .87rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-celda__datos small { font-size: .72rem; color: var(--suave-2); }

/* =====================================================================
   PASTILLAS
   ===================================================================== */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 600;
    background: rgba(43, 27, 37, .06);
    color: var(--suave);
    white-space: nowrap;
}

.pill--ok { background: var(--verde-suave); color: #1f7a50; }
.pill--alerta { background: var(--ambar-suave); color: #96650a; }
.pill--rojo { background: var(--rojo-suave); color: #a02f22; }
.pill--info { background: var(--rosa-suave); color: var(--rosa-osc); }
.pill--dorado { background: var(--dorado-suave); color: #8a6d10; }

/* =====================================================================
   AVISOS
   ===================================================================== */
.alerta {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 15px;
    border-radius: 14px;
    font-size: .85rem;
    font-weight: 500;
    margin-bottom: 16px;
}

.alerta i { font-size: 1.1rem; }
.alerta--error { background: var(--rojo-suave); color: #a02f22; border: 1px solid rgba(192, 57, 43, .2); }
.alerta--ok { background: var(--verde-suave); color: #1f7a50; border: 1px solid rgba(47, 158, 107, .2); }
.alerta--info { background: var(--rosa-suave); color: var(--rosa-osc); border: 1px solid rgba(214, 51, 108, .18); }
.alerta--alerta { background: var(--ambar-suave); color: #8a5c05; border: 1px solid rgba(201, 138, 18, .22); }

/* Avisos flotantes */
.avisos-flotantes { position: fixed; right: 18px; bottom: 18px; z-index: 1200; display: flex; flex-direction: column; gap: 8px; }

.aviso-flotante {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px;
    border-radius: 13px;
    background: rgba(43, 27, 37, .95);
    color: #fff;
    font-size: .85rem;
    box-shadow: var(--sombra-alta);
    animation: aviso-entra .22s ease both;
    max-width: 360px;
}

.aviso-flotante--error { background: rgba(150, 40, 30, .97); }
.aviso-flotante i { font-size: 1.05rem; color: var(--dorado-claro); }
.aviso-flotante--error i { color: #ffb3ab; }

@keyframes aviso-entra { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* =====================================================================
   MODALES
   ===================================================================== */
.modal-cristal .modal-content {
    border: 1px solid var(--borde);
    border-radius: 22px;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(20px);
    box-shadow: var(--sombra-alta);
}

.modal-cristal .modal-header,
.modal-cristal .modal-footer { border-color: var(--linea); padding: 16px 22px; }

.modal-cristal .modal-body { padding: 20px 22px; }
.modal-cristal .modal-title { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 1.4rem; font-weight: 600; }

/* =====================================================================
   ESTADOS VACÍOS
   ===================================================================== */
.vacio { text-align: center; padding: 40px 20px; color: var(--suave); font-size: .88rem; }
.vacio i { display: block; font-size: 2.1rem; color: var(--rosa-claro); margin-bottom: 10px; }


/* ------------------------------------------------ Carga de foto */
.foto-carga { display: flex; gap: 14px; align-items: flex-start; }

.foto-carga__vista {
    width: 92px; height: 92px; flex: 0 0 92px;
    display: grid; place-items: center;
    border-radius: 14px; overflow: hidden;
    background: rgba(255, 255, 255, .85);
    border: 1px dashed rgba(43, 27, 37, .2);
    color: var(--suave-2); font-size: 1.5rem;
}

.foto-carga__vista img { width: 100%; height: 100%; object-fit: cover; }

.foto-carga__acciones { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

/* El icono del estado vacío no debe afectar a los botones que van dentro */
.vacio > i { display: block; font-size: 2.1rem; color: var(--rosa-claro); margin-bottom: 10px; }
.vacio i { font-size: inherit; }

/* =====================================================================
   BARRAS Y HERRAMIENTAS
   ===================================================================== */
.herramientas { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }

.buscador { position: relative; flex: 1 1 260px; max-width: 380px; }
.buscador i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--suave-2); }
.buscador input {
    width: 100%;
    padding: 11px 14px 11px 40px;
    font-family: inherit;
    font-size: .88rem;
    background: rgba(255, 255, 255, .85);
    border: 1px solid rgba(43, 27, 37, .1);
    border-radius: 13px;
}
.buscador input:focus { outline: none; background: #fff; border-color: rgba(214, 51, 108, .5); box-shadow: 0 0 0 4px rgba(214, 51, 108, .1); }

.filtro-mini {
    padding: 10px 14px;
    font-family: inherit;
    font-size: .84rem;
    font-weight: 500;
    background: rgba(255, 255, 255, .85);
    border: 1px solid rgba(43, 27, 37, .1);
    border-radius: 13px;
}

/* =====================================================================
   BARRAS MÓVILES
   ===================================================================== */
.barra-movil { display: none; }
.telon { display: none; position: fixed; inset: 0; background: rgba(43, 27, 37, .35); z-index: 1040; }
.telon.visible { display: block; }

.barra-inferior { display: none; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 960px) {
    .panel { grid-template-columns: minmax(0, 1fr); }

    .lateral {
        position: fixed;
        inset: 0 auto 0 0;
        width: 264px;
        z-index: 1050;
        transform: translateX(-105%);
    }
    .lateral.abierto {
        transform: translateX(0);
        animation: menu-entra .24s cubic-bezier(.4, 0, .2, 1) both;
    }

    @keyframes menu-entra {
        from { transform: translateX(-105%); }
        to   { transform: translateX(0); }
    }

    .barra-movil {
        display: flex;
        align-items: center;
        gap: 12px;
        position: sticky;
        top: 0;
        z-index: 1030;
        padding: 10px 14px;
        background: rgba(255, 255, 255, .92);
        border-bottom: 1px solid var(--linea);
        backdrop-filter: blur(14px);
    }

    .barra-movil__btn {
        width: 40px; height: 40px;
        display: grid; place-items: center;
        border: 0;
        border-radius: 12px;
        background: var(--rosa-suave);
        color: var(--rosa);
        font-size: 1.1rem;
    }

    .barra-movil strong { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 1.15rem; }

    .contenido { padding: 16px 14px calc(96px + env(safe-area-inset-bottom)); }
    .encabezado h1 { font-size: 1.5rem; }

    .barra-inferior {
        position: fixed;
        left: 0; right: 0; bottom: 0;
        z-index: 1045;
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
        padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, .97);
        border-top: 1px solid var(--linea);
        box-shadow: 0 -14px 30px -26px rgba(43, 27, 37, .5);
    }

    .barra-inferior__item {
        display: grid;
        place-items: center;
        gap: 3px;
        padding: 6px 2px;
        border: 0;
        background: none;
        border-radius: 12px;
        color: var(--suave-2);
        font-family: inherit;
        font-size: .6rem;
        font-weight: 600;
        text-decoration: none;
    }

    .barra-inferior__item i { font-size: 1.15rem; }
    .barra-inferior__item.activo { color: var(--rosa); background: var(--rosa-suave); }
}

@media (max-width: 760px) {
    main.contenido table {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    main.contenido table th,
    main.contenido table td { white-space: nowrap; }

    main.contenido table td.vacio {
        display: block;
        width: 100%;
        white-space: normal !important;
        text-align: center !important;
        border: 0 !important;
        padding: 34px 16px !important;
    }

    main.contenido table tr:has(td.vacio) {
        display: block !important;
        border: 0 !important;
        background: none !important;
    }
    main.contenido table:has(td.vacio) thead { display: none; }
}

@media (max-width: 560px) {
    .rejilla--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .kpi { gap: 10px; }
    .kpi__icono { width: 38px; height: 38px; flex: 0 0 38px; font-size: 1rem; border-radius: 12px; }
    .kpi__valor { font-size: 1.15rem; }
    .kpi__nombre { font-size: .68rem; }
    .tarjeta { padding: 15px 16px; }
    .herramientas { gap: 8px; }
    .herramientas > .buscador { flex: 1 1 100%; max-width: none; }
    .herramientas .btn { flex: 1 1 auto; }
}


/* =====================================================================
   Móvil · nada se sale de la pantalla
   ===================================================================== */
@media (max-width: 760px) {
    .contenido,
    .panel { min-width: 0; max-width: 100%; }

    .alerta { flex-wrap: wrap; align-items: flex-start; }
    .alerta > .btn,
    .alerta > a.btn { width: 100%; justify-content: center; }

    .encabezado { flex-wrap: wrap; gap: 10px; }
    .encabezado__acciones { width: 100%; margin-left: 0; }
    .encabezado__acciones .btn { flex: 1 1 auto; justify-content: center; }

    .rejilla--2,
    .rejilla--3,
    .rejilla--4 { grid-template-columns: minmax(0, 1fr); }

    .kpi__texto { min-width: 0; }
    .kpi__valor,
    .kpi__nombre { overflow: hidden; text-overflow: ellipsis; }

    .tabla-caja { overflow: hidden; }

    .herramientas > * { min-width: 0; }
}

@media (min-width: 561px) and (max-width: 760px) {
    .rejilla--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rejilla--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media print {
    body::before, .lateral, .barra-movil, .barra-inferior, .encabezado__acciones, .herramientas { display: none !important; }
    body { background: #fff; }
    .cristal { box-shadow: none; border: 1px solid #ddd; backdrop-filter: none; background: #fff; }
    .contenido { padding: 0; }
}

@supports not (backdrop-filter: blur(4px)) {
    .cristal { background: rgba(255, 255, 255, .92); }
}
