/* ============================================================
   TaskFlow — Paleta taskflow-style
   amber #f59e0b · indigo #6366f1 · indigo-deep #4f46e5 · night #101231
   ============================================================ */
:root {
    --tf-accent: #f59e0b;
    --tf-primary: #6366f1;
    --tf-primary-soft: #4f46e5;
    --tf-navy: #101231;
    --tf-navy-2: #181b42;
    --tf-ink: #1c2340;
    --tf-muted: #6b7694;
    --tf-surface: #f1f3fa;
    --tf-white: #ffffff;
    --tf-line: #dfe2f3;
    --shadow-soft: 0 12px 30px rgba(18, 20, 60, 0.09);
    --shadow-strong: 0 20px 44px rgba(18, 20, 60, 0.15);

    --topbar-h: 62px;
    --sidebar-w: 274px;
}

* {
    box-sizing: border-box;
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(107, 108, 148, 0.45) transparent;
}

*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: rgba(107, 108, 148, 0.45);
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(107, 108, 148, 0.65);
}

html,
body {
    max-width: 100%;
    overflow-x: clip;
}

@supports not (overflow: clip) {
    html,
    body {
        overflow-x: hidden;
    }
}

body {
    margin: 0;
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    color: var(--tf-ink);
    background: radial-gradient(1200px 650px at 95% -10%, rgba(252, 174, 38, 0.18), transparent 62%),
                radial-gradient(950px 530px at -15% 10%, rgba(19, 19, 189, 0.1), transparent 62%),
                linear-gradient(180deg, #f5f6fd 0%, #edeff8 100%);
    line-height: 1.35;
}

h1, h2, h3, h4, h5 {
    color: #181e45;
    font-weight: 700;
    letter-spacing: 0.1px;
}

a {
    color: var(--tf-primary);
}

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

.top-nav {
    height: var(--topbar-h);
    background: linear-gradient(100deg, #131539 0%, #1c1e52 48%, #292b78 100%);
    border-bottom: 2px solid var(--tf-accent);
    box-shadow: 0 12px 34px rgba(10, 13, 52, 0.36);
    backdrop-filter: blur(6px);
}

.top-nav .container-fluid {
    padding-inline: 1rem 1.25rem;
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: #fff;
    font-size: 1.32rem;
    font-weight: 700;
}

.navbar-brand:hover {
    color: #fff;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.brand-logo {
    width: 38px;
    height: 38px;
    margin: 0 0.15rem 0 0;
    padding: 0;
    object-fit: contain;
    background: transparent;
    filter: drop-shadow(0 4px 10px rgba(16, 18, 49, 0.35));
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.34rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    color: rgba(245, 246, 255, 0.93);
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.08);
}

.user-chip-btn:hover,
.user-chip-btn:focus,
.user-chip-btn:active,
.show > .user-chip-btn {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.16);
}

.user-dropdown-menu {
    border-radius: 0.8rem;
    border: 1px solid var(--tf-line);
    box-shadow: 0 14px 28px rgba(11, 18, 77, 0.18);
    min-width: 210px;
}

.user-dropdown-menu .dropdown-item {
    font-weight: 600;
    color: var(--tf-primary);
}

.user-dropdown-menu .dropdown-item:hover {
    background: #f6f3ee;
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.8rem 0.55rem;
}

.user-dropdown-meta {
    display: grid;
    min-width: 0;
}

.user-dropdown-meta strong {
    color: var(--tf-primary);
    font-size: 0.92rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown-meta span {
    color: #626296;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: capitalize;
}

.user-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    color: var(--tf-muted);
    background: #e8e9f4;
    border: 1px solid var(--tf-line);
    font-size: 1.4rem;
    flex-shrink: 0;
}

/* Foto de perfil en el topbar: boton-avatar sin chip, el icono o la foto
   ocupan todo el tamano (a juego con el boton de la campana). */

.user-chip-avatar,
.user-chip-avatar:hover,
.user-chip-avatar:focus,
.user-chip-avatar:active,
.show > .user-chip-avatar {
    width: 2.45rem;
    height: 2.45rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    justify-content: center;
}

.user-chip-avatar i {
    font-size: 2.15rem;
    line-height: 1;
}

.user-chip-avatar:hover i,
.user-chip-avatar:focus i {
    color: #fff;
}

.user-avatar-mini {
    width: 2.45rem;
    height: 2.45rem;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 1px 6px rgba(10, 11, 45, 0.35);
}

.user-avatar-lg-mini {
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid #d1d5f2;
    flex-shrink: 0;
}

/* Editor de foto de perfil (recorte 1:1) */

.profile-avatar-wrap {
    width: 180px;
    height: 180px;
    border-radius: 1rem;
    border: 1px solid var(--tf-line);
    background: #f4f5ff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar-lg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-empty {
    color: #6e749d;
    font-weight: 700;
}

.profile-crop-box {
    width: 320px;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    border: 1px solid var(--tf-line);
    border-radius: 0.9rem;
    overflow: hidden;
    background: #f0f1fb;
}

.profile-crop-box canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Campana de notificaciones */

.notif-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.45rem;
    height: 2.45rem;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(245, 246, 255, 0.93);
}

.notif-bell::after {
    display: none;
}

.notif-bell:hover,
.notif-bell:focus,
.show > .notif-bell {
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.4);
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 1.18rem;
    height: 1.18rem;
    padding: 0 0.28rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.55);
}

.notif-dropdown {
    width: min(360px, 92vw);
    border-radius: 0.9rem;
    border: 1px solid var(--tf-line);
    box-shadow: 0 16px 34px rgba(11, 18, 77, 0.2);
    padding: 0;
    overflow: hidden;
}

.notif-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 0.95rem;
    border-bottom: 1px solid var(--tf-line);
    background: #f8f9ff;
}

.notif-dropdown-header strong {
    color: var(--tf-primary);
}

.notif-dropdown-header a {
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
}

.notif-dropdown-list {
    max-height: 330px;
    overflow-y: auto;
}

.notif-dropdown-item {
    display: block;
    padding: 0.65rem 0.95rem;
    border-bottom: 1px solid #f1f1fa;
    text-decoration: none;
    color: inherit;
}

.notif-dropdown-item:hover {
    background: #f8f9ff;
}

.notif-dropdown-item strong {
    display: block;
    font-size: 0.88rem;
    color: var(--tf-primary);
}

.notif-dropdown-item span {
    display: block;
    font-size: 0.8rem;
    color: var(--tf-muted);
}

.notif-empty {
    padding: 1.1rem 0.95rem;
    font-size: 0.86rem;
    color: var(--tf-muted);
    text-align: center;
}

/* ------------------------------------------------------------------ */
/* Estructura general                                                 */
/* ------------------------------------------------------------------ */

.app-shell {
    display: flex;
    min-height: 100vh;
    padding-top: var(--topbar-h);
}

.app-sidebar {
    width: var(--sidebar-w);
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    bottom: 0;
    z-index: 1030;
    overflow-y: auto;
    padding: 1rem 0.88rem 1.1rem;
    background: linear-gradient(185deg, #191c4a 0%, #14163d 50%, #101231 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-heading {
    margin: 0.18rem 0.6rem 0.9rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(195, 199, 255, 0.7);
    font-weight: 700;
}

.sidebar-nav {
    display: grid;
    gap: 0.33rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.74rem;
    padding: 0.72rem 0.84rem;
    border-radius: 0.76rem;
    color: #d8dbff;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: 0.2s ease;
}

.sidebar-link i {
    color: #9ea8ff;
    font-size: 1rem;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.09);
    color: #ffffff;
    transform: translateX(2px);
}

.sidebar-link.active {
    color: #fff;
    background: linear-gradient(120deg, #1313bd 0%, #2f36f1 100%);
    box-shadow: 0 10px 22px rgba(19, 19, 189, 0.44);
}

.sidebar-link.active i {
    color: #ffc96c;
}

.app-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    width: calc(100% - var(--sidebar-w));
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.content-wrap {
    padding: 1.5rem 1.6rem 1rem;
    width: 100%;
    max-width: 1500px;
    margin-inline: auto;
    flex: 1;
}

/* Encabezado de pagina */

.page-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1.15rem;
}

.page-title {
    font-size: 1.5rem;
    margin: 0;
    display: flex;
    align-items: center;
}

.page-subtitle {
    margin: 0.2rem 0 0;
    color: var(--tf-muted);
    font-size: 0.92rem;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
}

/* Tarjetas y botones */

.card {
    border: 1px solid var(--tf-line);
    border-radius: 1rem;
    box-shadow: var(--shadow-soft);
}

.card-header {
    background: #f8f9ff;
    border-bottom: 1px solid #e8eaf8;
    border-radius: 1rem 1rem 0 0 !important;
    font-weight: 700;
    color: #181e45;
    font-size: 0.95rem;
}

/* Botones */

.btn {
    border-radius: 0.7rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-brand {
    border: 0;
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.2px;
    background: linear-gradient(115deg, var(--tf-primary) 0%, var(--tf-primary-soft) 100%);
    border-radius: 0.74rem;
    box-shadow: 0 10px 20px rgba(19, 19, 189, 0.26);
}

.btn-brand:hover {
    color: #fff;
    transform: translateY(-1px);
    filter: brightness(1.03);
}

.btn-outline-primary,
.btn-outline-danger,
.btn-outline-secondary {
    font-weight: 700;
    border-width: 1.4px;
}

.btn-outline-primary:hover,
.btn-outline-danger:hover,
.btn-outline-secondary:hover {
    transform: translateY(-1px);
}

.view-switch .btn {
    font-weight: 600;
}

.view-switch .btn.active {
    background: var(--tf-primary);
    border-color: var(--tf-primary);
    color: #fff;
}

.filter-card .form-label {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--tf-muted);
    margin-bottom: 0.22rem;
}

/* Previene desborde de select2 en columnas flex del filtro */
.filter-card [class*="col-"] {
    overflow: visible;
    min-width: 0;
}

