/* =========================================================================
   Iceberg Marketing — estilos de la aplicación
   Basado en Bootstrap 5.3. Paleta tomada del logotipo.
   ========================================================================= */

:root,
[data-bs-theme="light"] {
    --ice-navy: #1c1f4a;
    --ice-indigo: #2e3a8c;
    --ice-blue: #2758a3;
    --ice-blue-hover: #1f4787;
    --ice-sky: #1f8fd6;
    --ice-cyan: #29a8e0;
    --ice-frost: #7ecff4;

    --bs-primary: #2758a3;
    --bs-primary-rgb: 39, 88, 163;
    --bs-primary-bg-subtle: #e3ecf8;
    --bs-primary-border-subtle: #b9cdeb;
    --bs-primary-text-emphasis: #1b3d72;
    --bs-link-color: #2758a3;
    --bs-link-color-rgb: 39, 88, 163;
    --bs-link-hover-color: #1f4787;
    --bs-link-hover-color-rgb: 31, 71, 135;
    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-body-bg: #f3f5fa;
    --bs-body-color: #1f2440;
    --bs-secondary-color: rgba(31, 36, 64, .62);
    --bs-border-color: #e3e7f0;
    --bs-border-radius: .6rem;
    --bs-border-radius-lg: .85rem;
    --bs-focus-ring-color: rgba(39, 88, 163, .25);

    --app-surface: #ffffff;
    --app-surface-2: #f8f9fc;
    --app-shadow: 0 1px 2px rgba(20, 28, 64, .05), 0 4px 16px rgba(20, 28, 64, .05);
    --app-shadow-hover: 0 4px 10px rgba(20, 28, 64, .07), 0 14px 32px rgba(20, 28, 64, .09);
    --app-topbar-bg: rgba(255, 255, 255, .85);
    --app-sidebar-w: 264px;
    --app-sidebar-w-compacto: 78px;
}

[data-bs-theme="dark"] {
    --bs-primary: #4f86d6;
    --bs-primary-rgb: 79, 134, 214;
    --bs-primary-bg-subtle: rgba(79, 134, 214, .16);
    --bs-primary-border-subtle: rgba(79, 134, 214, .4);
    --bs-primary-text-emphasis: #a9c6f0;
    --bs-link-color: #7aa7e8;
    --bs-link-color-rgb: 122, 167, 232;
    --bs-link-hover-color: #a9c6f0;
    --bs-link-hover-color-rgb: 169, 198, 240;
    --bs-body-bg: #0e1222;
    --bs-body-color: #dfe4f2;
    --bs-secondary-color: rgba(223, 228, 242, .6);
    --bs-border-color: #252c45;
    --bs-tertiary-bg: #171d33;

    --app-surface: #151a2e;
    --app-surface-2: #1a2038;
    --app-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
    --app-shadow-hover: 0 8px 28px rgba(0, 0, 0, .45);
    --app-topbar-bg: rgba(14, 18, 34, .85);
}

body {
    font-feature-settings: "cv11", "ss01";
    -webkit-font-smoothing: antialiased;
}

.min-w-0 { min-width: 0; }

/* ---------- Botones y formularios con el color de marca ---------- */

.btn { font-weight: 500; border-radius: .55rem; }

.btn-primary {
    --bs-btn-bg: var(--ice-blue);
    --bs-btn-border-color: var(--ice-blue);
    --bs-btn-hover-bg: var(--ice-blue-hover);
    --bs-btn-hover-border-color: var(--ice-blue-hover);
    --bs-btn-active-bg: #1a3c73;
    --bs-btn-active-border-color: #1a3c73;
    --bs-btn-disabled-bg: var(--ice-blue);
    --bs-btn-disabled-border-color: var(--ice-blue);
    --bs-btn-focus-shadow-rgb: 39, 88, 163;
    box-shadow: 0 2px 6px rgba(39, 88, 163, .25);
}

