/* ============================================================
   GOVRADAR — DESIGN SYSTEM
   Un único sistema de estilos: tokens, layout y componentes.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ------------------------------------------------------------
   1. Reset
------------------------------------------------------------ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body,
h1, h2, h3, h4, p,
figure {
    margin: 0;
}

ul, ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

button {
    font: inherit;
    cursor: pointer;
}

/* El atributo hidden siempre debe ganar, aunque el elemento
   tenga un display propio definido más abajo (ej: display: flex). */
[hidden] {
    display: none !important;
}

input,
select,
textarea {
    font: inherit;
    color: inherit;
}

/* ------------------------------------------------------------
   2. Tokens
------------------------------------------------------------ */

:root {
    /* Sidebar — tono oscuro cálido de boule.ar */
    --sidebar-width: 252px;
    --sidebar-bg: #1a1a1a;
    --sidebar-bg-active: #292925;
    --sidebar-border: rgba(255, 255, 255, .08);
    --sidebar-text: #a3a29a;
    --sidebar-text-active: #ffffff;

    /* Brand — verde azulado de boule.ar (--brand-accent) */
    --color-primary: #1ba697;
    --color-primary-dark: #11695f;
    --color-primary-soft: #e2f3f0;
    --color-primary-softer: #f3faf9;

    /* Surfaces — crema cálido en vez de gris frío */
    --color-bg: #f4f3ef;
    --color-surface: #ffffff;
    --color-border: #e6e4da;
    --color-border-strong: #d6d3c5;
    --color-table-head: #f8f7f3;

    /* Text — negro cálido en vez de navy frío */
    --color-text: #1a1a1a;
    --color-text-muted: #5c5a52;
    --color-text-faint: #8a8880;

    /* Estado */
    --success: #15803d;
    --success-bg: #e8f8ee;
    --warning: #b45309;
    --warning-bg: #fef6e7;
    --danger: #b91c1c;
    --danger-bg: #fdecec;
    --info: #11695f;
    --info-bg: #e2f3f0;
    --neutral: #5c5a52;
    --neutral-bg: #efeee8;
    --accent: #6d28d9;
    --accent-bg: #f2edfd;

    /* Forma */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-pill: 999px;

    /* Elevación — sombra cálida (tono negro, no navy) */
    --shadow-xs: 0 1px 2px rgba(26, 26, 26, .04);
    --shadow-sm: 0 1px 2px rgba(26, 26, 26, .04), 0 10px 24px rgba(26, 26, 26, .05);
    --shadow-md: 0 6px 14px rgba(26, 26, 26, .06), 0 18px 36px rgba(26, 26, 26, .08);

    --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --ease: cubic-bezier(.4, 0, .2, 1);
}

/* ------------------------------------------------------------
   3. Base
------------------------------------------------------------ */

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 14.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color .15s var(--ease);
}

a:hover {
    color: var(--color-primary-dark);
}

:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

::selection {
    background: var(--color-primary-soft);
    color: var(--color-primary-dark);
}

/* Scrollbar (webkit) */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(26, 26, 26, .15);
    border-radius: 999px;
    border: 2px solid var(--color-bg);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(26, 26, 26, .25);
}

/* ------------------------------------------------------------
   4. Layout general
------------------------------------------------------------ */

.contenedor {
    display: flex;
    align-items: stretch;
    min-height: 100vh;
    background: var(--color-bg);
}

.contenido {
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.pagina {
    flex: 1;
    padding: 32px 36px 48px;
    max-width: 1440px;
    width: 100%;
}

/* ------------------------------------------------------------
   5. Sidebar
------------------------------------------------------------ */

.sidebar {
    position: sticky;
    top: 0;
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
    background:
        radial-gradient(120% 140% at 0% 0%, #2b2b25 0%, transparent 55%),
        var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 4px 8px 22px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--sidebar-border);
}

.logo-mark {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 84px;
    height: 52px;
}

.logo-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.logo h1 {
    font-size: 17px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -.01em;
    line-height: 1.1;
}

.logo span {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #9c9a90;
}

.menu {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-top: 14px;
    padding-right: 4px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .22) transparent;
}

.menu::-webkit-scrollbar {
    width: 6px;
}

.menu::-webkit-scrollbar-track {
    background: transparent;
}

.menu::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 255, 255, .18);
}

.menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, .28);
}

.menu-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 42px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-size: 13.5px;
    font-weight: 500;
    transition: background-color .15s var(--ease), color .15s var(--ease);
}

.menu-item:hover {
    background: rgba(255, 255, 255, .05);
    color: #eae8df;
}

.menu-item.activo {
    background: var(--sidebar-bg-active);
    color: var(--sidebar-text-active);
    font-weight: 600;
}

.menu-item.activo::before {
    content: "";
    position: absolute;
    left: -16px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    border-radius: 0 4px 4px 0;
    background: var(--color-primary);
}

.menu-cascade {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.menu-cascade summary {
    list-style: none;
}

.menu-cascade summary::-webkit-details-marker {
    display: none;
}

.menu-cascade-toggle {
    cursor: pointer;
}

.menu-cascade.activo > .menu-cascade-toggle {
    background: rgba(255, 255, 255, .05);
    color: #eae8df;
}

.menu-cascade-caret {
    display: grid;
    place-items: center;
    width: 16px;
    height: 16px;
    margin-left: auto;
    color: currentColor;
    opacity: .72;
    transition: transform .15s var(--ease), opacity .15s var(--ease);
}

.menu-cascade-caret svg {
    width: 100%;
    height: 100%;
}

.menu-cascade[open] .menu-cascade-caret {
    transform: rotate(180deg);
    opacity: .95;
}

.menu-submenu {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-left: 16px;
    padding-left: 10px;
    border-left: 1px solid var(--sidebar-border);
}

.menu-subitem {
    min-height: 36px;
    padding: 8px 10px;
    font-size: 12.5px;
}

.menu-subitem.activo::before {
    left: -27px;
    height: 18px;
}

.menu-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: currentColor;
    opacity: .9;
}

.menu-icon svg {
    width: 100%;
    height: 100%;
}

.sidebar-footer {
    margin-top: 14px;
    padding: 12px 12px 4px;
    border-top: 1px solid var(--sidebar-border);
}

.sidebar-footer span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--sidebar-text);
}

.sidebar-footer span::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .18);
}

/* ------------------------------------------------------------
   6. Barra superior
------------------------------------------------------------ */

.barra-superior {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0 36px;
    background: rgba(255, 255, 255, .85);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--color-border);
}

.barra-superior h2 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -.01em;
}

.usuario {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
}

.usuario-avatar {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--color-primary), #35c9b6);
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 700;
    box-shadow: var(--shadow-xs);
}