.filter-card .select2-container {
    display: block;
    width: 100% !important;
}

/* Chips */

.estado-chip,
.proyecto-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.18rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--chip-color, #646a8b);
    background: color-mix(in srgb, var(--chip-color, #646a8b) 14%, #ffffff);
    border: 1px solid color-mix(in srgb, var(--chip-color, #646a8b) 34%, #ffffff);
}

@supports not (color: color-mix(in srgb, red 50%, white)) {
    .estado-chip,
    .proyecto-chip {
        color: #fff;
        background: var(--chip-color, #646a8b);
        border: none;
    }
}

.priority-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.14rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #fff;
    background: var(--prio-color, #949ab8);
    box-shadow: 0 3px 8px rgba(11, 18, 77, 0.14);
}

.rol-chip {
    display: inline-flex;
    padding: 0.16rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    background: #e8e9f4;
    color: var(--tf-muted);
    border: 1px solid var(--tf-line);
    text-transform: capitalize;
}

.rol-chip.rol-superusuario {
    background: rgba(189, 127, 19, 0.12);
    color: #8a5b0b;
    border-color: rgba(189, 127, 19, 0.3);
}

.rol-chip.rol-administrador {
    background: #e9e5ff;
    color: #3f3fae;
    border-color: #d5d5d5;
}

.rol-chip.rol-encargado {
    background: #dcf3ea;
    color: #157356;
    border-color: #b5e5d4;
}

.posicion-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.16rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    background: #f1f0fb;
    color: var(--tf-muted);
    border: 1px solid var(--tf-line);
}

.posicion-chip.posicion-lider {
    background: rgba(189, 127, 19, 0.12);
    color: #8a5b0b;
    border-color: rgba(189, 127, 19, 0.3);
}

.posicion-chip.posicion-mando {
    background: #e9e5ff;
    color: #3f3fae;
    border-color: #d5d5d5;
}

.proyecto-dot {
    display: inline-block;
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 999px;
    margin-right: 0.55rem;
    box-shadow: 0 0 0 4px rgba(11, 18, 77, 0.14);
}

/* ------------------------------------------------------------------ */
/* Dashboard                                                          */
/* ------------------------------------------------------------------ */

.stat-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 1.1rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--tf-line);
    box-shadow: var(--shadow-soft);
    height: 100%;
}

.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.9rem;
    height: 2.9rem;
    border-radius: 0.9rem;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.stat-total .stat-icon { background: #e8e9f4; color: var(--tf-primary); }
.stat-pendientes .stat-icon { background: #fef4e2; color: #b45309; }
.stat-completadas .stat-icon { background: #e3f7ec; color: #15803d; }
.stat-vencidas .stat-icon { background: #fde8e8; color: #b91c1c; }

.stat-meta {
    display: grid;
    min-width: 0;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #181e45;
    line-height: 1.1;
}

.stat-label {
    font-size: 0.82rem;
    color: var(--tf-muted);
    font-weight: 600;
}

.estado-bar-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.65rem;
}

.estado-bar-label {
    width: 120px;
    flex-shrink: 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: #3e3c6e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.estado-bar-track {
    flex: 1;
    height: 0.62rem;
    border-radius: 999px;
    background: var(--tf-line);
    overflow: hidden;
}

.estado-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.4s ease;
}

.estado-bar-value {
    width: 2rem;
    text-align: right;
    font-weight: 800;
    font-size: 0.88rem;
    color: #3e3c6e;
}

.detalle-list .detalle-row,
.detalle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    padding: 0.42rem 0;
    border-bottom: 1px dashed var(--tf-line);
    font-size: 0.9rem;
}

.detalle-row:last-child {
    border-bottom: none;
}

.detalle-row > span {
    color: var(--tf-muted);
    font-weight: 600;
}

.detalle-row > strong {
    text-align: right;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* ------------------------------------------------------------------ */
/* Kanban                                                             */
/* ------------------------------------------------------------------ */

.kanban-wrap {
    margin-inline: -0.25rem;
}

.kanban-board {
    display: flex;
    gap: 0.9rem;
    overflow-x: auto;
    padding: 0.25rem 0.25rem 1rem;
    align-items: flex-start;
    scroll-snap-type: x proximity;
}

.kanban-col {
    flex: 0 0 292px;
    max-width: 292px;
    background: #eeeef5;
    border: 1px solid var(--tf-line);
    border-radius: 12px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--topbar-h) - 210px);
    min-height: 180px;
}

.kanban-col-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 0.9rem 0.55rem;
    flex-shrink: 0;
}

.kanban-col-dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 999px;
    background: var(--estado-color, #646a8b);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--estado-color, #646a8b) 18%, transparent);
    flex-shrink: 0;
}

.kanban-col-title {
    font-weight: 800;
    font-size: 0.92rem;
    color: var(--tf-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kanban-col-count {
    margin-left: auto;
    background: #fff;
    border: 1px solid var(--tf-line);
    color: var(--tf-muted);
    font-size: 0.76rem;
    font-weight: 800;
    border-radius: 999px;
    padding: 0.05rem 0.5rem;
}

.kanban-col-body {
    padding: 0.35rem 0.6rem 0.7rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-height: 90px;
    flex: 1;
}

.kanban-card {
    background: #fff;
    border: 1px solid var(--tf-line);
    border-radius: 12px;
    padding: 0.65rem 0.75rem;
    box-shadow: 0 4px 12px rgba(11, 18, 77, 0.05);
    cursor: grab;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-card:hover {
    box-shadow: 0 10px 22px rgba(11, 18, 77, 0.1);
    transform: translateY(-1px);
}

.kanban-card.is-vencida {
    border-color: #f3c1c1;
    background: #fffafa;
}

.kanban-card.sortable-ghost {
    opacity: 0.45;
    border-style: dashed;
}

.kanban-card.sortable-chosen {
    box-shadow: 0 14px 30px rgba(11, 18, 77, 0.22);
}

.kanban-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
}

.badge-vencida {
    color: #dc2626;
    font-size: 0.85rem;
}

.kanban-card-title {
    display: block;
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--tf-primary);
    text-decoration: none;
    margin-bottom: 0.35rem;
    line-height: 1.28;
    overflow-wrap: anywhere;
}

.kanban-card-title:hover {
    color: var(--tf-primary);
}

.kanban-card .proyecto-chip {
    margin-bottom: 0.4rem;
    font-size: 0.72rem;
}

.kanban-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.76rem;
    color: var(--tf-muted);
    flex-wrap: wrap;
}

.kanban-card-user,
.kanban-card-date {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kanban-empty {
    border: 1.5px dashed var(--tf-line);
    border-radius: 0.8rem;
    padding: 1rem 0.6rem;
    text-align: center;
    color: var(--tf-muted);
    font-size: 0.82rem;
    font-weight: 600;
}

/* ------------------------------------------------------------------ */
/* Listas y tablas                                                    */
/* ------------------------------------------------------------------ */

.entity-list-table th {
    font-size: 0.77rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #525983;
    font-weight: 800;
    background: #f7f8fe;
    border-color: #e3e4f2;
    padding-top: 0.82rem;
    padding-bottom: 0.82rem;
}

.entity-list-table td {
    vertical-align: middle;
    border-color: #edeff8;
    color: #222755;
    font-weight: 500;
}

/* --- Tablas (app/ style) --- */

.table {
    margin: 0;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table thead th {
    border-bottom-width: 1px;
    border-color: #e3e4f2;
    text-transform: uppercase;
    font-size: 0.77rem;
    letter-spacing: 0.8px;
    color: #525983;
    font-weight: 800;
    background: #f7f8fe;
    padding-top: 0.82rem;
    padding-bottom: 0.82rem;
    position: relative;
}

.table tbody td {
    vertical-align: middle;
    border-color: #edeff8;
    color: #222755;
    font-weight: 500;
}

.table thead th:first-child,
.table tbody td:first-child {
    width: 62px;
    text-align: center;
}

.table tbody td:first-child {
    color: #6f7598;
    font-weight: 700;
}

.table tbody td:last-child,
.table thead th:last-child {
    white-space: nowrap;
}

.table tbody td.text-end {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.45rem;
}

.table-hover tbody tr:hover,
.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: #f8f9ff;
}

.table-hover tbody tr:hover {
    transform: none;
}

.table-footer-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin: 0.85rem 1rem 1rem;
    padding: 0.76rem 0.92rem;
    border: 1px solid #e4e6f7;
    border-radius: 0.72rem;
    background: #f8f9ff;
}

.records-totalizer {
    display: inline-flex;
    align-items: center;
    gap: 0.36rem;
    color: #4e5683;
    font-size: 0.91rem;
    font-weight: 600;
}

.records-totalizer i {
    color: #6a72a0;
}

.records-totalizer strong {
    color: #1b2875;
    font-weight: 700;
}

.table-pagination .page-link {
    border-radius: 0.56rem;
    border: 1px solid #d6daef;
    color: #242f72;
    background: #fff;
    margin: 0 1px;
    min-width: 34px;
    text-align: center;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 0.25rem 0.52rem;
}

.table-pagination .page-link:hover {
    background: #eef0ff;
    color: #17236f;
}

