/* ─────────────────────────────────────────────────────────────
   IconTeam · Descarga masiva de CFDI
   Paleta tomada del logotipo IconTeam
   ───────────────────────────────────────────────────────────── */
:root {
    /* Colores del logotipo */
    --icon-azul:    #0b5f9b;
    --icon-verde:   #00a651;
    --icon-lima:    #8dc63f;
    --icon-amarillo:#fdb93a;
    --icon-naranja: #f15a24;
    --icon-rojo:    #b5193f;
    --icon-morado:  #662d6b;
    --icon-petroleo:#00585a;
    --icon-gris:    #8a8d91;

    --arcoiris: linear-gradient(90deg,
        var(--icon-morado) 0%, var(--icon-azul) 16%, var(--icon-petroleo) 30%,
        var(--icon-verde) 44%, var(--icon-lima) 58%, var(--icon-amarillo) 72%,
        var(--icon-naranja) 86%, var(--icon-rojo) 100%);

    /* Roles de la interfaz */
    --fondo: #f3f5f8;
    --tarjeta: #ffffff;
    --texto: #1e2530;
    --tenue: #5f6672;
    --borde: #dde2e8;
    --primario: var(--icon-azul);
    --primario-hover: #084b7b;
    --verde: #00873f;
    --ambar: #c27c00;
    --rojo: var(--icon-rojo);
    --gris: #6e7781;
    --radio: 12px;
    --sombra: 0 1px 2px rgba(20, 30, 45, .06), 0 4px 16px rgba(20, 30, 45, .05);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    background:
        radial-gradient(1200px 420px at 100% -10%, rgba(11, 95, 155, .06), transparent 60%),
        radial-gradient(900px 380px at -10% 110%, rgba(241, 90, 36, .05), transparent 60%),
        var(--fondo);
    background-attachment: fixed;
    color: var(--texto);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.contenedor { max-width: 1140px; margin: 0 auto; padding: 0 20px; width: 100%; }

/* ── Barra superior ── */
.barra {
    background: #fff;
    color: var(--texto);
    position: sticky; top: 0; z-index: 10;
    box-shadow: 0 1px 0 var(--borde), 0 2px 12px rgba(20, 30, 45, .04);
}
.barra::after { content: ""; display: block; height: 4px; background: var(--arcoiris); }
.barra-interior { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 16px; }
.barra h1 { font-size: 1.1rem; margin: 0; font-weight: 700; }
.barra h1 a { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 12px; }
.marca-logo { height: 46px; width: auto; display: block; }
.marca-texto { display: flex; flex-direction: column; line-height: 1.15; }
.marca-texto .marca-nombre { font-size: .9rem; letter-spacing: .01em; font-weight: 700; color: var(--icon-gris); }
.marca-texto .marca-nombre b { color: var(--icon-azul); font-weight: 800; }
.marca-texto .marca-app { font-size: 1.08rem; color: var(--texto); }

.sesion { display: flex; align-items: center; gap: 14px; }
.sesion form { display: flex; align-items: center; gap: 8px; }
.rfc {
    font-family: ui-monospace, Consolas, monospace; font-weight: 700; font-size: .85rem;
    background: #eef4fa; color: var(--icon-azul);
    padding: 3px 9px; border-radius: 999px; border: 1px solid #cfe0ef;
}
.sesion .enlace { color: var(--tenue); text-decoration: none; font-weight: 600; padding: 6px 2px; border-bottom: 2px solid transparent; }
.sesion .enlace:hover { color: var(--icon-azul); }
.sesion .enlace.activo { color: var(--icon-azul); border-bottom-color: var(--icon-naranja); }
.quien { color: var(--tenue); font-weight: 600; }

main { padding-top: 28px; padding-bottom: 40px; flex: 1; }

/* ── Tarjetas ── */
.tarjeta {
    background: var(--tarjeta);
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    padding: 22px 26px;
    margin-bottom: 22px;
    box-shadow: var(--sombra);
    position: relative;
}
.tarjeta h2 { margin: 0 0 14px; font-size: 1.12rem; display: flex; align-items: center; gap: 10px; }
.tarjeta h2::before {
    content: ""; width: 6px; height: 1.1em; border-radius: 3px;
    background: linear-gradient(180deg, var(--icon-azul), var(--icon-verde));
}
.tarjeta:nth-of-type(2) h2::before { background: linear-gradient(180deg, var(--icon-naranja), var(--icon-rojo)); }
.tarjeta:nth-of-type(3) h2::before { background: linear-gradient(180deg, var(--icon-morado), var(--icon-azul)); }

.tarjeta.angosta { max-width: 460px; margin: 32px auto; overflow: hidden; padding-top: 26px; }
.tarjeta.angosta::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--arcoiris); }
.logo-acceso { display: block; width: 150px; height: auto; margin: 4px auto 18px; }
.tarjeta.angosta h2 { justify-content: center; }
.tarjeta.angosta h2::before { display: none; }