.usuario-logout {
    color: var(--color-text-faint);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.usuario-logout:hover {
    color: var(--danger);
}

/* ------------------------------------------------------------
   6.1 Login
------------------------------------------------------------ */

.auth-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 20%, rgba(20, 184, 166, .18), transparent 32%),
        radial-gradient(circle at 80% 10%, rgba(59, 130, 246, .16), transparent 34%),
        linear-gradient(135deg, #07111f 0%, #101b2d 52%, #0f292d 100%);
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
}

.auth-panel {
    width: min(100%, 460px);
    padding: 34px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 18px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 28px 80px rgba(0, 0, 0, .24);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 36px;
}

.auth-logo {
    display: grid;
    place-items: center;
    width: 104px;
    height: 64px;
}

.auth-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.auth-brand h1 {
    margin: 0;
    color: var(--color-text);
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 0;
}

.auth-brand p,
.auth-copy p {
    margin: 0;
    color: var(--color-text-muted);
}

.auth-brand p {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.auth-copy {
    margin-bottom: 24px;
}

.auth-eyebrow {
    display: inline-flex;
    margin-bottom: 10px;
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.auth-copy h2 {
    margin: 0 0 8px;
    color: var(--color-text);
    font-size: 30px;
    font-weight: 900;
    letter-spacing: 0;
}

.auth-copy p {
    font-size: 14px;
    line-height: 1.45;
}

.auth-alert,
.auth-error {
    padding: 11px 13px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
}

.auth-alert {
    margin-bottom: 18px;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
}

.auth-error {
    margin: 14px 0 0;
    color: var(--danger);
    background: #fff1f2;
    border: 1px solid #fecdd3;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auth-form label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 800;
}

.auth-form input {
    min-height: 44px;
    padding: 10px 13px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 14px;
}

.auth-form input:focus {
    outline: none;
    background: var(--color-surface);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.auth-submit {
    margin-top: 8px;
    justify-content: center;
}

/* ------------------------------------------------------------
   7. Encabezados de sección
------------------------------------------------------------ */

.bienvenida {
    margin-bottom: 22px;
}

.bienvenida h3 {
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -.015em;
    color: var(--color-text);
}

.bienvenida p {
    margin-top: 5px;
    font-size: 13.5px;
    color: var(--color-text-muted);
}

.hero-bienvenida {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    padding: 32px 34px;
    margin-bottom: 26px;
    border-radius: var(--radius-lg);
    background: linear-gradient(120deg, var(--color-primary-dark), var(--color-primary) 65%, #35c9b6);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.hero-anillos {
    position: absolute;
    top: 50%;
    right: -60px;
    width: 320px;
    height: 320px;
    transform: translateY(-50%);
    opacity: .16;
    pointer-events: none;
}

.hero-texto {
    position: relative;
    z-index: 1;
    max-width: 520px;
}

.hero-eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, .16);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.hero-texto h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -.015em;
    color: #ffffff;
}

.hero-texto p {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, .85);
}

.hero-acciones {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-acciones .boton-principal {
    background: #ffffff;
    color: var(--color-primary-dark);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .18);
}

.hero-acciones .boton-principal:hover {
    background: #f4f3ef;
}

.hero-acciones .boton-secundario {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .35);
    color: #ffffff;
}

.hero-acciones .boton-secundario:hover {
    background: rgba(255, 255, 255, .2);
    border-color: rgba(255, 255, 255, .5);
    color: #ffffff;
}

.seccion-secundaria {
    margin-top: 40px;
}

.acciones-pagina {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

/* ------------------------------------------------------------
   8. Botones
------------------------------------------------------------ */

.boton-principal,
.boton-secundario,
.btn,
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color .15s var(--ease), border-color .15s var(--ease),
        box-shadow .15s var(--ease), transform .1s var(--ease), color .15s var(--ease);
}

.boton-principal,
.btn-primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(27, 166, 151, .12), 0 6px 16px rgba(27, 166, 151, .25);
}

.boton-principal:hover,
.btn-primary:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(27, 166, 151, .16), 0 10px 22px rgba(27, 166, 151, .3);
}

.boton-principal:active,
.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(27, 166, 151, .14);
}

.boton-secundario,
.btn-secondary {
    background: var(--color-surface);
    border-color: var(--color-border-strong);
    color: var(--color-text);
}

.boton-secundario:hover,
.btn-secondary:hover {
    background: #f8fafc;
    border-color: #c2c9d6;
    color: var(--color-text);
}

.boton-secundario.esta-activo {
    background: var(--color-primary-soft);
    border-color: var(--color-primary);
    color: var(--color-primary-dark);
}

.btn-sm,
td .boton-secundario,
td .boton-principal {
    min-height: 30px;
    padding: 6px 11px;
    font-size: 12px;
    border-radius: 7px;
}

button.boton-principal,
button.boton-secundario {
    border: 1px solid transparent;
}

/* ------------------------------------------------------------
   9. Tarjetas
------------------------------------------------------------ */

.tarjeta,
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.tarjeta {
    padding: 22px;
}

.tarjetas,
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.stat-card {
    position: relative;
    min-height: 122px;
    padding: 20px 20px 20px 68px;
    transition: box-shadow .18s var(--ease), transform .18s var(--ease);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    position: absolute;
    top: 20px;
    left: 20px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-weight: 700;
}

.stat-icon svg {
    width: 18px;
    height: 18px;
}

.stat-icon-blue {
    background: var(--info-bg);
    color: var(--info);
}

.stat-icon-green {
    background: var(--success-bg);
    color: var(--success);
}

.stat-icon-amber {
    background: var(--warning-bg);
    color: var(--warning);
}

.stat-icon-indigo {
    background: var(--accent-bg);
    color: var(--accent);
}

.tarjeta-titulo {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.tarjeta-numero {
    display: block;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--color-text);
    line-height: 1.15;
}

.tarjeta-descripcion {
    display: block;
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--color-text-faint);
}

/* ------------------------------------------------------------
   10. Dashboard: paneles, donut, actividad
------------------------------------------------------------ */

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(300px, 0.85fr) minmax(360px, 1.15fr);
    gap: 20px;
}

.dashboard-grid + .dashboard-grid {
    margin-top: 20px;
}

.dashboard-panel {
    min-height: 260px;
}

.bar-list {
    display: grid;
    gap: 16px;
}

.bar-row-cabecera {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 7px;
    font-size: 13px;
    color: var(--color-text-muted);
}

.bar-row-cabecera strong {
    color: var(--color-text);
    font-size: 13.5px;
    font-weight: 700;
}

.bar-track {
    height: 8px;
    border-radius: var(--radius-pill);
    background: var(--color-bg);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: var(--radius-pill);
    transition: width .3s var(--ease);
}

.bar-success {
    background: var(--success);
}

.bar-warning {
    background: var(--warning);
}

.bar-danger {
    background: var(--danger);
}

.bar-info {
    background: var(--info);
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.panel-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text);
}

.panel-header p {
    margin-top: 3px;
    font-size: 12px;
    color: var(--color-text-faint);
}

.panel-header a {
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
}

