/* ============================================
   ESTILOS GLOBALES
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4361ee;
    --primary-dark: #3451d1;
    --primary-light: #7b94ff;
    --secondary: #64748b;
    --success: #2f9e44;
    --warning: #f08c00;
    --danger: #e03131;
    --bg: #f0f2f7;
    --card-bg: #ffffff;
    --text: #1a1d2e;
    --text-light: #64748b;
    --border: #d8dce8;
    --shadow: 0 2px 8px rgba(26, 29, 46, 0.08);
    --shadow-lg: 0 6px 18px rgba(26, 29, 46, 0.12);
    --shadow-xl: 0 12px 28px rgba(26, 29, 46, 0.16);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

/* Ocultar app hasta tener usuario y visibilidad por rol (evita ver “ocultar” menú/tareas al iniciar sesión) */
body.app-loading .app-wrapper {
    opacity: 0;
    pointer-events: none;
}

.app-wrapper {
    background: var(--bg);
    transition: opacity 0.15s ease-out;
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #f3f4f6;
}

.login-container {
    width: 100%;
    max-width: 980px;
    padding: 20px;
}

.login-card {
    background: var(--card-bg);
    padding: 0;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.login-logo {
    display: block;
    max-width: 120px;
    width: 100%;
    height: auto;
    margin: 0;
}

.login-card-pro {
    border: 1px solid var(--border);
    box-shadow: 0 12px 36px rgba(31, 34, 38, 0.18);
}

.login-shell {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    min-height: 520px;
}

.login-panel {
    padding: 40px;
}

.login-panel-left {
    background: #f7f7f8;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 30px;
}

.login-panel-right {
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 24px;
}

.login-hero {
    text-align: center;
}

.login-hero h1 {
    margin: 0 0 12px;
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
}

.login-subtitle {
    margin: 0;
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
}

.login-illustration {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-illustration img {
    max-width: 320px;
    width: 100%;
    height: auto;
    opacity: 0.98;
}

.login-form-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}

.login-form-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.login-footer {
    margin-top: 8px;
}

.btn-block {
    width: 100%;
}

.btn-outline {
    background: #ffffff;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background: #f4f5f6;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-light);
    font-size: 13px;
    margin: 16px 0;
}

.login-divider::before,
.login-divider::after {
    content: '';
    height: 1px;
    background: var(--border);
    flex: 1;
}

@media (max-width: 900px) {
    .login-container {
        max-width: 520px;
    }

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

    .login-panel-left {
        display: none;
    }
}
.login-card h1 {
    color: var(--primary);
    margin-bottom: 10px;
    text-align: center;
}

.login-card .subtitle {
    color: var(--text-light);
    text-align: center;
    margin-bottom: 30px;
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.3px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 13px;
    font-family: inherit;
    background: #fbfcfd;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #9aa0a6;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: #c7cbd1;
    background: #ffffff;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.area-item {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.area-item .area-select {
    flex: 1;
}

.remove-area-btn {
    flex-shrink: 0;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(84, 88, 95, 0.12);
}

/* Select pequeño para estados en tablas */
.form-control-sm {
    padding: 6px 10px;
    font-size: 12px;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    min-width: 120px;
}

.form-control-sm:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(84, 88, 95, 0.12);
}

/* Checkbox urgente */
.form-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary);
}

.form-group label[for="tareaUrgente"] {
    user-select: none;
    transition: all 0.2s;
}

.form-group label[for="tareaUrgente"]:hover {
    background: #ffe69c !important;
    border-color: #ff9800 !important;
}

.form-group label[for="tareaUrgente"] input[type="checkbox"]:checked + span {
    color: #d32f2f !important;
    font-weight: 900 !important;
}

.inline-check-label {
    color: var(--text);
    font-weight: 500;
    font-size: 13px;
}

.inline-check-label span {
    color: var(--text);
    font-weight: 500;
}

.inline-check-label input:checked + span {
    color: var(--text);
    font-weight: 500;
}

.multi-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fbfcfd;
    font-size: 13px;
    font-family: inherit;
    min-height: 42px;
}

.multi-select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(84, 88, 95, 0.12);
}

.multi-select option {
    padding: 6px 8px;
}

.tarea-areas-list {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #ffffff;
    max-height: 180px;
    overflow: auto;
}