.table-pagination .page-item.active .page-link {
    border-color: #1f25c6;
    background: linear-gradient(120deg, var(--tf-primary) 0%, #343aff 100%);
    color: #fff;
    box-shadow: 0 6px 12px rgba(19, 19, 189, 0.22);
}

.table-pagination .page-item.disabled .page-link {
    color: #9196b7;
    background: #f7f8fd;
}

.btn-icon-only {
    width: 2rem;
    height: 2rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-only i {
    font-size: 0.86rem;
    line-height: 1;
}

.table .badge,
.status-pill {
    padding: 0.32rem 0.6rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
}

.row-vencida {
    background: #fff8f8;
}

/* Proyectos */

.proyecto-card {
    border-top: 4px solid var(--proyecto-color, var(--tf-primary));
}

.proyecto-card-title {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--tf-primary);
    text-decoration: none;
    overflow-wrap: anywhere;
}

.proyecto-card-title:hover {
    color: var(--tf-primary);
}

.proyecto-card-desc {
    color: var(--tf-muted);
    font-size: 0.86rem;
    margin: 0.4rem 0 0.8rem;
}

.proyecto-progress {
    height: 0.55rem;
    border-radius: 999px;
    background: #ededf8;
}

.proyecto-inactivo {
    opacity: 0.65;
}

.depto-card {
    border-top: 4px solid var(--depto-color, var(--tf-primary));
}

.depto-card-title {
    font-weight: 800;
    color: var(--tf-primary);
}

.depto-count {
    color: var(--tf-muted);
    font-size: 0.86rem;
    font-weight: 700;
}

/* Detalle de tarea */

.tarea-descripcion {
    white-space: normal;
    overflow-wrap: anywhere;
    color: #353363;
}

.comentario-item {
    border: 1px solid var(--tf-line);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.6rem;
    background: #f8f9ff;
}

.comentario-head {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    font-size: 0.82rem;
    margin-bottom: 0.25rem;
}

.comentario-head strong {
    color: var(--tf-primary);
}

.comentario-head span {
    color: var(--tf-muted);
    flex-shrink: 0;
}

.comentario-body {
    font-size: 0.9rem;
    color: var(--tf-ink);
    overflow-wrap: anywhere;
}

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

.historial-list li {
    position: relative;
    padding: 0.4rem 0 0.4rem 1.15rem;
    font-size: 0.86rem;
    color: #4c4a7e;
    border-bottom: 1px dashed #ececf8;
}

.historial-list li:last-child {
    border-bottom: none;
}

.historial-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.85rem;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: var(--tf-primary);
}

.historial-fecha {
    display: block;
    font-size: 0.74rem;
    color: var(--tf-muted);
    font-weight: 700;
}

/* Estados (configuracion) */

.estados-sortable {
    display: grid;
    gap: 0.5rem;
}

.estado-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--tf-line);
    border-radius: 8px;
    background: #fff;
}

.estado-row-grip {
    color: var(--tf-muted);
    cursor: grab;
}

.estado-row-dot {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 999px;
    flex-shrink: 0;
}

.estado-row-name {
    font-weight: 700;
    color: var(--tf-primary);
    overflow-wrap: anywhere;
}

.estado-row.sortable-ghost {
    opacity: 0.5;
    border-style: dashed;
}

.permiso-grupo {
    border: 1px solid var(--tf-line);
    border-radius: 8px;
    padding: 0.7rem 0.85rem;
    background: #f8f9ff;
    height: 100%;
}

.permiso-grupo-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 800;
    color: var(--tf-muted);
    margin-bottom: 0.45rem;
}

.posicion-select {
    width: auto;
    min-width: 150px;
    display: inline-block;
}

/* Checklist de subtareas */

.checklist-progress {
    height: 0.5rem;
    border-radius: 999px;
    background: #ededf8;
}

.checklist-list {
    display: grid;
    gap: 0.4rem;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--tf-line);
    border-radius: 8px;
    background: #f8f9ff;
}

.checklist-item .form-check-input {
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
}

.checklist-titulo {
    font-size: 0.9rem;
    color: #353363;
    overflow-wrap: anywhere;
}

.checklist-item.is-done {
    background: #f2faf5;
    border-color: #d4ecdd;
}

.checklist-item.is-done .checklist-titulo {
    text-decoration: line-through;
    color: var(--tf-muted);
}

.checklist-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    margin-bottom: 0.4rem;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--tf-muted);
    background: #e8e9f4;
    border: 1px solid var(--tf-line);
    width: fit-content;
}

.checklist-badge.is-complete {
    color: #15803d;
    background: #e3f7ec;
    border-color: #c4ead4;
}

/* Archivos adjuntos */

.adjuntos-list {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
}

.adjunto-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--tf-line);
    border-radius: 0.75rem;
    background: #f8f9ff;
}

.adjunto-ext {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3rem;
    height: 2.2rem;
    padding: 0 0.4rem;
    border-radius: 0.55rem;
    background: #e8e9f4;
    color: #0b124d;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.adjunto-meta {
    display: grid;
    min-width: 0;
    flex: 1;
}

.adjunto-nombre {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--tf-primary);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.adjunto-nombre:hover {
    color: var(--tf-primary);
}

.adjunto-detalle {
    font-size: 0.76rem;
    color: var(--tf-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Etiquetas */

.etiqueta-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.16rem 0.55rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--chip-color, #8b5cf6);
    background: color-mix(in srgb, var(--chip-color, #8b5cf6) 13%, #ffffff);
    border: 1px solid color-mix(in srgb, var(--chip-color, #8b5cf6) 32%, #ffffff);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.etiqueta-chip i {
    font-size: 0.66rem;
}

.etiqueta-chip-sm {
    font-size: 0.68rem;
    padding: 0.08rem 0.45rem;
}

.etiquetas-mini {
    display: flex;
    flex-wrap: wrap;
    gap: 0.28rem;
    margin: 0.15rem 0 0.35rem;
}

/* Switches de modulos en configuracion */

.modulo-switch {
    padding: 0.55rem 0.6rem 0.55rem 3rem;
    border: 1px solid var(--tf-line);
    border-radius: 8px;
    background: #f8f9ff;
    height: 100%;
}

.modulo-switch .form-check-label {
    display: grid;
}

.modulo-switch .form-check-label strong {
    color: var(--tf-primary);
    font-size: 0.92rem;
}

.modulo-switch .form-check-label span {
    color: var(--tf-muted);
    font-size: 0.8rem;
}

/* Notificaciones (pagina) */

.notif-item {
    position: relative;
}

.notif-no-leida {
    background: #f8f9ff;
}

.notif-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 0.8rem;
    font-size: 1.05rem;
    flex-shrink: 0;
    background: #e8e9f4;
    color: var(--tf-muted);
}

.notif-icon.notif-asignacion { background: #e8e9f4; color: #0b124d; }
.notif-icon.notif-completada { background: #e3f7ec; color: #15803d; }
.notif-icon.notif-estado { background: #e0eafe; color: #0369a1; }
.notif-icon.notif-vencida { background: #fde8e8; color: #b91c1c; }
.notif-icon.notif-comentario { background: #fef4e2; color: #b45309; }

.notif-dot {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 999px;
    background: var(--tf-primary);
    flex-shrink: 0;
    margin-top: 0.4rem;
}

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

/* FullCalendar ajustes */

#calendarioTareas {
    --fc-border-color: #e7e6f4;
    --fc-button-bg-color: var(--tf-primary);
    --fc-button-border-color: var(--tf-primary);
    --fc-button-hover-bg-color: #0d165c;
    --fc-button-hover-border-color: #0d165c;
    --fc-button-active-bg-color: #070c34;
    --fc-button-active-border-color: #070c34;
    --fc-today-bg-color: rgba(11, 18, 77, 0.08);
}

#calendarioTareas .fc-event {
    cursor: pointer;
    border-radius: 0.45rem;
    font-size: 0.78rem;
    padding: 1px 4px;
}

#calendarioTareas .fc-toolbar-title {
    font-size: 1.15rem;
    text-transform: capitalize;
}

/* ------------------------------------------------------------------ */
/* FullCalendar: mejora de vista (especialmente en movil)             */
/* ------------------------------------------------------------------ */

#calendarioTareas .fc-event-vencida {
    box-shadow: 0 0 0 2px #ef4444 inset;
}

#calendarioTareas .fc-event-final {
    opacity: 0.72;
}

/* Popover "+N más" (vista mes) */
#calendarioTareas .fc-popover {
    border-radius: 0.9rem;
    border: 1px solid var(--tf-line);
    box-shadow: 0 18px 45px rgba(8, 12, 48, 0.28);
    max-width: min(340px, calc(100vw - 1rem));
}

#calendarioTareas .fc-popover-header {
    background: #f8f9ff;
    border-radius: 0.9rem 0.9rem 0 0;
    padding: 0.5rem 0.75rem;
    font-weight: 700;
}

/* Eventos en listas: tarjeta con estado y aviso */
#calendarioTareas .fc-movil-evento {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

#calendarioTareas .fc-movil-evento-titulo {
    font-weight: 700;
    color: #181e45;
    overflow-wrap: anywhere;
    word-break: break-word;
}

#calendarioTareas .fc-movil-evento-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
    font-size: 0.74rem;
    color: var(--tf-muted);
}

#calendarioTareas .fc-movil-badge {
    display: inline-block;
    font-size: 0.66rem;
    font-weight: 800;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

#calendarioTareas .fc-movil-badge.vencida {
    background: rgba(239, 68, 68, 0.14);
    color: #dc2626;
}

#calendarioTareas .fc-movil-badge.final {
    background: rgba(16, 185, 129, 0.14);
    color: #059669;
}