.donut-layout {
    display: grid;
    grid-template-columns: 158px 1fr;
    align-items: center;
    gap: 26px;
}

.donut-chart {
    position: relative;
    display: grid;
    place-items: center;
    width: 148px;
    height: 148px;
    border-radius: 999px;
    background: var(--donut-gradient, conic-gradient(var(--color-border) 0 100%));
    box-shadow: 0 10px 24px rgba(26, 26, 26, .1);
}

.donut-chart::before {
    content: "";
    position: absolute;
    inset: 15px;
    border-radius: 999px;
    background: var(--color-surface);
    box-shadow: inset 0 1px 2px rgba(26, 26, 26, .05);
}

.donut-chart span,
.donut-chart small {
    position: relative;
    z-index: 1;
}

.donut-chart span {
    color: var(--color-text);
    font-size: 26px;
    font-weight: 800;
}

.donut-chart small {
    display: block;
    margin-top: 2px;
    color: var(--color-text-faint);
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    text-align: center;
}

.legend-list {
    display: grid;
    gap: 16px;
}

.legend-row {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.legend-row-cabecera {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
    color: var(--color-text-muted);
}

.legend-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-valor {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.legend-valor strong {
    color: var(--color-text);
    font-size: 13.5px;
    font-weight: 700;
}

.legend-valor small {
    min-width: 30px;
    color: var(--color-text-faint);
    font-size: 11px;
    font-weight: 600;
    text-align: right;
}

.bar-track-mini {
    height: 6px;
}

.bar-neutral {
    background: var(--color-text-faint);
}

.legend-dot,
.activity-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    flex-shrink: 0;
}

.dot-danger {
    background: var(--danger);
}

.dot-warning {
    background: var(--warning);
}

.dot-info {
    background: var(--info);
}

.dot-neutral {
    background: var(--color-text-faint);
}

.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-row {
    display: grid;
    grid-template-columns: 9px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 11px 8px;
    margin: 0 -8px;
    border-radius: var(--radius-sm);
    color: var(--color-text);
    transition: background-color .15s var(--ease);
}

.activity-row:not(:last-child) {
    border-bottom: 1px solid var(--color-border);
}

a.activity-row:hover {
    background: var(--color-primary-softer);
}

.activity-dot {
    background: var(--success);
}

.activity-row strong,
.activity-row small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-row strong {
    font-size: 13px;
    font-weight: 600;
}

.activity-row small {
    margin-top: 2px;
    color: var(--color-text-faint);
    font-size: 11.5px;
}

.empty-inline {
    padding: 20px 4px;
    color: var(--color-text-faint);
    font-size: 12.5px;
    text-align: center;
}

/* ------------------------------------------------------------
   11. Tablas
------------------------------------------------------------ */

.table-card {
    padding: 0;
    overflow: hidden;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 220px;
}

.search-box span {
    position: absolute;
    left: 13px;
    display: grid;
    place-items: center;
    width: 15px;
    height: 15px;
    color: var(--color-text-faint);
    font-size: 0;
}

.search-box span::before {
    content: "";
    display: block;
    width: 14px;
    height: 14px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") center / contain no-repeat;
}

.search-box input,
.toolbar-actions select {
    height: 38px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 13px;
    transition: border-color .15s var(--ease), background-color .15s var(--ease), box-shadow .15s var(--ease);
}

.search-box input {
    width: min(420px, 100%);
    padding: 0 14px 0 36px;
}

.search-box input:focus,
.toolbar-actions select:focus {
    outline: none;
    background: var(--color-surface);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.search-box input::placeholder {
    color: var(--color-text-faint);
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.toolbar-actions select {
    padding: 0 30px 0 12px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8880' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 9px center;
    background-size: 15px;
}

.table-toolbar-pagination {
    justify-content: flex-end;
    padding-top: 12px;
    padding-bottom: 12px;
}

.page-size-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-muted);
    font-size: 12.5px;
    font-weight: 600;
}

.page-size-control select {
    height: 34px;
    min-width: 82px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0 30px 0 10px;
    color: var(--color-text);
    background-color: var(--color-bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8880' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 9px center;
    background-size: 15px;
    appearance: none;
    font-size: 12.5px;
}

.page-size-control select:focus {
    outline: none;
    background-color: var(--color-surface);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.filtros-panel {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
    padding: 14px 20px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
}

.filtros-panel-empresas {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    align-items: end;
}

.filtros-panel-empresas .filtro-campo {
    min-width: 0;
}

.filtros-panel-empresas .toolbar-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
}

.filtro-campo {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--color-text-faint);
}

.filtro-campo input,
.filtro-campo select {
    height: 36px;
    width: 100%;
    min-width: 180px;
    padding: 0 30px 0 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 13px;
    text-transform: none;
    font-weight: 500;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8880' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 9px center;
    background-size: 15px;
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}

.filtro-campo input {
    padding-right: 12px;
    background-image: none;
    appearance: auto;
}

.filtro-campo input:focus,
.filtro-campo select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}

@media (max-width: 980px) {
    .filtros-panel-empresas {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}

@media (max-width: 640px) {
    .filtros-panel-empresas {
        grid-template-columns: 1fr;
    }
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead th {
    position: sticky;
    top: 0;
    background: var(--color-table-head);
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--color-text-faint);
    padding: 13px 16px;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

.data-table tbody td {
    padding: 13px 16px;
    font-size: 13.5px;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background-color .12s var(--ease);
}

.data-table tbody tr:hover {
    background: var(--color-primary-softer);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table td:first-child,
.data-table th:first-child {
    padding-left: 20px;
}

.data-table td:last-child,
.data-table th:last-child {
    padding-right: 20px;
}

.cell-strong {
    font-weight: 600;
    color: var(--color-text);
}

.cell-muted,
.table-muted {
    color: var(--color-text-faint);
    font-size: 12.5px;
}

.cell-number {
    font-variant-numeric: tabular-nums;
}

.cell-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.message-cell {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 340px;
    color: var(--color-text-muted);
}

.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 20px;
    font-size: 12.5px;
    color: var(--color-text-faint);
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
}

.pagination-lite {
    display: flex;
    align-items: center;
    gap: 6px;
}

.page-control,
.page-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    transition: background-color .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}

.page-control:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

.page-control:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.page-current {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #ffffff;
}

/* ------------------------------------------------------------
   12. Badges
------------------------------------------------------------ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 22px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .01em;
    line-height: 1;
    white-space: nowrap;
}

.badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: currentColor;
    flex-shrink: 0;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

.badge-neutral {
    background: var(--neutral-bg);
    color: var(--neutral);
}

.badge-accent {
    background: var(--accent-bg);
    color: var(--accent);
}

/* ------------------------------------------------------------
   13. Vista de detalle
------------------------------------------------------------ */

.detail-card,
.detalle-organismo,
.formulario-contenedor {
    padding: 8px 24px;
}

.detalle-organismo {
    display: flex;
    flex-direction: column;
}

.detalle-fila {
    display: grid;
    grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
    gap: 20px;
    padding: 15px 0;
    border-bottom: 1px solid var(--color-border);
}

.detalle-fila:last-child {
    border-bottom: none;
}

.detalle-fila strong {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--color-text-faint);
    text-transform: uppercase;
    letter-spacing: .03em;
}

