/* ================================================================
   Catalogo Digital — hoja de estilo unica
   Paleta institucional Ecatepec: guinda #621132, oro #a57f2c.
   Base 18px y clickeables de 44px por accesibilidad.
   ================================================================ */

:root {
    --guinda: #621132;
    --guinda-claro: #7d1f45;
    --guinda-oscuro: #4a0d26;
    --oro: #a57f2c;
    --oro-claro: #c9a24b;

    --tinta: #1f2225;
    --tinta-suave: #55595e;
    --linea: #d9d5d0;
    --papel: #f6f4f1;
    --tarjeta: #ffffff;

    --ok: #1f6b3a;
    --ok-fondo: #e6f3ea;
    --alerta: #8a5a00;
    --alerta-fondo: #fdf3dd;
    --error: #a11d1d;
    --error-fondo: #fbe9e9;

    --radio: 10px;
    --sombra: 0 1px 3px rgba(0, 0, 0, .08), 0 4px 14px rgba(0, 0, 0, .05);
}

* { box-sizing: border-box; }

/* El atributo hidden debe ganarle a cualquier display de clase.
   Sin esto, un .boton[hidden] se seguia viendo: .boton trae
   display:inline-flex y le pasa por encima al hidden del navegador.
   Aparecia el boton "Copiar" de una contrasena todavia tapada. */
[hidden] { display: none !important; }

html { font-size: 18px; }

body {
    margin: 0;
    font-family: "Segoe UI", Montserrat, system-ui, -apple-system, Arial, sans-serif;
    background: var(--papel);
    color: var(--tinta);
    line-height: 1.55;
}

a { color: var(--guinda); }
a:hover { color: var(--guinda-claro); }

/* ---------- Encabezado ---------- */

.barra {
    background: var(--guinda);
    color: #fff;
    border-bottom: 4px solid var(--oro);
}

.barra-interna {
    max-width: 1380px;
    margin: 0 auto;
    padding: .7rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.marca {
    font-weight: 700;
    font-size: 1.15rem;
    color: #fff;
    text-decoration: none;
    letter-spacing: .2px;
    display: flex;
    align-items: center;
    gap: .55rem;
}

/* El nombre del sistema y, debajo, el area que lo hace. */
.marca-texto { display: flex; flex-direction: column; line-height: 1.15; }

.marca-texto small {
    font-size: .68rem;
    font-weight: 500;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--oro-claro);
    margin-top: .1rem;
}

/* La flor dorada va sobre el guinda de la barra, sin recuadro:
   el PNG ya es dorado con fondo transparente. */
.marca .sello {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex: none;
}

.menu { display: flex; gap: .3rem; flex-wrap: wrap; margin-left: auto; align-items: center; }

.menu a, .menu button {
    color: #fff;
    text-decoration: none;
    padding: .55rem .8rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    border-radius: 8px;
    font-size: .95rem;
    background: transparent;
    border: 0;
    cursor: pointer;
    font-family: inherit;
}

.menu a:hover, .menu button:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.menu a.activo { background: rgba(255, 255, 255, .2); font-weight: 600; }

/* Iconos en linea del menu. Tamano base; la capa "pro" lo ajusta. */
.ico { width: 18px; height: 18px; flex: none; }

.menu a { gap: .45rem; }

.quien {
    font-size: .85rem;
    opacity: .9;
    padding-left: .8rem;
    border-left: 1px solid rgba(255, 255, 255, .3);
    display: flex;
    align-items: center;
    gap: .6rem;
}

.quien-datos { line-height: 1.25; }
.quien-datos strong { display: block; font-weight: 600; }
.quien-datos small { font-size: .78rem; opacity: .85; }

.quien button {
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 8px;
    min-height: 40px;
    padding: .4rem .8rem;
    font-family: inherit;
    font-size: .85rem;
    cursor: pointer;
}

.quien button:hover { background: rgba(255, 255, 255, .14); }

/* ---------- Contenedor ---------- */

.envoltura { max-width: 1380px; margin: 0 auto; padding: 1.6rem 1.2rem 4rem; }