@media (max-width: 767px) {

    /* Barra superior compacta: titulo + navegacion */
    #calendarioTareas .fc-header-toolbar {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 0.4rem;
        margin-bottom: 0.5rem;
    }

    #calendarioTareas .fc-toolbar-title {
        font-size: 1rem;
        font-weight: 800;
        text-align: center;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        flex: 1;
        padding: 0 0.2rem;
    }

    #calendarioTareas .fc-header-toolbar .fc-button {
        min-width: 0;
        padding: 0.32rem 0.55rem;
        font-size: 0.8rem;
        line-height: 1.2;
        border-radius: 0.6rem;
    }

    #calendarioTareas .fc-header-toolbar .fc-button-group {
        gap: 0.25rem;
    }

    /* Selector de vista anclado abajo (barra tactil) */
    #calendarioTareas .fc-footer-toolbar {
        position: sticky;
        bottom: 0.4rem;
        z-index: 30;
        margin: 0.6rem -0.25rem 0;
        padding: 0.45rem;
        background: rgba(255, 255, 255, 0.92);
        -webkit-backdrop-filter: blur(6px);
        backdrop-filter: blur(6px);
        border: 1px solid var(--tf-line);
        border-radius: 1rem;
        box-shadow: 0 10px 26px rgba(8, 12, 48, 0.16);
    }

    #calendarioTareas .fc-footer-toolbar .fc-toolbar-chunk {
        width: 100%;
    }

    #calendarioTareas .fc-footer-toolbar .fc-button-group {
        display: flex;
        width: 100%;
    }

    #calendarioTareas .fc-footer-toolbar .fc-button {
        flex: 1 1 0;
        margin: 0;
        padding: 0.5rem 0.2rem;
        font-size: 0.82rem;
        font-weight: 700;
        border-radius: 0;
    }

    #calendarioTareas .fc-footer-toolbar .fc-button:first-child {
        border-radius: 0.6rem 0 0 0.6rem;
    }

    #calendarioTareas .fc-footer-toolbar .fc-button:last-child {
        border-radius: 0 0.6rem 0.6rem 0;
    }

    /* Dia actual como circulo destacado */
    #calendarioTareas .fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 1.7rem;
        height: 1.7rem;
        border-radius: 50%;
        background: var(--tf-primary);
        color: #fff;
        font-weight: 800;
    }

    /* Mes: eventos y celdas compactos y tappables */
    #calendarioTareas .fc-daygrid-event {
        font-size: 0.68rem;
        padding: 1px 3px;
        border-radius: 0.4rem;
    }

    #calendarioTareas .fc-daygrid-day-number {
        font-size: 0.78rem;
        padding: 3px 4px;
    }

    #calendarioTareas .fc-col-header-cell-cushion {
        font-size: 0.78rem;
        padding: 6px 2px;
    }

    /* Semana / Dia: encabezados y etiquetas compactos */
    #calendarioTareas .fc-timegrid-slot-label,
    #calendarioTareas .fc-timegrid-axis-cushion {
        font-size: 0.72rem;
    }

    #calendarioTareas .fc-timegrid-event {
        font-size: 0.72rem;
    }

    /* Lista: encabezados y filas con aire */
    #calendarioTareas .fc-list-day-cushion {
        font-size: 0.85rem;
        padding: 0.5rem 0.6rem;
    }

    #calendarioTareas .fc-list-event td {
        padding: 0.55rem 0.6rem;
    }

    #calendarioTareas .fc-list-event:hover td {
        background-color: rgba(11, 18, 77, 0.06);
    }
}

/* ------------------------------------------------------------------ */
/* Pie de pagina                                                      */
/* ------------------------------------------------------------------ */
/* Footer                                                            */
/* ------------------------------------------------------------------ */

.app-footer {
    position: relative;
    z-index: 1;
    margin: 0;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 0;
    padding: 0.18rem 0.6rem;
    min-height: 24px;
    background: linear-gradient(185deg, #191c4a 0%, #14163d 50%, #101231 100%);
    box-shadow: 0 -2px 8px rgba(8, 12, 48, 0.38);
}

.app-footer-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    flex-wrap: wrap;
    max-width: 1500px;
    margin-inline: auto;
}

.app-footer-left,
.app-footer-right {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
}

.app-footer-right {
    margin-left: auto;
}

.app-footer-copy,
.app-footer-note,
.app-footer-sep {
    color: #d8dbff;
    font-size: 0.79rem;
    line-height: 1;
}

.app-footer-note-mobile {
    display: none;
    color: #d8dbff;
    font-size: 0.79rem;
    line-height: 1;
}

.app-footer-link {
    font-weight: 600;
    color: #9ea8ff;
    text-decoration: none;
    font-size: 0.79rem;
    text-decoration: underline;
    text-underline-offset: 2px;
    line-height: 1;
}

.app-footer-link:hover {
    color: #ffffff;
}

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

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.4rem;
    background: radial-gradient(880px 460px at 10% 8%, rgba(245, 158, 11, 0.16), transparent 58%),
                radial-gradient(920px 560px at 92% 92%, rgba(99, 102, 241, 0.22), transparent 58%),
                linear-gradient(145deg, #f6f7fd 0%, #e6e8f6 100%);
}

.login-shell {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 0;
    width: min(940px, 100%);
    border-radius: 1.4rem;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid #dfe2f3;
    box-shadow: 0 28px 62px rgba(18, 20, 60, 0.18);
    box-sizing: border-box;
}

.login-brand {
    position: relative;
    padding: 2.6rem 2.4rem;
    color: #dfe1ff;
    background: linear-gradient(150deg, #101231 0%, #232463 46%, #4f46e5 100%);
}

.login-brand::after {
    content: "";
    position: absolute;
    width: 270px;
    height: 270px;
    border-radius: 50%;
    right: -95px;
    bottom: -95px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.9) 0%, rgba(245, 158, 11, 0.14) 62%, transparent 78%);
}

.login-brand-top {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    position: relative;
    z-index: 1;
    margin-bottom: 1.1rem;
}

.login-brand-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 0.9rem;
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.55);
    padding: 0.35rem;
    box-shadow: 0 10px 24px rgba(16, 18, 49, 0.35);
    position: relative;
    z-index: 1;
}

.login-wordmark {
    position: relative;
    z-index: 1;
    color: #ffffff;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.login-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    width: fit-content;
    padding: 0.22rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
    color: #f3f2ff;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.login-brand h1 {
    color: #fff;
    font-size: clamp(1.85rem, 2.5vw, 2.5rem);
    font-weight: 800;
    margin: 1rem 0 0.75rem;
    letter-spacing: 0.2px;
    line-height: 1.15;
    max-width: 16ch;
    position: relative;
    z-index: 1;
}

.login-brand p {
    color: rgba(255, 255, 255, 0.9);
    max-width: 36ch;
    position: relative;
    z-index: 1;
    line-height: 1.5;
}

.login-brand-list {
    position: relative;
    z-index: 1;
    margin: 1.35rem 0 1.75rem;
    padding-left: 1.5rem;
    color: rgba(255, 255, 255, 0.92);
}

.login-brand-list li {
    margin-bottom: 0.46rem;
}

.login-brand-list li::before {
    content: "\f26a";
    font-family: "bootstrap-icons";
    display: inline-block;
    margin-left: -1.3rem;
    width: 1.1rem;
    color: #ffffff;
}

.login-card {
    background: linear-gradient(170deg, #ffffff 0%, #f7f8fc 100%);
    padding: 2.45rem 2.45rem 2.2rem;
}

.login-eyebrow {
    display: inline-block;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #4f46e5;
    margin-bottom: 0.25rem;
}

.login-card h2 {
    color: var(--tf-navy);
    margin-bottom: 0.5rem;
    font-size: clamp(1.85rem, 2.2vw, 2.25rem);
    line-height: 1.15;
}

.login-subtitle {
    color: #5f638d;
    margin-bottom: 1.15rem;
}

.login-footnote {
    margin-top: 0.9rem;
    font-size: 0.82rem;
    color: #6b6f94;
}

.auth-link-row {
    margin-top: 1.35rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.auth-link-row a {
    color: #232aa9;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.92rem;
}

.auth-link-row a:hover {
    color: #161e6f;
    text-decoration: underline;
}

.login-brand-org {
    color: #f4f4ff;
    line-height: 1.45;
}

.login-card .form-label {
    color: #212670;
    font-weight: 700;
    margin-bottom: 0.45rem;
}

.login-card .form-control {
    min-height: 50px;
    border-radius: 0.85rem;
    border-color: #c9ceec;
    background: #f9faff;
    box-shadow: inset 0 1px 2px rgba(12, 15, 75, 0.04);
}

.login-card .form-control:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.18);
    background: #fff;
    outline: none;
}

.login-card .btn-brand {
    min-height: 50px;
    border-radius: 0.85rem;
    font-size: 1.05rem;
    font-weight: 700;
    box-shadow: 0 12px 26px rgba(79, 70, 229, 0.26);
}

/* Formularios */

.form-control,
.form-select,
textarea {
    border-radius: 0.72rem;
    border-color: #cfd2e8;
    min-height: 44px;
    font-size: 0.94rem;
    background-color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
    padding-block: 0.5rem;
}

.form-control::placeholder {
    color: #7b81a3;
}

.form-control:focus,
.form-select:focus,
textarea:focus {
    border-color: #6f70f1;
    box-shadow: 0 0 0 0.24rem rgba(19, 19, 189, 0.17);
    outline: none;
}

.form-label {
    font-weight: 700;
    color: #2f3766;
    font-size: 0.86rem;
    margin-bottom: 0.3rem;
}

.form-dynamic {
    border-color: #dbdff6;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: 0.42rem;
    margin-top: 1rem;
    margin-bottom: 0.4rem;
    padding: 0.2rem 0 0.55rem;
    border-bottom: 1px dashed #d9def3;
    color: #28336c;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.65px;
}

.form-dynamic .form-section-title:first-child {
    margin-top: 0.1rem;
}

.form-section-title i {
    color: #4251a5;
    font-size: 0.86rem;
}

.alert {
    border-radius: 0.8rem;
}

.select2-container {
    width: 100% !important;
    max-width: 100%;
    display: block;
}

/* El contenedor del dropdown se ancla a <body> con position:absolute y left>0;
   forzarlo a width:100% desborda el documento a la derecha y en iOS provoca
   que el viewport panee y el topbar quede cortado. Debe encoger a su contenido. */
body > .select2-container {
    width: auto !important;
}