.detalle-fila span {
    font-size: 13.5px;
    color: var(--color-text);
    word-break: break-word;
}

.empresa-detalle-layout {
    display: grid;
    gap: 18px;
}

.empresa-resumen-panel {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px 24px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
}

.empresa-resumen-icon,
.empresa-atributo-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    color: var(--color-primary);
    background: var(--color-primary-soft);
}

.empresa-resumen-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
}

.empresa-resumen-icon svg {
    width: 27px;
    height: 27px;
}

.empresa-resumen-contenido {
    min-width: 0;
}

.empresa-resumen-label,
.empresa-atributo span {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--color-text-faint);
}

.empresa-resumen-contenido h3 {
    margin: 3px 0 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: 0;
}

.empresa-resumen-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.empresa-atributos-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.empresa-atributo {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    box-shadow: var(--shadow-xs);
}

.empresa-atributo-icon {
    align-self: center;
    justify-self: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

.empresa-atributo-icon svg {
    display: block;
    width: 18px;
    height: 18px;
    margin: auto;
}

.empresa-atributo div {
    min-width: 0;
}

.empresa-atributo strong,
.empresa-atributo a {
    display: block;
    margin-top: 5px;
    font-size: 14px;
    font-weight: 650;
    color: var(--color-text);
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.empresa-atributo a {
    color: var(--color-primary);
    text-decoration: none;
}

.empresa-atributo a:hover {
    text-decoration: underline;
}

@media (max-width: 1180px) {
    .empresa-atributos-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .empresa-resumen-panel {
        align-items: flex-start;
    }

    .empresa-atributos-grid {
        grid-template-columns: 1fr;
    }
}

/* ------------------------------------------------------------
   14. Formularios
------------------------------------------------------------ */

.formulario-contenedor {
    padding: 26px 28px 30px;
}

.formulario-contenedor form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 24px;
}

.formulario-contenedor form > p {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0 0 16px;
}

.campo-grupo {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0 0 16px;
}

.campo-grupo-full {
    grid-column: 1 / -1;
}

.formulario-contenedor form > p:has(textarea) {
    grid-column: 1 / -1;
}

.formulario-contenedor form > p:has(input[type="checkbox"]) {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    gap: 9px;
    padding: 4px 0;
}

.formulario-contenedor form > p:has(input[type="checkbox"]) label {
    order: 2;
    margin: 0;
}

.formulario-contenedor label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--color-text-muted);
}

.campo-formulario,
.formulario-contenedor input[type="text"],
.formulario-contenedor input[type="url"],
.formulario-contenedor input[type="email"],
.formulario-contenedor input[type="number"],
.formulario-contenedor input[type="search"],
.formulario-contenedor select,
.formulario-contenedor textarea {
    min-height: 42px;
    padding: 10px 13px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 13.5px;
    width: 100%;
    transition: border-color .15s var(--ease), background-color .15s var(--ease), box-shadow .15s var(--ease);
}

.campo-formulario:focus,
.formulario-contenedor input:focus,
.formulario-contenedor select:focus,
.formulario-contenedor textarea:focus {
    outline: none;
    background: var(--color-surface);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.campo-lectura {
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 10px 13px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    color: var(--color-text-muted);
    font-size: 13.5px;
}

.password-field {
    position: relative;
}

.password-field .campo-formulario {
    padding-right: 46px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    color: var(--color-text-faint);
    background: transparent;
    cursor: pointer;
    transform: translateY(-50%);
    transition: color .18s var(--ease), background .18s var(--ease);
}

.password-toggle:hover {
    color: var(--color-primary);
    background: rgba(13, 148, 136, .08);
}

.password-toggle svg {
    width: 18px;
    height: 18px;
}

.formulario-contenedor select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8880' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 15px;
    padding-right: 34px;
}

.formulario-contenedor textarea {
    min-height: 100px;
    resize: vertical;
}

.formulario-contenedor input[type="checkbox"] {
    width: 17px;
    height: 17px;
    min-height: 0;
    accent-color: var(--color-primary);
    order: 1;
}

.permission-checklist {
    max-height: 340px;
    margin: 0;
    padding: 14px;
    overflow: auto;
    list-style: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
}

.permission-checklist > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.permission-checklist > div > div {
    display: grid;
    gap: 8px;
    align-content: start;
}

.permission-checklist > div > div > label {
    font-size: 11.5px;
    font-weight: 800;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.permission-checklist label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--color-text);
}

.permission-checklist input[type="checkbox"] {
    flex: 0 0 auto;
}

.permiso-denegado {
    max-width: 620px;
    margin: 60px auto;
    padding: 34px;
    text-align: center;
}

.permiso-denegado-icono {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin: 0 auto 18px;
    border-radius: var(--radius-pill);
    background: var(--danger-bg);
    color: var(--danger);
}

.permiso-denegado-icono svg {
    width: 28px;
    height: 28px;
}

.permiso-denegado h3 {
    margin-bottom: 8px;
    font-size: 20px;
    color: var(--color-text);
}

.permiso-denegado p {
    max-width: 460px;
    margin: 0 auto 16px;
    color: var(--color-text-muted);
    font-size: 14px;
    line-height: 1.5;
}

.permiso-denegado span {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: var(--radius-pill);
    background: var(--neutral-bg);
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 700;
}

.formulario-contenedor .helptext {
    display: block;
    margin-top: -2px;
    font-size: 11.5px;
    font-weight: 400;
    color: var(--color-text-faint);
}

.formulario-contenedor .errorlist {
    color: var(--danger);
    font-size: 12px;
    font-weight: 600;
    margin: 0 0 2px;
}

.acciones-formulario {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
    padding-top: 22px;
    border-top: 1px solid var(--color-border);
}

/* ------------------------------------------------------------
   15. Panel de análisis en curso
------------------------------------------------------------ */

.analisis-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px 26px 22px;
    margin-bottom: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid #c8e6df;
    background: linear-gradient(135deg, #e3f4f1 0%, #f8f7f2 55%, #ffffff 100%);
    box-shadow: var(--shadow-sm);
}

.analisis-panel-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.analisis-wave-strip {
    position: relative;
    overflow: hidden;
    height: 54px;
    margin: 6px -2px 2px;
    border-radius: var(--radius-sm);
}