h1 { font-size: 1.7rem; margin: 0 0 .3rem; color: var(--guinda-oscuro); }
h2 { font-size: 1.25rem; margin: 2rem 0 .8rem; color: var(--guinda-oscuro); }
h3 { font-size: 1.05rem; margin: 0 0 .5rem; }

.subtitulo { color: var(--tinta-suave); margin: 0 0 1.4rem; }

/* ---------- Tarjetas ---------- */

.tarjeta {
    background: var(--tarjeta);
    border: 1px solid var(--linea);
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    padding: 1.1rem 1.2rem;
    margin-bottom: 1.2rem;
}

.tarjeta > h2:first-child, .tarjeta > h3:first-child { margin-top: 0; }

.rejilla { display: grid; gap: 1rem; }
.rejilla-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.rejilla-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.rejilla-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* ---------- Numeritos del panel ---------- */

.cifra {
    background: var(--tarjeta);
    border: 1px solid var(--linea);
    border-left: 5px solid var(--guinda);
    border-radius: var(--radio);
    padding: 1rem 1.1rem;
    text-decoration: none;
    color: inherit;
    display: block;
}

.cifra:hover { border-color: var(--oro); color: inherit; }
.cifra .n { font-size: 2rem; font-weight: 700; color: var(--guinda); line-height: 1.1; }
.cifra .etq { font-size: .85rem; color: var(--tinta-suave); text-transform: uppercase; letter-spacing: .4px; }
.cifra.aviso { border-left-color: var(--alerta); }
.cifra.aviso .n { color: var(--alerta); }

/* ---------- Etiquetas de estado ---------- */

.chip {
    display: inline-block;
    padding: .18rem .6rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    white-space: nowrap;
}