.select2-container .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    min-height: 44px;
    border: 1px solid #c8ccee;
    border-radius: 0.75rem;
    background: linear-gradient(180deg, #ffffff 0%, #f7f8ff 100%);
    padding: 0.26rem 0.38rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.select2-container .select2-selection--single {
    display: flex;
    align-items: center;
}

.select2-container .select2-selection--single .select2-selection__rendered {
    color: #1d204b;
    font-size: 0.95rem;
    line-height: 1.35;
    padding-left: 0.2rem;
    padding-right: 1.9rem;
}

.select2-container .select2-selection--single .select2-selection__placeholder {
    color: #7a81af;
}

.select2-container .select2-selection--single .select2-selection__arrow {
    height: 100%;
    right: 0.55rem;
}

.select2-container .select2-selection--single .select2-selection__arrow b {
    border-color: #474fa7 transparent transparent transparent;
}

.select2-container--default .select2-selection--multiple {
    padding-right: 1.9rem;
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    display: flex;
    flex-wrap: wrap;
    gap: 0.34rem;
}

.select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field {
    margin-top: 0.3rem;
    margin-left: 0.2rem;
    color: #1d204b;
}

.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: #2f38c6;
    box-shadow: 0 0 0 0.2rem rgba(47, 56, 198, 0.15);
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: #2f38c6;
    box-shadow: 0 0 0 0.2rem rgba(47, 56, 198, 0.15);
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    border: 1px solid #c4c9f1;
    background: linear-gradient(180deg, #edf0ff 0%, #e5e8ff 100%);
    color: #17217a;
    border-radius: 999px;
    padding: 0.2rem 0.56rem;
    font-size: 0.84rem;
    font-weight: 600;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #1a2480;
    margin-right: 0.34rem;
    border-right: 0;
}

.select2-dropdown {
    border: 1px solid #c8ccee;
    border-radius: 0.75rem;
    box-shadow: 0 14px 32px rgba(24, 30, 91, 0.14);
    overflow: hidden;
}

.select2-container--open .select2-dropdown--below {
    margin-top: 0.28rem;
}

.select2-container--open .select2-dropdown {
    max-width: calc(100vw - 1rem);
}

.select2-search--dropdown {
    padding: 0.45rem;
    background: #f6f7ff;
    border-bottom: 1px solid #e2e5fa;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #c8ccee;
    border-radius: 0.55rem;
    min-height: 36px;
    padding: 0.35rem 0.55rem;
    color: #1d204b;
    /* Minimo 16px: evita el auto-zoom de iOS/Safari al enfocar el buscador. */
    font-size: 16px;
}

.select2-container--default .select2-results__option {
    padding: 0.52rem 0.72rem;
    color: #232856;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background: #2f38c6;
    color: #ffffff;
}

.select2-container--default .select2-results__option--selected {
    background: #edeeff;
    color: #17217a;
}

/* Select2 compacto dentro de la barra de filtros */
.filter-card .select2-container--default .select2-selection--single {
    height: 33px;
    font-size: 0.85rem;
}

.filter-card .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 31px;
}

.filter-card .select2-container--default .select2-selection--single .select2-selection__rendered {
    font-size: 0.85rem;
}

/* Selector de estado en linea */
.estado-chip-btn {
    cursor: pointer;
    border: 1px solid color-mix(in srgb, var(--chip-color, #646a8b) 34%, #ffffff);
}

.estado-chip-btn::after {
    margin-left: 0.3rem;
    vertical-align: 0.1em;
}

.estado-selector-menu {
    border-radius: 0.7rem;
    border: 1px solid var(--tf-line);
    box-shadow: 0 12px 26px rgba(11, 18, 77, 0.16);
    min-width: 170px;
    padding: 0.3rem;
    z-index: 1080; /* Por encima de topbar/sidebar y contenedores con scroll. */
}

.estado-selector-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.86rem;
    font-weight: 600;
    border-radius: 0.5rem;
    padding: 0.42rem 0.6rem;
    color: var(--tf-primary);
}

.estado-selector-menu .dropdown-item:hover {
    background: #f6f3ee;
}

.estado-selector-menu .dropdown-item.active {
    background: var(--tf-primary);
    color: #fff;
}

.estado-dot {
    display: inline-block;
    width: 0.62rem;
    height: 0.62rem;
    border-radius: 999px;
    flex-shrink: 0;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                         */
/* ------------------------------------------------------------------ */

@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-105%);
        transition: transform 0.25s ease;
        box-shadow: none;
        width: min(300px, 86vw);
    }

    .app-sidebar.open {
        transform: translateX(0);
        box-shadow: 24px 0 60px rgba(15, 10, 40, 0.4);
    }

    .app-content {
        margin-left: 0;
        width: 100%;
    }

    .content-wrap {
        padding: 1.1rem 0.95rem 0.8rem;
    }

    .kanban-col {
        flex-basis: 262px;
        max-width: 262px;
        max-height: calc(100vh - var(--topbar-h) - 180px);
    }

    .page-title {
        font-size: 1.28rem;
    }

    .navbar-brand {
        font-size: 1.15rem;
    }
}

@media (max-width: 900px) {
    .login-page {
        padding: 0.95rem;
    }

    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-brand {
        padding: 2.2rem;
    }

    .login-brand-top {
        gap: 0.6rem;
    }

    .login-brand-logo {
        width: 44px;
        height: 44px;
    }

    .login-brand h1 {
        max-width: none;
    }

    .login-card {
        padding: 2rem;
    }

    .auth-link-row {
        justify-content: flex-start;
    }
}

@media (max-width: 767px) {
    .login-page {
        padding: 0.62rem;
    }

    .login-shell {
        width: 100%;
        border-radius: 0.98rem;
    }

    .login-brand {
        padding: 1.2rem;
    }

    .login-brand-top {
        gap: 0.5rem;
        margin-bottom: 0.8rem;
    }

    .login-brand::after {
        width: 150px;
        height: 150px;
        right: -48px;
        bottom: -48px;
    }

    .login-brand-logo {
        width: 38px;
        height: 38px;
    }

    .login-badge {
        font-size: 0.68rem;
        padding: 0.3rem 0.55rem;
    }

    .login-brand h1 {
        font-size: clamp(1.35rem, 8vw, 1.85rem);
        letter-spacing: 0.4px;
        margin-top: 0.7rem;
        margin-bottom: 0.55rem;
    }

    .login-brand p,
    .login-brand-org,
    .login-brand-list {
        max-width: none;
        font-size: 0.94rem;
    }

    .login-brand-list {
        margin: 1rem 0 1.2rem;
        padding-left: 1.3rem;
    }

    .login-card {
        padding: 1.15rem;
    }

    .login-card h2 {
        font-size: clamp(1.45rem, 7vw, 1.78rem);
        margin-bottom: 0.45rem;
    }

    .login-subtitle {
        margin-bottom: 0.9rem;
        font-size: 0.94rem;
    }

    .login-card .form-control {
        min-height: 46px;
    }

    .login-card .btn-brand {
        min-height: 46px;
        font-size: 1rem;
    }

    .auth-link-row {
        margin-top: 1rem;
        gap: 0.55rem;
    }

    .navbar-brand {
        gap: 0.48rem;
    }

    .brand-logo {
        width: 38px;
        height: 38px;
    }

    .top-nav .btn.btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.76rem;
    }

    .user-chip-btn {
        padding: 0.28rem 0.52rem;
        font-size: 0.76rem;
    }

    .page-head {
        align-items: stretch;
        flex-direction: column;
    }

    .page-actions {
        justify-content: flex-end;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .stat-icon {
        width: 2.4rem;
        height: 2.4rem;
        font-size: 1.1rem;
    }

    .estado-bar-label {
        width: 92px;
    }

    .app-footer {
        padding: 0.16rem 0.4rem;
        min-height: 22px;
    }

    .app-footer-main {
        justify-content: space-between;
        gap: 0.24rem;
    }

    .app-footer-left,
    .app-footer-right {
        gap: 0.24rem;
    }

    .app-footer-copy,
    .app-footer-note,
    .app-footer-sep,
    .app-footer-link,
    .app-footer-note-mobile {
        font-size: 0.74rem;
    }

    .app-footer-link {
        padding: 0;
    }

    .app-footer-sep,
    .app-footer-note {
        display: none;
    }

    .app-footer-note-mobile {
        display: inline;
    }

    .form-control,
    .form-select,
    textarea {
        min-height: 41px;
    }

    select[multiple] {
        min-height: 140px;
    }

    .table thead th,
    .table tbody td {
        font-size: 0.82rem;
        padding-top: 0.66rem;
        padding-bottom: 0.66rem;
    }

    .table thead th:first-child,
    .table tbody td:first-child {
        width: 52px;
    }

    .table tbody td.text-end {
        gap: 0.3rem;
    }

    .table-footer-block {
        flex-direction: column;
        align-items: stretch;
        margin-inline: 0.7rem;
    }

    .table-pagination {
        justify-content: center;
    }

    .records-totalizer {
        font-size: 0.84rem;
    }

    .table-pagination .page-link {
        min-width: 30px;
        font-size: 0.78rem;
        padding: 0.2rem 0.44rem;
    }

    .btn-icon-only {
        width: 1.9rem;
        height: 1.9rem;
    }
}