.analisis-wave {
    position: absolute;
    inset: 0;
    background-repeat: repeat-x;
    background-size: 300px 100%;
    animation-name: analisis-wave-scroll;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.analisis-wave-back {
    opacity: .45;
    background-position-y: 20%;
    animation-duration: 15s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='60' viewBox='0 0 300 60'%3E%3Cpath d='M0 34 C 37.5 10 75 10 112.5 34 C 150 58 187.5 58 225 34 C 262.5 10 275 10 300 34' fill='none' stroke='%237dc9bb' stroke-width='2'/%3E%3C/svg%3E");
}

.analisis-wave-front {
    opacity: .85;
    background-position-y: 65%;
    animation-duration: 9s;
    animation-direction: reverse;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='60' viewBox='0 0 300 60'%3E%3Cpath d='M0 36 C 37.5 14 75 14 112.5 36 C 150 58 187.5 58 225 36 C 262.5 14 275 14 300 36' fill='none' stroke='%231ba697' stroke-width='2.5'/%3E%3C/svg%3E");
}

@keyframes analisis-wave-scroll {
    from {
        background-position-x: 0;
    }

    to {
        background-position-x: -300px;
    }
}

.analisis-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(27, 166, 151, .18), 0 0 10px 2px rgba(27, 166, 151, .85);
    animation: analisis-dot-travel 6.5s ease-in-out infinite;
}

@keyframes analisis-dot-travel {
    0% {
        left: 0%;
        top: 65%;
        opacity: 0;
    }

    8% {
        opacity: 1;
    }

    25% {
        left: 25%;
        top: 20%;
    }

    50% {
        left: 50%;
        top: 72%;
    }

    75% {
        left: 75%;
        top: 18%;
    }

    92% {
        opacity: 1;
    }

    100% {
        left: 100%;
        top: 60%;
        opacity: 0;
    }
}

.analisis-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px 5px 10px;
    border-radius: var(--radius-pill);
    background: #ffffff;
    border: 1px solid #c3e5dc;
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 700;
    box-shadow: var(--shadow-xs);
    transition: color .2s var(--ease), border-color .2s var(--ease);
}

.analisis-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--color-primary);
    animation: analisis-pulse 1.4s ease-in-out infinite;
    transition: background-color .2s var(--ease);
}

.analisis-badge.es-exito {
    color: var(--success);
    border-color: #bfead2;
}

.analisis-badge.es-exito .analisis-badge-dot {
    background: var(--success);
    animation: none;
}

.analisis-badge.es-error {
    color: var(--danger);
    border-color: #f6c9c9;
}

.analisis-badge.es-error .analisis-badge-dot {
    background: var(--danger);
    animation: none;
}

.analisis-panel--en-espera .analisis-wave,
.analisis-panel--en-espera .analisis-dot,
.analisis-panel--en-espera .analisis-badge-dot {
    animation-play-state: paused;
}

.analisis-panel--en-espera .analisis-dot {
    opacity: 0;
}

/* Cuando ya sabemos el resultado, "congelamos" el flujo animado
   en vez de cortarlo en seco: las olas y el punto dejan de moverse
   y se atenúan, mientras se arma la recarga de la página. */
.analisis-panel--finalizado .analisis-wave-strip {
    opacity: .3;
    transition: opacity .5s var(--ease);
}

.analisis-panel--finalizado .analisis-wave,
.analisis-panel--finalizado .analisis-dot {
    animation-play-state: paused;
}

.analisis-panel--finalizado .analisis-dot {
    opacity: 0;
    transition: opacity .3s var(--ease);
}

@keyframes analisis-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.8);
        opacity: .35;
    }
}

.analisis-eta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-text-faint);
    font-size: 12px;
    font-weight: 500;
}

.analisis-eta svg {
    width: 13px;
    height: 13px;
    animation: analisis-spin 2.6s linear infinite;
}

@keyframes analisis-spin {
    to {
        transform: rotate(360deg);
    }
}

.analisis-panel-titulo {
    font-size: 17px;
    font-weight: 800;
    color: var(--color-text);
}

.analisis-panel-texto {
    max-width: 540px;
    font-size: 13px;
    color: var(--color-text-muted);
}

/* ------------------------------------------------------------
   16. Hero BPO empleados
------------------------------------------------------------ */

.bpo-empleados-pantalla {
    width: calc(100vw - var(--sidebar-width));
    min-height: calc(100vh - 64px);
    margin: -32px -36px -48px;
}

.bpo-empleados-hero {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 64px);
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: clamp(30px, 5vw, 58px);
    border: 0;
    border-radius: 0;
    background:
        linear-gradient(118deg, #07111f 0%, #0a1728 42%, #0d2b3c 72%, #081827 100%);
    box-shadow: 0 24px 70px rgba(4, 20, 35, .22);
    isolation: isolate;
}

.bpo-empleados-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .28;
    background-image:
        linear-gradient(90deg, rgba(159, 231, 239, .08) 1px, transparent 1px),
        linear-gradient(0deg, rgba(159, 231, 239, .055) 1px, transparent 1px);
    background-size: 64px 64px;
    transform: perspective(800px) rotateX(62deg) scale(1.18);
    transform-origin: 50% 100%;
    z-index: -2;
}

.bpo-empleados-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(3, 10, 20, .95) 0%, rgba(3, 10, 20, .74) 37%, rgba(3, 10, 20, .28) 68%, rgba(3, 10, 20, .12) 100%),
        linear-gradient(180deg, rgba(91, 221, 230, .12) 0%, transparent 28%, rgba(2, 8, 16, .22) 100%);
    z-index: -1;
}