.tarea-areas-empty {
    color: var(--text-light);
    font-size: 12px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-light);
    font-size: 12px;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn .lucide-icon {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    vertical-align: text-bottom;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border-color: rgba(0, 0, 0, 0.12);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f3f5f7;
    color: var(--text);
    border-color: #e1e4e8;
}

.btn-secondary:hover {
    background: #e9ecef;
}

.btn-conjunto {
    background: #ffffff;
    border: 1px dashed #c3c7cd;
    color: var(--text);
}

.btn-conjunto:hover {
    background: #f5f6f8;
    border-color: #b7bcc3;
}

.btn-warning {
    background: var(--warning);
    color: white;
    border-color: rgba(0, 0, 0, 0.12);
}

.btn-warning:hover {
    background: #d97706;
}

.btn-danger {
    background: var(--danger);
    color: white;
    border-color: rgba(0, 0, 0, 0.12);
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 11px;
    border-radius: 8px;
}

/* ============================================
   APP LAYOUT
   ============================================ */

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: #16181d;
    color: #eef0f2;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 10px 0 30px rgba(15, 16, 18, 0.18);
}

.sidebar-header {
    padding: 18px 18px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    background: #ffffff;
    border-radius: 6px;
    padding: 4px;
}

.sidebar-brand-text {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.sidebar-brand-text,
.sidebar-username {
    color: #f2f4f6;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    background: #ffffff;
    border-radius: 6px;
    padding: 4px;
    border: 1px solid var(--border);
}

.sidebar-profile {
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
    color: #ffffff;
    overflow: hidden;
}

.sidebar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.sidebar-user-info {
    flex: 1;
}

.sidebar-welcome {
    font-size: 11px;
    opacity: 0.8;
}

.sidebar-username {
    font-size: 13px;
}

.sidebar-username {
    font-weight: 600;
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
}

.sidebar-nav-item {
    width: calc(100% - 24px);
    margin: 4px 12px;
    padding: 10px 14px;
    background: none;
    border: none;
    color: #e7eaee;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    border-radius: 10px;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.nav-count {
    margin-left: auto;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    color: #f2f4f7;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-nav-item.nav-task {
    position: relative;
}

.sidebar-nav-item.nav-task::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 999px;
    margin-left: auto;
    display: inline-block;
    background: rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.sidebar-nav-item.nav-task .nav-icon {
    border-radius: 8px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-nav-item.nav-task-mine .nav-icon {
    background: rgba(255, 255, 255, 0.18);
}

.sidebar-nav-item.nav-task-assigned .nav-icon {
    background: rgba(255, 255, 255, 0.12);
}

.sidebar-nav-item.nav-task-completed .nav-icon {
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-nav-item.nav-task-mine::after {
    background: rgba(255, 255, 255, 0.75);
}

.sidebar-nav-item.nav-task-assigned::after {
    background: rgba(255, 255, 255, 0.5);
}

.sidebar-nav-item.nav-task-completed::after {
    background: rgba(255, 255, 255, 0.25);
}

.nav-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
}

.nav-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.sidebar-nav-item:hover .nav-icon,
.sidebar-nav-item.active .nav-icon {
    opacity: 1;
}

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

.sidebar-nav-item.active {
    background: rgba(67, 97, 238, 0.15);
    color: #ffffff;
    box-shadow: inset 3px 0 0 var(--primary);
}

.sidebar-footer {
    padding: 16px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logout {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #eef0f2;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
}

.sidebar-logout:hover {
    background: rgba(255, 255, 255, 0.16);
}

/* Main Content */
.main-content-wrapper {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
}

.top-header {
    background: #ffffff;
    padding: 16px 24px;
    border-bottom: 1px solid #e6e8eb;
    box-shadow: 0 6px 18px rgba(31, 34, 38, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title {
    font-size: 20px;
    color: var(--text);
    font-weight: 600;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-user #headerUserName {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
}

.header-user-role {
    background: #eef0ff;
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    letter-spacing: 0.2px;
    border: 1px solid #c5cef8;
}

.content-area {
    flex: 1;
    padding: 24px;
    background: var(--bg);
}

.view-content {
    display: none;
}

.view-content.active {
    display: block;
}

.view-header {
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.view-header .btn {
    box-shadow: 0 6px 16px rgba(31, 34, 38, 0.12);
}

/* ============================================
   TABLES
   ============================================ */

.table-container {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: var(--shadow);
    border: 1px solid #e6e8eb;
    overflow: hidden;
    overflow-x: auto;
    margin-bottom: 20px;
}

.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-thumb {
    background: rgba(61, 63, 68, 0.25);
    border-radius: 999px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f2f4;
}

.card {
    background: #ffffff;
    border: 1px solid #e6e8eb;
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 18px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

.data-table thead {
    background: #f3f5f7;
    color: var(--text);
}

.data-table thead th {
    border-bottom: 1px solid #d5d9e0;
}

.data-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #5a6169;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #d6dbe2;
    color: #2b2f33;
    font-size: 13px;
}

/* Descripciones con altura fija y múltiples líneas */
.data-table td:nth-child(2) {
    max-width: 300px;
    min-height: 60px;
    max-height: 120px;
    overflow-y: auto;
    overflow-x: hidden;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    line-height: 1.4;
    vertical-align: top;
}

/* Asegurar que todas las celdas tengan altura mínima consistente */
.data-table td {
    min-height: 50px;
    vertical-align: top;
}

.data-table tbody tr:hover {
    background: #f6f7f9;
}

.name-strong {
    font-weight: 700;
    color: #23272b;
}

.responsables-detail {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11px;
    color: var(--text-light);
}

.responsables-count {
    background: #f0f2f5;
    color: #50565c;
    padding: 2px 6px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 10px;
}

.responsables-names {
    color: var(--text-light);
}

/* Columna Responsable: límite horizontal para que no desborde si hay mucho texto o salto de línea */
.task-responsable-cell {
    max-width: 200px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.data-table tbody tr {
    transition: background 0.2s ease;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:nth-child(even) {
    background: #fbfcfd;
}

/* Enlaces en tablas (forzar color de tema sobre estilos inline) */
.data-table a {
    color: var(--primary) !important;
    text-decoration: none;
    font-weight: 600;
}

.data-table a:hover {
    text-decoration: underline;
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.badge-success {
    background: var(--success);
    color: white;
}

.badge-danger {
    background: var(--danger);
    color: white;
}

.badge-warning {
    background: #fff8e6;
    color: #92620a;
    border: 1px solid #fde8a3;
}

.badge-info {
    background: #fff0e6;
    color: #c05621;
    border: 1px solid #fbd38d;
}

.badge-secondary {
    background: #64748b;
    color: #ffffff;
}

/* Estado de tareas (scoped) */
.badge.tarea-estado-badge--pendiente { background: #fff3cd; color: #856404; }
.badge.tarea-estado-badge--proceso { background: #cce5ff; color: #0a58ca; }
.badge.tarea-estado-badge--ajuste { background: #6c757d; color: #ffffff; }
.badge.tarea-estado-badge--completada { background: #d4edda; color: #155724; }
.badge.tarea-estado-badge--default { background: #e9ecef; color: #495057; }

.tarea-mi-estado-label { font-size: 0.9em; color: var(--text-light, #6c757d); margin-right: 4px; }
.ver-estados-conjunto-popup .table { width: 100%; margin-top: 8px; }
.ver-estados-conjunto-popup .progress { height: 20px; background: #e9ecef; border-radius: 8px; overflow: hidden; }

/* Celda estado en Mis tareas: select + botón Ver estados alineados */
.mis-tareas-estado-cell-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.mis-tareas-estado-cell-wrap .form-control-sm { width: auto; min-width: 120px; flex-shrink: 0; }
.mis-tareas-estado-cell-wrap .ver-estados-conjunto-btn {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
}

/* Tarea en conjunto en Pendiente pero alguien ya trabaja: color azul "En proceso", en tabla Pendiente. Sin cambiar color al pasar el cursor. */
#misTareasPendientesBody tr.mis-tareas-pendiente-otros-en-proceso,
#misTareasPendientesBody tr.mis-tareas-pendiente-otros-en-proceso:hover {
    background-color: #e8f0fe !important;
    border-left: 4px solid #4361ee !important;
}

/* Contenedor estado + botón Ver estados (Tareas Asignadas, Todas las tareas, etc.) */
.estado-y-ver-estados-wrap {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* Botón Ver estados (todos los tableros): mismo estilo que en Mis tareas */
.ver-estados-conjunto-btn {
    vertical-align: middle;
    white-space: nowrap;
    font-size: 0.8rem;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
}

/* Mis Tareas: filas de la sección "En proceso" siempre en azul (orden visual) */
#misTareasProcesoBody tr.estado-en-proceso {
    background-color: #e8f0fe !important;
    border-left: 4px solid #4361ee !important;
}

/* Tareas completadas (Líder): fila aprobada = verde pastel */
#tareas-completadas tr.tareas-completadas-fila-aprobada,
#tareas-completadas tr.tareas-completadas-fila-aprobada:hover {
    background-color: #d4edda !important;
    border-left: 4px solid #2f9e44;
}

/* Tareas completadas: espacio entre botones Ver Detalles / Aprobar */
/* Filtros Mes / Semana: separados del borde sin exagerar */
#tareas-completadas .tareas-completadas-week-filters {
    padding-left: 14px;
    padding-top: 6px;
}

#tareas-completadas .tareas-completadas-acciones-btns {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 4px 0;
}

#tareas-completadas .tareas-completadas-acciones-btns .btn {
    margin-left: 0;
}

#tareas-completadas .tarea-link-cell {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}
#tareas-completadas .tarea-link-cell:hover {
    text-decoration: underline;
}

/* ============================================
   CHAT FLOTANTE IA
   ============================================ */

.ai-chat {
    position: fixed;
    left: 24px;
    bottom: 90px;
    z-index: 1200;
    font-family: inherit;
}

.ai-chat-button {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--primary-light);
    color: #ffffff;
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-chat-panel {
    position: absolute;
    left: 0;
    bottom: 64px;
    width: 320px;
    max-height: 420px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.ai-chat-panel.active {
    display: flex;
}

.ai-chat-header {
    padding: 12px 14px;
    background: #f6f7f8;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-chat-title {
    font-weight: 600;
    color: var(--text);
}

.ai-chat-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    font-size: 16px;
}

.ai-chat-messages {
    padding: 12px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-chat-message {
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.4;
}

.ai-chat-message.user {
    align-self: flex-end;
    background: var(--primary);
    color: #ffffff;
}

.ai-chat-message.assistant {
    align-self: flex-start;
    background: #f2f3f5;
    color: var(--text);
}

.ai-chat-input {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid var(--border);
    background: #ffffff;
}

.ai-chat-input input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
}

.ai-chat-input button {
    border: none;
    background: var(--primary);
    color: #ffffff;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
}

/* ============================================
   MODALS
   ============================================ */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(20, 22, 26, 0.55);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 16px;
    width: 90%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid #e6e8eb;
    box-shadow: var(--shadow-xl);
}

.modal-content h2 {
    margin-bottom: 18px;
    color: var(--text);
    font-size: 18px;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
}

.close:hover {
    color: var(--text);
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 18px;
}

/* ============================================
   ERROR MESSAGE
   ============================================ */

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 4px;
    margin-top: 15px;
}

/* Botones de Google (override de inline styles) */
#googleLoginBtn,
#connectGoogleBtn {
    background: var(--card-bg) !important;
    color: #ffffff !important;
    border: 1px solid var(--border) !important;
}

#googleLoginBtn,
#connectGoogleBtn {
    color: var(--text) !important;
}

.google-logo {
    width: 18px;
    height: 18px;
    display: inline-block;
}

#googleConnected {
    color: var(--primary) !important;
}

label[for="tareaUrgente"] {
    background: #fff3cd !important;
    border-color: #ffc107 !important;
}

label[for="tareaUrgente"] span {
    color: #856404 !important;
    font-weight: 700 !important;
}

label[for="tareaImportante"] {
    background: #d1ecf1 !important;
    border-color: #17a2b8 !important;
}

label[for="tareaImportante"] span {
    color: #0c5460 !important;
    font-weight: 700 !important;
}


/* ============================================
   SECCIONES COLAPSABLES DE TAREAS
   ============================================ */

.tareas-secciones-container {
    width: 100%;
}

.tarea-section {
    margin-bottom: 20px;
}

.tarea-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s, box-shadow 0.2s;
}

.tarea-section-header:hover {
    background: #f8f9fa;
    box-shadow: var(--shadow);
}

.tarea-section-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.section-toggle-icon {
    font-size: 12px;
    transition: transform 0.2s;
    color: var(--text-light);
    margin-right: 8px;
}

.tarea-section-content {
    margin-bottom: 20px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tarea-section-content table {
    width: 100%;
    margin-top: 10px;
    border-collapse: collapse;
}

.tarea-section-content table thead {
    background: var(--bg);
}

.tarea-section-content table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text);
    border-bottom: 2px solid var(--border);
}

.tarea-section-content table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.tarea-section-content table tbody tr:hover {
    background: #f8f9fa;
}

/* ============================================
   MIS TAREAS - TABLEROS
   ============================================ */

.task-board {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    margin-bottom: 16px;
    background: #fff;
    overflow: hidden;
}

.task-board-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.task-board-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
}

.task-board-count {
    font-weight: 700;
    font-size: 12px;
    color: var(--text-light);
}

.task-board-toggle {
    border: 0;
    background: #ffffff;
    color: var(--text);
    width: 26px;
    height: 26px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.task-board-body {
    max-height: 560px;
    overflow: hidden;
    opacity: 1;
    transition: none;
}

/* Contenedor con scroll: tabla directa dentro para que sticky thead funcione */
.task-board-scroll {
    overflow: auto;
    max-height: 500px;
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--shadow);
    border: 1px solid #e6e8eb;
}

.task-board-scroll .task-board-table {
    margin-bottom: 0;
}

.task-board.transition-enabled .task-board-body {
    transition: max-height 0.2s ease, opacity 0.2s ease;
}

.task-board.collapsed .task-board-body {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

/* Cabeceras fijas al hacer scroll (tabla directa dentro de .task-board-scroll) */
.task-board-scroll .task-board-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f3f5f7;
    box-shadow: 0 1px 0 0 #d5d9e0;
}

/* Bloque descripción fijo en tarjetas de tareas (Mis tareas, Ajustes) */
.task-desc-wrap {
    display: block;
    min-height: 92px; /* clip 72px + línea "Ver más" ~20px: evita tic al mostrar el enlace */
}
.task-desc-clip {
    max-height: 72px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-clamp: 3;
}
.task-desc-text {
    display: block;
}
.ver-mas-desc {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    margin-top: 4px;
    display: inline-block;
    visibility: hidden;
    pointer-events: none;
    min-height: 18px;
}
.ver-mas-desc.visible {
    visibility: visible;
    pointer-events: auto;
}
.ver-mas-desc:hover { text-decoration: underline; color: var(--primary-dark); }

/* ============================================
   FILTROS DE BÚSQUEDA EN TAREAS
   ============================================ */

.task-filter-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 10px 0 16px;
}

.task-filter-input {
    min-width: 240px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #ffffff;
    font-size: 13px;
    color: var(--text);
}

.task-filter-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.12);
}