/* ------------------------------------------------------------------ */
/* Barra de navegacion inferior (solo vista movil)                     */
/* ------------------------------------------------------------------ */

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    /* Debajo del sidebar (1030) y su backdrop (1029) para que el menu la cubra */
    z-index: 1028;
    display: flex;
    align-items: stretch;
    gap: 0.15rem;
    padding: 0.3rem 0.45rem calc(0.3rem + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(100deg, #131539 0%, #1c1e52 48%, #292b78 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 -12px 30px rgba(10, 13, 52, 0.35);
}

.bottom-nav-link {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.16rem;
    padding: 0.3rem 0.1rem 0.26rem;
    border-radius: 0.65rem;
    color: rgba(233, 234, 255, 0.72);
    text-decoration: none;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-link i {
    font-size: 1.18rem;
    line-height: 1;
}

.bottom-nav-link span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bottom-nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
}

/* El footer queda pegado a la barra: su propio fondo rellena la franja que
   la barra fija cubre, asi no aparece ningun hueco ni contenido debajo. */
@media (max-width: 991.98px) {
    body.has-bottom-nav .app-footer {
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    }
}

.sidebar-backdrop {
    display: none;
}

@media (max-width: 991.98px) {
    .sidebar-backdrop.show {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1029;
        background: rgba(13, 9, 34, 0.55);
        backdrop-filter: blur(2px);
    }
}

/* ------------------------------------------------------------------ */
/* Modo oscuro                                                        */
/* ------------------------------------------------------------------ */

.theme-dark body {
    color: #d7d5f5;
    background: radial-gradient(1200px 650px at 95% -10%, rgba(11, 18, 77, 0.16), transparent 62%),
                linear-gradient(180deg, #0b0a20 0%, #130f2a 100%);
}

.theme-dark h1,
.theme-dark h2,
.theme-dark h3,
.theme-dark h4,
.theme-dark h5,
.theme-dark .page-title {
    color: #eae8ff;
}

.theme-dark .page-subtitle,
.theme-dark .text-muted,
.theme-dark .form-text,
.theme-dark .small.text-muted {
    color: #928dc4 !important;
}

.theme-dark .card {
    background: #1c1738;
    border-color: #2d2652;
}

.theme-dark .card-header {
    background: #221c44;
    border-color: #2d2652;
    color: #d2cff6;
}

.theme-dark .card-footer {
    background: #221c44;
    border-color: #2d2652;
}

.theme-dark .table {
    --bs-table-bg: transparent;
    --bs-table-color: #d2cff6;
    --bs-table-border-color: #2d2652;
    --bs-table-hover-bg: rgba(11, 18, 77, 0.12);
    --bs-table-hover-color: #eae8ff;
}

.theme-dark .entity-list-table th {
    background: #221c44;
    color: #928dc4;
}

.theme-dark .table-footer-block {
    background: #1c1738;
    border-color: #2d2652;
}

.theme-dark .records-totalizer {
    color: #aeaae0;
}

.theme-dark .records-totalizer strong {
    color: #d2cff6;
}

.theme-dark .table-pagination .page-link {
    background: #1c1738;
    border-color: #342c60;
    color: #aeaae0;
}

.theme-dark .table-pagination .page-link:hover {
    background: #2d2652;
    color: #eae8ff;
}

.theme-dark .table-pagination .page-item.disabled .page-link {
    color: #605d8f;
    background: #17122e;
}

.theme-dark .row-vencida {
    background: rgba(239, 68, 68, 0.08);
}

.theme-dark .list-group-item {
    background: transparent;
    border-color: #2d2652;
    color: #d2cff6;
}

.theme-dark .list-group-item-action:hover {
    background: rgba(11, 18, 77, 0.12);
}

.theme-dark .form-control,
.theme-dark .form-select {
    background: #15102c;
    border-color: #342c60;
    color: #dedbff;
}

.theme-dark .form-control:focus,
.theme-dark .form-select:focus {
    background: #15102c;
    color: #dedbff;
    border-color: var(--tf-accent);
}

.theme-dark .form-control::placeholder {
    color: #605d8f;
}

.theme-dark .form-label {
    color: #bcb8ea;
}

.theme-dark .form-check-input {
    background-color: #15102c;
    border-color: #423a70;
}

.theme-dark .form-check-input:checked {
    background-color: var(--tf-primary);
    border-color: var(--tf-primary);
}

.theme-dark .btn-outline-secondary {
    --bs-btn-color: #aeaae0;
    --bs-btn-border-color: #423a70;
    --bs-btn-hover-bg: #2d2652;
    --bs-btn-hover-border-color: #544a90;
    --bs-btn-hover-color: #eae8ff;
}

.theme-dark .btn-outline-primary {
    --bs-btn-color: #bcb8ea;
    --bs-btn-border-color: #423a70;
    --bs-btn-hover-bg: var(--tf-primary);
    --bs-btn-hover-border-color: var(--tf-primary);
}

/* ================================================================
   ASISTENTE IA — Estilos
   ================================================================ */

/* Boton del asistente */
.btn-ai-assist {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.2px;
    padding: 0.45rem 1.05rem 0.45rem 0.5rem;
    background: linear-gradient(135deg, #b794f6 0%, #9b6df0 45%, #7c5cf0 100%);
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
    overflow: hidden;
}

.btn-ai-assist::after {
    content: '';
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(115deg, transparent, rgba(255, 255, 255, 0.38), transparent);
    transform: skewX(-20deg);
    transition: left 0.45s ease;
}

.btn-ai-assist:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(139, 92, 246, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    filter: brightness(1.04);
}

.btn-ai-assist:hover::after {
    left: 125%;
}

.ai-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    font-size: 0.85rem;
}

/* Contenedor del modal (neutro, como el resto de la app) */
.ai-modal-content {
    border-radius: 1.1rem;
    overflow: hidden;
    box-shadow: 0 18px 44px rgba(15, 16, 42, 0.18);
}

/* Header del modal */
.ai-modal-header {
    padding: 1.15rem 1.5rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.ai-modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.ai-modal-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 0.9rem;
    background: #f3ecff;
    color: #7c3aed;
    border: 1px solid #e6d8fc;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.ai-modal-header .modal-title {
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: 0.1px;
    line-height: 1.25;
}

.ai-modal-sub {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--bs-secondary-color);
    margin-top: 0.15rem;
}

.ai-btn-close {
    opacity: 1;
}

/* Cuerpo del modal */
.ai-modal-body {
    padding: 1.4rem 1.5rem 1.6rem;
}

/* Indicador de pasos */
.ai-steps {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
    padding: 0.6rem 0.85rem;
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.9rem;
}

.ai-step {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--bs-secondary-color);
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.ai-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: var(--bs-body-bg);
    color: var(--bs-secondary-color);
    border: 1px solid var(--bs-border-color);
    font-size: 0.78rem;
    transition: all 0.25s ease;
}

.ai-step.active {
    color: var(--tf-primary);
}

.ai-step.active .ai-step-num {
    background: var(--tf-primary);
    color: #fff;
    border-color: var(--tf-primary);
    box-shadow: 0 4px 10px rgba(19, 19, 189, 0.25);
}

.ai-step.completed {
    color: var(--tf-primary);
}

.ai-step.completed .ai-step-num {
    background: #dcfce7;
    color: #15803d;
    border-color: #bbf7d0;
}

.ai-step-divider {
    flex: 1;
    height: 2px;
    background: var(--bs-border-color);
    border-radius: 2px;
}

/* Nota introductoria */
.ai-modal-note {
    color: var(--bs-secondary-color);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.9rem;
}

/* Textarea del asistente (neutro) */
.ai-textarea {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.65rem;
    font-size: 0.95rem;
    line-height: 1.55;
    padding: 0.85rem 1rem;
    resize: vertical;
    min-height: 120px;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.ai-textarea:focus {
    border-color: var(--tf-primary);
    box-shadow: 0 0 0 0.22rem rgba(19, 19, 189, 0.15);
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
}

.ai-textarea::placeholder {
    color: var(--bs-secondary-color);
    opacity: 0.7;
}

.ai-input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.6rem;
}

/* Ejemplos: chips */
.ai-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.ai-example-label {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #9a88c6;
}

.ai-example-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.32rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #6d28d9;
    background: #fff;
    border: 1px solid #e0d2fa;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.06);
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.ai-example-chip i {
    font-size: 0.85rem;
    color: #8b5cf6;
}

.ai-example-chip:hover {
    background: #f1e8ff;
    border-color: #b48fe0;
    color: #5b21b6;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(124, 58, 237, 0.14);
}

/* Boton analizar */
.btn-ai-analyze {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    font-weight: 700;
    background: linear-gradient(135deg, #b794f6 0%, #8b5cf6 100%);
    border-radius: 0.75rem;
    padding: 0.55rem 1.25rem;
    box-shadow: 0 6px 18px rgba(139, 92, 246, 0.3);
    transition: all 0.2s ease;
}

.btn-ai-analyze:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(139, 92, 246, 0.4);
    filter: brightness(1.04);
}

.btn-ai-analyze:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Campo personalizar + boton enviar inline (cuadrado fijo) */
.ai-personalizar-wrap {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

.ai-personalizar-wrap .ai-personalizar {
    flex: 1 1 auto;
    min-width: 0;
}

.ai-refine-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2.6rem;
    height: 2.6rem;
    border: 0;
    border-radius: 0.75rem;
    color: #fff;
    background: linear-gradient(135deg, #a78bfa, #8b5cf6);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
    transition: all 0.2s ease;
}

.ai-refine-send:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.38);
    filter: brightness(1.05);
}

.ai-refine-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.ai-refine-send i {
    font-size: 1.05rem;
}

/* Spinner animado */
.ai-spinner-wrap {
    background: rgba(255, 255, 255, 0.7);
    border: 1px dashed #dcccf8;
    border-radius: 0.9rem;
    padding: 1rem;
}

.spinner-ai {
    display: inline-block;
    width: 2.6rem;
    height: 2.6rem;
    border: 3px solid #e7dcfc;
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: ai-spin 0.7s linear infinite;
}

@keyframes ai-spin {
    to { transform: rotate(360deg); }
}

/* Preview: header */
.ai-preview-header {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.8rem 1rem;
    background: #ecfdf3;
    border: 1px solid #c8f0d7;
    border-radius: 0.9rem;
    color: #15803d;
}

.ai-preview-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #dcfce7;
    color: #16a34a;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.ai-preview-header strong {
    display: block;
    font-size: 0.95rem;
    line-height: 1.2;
}

.ai-preview-sub {
    display: block;
    font-size: 0.78rem;
    color: #3f9d63;
    margin-top: 0.1rem;
}

/* Preview: card */
.ai-preview-card {
    border: 1.5px solid #e9defb;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 10px 26px rgba(76, 29, 149, 0.08);
}

.ai-preview-card .card-body {
    padding: 1.15rem 1.25rem;
}