.bpo-empleados-fondo {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.bpo-empleados-fondo::before {
    content: "";
    position: absolute;
    top: 9%;
    right: 5%;
    width: min(48vw, 640px);
    height: 72%;
    border: 1px solid rgba(164, 232, 244, .12);
    border-radius: 28px;
    background:
        linear-gradient(90deg, rgba(159, 231, 239, .08) 1px, transparent 1px),
        linear-gradient(0deg, rgba(159, 231, 239, .055) 1px, transparent 1px),
        linear-gradient(145deg, rgba(9, 54, 78, .20), rgba(6, 20, 38, .06));
    background-size: 42px 42px, 42px 42px, auto;
    box-shadow: inset 0 0 70px rgba(113, 242, 239, .05);
    transform: perspective(900px) rotateY(-18deg) rotateX(3deg);
    transform-origin: 100% 50%;
    z-index: 0;
}

.bpo-empleados-fondo::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 58%;
    background:
        linear-gradient(120deg, transparent 0%, rgba(71, 228, 230, .08) 44%, transparent 45%),
        linear-gradient(120deg, transparent 16%, rgba(67, 150, 255, .10) 52%, transparent 53%),
        linear-gradient(120deg, transparent 36%, rgba(71, 228, 230, .06) 70%, transparent 71%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 22%, #000 76%, transparent 100%);
    z-index: 0;
}

.bpo-flujo {
    position: absolute;
    z-index: 1;
    right: -8%;
    width: 76%;
    height: 154px;
    border-radius: 999px;
    opacity: .76;
    background:
        linear-gradient(104deg, transparent 0%, rgba(77, 235, 231, .08) 24%, rgba(80, 161, 255, .17) 47%, rgba(90, 244, 226, .08) 70%, transparent 100%),
        repeating-linear-gradient(104deg, transparent 0 24px, rgba(119, 241, 238, .38) 25px 26px, transparent 27px 42px);
    filter: drop-shadow(0 0 10px rgba(34, 221, 226, .36));
    mask-image: linear-gradient(90deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
    transform-origin: 50% 50%;
    animation: bpo-flujo-mover 12s ease-in-out infinite paused;
}

.bpo-flujo-uno {
    top: 17%;
    transform: rotate(-11deg);
}

.bpo-flujo-dos {
    top: 36%;
    height: 132px;
    opacity: .56;
    transform: rotate(-6deg) scaleX(1.04);
    animation-duration: 15s;
    animation-direction: reverse;
}

.bpo-flujo-tres {
    top: 55%;
    height: 110px;
    opacity: .38;
    transform: rotate(-15deg) scaleX(.92);
    animation-duration: 18s;
}

@keyframes bpo-flujo-mover {
    0%, 100% {
        background-position: 0 0;
        translate: 0 0;
    }

    50% {
        background-position: 150px 0;
        translate: -18px 7px;
    }
}

.bpo-nodo {
    position: absolute;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 82px;
    height: 82px;
    border: 1px solid rgba(164, 232, 244, .26);
    border-radius: 20px;
    color: #d8fbff;
    background:
        linear-gradient(145deg, rgba(13, 72, 95, .62), rgba(13, 36, 67, .74));
    box-shadow: 0 18px 42px rgba(3, 12, 24, .28), inset 0 0 28px rgba(255, 255, 255, .05);
    backdrop-filter: blur(10px);
    animation: bpo-nodo-flotar 8s ease-in-out infinite paused;
}

.bpo-nodo svg {
    width: 36px;
    height: 36px;
}

.bpo-nodo-empresa {
    top: 29%;
    left: 45%;
}

.bpo-nodo-contactos {
    top: 42%;
    left: 63%;
    animation-delay: -1.8s;
}

.bpo-nodo-ficha {
    top: 54%;
    right: 11%;
    animation-delay: -3.5s;
}

@keyframes bpo-nodo-flotar {
    0%, 100% {
        translate: 0 0;
        rotate: -2deg;
    }

    50% {
        translate: 0 -10px;
        rotate: 2deg;
    }
}

.bpo-card {
    position: absolute;
    z-index: 2;
    width: 148px;
    height: 58px;
    border: 1px solid rgba(158, 227, 240, .18);
    border-radius: 12px;
    background:
        linear-gradient(90deg, rgba(105, 238, 226, .16) 0 20px, transparent 20px),
        linear-gradient(180deg, rgba(19, 86, 112, .24), rgba(5, 21, 39, .44));
    box-shadow: 0 16px 34px rgba(3, 12, 24, .22);
    backdrop-filter: blur(8px);
    animation: bpo-card-flotar 9s ease-in-out infinite paused;
}

.bpo-card::before,
.bpo-card::after {
    content: "";
    position: absolute;
    left: 34px;
    right: 16px;
    height: 2px;
    border-radius: 999px;
    background: rgba(188, 244, 250, .42);
}

.bpo-card::before {
    top: 17px;
}

.bpo-card::after {
    top: 29px;
    right: 36px;
}

.bpo-card-uno {
    top: 18%;
    right: 6%;
    rotate: -4deg;
}

.bpo-card-dos {
    top: 59%;
    right: 20%;
    rotate: 3deg;
    animation-delay: -2.6s;
}

.bpo-card-tres {
    top: 72%;
    right: 5%;
    rotate: 6deg;
    animation-delay: -4s;
}

@keyframes bpo-card-flotar {
    0%, 100% {
        translate: 0 0;
    }

    50% {
        translate: -8px -8px;
    }
}

.bpo-particula {
    position: absolute;
    z-index: 3;
    width: 4px;
    height: 4px;
    background: rgba(157, 250, 245, .72);
    box-shadow: 0 0 10px rgba(100, 251, 242, .54);
    animation: bpo-particula-viaje 6.4s linear infinite paused;
}

.bpo-particula-uno {
    top: 26%;
    left: 55%;
}

.bpo-particula-dos {
    top: 62%;
    left: 68%;
    animation-delay: -1.8s;
}

.bpo-particula-tres {
    top: 34%;
    left: 82%;
    animation-delay: -3.2s;
}

@keyframes bpo-particula-viaje {
    0% {
        translate: 0 0;
        opacity: .35;
    }

    50% {
        translate: 44px -28px;
        opacity: 1;
    }

    100% {
        translate: 88px -4px;
        opacity: .25;
    }
}

.bpo-empleados-contenido {
    position: relative;
    z-index: 2;
    max-width: 470px;
}

.bpo-empleados-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    padding: 7px 13px;
    border: 1px solid rgba(62, 239, 221, .22);
    border-radius: 999px;
    color: #4dfff0;
    background: rgba(6, 39, 55, .68);
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 0 22px rgba(19, 235, 226, .12);
}

.bpo-empleados-badge-dot {
    width: 7px;
    height: 7px;
    background: #26f6e6;
    box-shadow: 0 0 10px rgba(38, 246, 230, .9);
}

.bpo-empleados-badge.es-exito {
    color: #dffef5;
    border-color: rgba(69, 255, 180, .42);
}

.bpo-empleados-badge.es-error {
    color: #ffe5e5;
    border-color: rgba(255, 117, 117, .48);
}

.bpo-empleados-hero h3 {
    margin: 54px 0 18px;
    color: #ffffff;
    font-size: clamp(44px, 5vw, 70px);
    line-height: .96;
    letter-spacing: 0;
    font-weight: 900;
}

.bpo-empleados-hero h3 span {
    display: block;
    color: #36c9ff;
}

.bpo-empleados-hero p {
    max-width: 420px;
    margin: 0 0 34px;
    color: rgba(230, 247, 255, .82);
    font-size: 18px;
    line-height: 1.35;
}

.bpo-empleados-acciones {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.bpo-empleados-boton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
    min-height: 58px;
    padding: 0 26px 0 16px;
    border: 1px solid rgba(165, 255, 251, .72);
    border-radius: 999px;
    color: #ffffff;
    background: linear-gradient(135deg, #2ff2e2 0%, #178de6 100%);
    box-shadow: 0 0 0 7px rgba(45, 238, 226, .12), 0 0 36px rgba(45, 238, 226, .62);
    font-family: inherit;
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), opacity .2s var(--ease);
}

.bpo-empleados-boton:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 0 9px rgba(45, 238, 226, .15), 0 0 48px rgba(45, 238, 226, .78);
}

.bpo-empleados-boton:disabled {
    cursor: wait;
    opacity: .86;
}

#analizar-intereses .bpo-empleados-boton:disabled {
    cursor: not-allowed;
}

#analizar-intereses[aria-busy="true"] .bpo-empleados-boton {
    cursor: wait;
}