.nota { color: var(--tenue); font-size: .9rem; }
ul.nota { margin: 18px 0 0; padding: 14px 16px 14px 34px; background: #f7f9fb; border-radius: 10px; border: 1px solid var(--borde); }
ul.nota li { margin: 3px 0; }
ul.nota li::marker { color: var(--icon-naranja); }

/* ── Formularios ── */
.formulario { display: flex; flex-direction: column; gap: 14px; }
.formulario.rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 18px; }
.formulario label { display: flex; flex-direction: column; gap: 5px; font-size: .86rem; font-weight: 600; color: #3a414c; }
.formulario input, .formulario select {
    font: inherit; font-weight: 400;
    padding: 9px 11px;
    border: 1px solid var(--borde);
    border-radius: 8px;
    background: #fff;
    color: var(--texto);
    transition: border-color .15s, box-shadow .15s;
}
.formulario input:hover, .formulario select:hover { border-color: #c3cad3; }
.formulario input:focus, .formulario select:focus {
    outline: none; border-color: var(--icon-azul);
    box-shadow: 0 0 0 3px rgba(11, 95, 155, .15);
}
.formulario input[type="file"] { padding: 7px; background: #f7f9fb; }
.formulario input[type="file"]::file-selector-button {
    font: inherit; font-weight: 600; border: 0; border-radius: 6px;
    padding: 6px 12px; margin-right: 10px; cursor: pointer;
    background: #e6eff7; color: var(--icon-azul);
}
.acciones-form { grid-column: 1 / -1; }

/* ── Botones ── */
.boton {
    display: inline-block;
    font: inherit; font-weight: 600;
    padding: 9px 18px;
    border: 0;
    border-radius: 8px;
    background: var(--primario);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, transform .05s, box-shadow .15s;
    box-shadow: 0 1px 2px rgba(11, 95, 155, .25);
}
.boton:hover { background: var(--primario-hover); }
.boton:active { transform: translateY(1px); }
.boton:focus-visible { outline: 3px solid rgba(253, 185, 58, .7); outline-offset: 2px; }
.boton:disabled { opacity: .6; cursor: wait; }
.boton.secundario { background: transparent; border: 1px solid currentColor; color: inherit; box-shadow: none; }
.barra .boton.secundario { color: var(--tenue); border-color: var(--borde); }
.barra .boton.secundario:hover { color: var(--icon-azul); border-color: var(--icon-azul); background: #f2f7fb; }
.tarjeta .boton.secundario { color: var(--primario); }
.tarjeta .boton.secundario:hover { background: #eef4fa; }
.boton.chico { padding: 5px 11px; font-size: .84rem; }
.boton.verde { background: var(--verde); box-shadow: 0 1px 2px rgba(0, 135, 63, .25); }
.boton.verde:hover { background: #006e33; }
.boton.peligro { background: var(--rojo); }
.boton.peligro:hover { background: #941335; }

/* ── Avisos ── */
.aviso { padding: 11px 14px 11px 16px; border-radius: 10px; margin-bottom: 10px; border: 1px solid; border-left-width: 5px; }
.aviso.ok    { background: #eaf7ef; border-color: #bfe3cc; border-left-color: var(--icon-verde); }
.aviso.info  { background: #edf4fb; border-color: #c6dbef; border-left-color: var(--icon-azul); }
.aviso.error { background: #fcedf0; border-color: #f0c4ce; border-left-color: var(--icon-rojo); }

.encabezado-seccion { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.encabezado-seccion h2 { margin: 0; }

/* ── Tablas ── */
.tabla-envoltura { overflow-x: auto; border: 1px solid var(--borde); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--borde); vertical-align: top; }
thead th { background: #f5f7fa; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfd; }
th { color: var(--tenue); font-weight: 700; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; }
td small { color: var(--tenue); }
code { font-size: .8rem; color: var(--tenue); }
td.acciones { white-space: nowrap; }
td.acciones form { display: inline; }

/* ── Estados y etiquetas ── */
.estado { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; color: #fff; }
.estado.verde { background: var(--verde); }
.estado.ambar { background: var(--icon-amarillo); color: #4a3200; }
.estado.rojo  { background: var(--rojo); }
.estado.gris  { background: var(--gris); }

.etiqueta { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: #eceff3; color: var(--tenue); }
.etiqueta.admin { background: #f0e6f1; color: var(--icon-morado); }
.etiqueta.inactivo { background: #fcedf0; color: var(--rojo); }

details.editar summary { cursor: pointer; color: var(--primario); font-weight: 600; font-size: .85rem; }
details.editar[open] { background: #f7f9fb; border: 1px solid var(--borde); border-radius: 10px; padding: 12px; margin-top: 6px; }
details.editar .formulario { margin-top: 10px; }
.casilla { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 400 !important; }
.casilla input { accent-color: var(--icon-azul); }

/* ── Vigencia de usuarios ── */
.vigencia { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.vigencia.sin-limite { background: #eceff3; color: var(--tenue); }
.vigencia.vigente    { background: #e3f5ea; color: var(--verde); }
.vigencia.por-vencer { background: #fff3da; color: #8a5a00; }
.vigencia.vencida    { background: #fcedf0; color: var(--rojo); }
.aviso.vigencia-aviso { background: #fff7e6; border-color: #f6dca6; border-left-color: var(--icon-amarillo); }
form.renovar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--borde); font-size: .84rem; font-weight: 600; color: var(--tenue); }

/* ── Pie ── */
.pie { border-top: 1px solid var(--borde); background: #fff; color: var(--tenue); font-size: .82rem; }
.pie-interior { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; }
.pie-puntos { display: flex; gap: 5px; }
.pie-puntos i { width: 9px; height: 9px; border-radius: 50%; display: block; }

@media (max-width: 720px) {
    .barra-interior { flex-wrap: wrap; padding: 10px 0; }
    .sesion { flex-wrap: wrap; }
    .marca-texto .marca-app { font-size: .98rem; }
    .tarjeta { padding: 18px; }
    .pie-interior { flex-direction: column; justify-content: center; padding: 12px 0; text-align: center; }
}