/* Etiquetas de campo */
.ai-field-label {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: #9a88c6;
    margin-bottom: 0.25rem;
}

/* Preview: campos */
.ai-field {
    font-size: 0.92rem;
    color: #3b2e5e;
    font-weight: 500;
    line-height: 1.45;
    min-height: 1.4rem;
    overflow-wrap: anywhere;
    padding: 0.3rem 0.55rem;
    background: #faf7ff;
    border: 1px solid #efe7fb;
    border-radius: 0.55rem;
}

.ai-field-titulo {
    font-weight: 700;
    font-size: 1rem;
    color: #4c1d95;
}

/* Badges de prioridad */
.ai-priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
}

.ai-priority-badge i {
    font-size: 0.82rem;
}

.ai-p-urgente {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.ai-p-alta {
    background: #ffedd5;
    color: #c2410c;
    border: 1px solid #fed7aa;
}

.ai-p-media {
    background: #fee8c3;
    color: #a16907;
    border: 1px solid #fdd38a;
}

.ai-p-baja {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

/* Checklist visual en preview */
.ai-checklist {
    display: grid;
    gap: 0.45rem;
}

.ai-checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.5rem 0.7rem;
    border: 1px solid #e4dafc;
    border-radius: 0.6rem;
    background: #f8f5ff;
    transition: border-color 0.15s ease;
}

.ai-check-input {
    margin-top: 0.28rem;
    flex-shrink: 0;
    pointer-events: none;
    accent-color: #8b5cf6;
}

.ai-checklist-text {
    font-size: 0.9rem;
    color: #3b2e5e;
    line-height: 1.4;
}

/* Textarea de personalizacion (neutro) */
.ai-personalizar {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.65rem;
    font-size: 0.88rem;
    padding: 0.7rem 0.85rem;
    resize: vertical;
    min-height: 58px;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ai-personalizar:focus {
    border-color: var(--tf-primary);
    box-shadow: 0 0 0 0.18rem rgba(19, 19, 189, 0.15);
}

.ai-personalizar::placeholder {
    color: var(--bs-secondary-color);
    opacity: 0.7;
    font-style: italic;
}

/* Campo de razonamiento (pensamiento de la IA) */
.ai-razon {
    font-style: italic;
    color: #5b21b6;
    font-size: 0.84rem;
    background: #f6efff;
    border-color: #e5d6fb;
}

/* Acciones del preview */
.ai-preview-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 1rem;
    justify-content: flex-end;
}

.ai-preview-actions .btn-outline-secondary {
    margin-right: auto;
}

/* Cuenta regresiva (rate limit) */
.ai-countdown-box {
    border-radius: 0.85rem;
    border: 1.5px solid #fcbc4d;
    background: #fff8eb;
    padding: 0.85rem 1rem;
}

.ai-countdown-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbac24, #f59f0b);
    box-shadow: 0 4px 14px rgba(245, 159, 11, 0.35);
    flex-shrink: 0;
    animation: countdown-pulse 1s ease-in-out infinite;
}

.ai-countdown-num {
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
    text-align: center;
    line-height: 1.1;
}

@keyframes countdown-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

/* Tema oscuro — cuenta regresiva */
.theme-dark .ai-countdown-box {
    background: #2a2010;
    border-color: #6b4400;
}

/* Tema oscuro — asistente */
.theme-dark .ai-modal-badge {
    background: #2a2355;
    color: #c4b5fd;
    border-color: #4a3a70;
}

.theme-dark .ai-example-label {
    color: #a99ad0;
}

.theme-dark .ai-example-chip {
    background: #2a2355;
    border-color: #4a3a70;
    color: #c4b5fd;
}

.theme-dark .ai-example-chip:hover {
    background: #342e66;
    border-color: #7c6bb0;
    color: #ddd6fe;
}

.theme-dark .ai-preview-card {
    background: #1b1948;
    border-color: #35307a;
}

.theme-dark .ai-field-label {
    color: #9a8fd0;
}

.theme-dark .ai-field {
    color: #cec8f0;
    background: #1b1948;
    border-color: #2e2e60;
}

.theme-dark .ai-field-titulo {
    color: #ddd6fe;
}

.theme-dark .ai-preview-header {
    background: #142d24;
    border-color: #1e4a35;
    color: #4ade80;
}

.theme-dark .ai-preview-icon {
    background: #16382a;
    color: #4ade80;
}

.theme-dark .ai-preview-sub {
    color: #5ea87b;
}

.theme-dark .ai-checklist-item {
    background: #1b1a40;
    border-color: #2d4a3a;
}

.theme-dark .ai-checklist-text {
    color: #beb8f0;
}

.theme-dark .ai-razon {
    color: #d5c6fb;
    background: #2a2045;
    border-color: #453271;
}

.theme-dark .ai-spinner-wrap {
    background: rgba(27, 25, 72, 0.6);
    border-color: #3a3270;
}

.theme-dark .spinner-ai {
    border-color: #3a3270;
    border-top-color: #a78bfa;
}

.theme-dark .btn-ai-assist {
    background: linear-gradient(135deg, #7c3aed 0%, #9333ea 45%, #6366f1 100%);
}

.theme-dark .btn-ai-analyze {
    background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
}

.theme-dark .ai-refine-send {
    background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
}

.theme-dark .ai-refine-send:hover {
    filter: brightness(1.08);
}

@media (max-width: 576px) {
    .ai-examples {
        flex-direction: column;
        align-items: flex-start;
    }
}

.theme-dark .dropdown-menu {
    background: #221c44;
    border-color: #342c60;
}

.theme-dark .dropdown-item {
    color: #d2cff6;
}

.theme-dark .dropdown-item:hover {
    background: rgba(11, 18, 77, 0.2);
    color: #fff;
}

.theme-dark .dropdown-divider {
    border-color: #342c60;
}

.theme-dark .user-dropdown-meta strong,
.theme-dark .notif-dropdown-header strong,
.theme-dark .user-dropdown-menu .dropdown-item {
    color: #dedbff;
}

.theme-dark .notif-dropdown-header {
    background: #1c1738;
    border-color: #2d2652;
}

.theme-dark .notif-dropdown-item {
    border-color: #2d2652;
}

.theme-dark .notif-dropdown-item strong {
    color: #dedbff;
}

.theme-dark .notif-dropdown-item:hover {
    background: rgba(11, 18, 77, 0.14);
}

.theme-dark .notif-no-leida {
    background: rgba(11, 18, 77, 0.12);
}

.theme-dark .user-avatar-fallback {
    background: #221c44;
    border-color: #342c60;
    color: #928dc4;
}

.theme-dark .kanban-col {
    background: #14173262;
    background: #1a1534;
    border-color: #2d2652;
}

.theme-dark .kanban-col-title {
    color: #d2cff6;
}

.theme-dark .kanban-col-count {
    background: #221c44;
    border-color: #342c60;
    color: #aeaae0;
}

.theme-dark .kanban-card {
    background: #221c44;
    border-color: #342c60;
}

.theme-dark .kanban-card-title {
    color: #eae8ff;
}

.theme-dark .kanban-card.is-vencida {
    background: #251b3d;
    border-color: #7f2b3f;
}

.theme-dark .kanban-empty {
    border-color: #342c60;
    color: #605d8f;
}

.theme-dark .stat-card {
    background: #1c1738;
    border-color: #2d2652;
}

.theme-dark .stat-value {
    color: #eae8ff;
}

.theme-dark .estado-bar-track {
    background: #221c44;
}

.theme-dark .estado-bar-label,
.theme-dark .estado-bar-value {
    color: #bcb8ea;
}

.theme-dark .detalle-row {
    border-color: #2d2652;
}

.theme-dark .detalle-row > strong {
    color: #dedbff;
}

.theme-dark .comentario-item,
.theme-dark .checklist-item,
.theme-dark .adjunto-item,
.theme-dark .permiso-grupo,
.theme-dark .estado-row,
.theme-dark .modulo-switch {
    background: #1a1534;
    border-color: #2d2652;
}

.theme-dark .comentario-head strong,
.theme-dark .estado-row-name,
.theme-dark .modulo-switch .form-check-label strong {
    color: #dedbff;
}

.theme-dark .comentario-body,
.theme-dark .checklist-titulo,
.theme-dark .tarea-descripcion,
.theme-dark .historial-list li {
    color: #bcb8ea;
}

.theme-dark .checklist-item.is-done {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.25);
}

.theme-dark .adjunto-nombre {
    color: #dedbff;
}

.theme-dark .adjunto-ext {
    background: #2d2652;
    color: #a89aff;
}

.theme-dark .checklist-progress,
.theme-dark .proyecto-progress {
    background: #221c44;
}

.theme-dark .filter-card .form-label {
    color: #928dc4;
}

.theme-dark .app-footer {
    background: linear-gradient(185deg, #191c4a 0%, #14163d 50%, #101231 100%);
    border-color: rgba(255, 255, 255, 0.16);
}

.theme-dark .app-footer-link {
    color: #9ea8ff;
}

.theme-dark .app-footer-link:hover {
    color: #ffffff;
}

.theme-dark .pagination {
    --bs-pagination-bg: #1c1738;
    --bs-pagination-border-color: #342c60;
    --bs-pagination-color: #aeaae0;
    --bs-pagination-hover-bg: #2d2652;
    --bs-pagination-hover-color: #eae8ff;
    --bs-pagination-hover-border-color: #423a70;
    --bs-pagination-disabled-bg: #17122e;
    --bs-pagination-disabled-border-color: #2d2652;
    --bs-pagination-disabled-color: #605d8f;
}

.theme-dark .alert-success {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.3);
    color: #7ce3a4;
}

.theme-dark .alert-danger {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f2a0a0;
}

.theme-dark .alert-info,
.theme-dark .alert-warning {
    background: rgba(11, 18, 77, 0.14);
    border-color: rgba(11, 18, 77, 0.3);
    color: #bcb8ea;
}