.bpo-empleados-play {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    color: #2eece1;
    background: rgba(255, 255, 255, .88);
}

.bpo-empleados-play svg {
    width: 13px;
    height: 13px;
    translate: 1px 0;
}

.bpo-empleados-flecha {
    width: 18px;
    height: 18px;
}

.bpo-empleados-estado {
    color: rgba(229, 250, 255, .78);
    font-size: 13px;
    font-weight: 800;
}

.bpo-empleados-hero--activo .bpo-flujo,
.bpo-empleados-hero--activo .bpo-nodo,
.bpo-empleados-hero--activo .bpo-card,
.bpo-empleados-hero--activo .bpo-particula {
    animation-play-state: running;
}

.bpo-empleados-hero--activo .bpo-empleados-badge-dot {
    animation: bpo-badge-parpadeo 1.1s ease-in-out infinite;
}

@keyframes bpo-badge-parpadeo {
    0%, 100% {
        opacity: 1;
        scale: 1;
    }

    50% {
        opacity: .45;
        scale: 1.7;
    }
}

.bpo-empleados-hero--error {
    border-color: rgba(255, 112, 112, .38);
}

.bpo-empresas-hero {
    background: linear-gradient(118deg, #08101b 0%, #0d1828 42%, #112f35 72%, #0d1b25 100%);
}

.bpo-empresas-hero::after {
    background:
        linear-gradient(90deg, rgba(3, 10, 18, .95) 0%, rgba(3, 10, 18, .76) 37%, rgba(3, 10, 18, .30) 68%, rgba(3, 10, 18, .12) 100%),
        linear-gradient(180deg, rgba(97, 230, 192, .12) 0%, transparent 28%, rgba(2, 8, 16, .22) 100%);
}

.bpo-empresas-hero .bpo-empleados-fondo::before {
    border-color: rgba(168, 236, 215, .13);
    background:
        linear-gradient(90deg, rgba(168, 236, 215, .075) 1px, transparent 1px),
        linear-gradient(0deg, rgba(168, 236, 215, .05) 1px, transparent 1px),
        linear-gradient(145deg, rgba(20, 79, 72, .20), rgba(6, 20, 38, .06));
}

.bpo-empresas-hero .bpo-empleados-fondo::after {
    background:
        linear-gradient(120deg, transparent 0%, rgba(78, 219, 178, .09) 44%, transparent 45%),
        linear-gradient(120deg, transparent 16%, rgba(69, 180, 235, .08) 52%, transparent 53%),
        linear-gradient(120deg, transparent 36%, rgba(109, 236, 190, .06) 70%, transparent 71%);
}

.bpo-empresas-hero .bpo-flujo {
    background:
        linear-gradient(104deg, transparent 0%, rgba(82, 222, 178, .08) 24%, rgba(92, 169, 239, .14) 47%, rgba(117, 238, 190, .08) 70%, transparent 100%),
        repeating-linear-gradient(104deg, transparent 0 24px, rgba(130, 236, 194, .35) 25px 26px, transparent 27px 42px);
    filter: drop-shadow(0 0 10px rgba(78, 220, 178, .30));
}

.bpo-empresas-hero .bpo-nodo {
    color: #ddfff0;
    border-color: rgba(172, 237, 214, .25);
    background: linear-gradient(145deg, rgba(18, 91, 80, .58), rgba(13, 43, 59, .72));
}

.bpo-empresas-hero .bpo-card {
    border-color: rgba(169, 235, 211, .18);
    background:
        linear-gradient(90deg, rgba(111, 236, 190, .15) 0 20px, transparent 20px),
        linear-gradient(180deg, rgba(25, 97, 85, .24), rgba(5, 21, 39, .44));
}

.bpo-empresas-hero .bpo-card::before,
.bpo-empresas-hero .bpo-card::after {
    background: rgba(198, 247, 230, .40);
}

.bpo-empresas-hero .bpo-particula {
    background: rgba(166, 250, 218, .72);
    box-shadow: 0 0 10px rgba(117, 241, 194, .50);
}

.bpo-empresas-hero .bpo-empleados-badge {
    color: #7cf0c2;
    border-color: rgba(124, 240, 194, .22);
    background: rgba(8, 44, 43, .66);
}

.bpo-empresas-hero .bpo-empleados-badge-dot {
    background: #67efbc;
    box-shadow: 0 0 10px rgba(103, 239, 188, .85);
}

.bpo-empresas-hero h3 span {
    color: #69dfb3;
}

.bpo-empresas-hero .bpo-empleados-boton {
    background: linear-gradient(135deg, #5ee6b1 0%, #139eaf 100%);
    border-color: rgba(192, 255, 228, .62);
    box-shadow: 0 0 0 7px rgba(94, 230, 177, .12), 0 0 36px rgba(94, 230, 177, .48);
}

.bpo-empresas-hero .bpo-empleados-boton:hover {
    box-shadow: 0 0 0 9px rgba(94, 230, 177, .14), 0 0 48px rgba(94, 230, 177, .62);
}

.bpo-empresas-hero .bpo-empleados-play {
    color: #22a77e;
}

@media (max-width: 980px) {
    .bpo-empleados-pantalla {
        width: 100vw;
        margin: -24px -20px -36px;
    }

    .bpo-empleados-hero {
        min-height: 620px;
        align-items: flex-end;
    }

    .bpo-empleados-hero::after {
        background: linear-gradient(180deg, rgba(3, 12, 23, .1) 0%, rgba(3, 12, 23, .88) 58%, rgba(3, 12, 23, .96) 100%);
    }

    .bpo-nodo-empresa {
        left: 18%;
    }

    .bpo-nodo-contactos {
        left: 54%;
    }

    .bpo-card {
        opacity: .72;
    }
}

@media (max-width: 640px) {
    .bpo-empleados-pantalla {
        margin: -24px -20px -36px;
    }

    .bpo-empleados-hero {
        min-height: 620px;
        padding: 26px;
    }

    .bpo-empleados-hero h3 {
        margin-top: 34px;
        font-size: 42px;
    }

    .bpo-empleados-hero p {
        font-size: 15px;
    }

    .bpo-empleados-boton {
        width: 100%;
        min-height: 56px;
        padding-right: 18px;
        font-size: 13px;
    }

    .bpo-nodo {
        width: 58px;
        height: 58px;
        border-radius: 14px;
    }

    .bpo-nodo svg {
        width: 30px;
        height: 30px;
    }

    .bpo-card {
        width: 104px;
        height: 44px;
    }
}

/* ------------------------------------------------------------
   17. Carrusel de leads en tarjetas
------------------------------------------------------------ */

.leads-carousel-panel {
    padding: 22px;
}

.leads-carousel {
    display: flex;
    align-items: stretch;
    gap: 14px;
}

.leads-carousel-viewport {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.leads-carousel-track {
    display: flex;
    gap: 16px;
    transition: transform .35s var(--ease);
}

.lead-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 0 0 calc(50% - 8px);
    min-height: 176px;
    padding: 18px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: inherit;
    transition: box-shadow .18s var(--ease), transform .18s var(--ease), border-color .18s var(--ease);
}

.lead-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--color-border-strong);
}