.chip-PRODUCCION { background: var(--ok-fondo); color: var(--ok); }
.chip-LOCAL      { background: #e8eef7; color: #23497e; }
.chip-DESARROLLO { background: var(--alerta-fondo); color: var(--alerta); }
.chip-PAUSADO    { background: #eceaea; color: #5c5c5c; }
.chip-BAJA       { background: var(--error-fondo); color: var(--error); }
.chip-neutro     { background: #eee9e2; color: #6b5b3e; }
.chip-oro        { background: #f6ecd5; color: #7a5c15; }

/* ---------- Tablas ---------- */

.tabla { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tabla th, .tabla td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--linea); vertical-align: top; }
.tabla th { background: #faf8f6; font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; color: var(--tinta-suave); }
.tabla tr:hover td { background: #fbfaf8; }
.tabla-envuelta { overflow-x: auto; }

.mono { font-family: "Cascadia Mono", Consolas, "Courier New", monospace; font-size: .85rem; }

/* ---------- Formularios ---------- */

label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: .25rem; color: var(--tinta-suave); }

input[type=text], input[type=password], input[type=email], input[type=number],
select, textarea {
    width: 100%;
    padding: .6rem .7rem;
    min-height: 44px;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid var(--linea);
    border-radius: 8px;
    background: #fff;
    color: var(--tinta);
}

input:focus, select:focus, textarea:focus {
    outline: 3px solid var(--oro-claro);
    outline-offset: 1px;
    border-color: var(--oro);
}

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

.campo { margin-bottom: .9rem; }
.campos { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.pista { font-size: .8rem; color: var(--tinta-suave); margin-top: .2rem; }

.casilla { display: flex; align-items: center; gap: .5rem; min-height: 44px; }
.casilla input { width: 22px; height: 22px; }
.casilla label { margin: 0; font-weight: 500; color: var(--tinta); }

/* ---------- Botones ---------- */

.boton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    min-height: 44px;
    padding: .55rem 1.1rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: .95rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    background: var(--guinda);
    color: #fff;
}

.boton:hover { background: var(--guinda-claro); color: #fff; }
.boton:disabled { opacity: .55; cursor: not-allowed; }

.boton-borde { background: #fff; color: var(--guinda); border-color: var(--guinda); }
.boton-borde:hover { background: #f7eff2; color: var(--guinda); }

.boton-oro { background: var(--oro); color: #2c2205; }
.boton-oro:hover { background: var(--oro-claro); color: #2c2205; }

.boton-peligro { background: #fff; color: var(--error); border-color: var(--error); }
.boton-peligro:hover { background: var(--error-fondo); color: var(--error); }

.boton-chico { min-height: 36px; padding: .3rem .7rem; font-size: .82rem; }

.acciones { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

/* ---------- Avisos ---------- */

.aviso {
    padding: .8rem 1rem;
    border-radius: var(--radio);
    margin-bottom: 1rem;
    border-left: 5px solid;
    font-size: .95rem;
}

.aviso-ok    { background: var(--ok-fondo); border-color: var(--ok); color: #12401f; }
.aviso-error { background: var(--error-fondo); border-color: var(--error); color: #6b1010; }
.aviso-info  { background: #eaf0f8; border-color: #23497e; color: #1a3358; }
.aviso-nota  { background: var(--alerta-fondo); border-color: var(--alerta); color: #5e3f00; }

/* ---------- Login ---------- */

.acceso-fondo {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: linear-gradient(160deg, var(--guinda-oscuro), var(--guinda) 55%, #7d1f45);
}

.acceso-caja {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .3);
    padding: 2rem;
    width: 100%;
    max-width: 420px;
    border-top: 6px solid var(--oro);
}

.acceso-caja h1 { font-size: 1.35rem; margin-bottom: .1rem; }

.acceso-flor {
    display: block;
    width: 82px;
    height: 82px;
    object-fit: contain;
    margin: 0 auto .8rem;
}

/* ---------- Ficha de sistema ---------- */

.ficha-cabeza {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 1.2rem;
}

.datos { display: grid; gap: .1rem .9rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.dato { padding: .45rem 0; border-bottom: 1px dashed var(--linea); }
.dato .k { font-size: .75rem; text-transform: uppercase; letter-spacing: .5px; color: var(--tinta-suave); }
.dato .v { word-break: break-word; }

.lista-limpia { list-style: none; margin: 0; padding: 0; }

.liga-fila {
    display: flex;
    gap: .7rem;
    align-items: center;
    padding: .6rem 0;
    border-bottom: 1px solid var(--linea);
    flex-wrap: wrap;
}

.liga-fila:last-child { border-bottom: 0; }
.liga-fila .crece { flex: 1; min-width: 220px; }

.secreto {
    font-family: "Cascadia Mono", Consolas, monospace;
    background: #f4f1ec;
    border: 1px dashed var(--oro);
    border-radius: 6px;
    padding: .35rem .6rem;
    display: inline-block;
    min-width: 140px;
    word-break: break-all;
}

details.desplegable { border: 1px solid var(--linea); border-radius: var(--radio); padding: .6rem .9rem; margin-top: 1rem; background: #fdfcfb; }
details.desplegable > summary { cursor: pointer; font-weight: 600; color: var(--guinda); min-height: 34px; display: flex; align-items: center; }
details.desplegable[open] > summary { margin-bottom: .8rem; }

.vacio { color: var(--tinta-suave); font-style: italic; padding: .6rem 0; }

.pie {
    text-align: center;
    color: var(--tinta-suave);
    font-size: .8rem;
    padding: 1.5rem 1rem 2.5rem;
}

/* ---------- Filtros ---------- */

.filtros { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }

.filtro {
    padding: .45rem .9rem;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--linea);
    border-radius: 999px;
    background: #fff;
    text-decoration: none;
    color: var(--tinta-suave);
    font-size: .85rem;
}

.filtro:hover { border-color: var(--oro); color: var(--tinta); }
.filtro.activo { background: var(--guinda); border-color: var(--guinda); color: #fff; font-weight: 600; }

.buscador { display: flex; gap: .6rem; flex-wrap: wrap; }
.buscador input { flex: 1; min-width: 240px; }

@media print {
    .barra, .menu, .acciones, .boton { display: none !important; }
    body { background: #fff; }
}