.theme-dark .estado-chip,
.theme-dark .proyecto-chip,
.theme-dark .etiqueta-chip {
    background: color-mix(in srgb, var(--chip-color, #646a8b) 22%, #1a143a);
    border-color: color-mix(in srgb, var(--chip-color, #646a8b) 45%, #1a143a);
    color: color-mix(in srgb, var(--chip-color, #646a8b) 70%, #ffffff);
}

.theme-dark .rol-chip,
.theme-dark .posicion-chip {
    background: #221c44;
    border-color: #342c60;
    color: #aeaae0;
}

.theme-dark .notif-icon {
    background: #221c44;
    color: #a89aff;
}

.theme-dark .select2-container--default .select2-selection--single,
.theme-dark .select2-container--default .select2-selection--multiple {
    background: #15102c;
    border-color: #342c60;
}

.theme-dark .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #dedbff;
}

.theme-dark .select2-dropdown {
    background: #221c44;
    border-color: #342c60;
}

.theme-dark .select2-container--default .select2-results__option {
    color: #d2cff6;
}

.theme-dark .select2-container--default .select2-search--dropdown .select2-search__field {
    background: #15102c;
    border-color: #342c60;
    color: #dedbff;
}

.theme-dark .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: #2d2652;
    border-color: #423a70;
    color: #dedbff;
}

.theme-dark #calendarioTareas {
    --fc-border-color: #2d2652;
    --fc-page-bg-color: transparent;
    --fc-neutral-bg-color: #221c44;
    --fc-list-event-hover-bg-color: rgba(11, 18, 77, 0.14);
    --fc-today-bg-color: rgba(11, 18, 77, 0.14);
}

.theme-dark #calendarioTareas .fc-col-header-cell-cushion,
.theme-dark #calendarioTareas .fc-daygrid-day-number,
.theme-dark #calendarioTareas .fc-toolbar-title,
.theme-dark #calendarioTareas .fc-list-day-text,
.theme-dark #calendarioTareas .fc-list-day-side-text {
    color: #d2cff6;
}

.theme-dark .estados-sortable .estado-row-grip {
    color: #605d8f;
}

/* Modo oscuro: refuerzos de legibilidad */

.theme-dark a {
    color: #a89aff;
}

.theme-dark a:hover {
    color: #ccc3ff;
}

.theme-dark .proyecto-card-title,
.theme-dark .depto-card-title,
.theme-dark .adjunto-nombre,
.theme-dark .kanban-card-title,
.theme-dark .table .fw-semibold,
.theme-dark .list-group-item .fw-semibold {
    color: #eae8ff;
}

.theme-dark .proyecto-card-title:hover,
.theme-dark .kanban-card-title:hover,
.theme-dark .adjunto-nombre:hover {
    color: #ccc3ff;
}

.theme-dark .table a.fw-semibold,
.theme-dark .list-group-item a.fw-semibold {
    color: #dedbff;
}

.theme-dark .stat-label,
.theme-dark .detalle-row > span,
.theme-dark .depto-count,
.theme-dark .kanban-card-user,
.theme-dark .kanban-card-date,
.theme-dark .kanban-card-meta,
.theme-dark .permiso-grupo-title,
.theme-dark .historial-fecha,
.theme-dark .comentario-head span,
.theme-dark .notif-empty,
.theme-dark .adjunto-detalle,
.theme-dark .notif-dropdown-item span,
.theme-dark .proyecto-card-desc,
.theme-dark .modulo-switch .form-check-label span {
    color: #928dc4;
}

.theme-dark .form-check-label,
.theme-dark .form-check-label strong {
    color: #d2cff6;
}

.theme-dark .checklist-badge {
    background: #221c44;
    border-color: #342c60;
    color: #aeaae0;
}

.theme-dark .checklist-badge.is-complete {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.3);
    color: #7ce3a4;
}

.theme-dark .form-select option {
    background: #15102c;
    color: #dedbff;
}

.theme-dark .estados-sortable .estado-row .badge.text-bg-light {
    background: #2d2652 !important;
    color: #aeaae0 !important;
    border-color: #423a70 !important;
}

.theme-dark .badge.text-bg-light {
    background: #2d2652 !important;
    color: #aeaae0 !important;
}

.theme-dark .select2-container--default .select2-selection__placeholder {
    color: #605d8f;
}

.theme-dark .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-top-color: #928dc4;
}

.theme-dark .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-bottom-color: #928dc4;
}

.theme-dark .select2-container--default .select2-results__option[aria-selected="true"]:not(.select2-results__option--highlighted) {
    background: #2d2652;
}

/* SweetAlert2 en modo oscuro */

.theme-dark .swal2-popup {
    background: #221c44;
    color: #dedbff;
}

.theme-dark .swal2-title {
    color: #eae8ff;
}

.theme-dark .swal2-html-container {
    color: #bcb8ea;
}

.theme-dark .swal2-toast {
    background: #221c44 !important;
    color: #dedbff !important;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5) !important;
}

.theme-dark .swal2-toast .swal2-title {
    color: #dedbff;
}

.theme-dark .swal2-timer-progress-bar {
    background: rgba(168, 154, 255, 0.5);
}

/* FullCalendar: refuerzos oscuros */

.theme-dark #calendarioTareas .fc-daygrid-day.fc-day-other .fc-daygrid-day-number {
    color: #605d8f;
}

.theme-dark #calendarioTareas .fc-list-event-title a,
.theme-dark #calendarioTareas .fc-list-event-time {
    color: #d2cff6;
}

.theme-dark #calendarioTareas .fc-list-empty {
    background: #1c1738;
    color: #928dc4;
}

/* FullCalendar: refuerzos oscuros para la vista movil */

.theme-dark #calendarioTareas .fc-footer-toolbar {
    background: rgba(28, 23, 56, 0.92);
    border-color: #2d2652;
}

.theme-dark #calendarioTareas .fc-popover {
    background: #221c44;
    border-color: #342c60;
}

.theme-dark #calendarioTareas .fc-popover-header {
    background: #1c1738;
    color: #eae8ff;
}

.theme-dark #calendarioTareas .fc-movil-evento-titulo {
    color: #eae8ff;
}

.theme-dark #calendarioTareas .fc-movil-evento-meta {
    color: #928dc4;
}

/* ------------------------------------------------------------------ */
/* Modo oscuro: variables base de Bootstrap (cobertura global)        */
/* Con data-bs-theme="dark" + estas variables, TODO componente        */
/* (tarjetas, tablas, textos sueltos, forms, dropdowns) hereda bien.  */
/* ------------------------------------------------------------------ */

.theme-dark,
.theme-dark[data-bs-theme="dark"] {
    --bs-body-color: #d7d5f5;
    --bs-body-color-rgb: 213, 219, 245;
    --bs-body-bg: #110d26;
    --bs-body-bg-rgb: 13, 15, 38;
    --bs-emphasis-color: #e8e9f4;
    --bs-emphasis-color-rgb: 238, 240, 255;
    --bs-secondary-color: #928dc4;
    --bs-secondary-color-rgb: 141, 150, 196;
    --bs-secondary-bg: #221c44;
    --bs-tertiary-color: #6d6b94;
    --bs-tertiary-bg: #1c1738;
    --bs-border-color: #2d2652;
    --bs-border-color-translucent: rgba(255, 255, 255, 0.08);
    --bs-heading-color: #eae8ff;
    --bs-link-color: #a89aff;
    --bs-link-color-rgb: 154, 165, 255;
    --bs-link-hover-color: #ccc3ff;
    --bs-link-hover-color-rgb: 195, 201, 255;
    --bs-code-color: #f2a0d0;
}

.theme-dark .card {
    --bs-card-color: #d2cff6;
    --bs-card-title-color: #eae8ff;
    --bs-card-subtitle-color: #928dc4;
    --bs-card-cap-color: #d2cff6;
}

.theme-dark .list-group {
    --bs-list-group-color: #d2cff6;
    --bs-list-group-bg: transparent;
    --bs-list-group-border-color: #2d2652;
    --bs-list-group-action-color: #d2cff6;
    --bs-list-group-action-hover-color: #eae8ff;
    --bs-list-group-action-hover-bg: rgba(11, 18, 77, 0.1);
}

.theme-dark .dropdown-menu {
    --bs-dropdown-color: #d2cff6;
    --bs-dropdown-bg: #221c44;
    --bs-dropdown-link-color: #d2cff6;
    --bs-dropdown-link-hover-color: #ffffff;
    --bs-dropdown-link-hover-bg: rgba(11, 18, 77, 0.18);
    --bs-dropdown-border-color: #342c60;
    --bs-dropdown-divider-bg: #342c60;
    --bs-dropdown-header-color: #928dc4;
}

.theme-dark .progress {
    --bs-progress-bg: #221c44;
}

.theme-dark strong,
.theme-dark b {
    color: inherit;
}

.theme-dark .card-body,
.theme-dark .card-body p,
.theme-dark .card-body li {
    color: #d2cff6;
}

.theme-dark .card-body .text-muted,
.theme-dark .card-body .form-text {
    color: #928dc4 !important;
}

/* ------------------------------------------------------------------ */
/* Notificaciones: fix de desborde en movil                           */
/* ------------------------------------------------------------------ */

/* Red segura para todo tamano */
.notif-dropdown {
    max-width: calc(100vw - 1rem);
}

@media (max-width: 767px) {
    .notif-dropdown {
        position: fixed !important;
        top: 3.7rem !important;
        right: 0.6rem !important;
        width: min(360px, calc(100vw - 1.2rem)) !important;
        max-width: calc(100vw - 1.2rem) !important;
        transform: none !important;
    }
}

/* Evita que textos largos desborden horizontalmente */
.notif-dropdown-item strong,
.notif-dropdown-item span,
.notif-item .flex-grow-1,
.notif-item .text-muted {
    overflow-wrap: anywhere;
    word-break: break-word;
}