.task-title-cell {
    font-weight: 700;
}

/* ============================================
   TAREAS ASIGNADAS - FILTRO POR PERSONA
   ============================================ */

.assigned-users-filter {
    margin-bottom: 18px;
}

.assigned-users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.assigned-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border 0.2s ease;
}

.assigned-user-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.assigned-user-card.active {
    border-color: var(--primary);
    background: rgba(67, 97, 238, 0.04);
}

.assigned-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.08);
    color: var(--text);
    overflow: hidden;
    flex-shrink: 0;
}

.assigned-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.assigned-user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.assigned-user-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
}

.assigned-user-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.assigned-user-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.08);
    color: var(--text);
}

/* Badge de aprobada */
.badge-success {
    background: var(--success);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   FILTROS TIPO EXCEL (COLUMNAS)
   ============================================ */

.data-table thead th {
    position: relative;
}

.data-table thead th.has-column-filter {
    padding-right: 28px;
}

.column-filter-btn {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 0;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
}

.column-filter-btn.active {
    color: var(--primary);
}

.column-filter-menu {
    position: absolute;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    padding: 12px;
    min-width: 220px;
    z-index: 1000;
}

.column-filter-search {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 8px;
}

.column-filter-options {
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.column-filter-option {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.column-filter-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.column-filter-actions .btn {
    flex: 1;
    padding: 6px 8px;
    font-size: 12px;
}

/* ============================================
   UTILITIES
   ============================================ */

.admin-only,
.leader-only,
.responsable-only {
    display: none;
}

.responsible-only {
    display: none;
}

/* ============================================
   HISTORIAL
   ============================================ */

.historial-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.historial-stat {
    background: var(--card-bg);
    border: 1px solid #e6e8eb;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 11px;
    color: var(--text);
}

.historial-grid {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

.historial-month {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ============================================
   NOTIFICACIONES
   ============================================ */

/* Próxima reunión (solo la más cercana) al lado de la campanita */
.header-next-meeting {
    flex-shrink: 0;
    max-width: 220px;
}
.header-next-meeting.hidden { display: none !important; }
.header-next-meeting-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    background: #fff;
    color: var(--text, #1f2226);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.15s, border-color 0.15s;
}
.header-next-meeting-btn:hover {
    background: #f0f4ff;
    border-color: var(--primary);
}
.header-next-meeting-btn i { font-size: 14px; color: var(--primary); flex-shrink: 0; }
.header-next-meeting-text { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 768px) {
    .header-next-meeting { max-width: 140px; }
    .header-next-meeting-text { font-size: 12px; }
}

.notif-wrapper {
    position: relative;
    display: inline-block;
}

.notif-bell {
    position: relative;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 10px;
}

.notif-bell:hover {
    background: rgba(0, 0, 0, 0.05);
}

.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: #ff3b30;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.chat-sidebar-badge {
    position: static;
    margin-left: auto;
}

.hidden {
    display: none !important;
}

.notif-dropdown {
    position: absolute;
    top: 46px;
    right: 0;
    width: 360px;
    max-width: 90vw;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 9999;
}

.notif-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.notif-title {
    font-weight: 800;
    font-size: 14px;
}

.notif-markall {
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
}

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

.notif-item.notification-unread {
    background: #f0f4ff;
    border-left: 3px solid var(--primary);
}

.notif-item.notification-unread:hover {
    background: #e8eeff;
}

.notif-item-icon {
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.notif-group {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.notif-group-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: none;
    background: #f8fafc;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    text-align: left;
    transition: background 0.15s;
}

.notif-group-header:hover {
    background: #f1f5f9;
}

.notif-group-label {
    flex: 1;
}

.notif-group-chevron {
    font-size: 10px;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.notif-group-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    visibility: hidden;
}

.notif-group-body.expanded {
    max-height: 400px;
    overflow-y: auto;
    visibility: visible;
}

.notif-group-body .notif-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.notif-bell.bell-shake {
    animation: bellShake 0.6s ease;
}

@keyframes bellShake {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(12deg); }
    50% { transform: rotate(-12deg); }
    75% { transform: rotate(6deg); }
    100% { transform: rotate(0deg); }
}

.notif-push {
    padding: 10px 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: #fafbfc;
}

.notif-enable {
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #fff;
    border-radius: 12px;
    padding: 8px 12px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
}

.notif-enable:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.notif-item {
    padding: 12px 14px;
    display: flex;
    gap: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
}

.notif-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

.notif-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-top: 4px;
    background: var(--primary);
    flex: 0 0 auto;
}

.notif-item.read .notif-dot {
    background: rgba(0, 0, 0, 0.15);
}

.notif-body {
    flex: 1;
}

.notif-item-title {
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 2px;
}

.notif-item-msg {
    font-size: 12px;
    opacity: 0.85;
    line-height: 1.2;
}

.notif-item-time {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 6px;
}

.notif-foot {
    padding: 10px 14px;
}

.notif-viewall {
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #fff;
    border-radius: 12px;
    padding: 10px;
    font-weight: 800;
    cursor: pointer;
}

.notif-loadmore-wrap {
    padding: 8px 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.notif-loadmore-wrap.hidden {
    display: none;
}

.notif-loadmore {
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #f5f5f5;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
}

.historial-month-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.historial-month-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 12px;
}

.historial-date-card {
    border: 1px solid #e6e8eb;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 12px 14px;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(31, 34, 38, 0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.historial-date-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(31, 34, 38, 0.12);
    background: #fafbfc;
}

.historial-date-card.active {
    border-color: var(--primary);
    background: #f0f4ff;
}

.historial-date-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.historial-date-sub {
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-light);
}

.historial-date-meta {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.historial-pill {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eceff2;
    color: var(--text);
}

.historial-pill-warn {
    background: #e1e4e8;
}

.historial-details {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
}

.historial-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.historial-date-count {
    font-size: 12px;
    color: var(--text-light);
}

.historial-task-list {
    display: grid;
    gap: 12px;
    padding-top: 4px;
}

.historial-modal-content {
    max-width: 760px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 24px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.historial-modal-list {
    max-height: 420px;
    padding-right: 6px;
}

.historial-details-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.historial-details-header h4 {
    font-size: 16px;
    font-weight: 600;
}

.historial-date-count {
    font-size: 11px;
    color: var(--text-light);
}

.historial-task-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    background: #f9fafb;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.historial-task-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.historial-task-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    font-size: 15px;
}

.historial-task-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-light);
}

.historial-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.historial-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 12px;
}