.btn-outline-primary {
    --bs-btn-color: var(--bs-primary);
    --bs-btn-border-color: var(--bs-primary-border-subtle);
    --bs-btn-hover-bg: var(--ice-blue);
    --bs-btn-hover-border-color: var(--ice-blue);
    --bs-btn-active-bg: var(--ice-blue-hover);
    --bs-btn-active-border-color: var(--ice-blue-hover);
    --bs-btn-focus-shadow-rgb: 39, 88, 163;
}

.btn-light {
    --bs-btn-bg: var(--app-surface-2);
    --bs-btn-border-color: var(--bs-border-color);
    --bs-btn-color: var(--bs-body-color);
    --bs-btn-hover-bg: var(--bs-border-color);
    --bs-btn-hover-border-color: var(--bs-border-color);
    --bs-btn-hover-color: var(--bs-body-color);
}

.btn-icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: .6rem;
    color: var(--bs-secondary-color);
    border: 0;
    font-size: 1.2rem;
    transition: background-color .15s, color .15s;
}
.btn-icon:hover, .btn-icon:focus-visible, .btn-icon[aria-expanded="true"] {
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
}
.btn-icon-sm { width: 34px; height: 34px; font-size: 1rem; }

.form-control, .form-select { border-radius: .55rem; border-color: var(--bs-border-color); }
.form-control:focus, .form-select:focus {
    border-color: rgba(var(--bs-primary-rgb), .55);
    box-shadow: 0 0 0 .22rem rgba(var(--bs-primary-rgb), .15);
}
.form-check-input:checked { background-color: var(--bs-primary); border-color: var(--bs-primary); }
.form-check-input:focus { box-shadow: 0 0 0 .22rem rgba(var(--bs-primary-rgb), .15); border-color: rgba(var(--bs-primary-rgb), .55); }
.form-label { font-weight: 500; font-size: .875rem; margin-bottom: .35rem; }
.input-group-text { background: var(--app-surface-2); border-color: var(--bs-border-color); color: var(--bs-secondary-color); }

.nav-pills { --bs-nav-pills-link-active-bg: var(--ice-blue); }
.pagination {
    --bs-pagination-active-bg: var(--ice-blue);
    --bs-pagination-active-border-color: var(--ice-blue);
    --bs-pagination-color: var(--bs-body-color);
    --bs-pagination-bg: var(--app-surface);
    --bs-pagination-border-color: var(--bs-border-color);
    --bs-pagination-focus-box-shadow: 0 0 0 .22rem rgba(var(--bs-primary-rgb), .15);
}
.dropdown-menu {
    --bs-dropdown-link-active-bg: var(--ice-blue);
    --bs-dropdown-border-color: var(--bs-border-color);
    --bs-dropdown-bg: var(--app-surface);
    border-radius: .75rem;
    padding: .4rem;
}
.dropdown-item { border-radius: .45rem; padding: .5rem .75rem; font-size: .9rem; }

.modal-content { border: 0; border-radius: 1rem; background: var(--app-surface); box-shadow: 0 24px 64px rgba(10, 16, 40, .25); }
.modal-header { border-bottom-color: var(--bs-border-color); padding: 1.1rem 1.5rem; }
.modal-body { padding: 1.5rem; }
.modal-footer { border-top-color: var(--bs-border-color); padding: .9rem 1.5rem; }
.modal-title { font-weight: 600; display: flex; align-items: center; gap: .6rem; }
.modal-title .bi { color: var(--bs-primary); }
.modal-backdrop.show { opacity: .45; }

/* ---------- Estructura: menú lateral ---------- */