.lead-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.lead-card-nombre {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--color-text);
}

.lead-card-cargo {
    font-size: 12.5px;
    color: var(--color-text-faint);
}

.lead-card-meta {
    display: flex;
    gap: 26px;
    padding-top: 10px;
    border-top: 1px dashed var(--color-border);
}

.lead-card-metric {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.lead-card-metric-label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--color-text-faint);
}

.lead-card-metric-valor {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
}

.lead-card-email {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: auto;
    padding-top: 4px;
    font-size: 12.5px;
    color: var(--color-text-muted);
}

.lead-card-email svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--color-text-faint);
}

.leads-carousel-btn {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    align-self: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid var(--color-border-strong);
    background: var(--color-surface);
    color: var(--color-text-muted);
    transition: background-color .15s var(--ease), color .15s var(--ease),
        border-color .15s var(--ease), opacity .15s var(--ease);
}

.leads-carousel-btn svg {
    width: 17px;
    height: 17px;
}

.leads-carousel-btn:hover:not(:disabled) {
    background: var(--color-primary-softer);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.leads-carousel-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.leads-carousel-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
    font-size: 12px;
    color: var(--color-text-faint);
}

/* ------------------------------------------------------------
   17. Responsive
------------------------------------------------------------ */

@media (max-width: 1180px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 960px) {
    :root {
        --sidebar-width: 76px;
    }

    .logo-text,
    .menu-item span:last-child,
    .sidebar-footer span {
        display: none;
    }

    .logo {
        justify-content: center;
        padding-bottom: 18px;
    }

    .menu-item {
        justify-content: center;
        padding: 10px;
    }

    .menu-cascade-caret {
        display: none;
    }

    .menu-cascade-toggle .menu-label {
        display: none;
    }

    .menu-submenu {
        margin-left: 0;
        padding-left: 0;
        border-left: 0;
    }

    .menu-subitem {
        padding: 10px;
    }

    .menu-item.activo::before {
        left: -16px;
    }

    .pagina {
        padding: 24px 20px 36px;
    }

    .barra-superior {
        padding: 0 20px;
    }
}

@media (max-width: 820px) {
    .contenedor {
        flex-direction: column;
    }

    :root {
        --sidebar-width: 100%;
    }

    .sidebar {
        position: relative;
        height: auto;
        min-height: initial;
        flex-direction: row;
        align-items: center;
        padding: 12px 16px;
    }

    .logo {
        border-bottom: none;
        padding: 0;
        margin: 0;
    }

    .logo-text {
        display: flex;
    }

    .menu {
        flex-direction: row;
        padding-top: 0;
        padding-right: 0;
        margin-left: auto;
        gap: 2px;
        overflow: visible;
    }

    .menu-cascade {
        position: relative;
    }

    .menu-submenu {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        z-index: 20;
        min-width: 244px;
        padding: 6px;
        border: 1px solid var(--sidebar-border);
        border-radius: var(--radius-sm);
        background: var(--sidebar-bg);
        box-shadow: var(--shadow-lg);
    }

    .menu-item span:last-child {
        display: none;
    }

    .menu-subitem {
        justify-content: flex-start;
    }

    .menu-subitem span:last-child {
        display: inline;
    }

    .sidebar-footer {
        display: none;
    }

    .contenido {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .tarjetas {
        grid-template-columns: 1fr;
    }

    .formulario-contenedor form {
        grid-template-columns: 1fr;
    }

    .detalle-fila {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .acciones-formulario {
        justify-content: stretch;
    }

    .acciones-formulario .boton-principal,
    .acciones-formulario .boton-secundario {
        flex: 1;
    }

    .analisis-panel-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .analisis-eta {
        white-space: normal;
    }

    .lead-card {
        flex-basis: 100%;
    }

    .leads-carousel {
        gap: 8px;
    }

    .leads-carousel-panel {
        padding: 16px;
    }
}

.intereses-empleados {
    min-width: 0;
}

.bpo-intereses-hero .bpo-nodo {
    font-size: 32px;
    font-weight: 600;
}

.bpo-intereses-hero .bpo-empleados-contenido {
    max-width: 520px;
    min-width: 0;
    overflow-wrap: anywhere;
}

.bpo-intereses-hero .bpo-empleados-acciones {
    align-items: flex-start;
    flex-direction: column;
}

.bpo-intereses-hero .bpo-empleados-estado {
    margin: 0;
}

@media (prefers-reduced-motion: reduce) {
    .bpo-intereses-hero .bpo-flujo,
    .bpo-intereses-hero .bpo-nodo,
    .bpo-intereses-hero .bpo-card {
        animation: none;
    }
}

.intereses-empleado {
    padding: 24px 0;
    border-bottom: 1px solid #dce2e0;
    overflow-wrap: anywhere;
}

.intereses-empleado-cabecera {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 12px;
    align-items: center;
    gap: 12px;
    list-style: none;
}

.intereses-empleado-cabecera::-webkit-details-marker {
    display: none;
}

.intereses-empleado-cabecera::after {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
}

.intereses-empleado[open] > .intereses-empleado-cabecera::after {
    transform: rotate(225deg);
}

.intereses-empleado-cabecera:focus-visible {
    outline: 2px solid #18a497;
    outline-offset: 4px;
}

.intereses-empleado-contenido {
    padding-top: 20px;
}

.intereses-empleado h3 {
    margin: 0 0 6px;
    font-size: 18px;
}

.intereses-empleado h4 {
    margin: 16px 0 8px;
    font-size: 14px;
}

.intereses-empleado p,
.intereses-empleado li {
    line-height: 1.6;
}

.intereses-fecha,
.interes-tema small {
    color: #626b69;
    font-size: 12px;
}

.intereses-analisis-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 12px;
}

.intereses-analisis-meta .intereses-fecha {
    margin: 0;
}

.intereses-fecha time {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.intereses-aviso {
    color: #8c4513;
}

.intereses-temas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: 20px;
    margin: 16px 0;
}

.interes-tema {
    border-left: 3px solid #18a497;
    padding-left: 16px;
    min-width: 0;
}

.intereses-empleado summary {
    cursor: pointer;
}

/* Corridas por lotes y módulo Reporte */
.campo-lote {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--color-text-faint);
}

.campo-lote input[type="number"] {
    width: 90px;
}

.campo-lote-check input {
    width: auto;
}

.form-lote {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.bpo-campo-lote {
    color: inherit;
    opacity: .9;
}

.reporte-pestanas {
    gap: 8px;
}

.reporte-calidad-extra {
    padding: 12px 20px;
    font-size: 13px;
}

.reporte-calidad-extra p {
    margin: 4px 0;
}

.reporte-factores summary {
    cursor: pointer;
}