.historial-link:hover {
    text-decoration: underline;
}

.simplebar-scrollbar:before {
    background: var(--primary-light);
}

.simplebar-track.simplebar-vertical {
    width: 10px;
}

.tarea-section-content.no-animate {
    animation: none;
}

.historial-task-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    background: #ffffff;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.historial-task-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.historial-task-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-light);
}

.historial-task-side {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.historial-task-meta span {
    background: #f1f3f5;
    padding: 4px 8px;
    border-radius: 999px;
}

.historial-task-side .historial-badge {
    padding: 5px 10px;
}

.historial-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.historial-badge-ok {
    background: #d4edda;
    color: #1f4d2f;
}

.historial-badge-warn {
    background: #f8e6c2;
    color: #6b4f00;
}

.historial-badge-neutral {
    background: #f0f1f2;
    color: var(--text);
}

.historial-link {
    color: var(--primary);
    font-weight: 600;
}

/* ============================================
   FILTROS DROPDOWN (COMPACTO)
   ============================================ */

    text-decoration: none;
    font-size: 12px;
}

.historial-link:hover {
    text-decoration: underline;
}

.historial-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
}

/* ============================================
   MÓVIL: drawer sidebar + ajustes
   ============================================ */
.sidebar-overlay {
    display: none;
    pointer-events: none;
}
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 1060;
        transform: translateX(-100%);
        transition: transform 0.25s ease-out;
        box-shadow: none;
    }
    body.sidebar-open .sidebar {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1055;
        opacity: 0;
        transition: opacity 0.2s ease;
    }
    body.sidebar-open .sidebar-overlay {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }
    .main-content-wrapper {
        margin-left: 0;
        min-width: 0;
        width: 100%;
    }
    .top-header {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .header-left {
        min-width: 0;
        flex: 1;
    }
    .header-brand {
        min-width: 0;
    }
    .page-title {
        font-size: 16px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 50vw;
    }
    .content-area {
        padding: 16px;
    }
    .global-search-bar-row {
        padding: 10px 16px 12px;
    }
    .global-search-wrapper {
        max-width: 100%;
    }
    .view-header {
        gap: 8px;
    }
    .table-container {
        -webkit-overflow-scrolling: touch;
    }
    .data-table {
        min-width: 560px;
    }
}