.app { min-height: 100vh; }

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--app-sidebar-w);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    color: rgba(255, 255, 255, .78);
    background:
        radial-gradient(120% 60% at 0% 0%, rgba(41, 168, 224, .18), transparent 60%),
        linear-gradient(180deg, #1a1d47 0%, #1f2a66 100%);
    transition: width .22s ease, transform .22s ease;
    overflow: hidden;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1.25rem 1.35rem 1.1rem;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
}
.app-brand:hover { color: #fff; }
.app-brand-mark {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
    padding: 4px;
    border-radius: .65rem;
    background: rgba(255, 255, 255, .95);
}
.app-brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.app-brand-text strong { font-size: 1.05rem; letter-spacing: .14em; font-weight: 700; }
.app-brand-text small { font-size: .68rem; letter-spacing: .32em; text-transform: uppercase; color: var(--ice-frost); }

.app-nav { flex: 1; overflow-y: auto; padding: .5rem .85rem 1rem; }
.app-nav-section {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: rgba(255, 255, 255, .42);
    padding: 1rem .75rem .45rem;
    white-space: nowrap;
}
.app-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .62rem .8rem;
    margin-bottom: 2px;
    border-radius: .6rem;
    color: rgba(255, 255, 255, .74);
    text-decoration: none;
    font-size: .92rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color .15s, color .15s;
}
.app-nav-link .bi { font-size: 1.15rem; width: 1.3rem; text-align: center; flex-shrink: 0; }
.app-nav-link:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.app-nav-link.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(41, 168, 224, .26), rgba(41, 168, 224, .08));
}
.app-nav-link.active::before {
    content: "";
    position: absolute;
    left: -.85rem;
    top: 22%;
    bottom: 22%;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--ice-cyan);
}
.app-nav-link.active .bi { color: var(--ice-frost); }
.app-nav-badge {
    margin-left: auto;
    min-width: 22px;
    padding: .1rem .45rem;
    border-radius: 999px;
    background: var(--ice-cyan);
    color: #08213a;
    font-size: .72rem;
    font-weight: 700;
    text-align: center;
}

.app-sidebar-footer {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    padding: .9rem 1.35rem;
    font-size: .72rem;
    color: rgba(255, 255, 255, .42);
    border-top: 1px solid rgba(255, 255, 255, .07);
    white-space: nowrap;
}

.app-sidebar-backdrop { display: none; }

.app-main {
    margin-left: var(--app-sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left .22s ease;
}

/* Menú compacto (solo iconos) en escritorio */
@media (min-width: 992px) {
    .sidebar-compacto .app-sidebar { width: var(--app-sidebar-w-compacto); }
    .sidebar-compacto .app-main { margin-left: var(--app-sidebar-w-compacto); }
    .sidebar-compacto .app-brand { padding-left: 1.3rem; }
    .sidebar-compacto .app-brand-text,
    .sidebar-compacto .app-nav-text,
    .sidebar-compacto .app-sidebar-footer { opacity: 0; pointer-events: none; }
    .sidebar-compacto .app-nav-section { visibility: hidden; height: .75rem; padding: 0; }
    .sidebar-compacto .app-nav-link { justify-content: center; padding: .7rem 0; }
    .sidebar-compacto .app-nav-badge {
        position: absolute;
        top: 3px;
        right: 6px;
        min-width: 18px;
        padding: 0 .3rem;
        font-size: .65rem;
    }
}

/* Menú deslizable en móvil y tablet */
@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); box-shadow: none; }
    .app-main { margin-left: 0; }
    .sidebar-abierto .app-sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
    .sidebar-abierto .app-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1035;
        background: rgba(10, 14, 35, .5);
        backdrop-filter: blur(2px);
    }
}

/* ---------- Barra superior ---------- */

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: .75rem;
    height: 64px;
    padding: 0 1.5rem;
    background: var(--app-topbar-bg);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--bs-border-color);
}

.topbar-badge {
    position: absolute;
    top: 4px;
    right: 3px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: #e5484d;
    color: #fff;
    font-size: .66rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--app-surface);
    animation: latido 2.4s ease-in-out infinite;
}
@keyframes latido { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }

.usuario-menu {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .3rem .55rem .3rem .3rem;
    border: 0;
    border-radius: 999px;
}
.usuario-menu:hover, .usuario-menu[aria-expanded="true"] { background: var(--bs-primary-bg-subtle); }

[data-bs-theme="light"] .icono-tema-oscuro,
[data-bs-theme="dark"] .icono-tema-claro { display: none; }

/* Panel de notificaciones */
.notificaciones { width: min(360px, calc(100vw - 2rem)); padding: 0; overflow: hidden; }
.notificaciones-header { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1rem; border-bottom: 1px solid var(--bs-border-color); }
.notificaciones-lista { max-height: 340px; overflow-y: auto; }
.notificacion {
    display: flex;
    gap: .75rem;
    padding: .8rem 1rem;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--bs-border-color);
    transition: background-color .15s;
}
.notificacion:hover { background: var(--app-surface-2); color: inherit; }
.notificacion-icono {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
}
.notificacion-cuerpo { display: flex; flex-direction: column; min-width: 0; }
.notificacion-texto { font-size: .875rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notificacion-meta { font-size: .75rem; color: var(--bs-secondary-color); margin-top: .15rem; }
.notificaciones-vacio { text-align: center; padding: 2rem 1rem; color: var(--bs-secondary-color); }
.notificaciones-vacio .bi { font-size: 2rem; color: #2fa36b; display: block; margin-bottom: .4rem; }
.notificaciones-footer { display: block; text-align: center; padding: .75rem; font-size: .85rem; font-weight: 500; text-decoration: none; }
.notificaciones-footer:hover { background: var(--app-surface-2); }

/* ---------- Contenido ---------- */

.app-content { padding: 1.75rem 1.5rem 3rem; flex: 1; width: 100%; max-width: 1480px; margin: 0 auto; }

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.page-header-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: .85rem;
    font-size: 1.35rem;
    color: #fff;
    background: linear-gradient(135deg, var(--ice-cyan), var(--ice-indigo));
    box-shadow: 0 6px 16px rgba(39, 88, 163, .3);
}
.page-title { font-size: 1.5rem; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.page-subtitle { margin: .15rem 0 0; color: var(--bs-secondary-color); font-size: .92rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

.card {
    --bs-card-bg: var(--app-surface);
    --bs-card-border-color: var(--bs-border-color);
    --bs-card-border-radius: .9rem;
    --bs-card-inner-border-radius: .9rem;
    --bs-card-cap-bg: transparent;
    box-shadow: var(--app-shadow);
}
.card-header { padding: 1rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.card-title { font-size: 1rem; font-weight: 600; margin: 0; display: flex; align-items: center; gap: .55rem; }
.card-title .bi { color: var(--bs-primary); }
.card-body { padding: 1.25rem; }

/* Indicadores del dashboard */
.kpi-card {
    color: inherit;
    transition: transform .18s ease, box-shadow .18s ease;
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--app-shadow-hover); color: inherit; }
.kpi-icon {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: .9rem;
    font-size: 1.4rem;
    color: #fff;
}
.kpi-c0 { background: linear-gradient(135deg, #3d7be0, #2e3a8c); }
.kpi-c1 { background: linear-gradient(135deg, #29a8e0, #1f6fb5); }
.kpi-c2 { background: linear-gradient(135deg, #f5a524, #e2711d); }
.kpi-c3 { background: linear-gradient(135deg, #34c17b, #1f8f5c); }
.kpi-label { font-size: .82rem; color: var(--bs-secondary-color); font-weight: 500; }
.kpi-value { font-size: 1.85rem; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.kpi-arrow { color: var(--bs-secondary-color); transition: transform .18s; }
.kpi-card:hover .kpi-arrow { transform: translateX(4px); color: var(--bs-primary); }

/* Barra de herramientas de tablas */
.toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.buscador { position: relative; flex: 1 1 260px; max-width: 360px; }
.buscador .bi { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--bs-secondary-color); pointer-events: none; }
.buscador .form-control { padding-left: 2.4rem; }
.contador { font-size: .82rem; color: var(--bs-secondary-color); margin-left: auto; }

.filtros { display: inline-flex; padding: 3px; border-radius: .65rem; background: var(--app-surface-2); border: 1px solid var(--bs-border-color); }
.filtros .btn { border: 0; padding: .32rem .8rem; font-size: .85rem; color: var(--bs-secondary-color); box-shadow: none; }
.filtros .btn.active { background: var(--app-surface); color: var(--bs-body-color); box-shadow: 0 1px 3px rgba(20, 28, 64, .12); }
.filtros .badge { font-weight: 600; }

/* Tablas */
.table-modern {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: var(--app-surface-2);
    margin: 0;
    vertical-align: middle;
}
.table-modern > thead th {
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--bs-secondary-color);
    background: var(--app-surface-2);
    border-bottom: 1px solid var(--bs-border-color);
    padding: .8rem 1rem;
    white-space: nowrap;
}
.table-modern > tbody td { padding: .85rem 1rem; border-color: var(--bs-border-color); }
.table-modern > tbody tr:last-child td { border-bottom: 0; }
.table-modern th[data-ordenar] { cursor: pointer; user-select: none; }
.table-modern th[data-ordenar]::after {
    content: "\F283";
    font-family: bootstrap-icons;
    font-size: .7rem;
    margin-left: .35rem;
    opacity: .35;
}
.table-modern th[aria-sort="ascending"]::after { content: "\F235"; opacity: 1; color: var(--bs-primary); }
.table-modern th[aria-sort="descending"]::after { content: "\F229"; opacity: 1; color: var(--bs-primary); }
.table-modern tr[data-href] { cursor: pointer; }
.table-modern tr[data-href]:hover .fila-flecha { transform: translateX(3px); color: var(--bs-primary); }
.fila-flecha { color: var(--bs-secondary-color); transition: transform .15s; }
.table-responsive { border-radius: 0 0 .9rem .9rem; }

/* Avatares */
.avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    font-size: .85rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: .02em;
}
.avatar-sm { width: 34px; height: 34px; font-size: .78rem; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.35rem; }
.avatar-c0 { background: linear-gradient(135deg, #3d7be0, #2e3a8c); }
.avatar-c1 { background: linear-gradient(135deg, #29a8e0, #1f6fb5); }
.avatar-c2 { background: linear-gradient(135deg, #8b6cf0, #5b3fc4); }
.avatar-c3 { background: linear-gradient(135deg, #34c17b, #1f8f5c); }
.avatar-c4 { background: linear-gradient(135deg, #f5a524, #e2711d); }
.avatar-c5 { background: linear-gradient(135deg, #ef6b8a, #c73a64); }

.persona { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.persona-nombre { font-weight: 600; line-height: 1.25; }
.persona-detalle { font-size: .8rem; color: var(--bs-secondary-color); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.badge { font-weight: 600; letter-spacing: .01em; }
.badge-soft { padding: .38em .7em; border-radius: 999px; font-weight: 600; font-size: .75rem; }
.badge-dot::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: .4em; vertical-align: middle; }
.codigo { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; }

/* Estado vacío */
.estado-vacio { text-align: center; padding: 3rem 1rem; }
.estado-vacio-icono {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 1.6rem;
    color: var(--bs-primary);
    background: var(--bs-primary-bg-subtle);
}

/* Lista de alertas (tarjetas) */
.alerta-item {
    display: flex;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--bs-border-color);
    transition: background-color .15s;
}
.alerta-item:last-child { border-bottom: 0; }
.alerta-item:hover { background: var(--app-surface-2); }
.alerta-icono {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: .75rem;
    font-size: 1.15rem;
    color: #b45309;
    background: #fef3c7;
}
[data-bs-theme="dark"] .alerta-icono { background: rgba(245, 165, 36, .15); color: #f5b955; }
.alerta-mensaje { font-weight: 500; margin-bottom: .3rem; white-space: pre-line; word-break: break-word; }
.alerta-meta { font-size: .8rem; color: var(--bs-secondary-color); display: flex; flex-wrap: wrap; gap: .35rem 1rem; }
.alerta-meta .bi { margin-right: .25rem; }

/* Línea de tiempo (historial de alertas y actividad) */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline-item { position: relative; padding: 0 0 1.25rem 2rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
    content: "";
    position: absolute;
    left: 9px;
    top: 22px;
    bottom: 0;
    width: 2px;
    background: var(--bs-border-color);
}
.timeline-item:last-child::before { display: none; }
.timeline-punto {
    position: absolute;
    left: 0;
    top: 2px;
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: .65rem;
    color: #fff;
}
.punto-activa { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, .18); }
.punto-atendida { background: #22a06b; box-shadow: 0 0 0 4px rgba(34, 160, 107, .18); }
.punto-info { background: var(--bs-primary); box-shadow: 0 0 0 4px rgba(var(--bs-primary-rgb), .16); }
.punto-error { background: #e5484d; box-shadow: 0 0 0 4px rgba(229, 72, 77, .16); }
.timeline-texto { font-size: .9rem; word-break: break-word; white-space: pre-line; }
.timeline-meta { font-size: .76rem; color: var(--bs-secondary-color); margin-top: .15rem; }

/* Documentos */
.zona-carga {
    position: relative;
    display: block;
    padding: 1.6rem 1rem;
    text-align: center;
    border: 2px dashed var(--bs-border-color);
    border-radius: .85rem;
    background: var(--app-surface-2);
    cursor: pointer;
    transition: border-color .15s, background-color .15s;
}
.zona-carga:hover, .zona-carga.arrastrando { border-color: var(--bs-primary); background: var(--bs-primary-bg-subtle); }
.zona-carga input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.zona-carga-icono { font-size: 1.8rem; color: var(--bs-primary); }
.archivos-seleccionados { list-style: none; padding: 0; margin: .75rem 0 0; }
.archivos-seleccionados li {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .45rem .7rem;
    margin-bottom: .35rem;
    border-radius: .55rem;
    background: var(--app-surface-2);
    font-size: .85rem;
}
.archivos-seleccionados li.invalido { color: #c42b31; background: rgba(229, 72, 77, .1); }

.documento {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .75rem .25rem;
    border-bottom: 1px solid var(--bs-border-color);
}
.documento:last-child { border-bottom: 0; }
.documento-icono {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: .6rem;
    font-size: 1.2rem;
}
.doc-pdf { background: rgba(229, 72, 77, .12); color: #d93a40; }
.doc-img { background: rgba(139, 108, 240, .14); color: #7553e0; }
.doc-word { background: rgba(39, 88, 163, .12); color: var(--bs-primary); }
.doc-excel { background: rgba(34, 160, 107, .13); color: #1f8f5c; }
.doc-otro { background: var(--app-surface-2); color: var(--bs-secondary-color); }
.documento-nombre { font-weight: 500; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Ficha de cliente */
.ficha-encabezado { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.dato-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .25rem .65rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 500;
    background: var(--app-surface);
    border: 1px solid var(--bs-border-color);
}
.dato-chip .bi { color: var(--bs-primary); }
.cambios-pendientes { display: none; font-size: .8rem; color: #b45309; }
form.modificado .cambios-pendientes { display: inline-flex; align-items: center; gap: .3rem; }

/* Fortaleza de contraseña */
.fortaleza { height: 6px; border-radius: 999px; background: var(--bs-border-color); overflow: hidden; margin-top: .5rem; }
.fortaleza-barra { height: 100%; width: 0; border-radius: 999px; transition: width .25s, background-color .25s; }
.fortaleza-texto { font-size: .75rem; color: var(--bs-secondary-color); margin-top: .3rem; }

/* Avisos emergentes */
.toast-container { z-index: 1090; }
.aviso {
    border: 0;
    border-radius: .8rem;
    background: var(--app-surface);
    box-shadow: 0 12px 32px rgba(10, 16, 40, .18);
    border-left: 4px solid;
    font-size: .9rem;
    overflow: hidden;
}
.aviso-icono { font-size: 1.15rem; line-height: 1.3; }
.aviso-success { border-left-color: #22a06b; } .aviso-success .aviso-icono { color: #22a06b; }
.aviso-danger { border-left-color: #e5484d; } .aviso-danger .aviso-icono { color: #e5484d; }
.aviso-warning { border-left-color: #f59e0b; } .aviso-warning .aviso-icono { color: #f59e0b; }
.aviso-info { border-left-color: var(--bs-primary); } .aviso-info .aviso-icono { color: var(--bs-primary); }
.btn-close-sm { font-size: .7rem; margin-top: .2rem; }

.confirmar-icono {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 1.5rem;
    color: #e5484d;
    background: rgba(229, 72, 77, .12);
}
.confirmar-icono.confirmar-primario { color: var(--bs-primary); background: var(--bs-primary-bg-subtle); }

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

.login-page { min-height: 100vh; background: var(--app-surface); }
.login-wrapper { display: flex; min-height: 100vh; }
.login-aside {
    position: relative;
    flex: 1 1 55%;
    background: #f4f6fb url("../img/login-bg.jpg") center / cover no-repeat;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}
.login-panel {
    flex: 1 1 45%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
}
.login-card { width: 100%; max-width: 400px; }
.login-logo { width: 116px; display: block; margin-bottom: 1.75rem; }
[data-bs-theme="dark"] .login-logo { background: #fff; border-radius: 1rem; padding: .6rem; }
.login-card .form-floating > .form-control { border-radius: .7rem; height: calc(3.6rem + 2px); }
.login-card .btn-lg { padding: .8rem 1rem; border-radius: .7rem; font-size: 1rem; }
.campo-password { position: relative; }
.campo-password .form-control { padding-right: 3rem; }
.campo-password .btn-ver {
    position: absolute;
    right: .5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
}
.login-pie { margin-top: 2.5rem; font-size: .78rem; color: var(--bs-secondary-color); }

/* ---------- Página de mensaje (bloqueos / errores) ---------- */

.pagina-mensaje {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background:
        radial-gradient(80% 60% at 50% 0%, rgba(41, 168, 224, .14), transparent 70%),
        var(--bs-body-bg);
}
.pagina-mensaje-card {
    width: 100%;
    max-width: 440px;
    text-align: center;
    padding: 2.5rem 2rem;
    border-radius: 1.1rem;
    background: var(--app-surface);
    box-shadow: var(--app-shadow-hover);
}
.pagina-mensaje-logo { width: 46px; margin-bottom: 1.5rem; }
.pagina-mensaje-icono {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 1.7rem;
    color: #e5484d;
    background: rgba(229, 72, 77, .12);
}

/* ---------- Animación de entrada ---------- */

.app-content > * { animation: aparecer .35s ease both; }
.app-content > *:nth-child(2) { animation-delay: .04s; }
.app-content > *:nth-child(3) { animation-delay: .08s; }
@keyframes aparecer { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Ajustes responsivos ---------- */

@media (max-width: 575.98px) {
    .app-content { padding: 1.25rem 1rem 2.5rem; }
    .app-topbar { padding: 0 .75rem; }
    .page-title { font-size: 1.25rem; }
    .page-header-icon { width: 42px; height: 42px; font-size: 1.15rem; }
    .page-actions, .page-actions .btn { width: 100%; }
    .contador { margin-left: 0; width: 100%; }
    .buscador { max-width: none; }
}