/* ============================================
   MEETING HUB
   ============================================ */
.meetings-tabs .btn { font-size: 0.9rem; }
.meetings-tab-pane { padding-top: 1rem; }
/* Calendario: tamaño generoso y legible */
.meetings-calendar-wrap {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 16px 24px;
    background: var(--card-bg, #fff);
    border-radius: 12px;
    box-shadow: var(--shadow, 0 2px 8px rgba(0,0,0,0.08));
    border: 1px solid var(--border, #e5e7eb);
}
.meetings-calendar-container {
    min-height: 700px;
    height: 740px;
}
.meetings-calendar-container .fc { font-size: 14px; height: 100%; }
.meetings-calendar-container .fc-view-harness { flex: 1; min-height: 0; }
.meetings-calendar-container .fc-toolbar-title { font-size: 1.2rem; }
.meetings-calendar-container .fc-scrollgrid { border-radius: 8px; overflow: hidden; }
.meeting-card { transition: box-shadow 0.2s; }
.meeting-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
#meetingDetailModal .modal-content { max-width: 620px; }
#meetingFormModal .modal-content { max-width: 560px; }
.meetings-list { max-width: 720px; }
/* Desplegable asistentes: lista de personas del proyecto (no casillas) */
#meetingFormModal .ts-wrapper .ts-control { min-height: 38px; border-radius: 6px; }
#meetingFormModal .ts-wrapper .ts-dropdown .option { padding: 8px 12px; }
#meetingFormModal .ts-wrapper .ts-dropdown .option:hover { background: #f0f1f3; }
#meetingFormModal .ts-wrapper.has-items .ts-control .item { background: var(--primary); color: #fff; border-radius: 4px; padding: 2px 8px; }
