/* 
 * CSS Móvil - Solo se activa en pantallas pequeñas
 * NO afecta el desktop
 */

/* Solo aplicar en pantallas móviles y tablets */
@media (max-width: 1024px) {
    
    /* Regla general para data-label en cualquier elemento */
    [data-label]::before {
        content: attr(data-label) ": ";
        display: inline-block;
        font-weight: bold;
        color: #6c757d;
        min-width: 90px;
        margin-right: 4px;
    }
    
    /* Prevenir overflow horizontal */
    body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    /* Contenedores principales */
    .container, .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Navbar móvil mejorado */
    .navbar {
        padding: 0.5rem 1rem;
        position: relative;
        z-index: 1030;
    }
    
    .navbar-toggler {
        border: none;
        padding: 0.5rem;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 0.375rem;
        position: relative;
        z-index: 1031;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        border: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    .navbar-toggler:focus {
        box-shadow: 0 0 0 0.2rem rgba(0, 0, 0, 0.25);
        background: rgba(255, 255, 255, 1);
    }
    
    .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2833, 37, 41, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
        display: inline-block;
        width: 1.5em;
        height: 1.5em;
        vertical-align: middle;
        background-repeat: no-repeat;
        background-position: center;
        background-size: 100%;
    }
    
    .navbar-collapse {
        background: rgba(255, 255, 255, 0.95);
        border-radius: 0.375rem;
        margin-top: 0.5rem;
        padding: 1rem;
        position: relative;
        z-index: 1029;
        border: 1px solid rgba(0, 0, 0, 0.1);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }
    
    .navbar-nav {
        font-size: 1rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        border-radius: 0.25rem;
        margin: 0.25rem 0;
        color: #212529 !important;
        font-weight: 500;
    }
    
    .navbar-nav .nav-link:hover {
        background: rgba(0, 0, 0, 0.05);
        color: #000 !important;
    }
    
    .navbar-nav .nav-link.active {
        background: rgba(250, 54, 15, 0.1);
        color: #fa360f !important;
    }
    
    .dropdown-item {
        padding: 0.75rem 1rem;
        color: #212529 !important;
    }
    
    .dropdown-item:hover {
        background: rgba(0, 0, 0, 0.05);
        color: #000 !important;
    }
    
    /* Mejorar dropdowns en móvil */
    .dropdown-menu {
        position: absolute !important;
        float: none !important;
        width: 100% !important;
        margin-top: 0.5rem !important;
        border-radius: 0.25rem;
        border: 1px solid rgba(0, 0, 0, 0.1);
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        z-index: 1032;
        display: none;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        min-width: 200px !important;
    }
    
    .dropdown-menu.show {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        background: #ffffff !important;
        border: 2px solid #007bff !important;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2) !important;
        z-index: 1033 !important;
        /* Estilos temporales para debugging */
        min-height: 50px !important;
        padding: 10px !important;
        margin: 5px 0 !important;
    }
    
    /* Asegurar que el contenedor del dropdown tenga position relative */
    .dropdown {
        position: relative !important;
        overflow: visible !important;
    }
    
    /* Forzar posicionamiento correcto del dropdown */
    .navbar-nav .dropdown {
        position: relative !important;
        overflow: visible !important;
    }
    
    .navbar-nav .dropdown-menu {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: auto !important;
        width: 100% !important;
        margin-top: 0 !important;
        transform: none !important;
        overflow: visible !important;
    }
    
    .navbar-nav .dropdown-menu.show {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: auto !important;
        width: 100% !important;
        margin-top: 0 !important;
        transform: none !important;
        overflow: visible !important;
        /* Debugging visual agresivo */
        background: #ff0000 !important;
        border: 5px solid #00ff00 !important;
        color: #ffffff !important;
        font-weight: bold !important;
        font-size: 16px !important;
        min-height: 100px !important;
        padding: 20px !important;
        z-index: 9999 !important;
    }
    
    /* Asegurar que el navbar no corte el contenido */
    .navbar-collapse {
        overflow: visible !important;
    }
    
    .navbar-nav {
        overflow: visible !important;
    }
    
    /* Forzar visibilidad del dropdown fuera del flujo */
    .navbar-nav .dropdown-menu.show {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: auto !important;
        width: 100% !important;
        margin-top: 0 !important;
        transform: none !important;
        background: #ffffff !important;
        border: 1px solid rgba(0, 0, 0, 0.1) !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
        z-index: 1033 !important;
        min-height: auto !important;
        padding: 0.5rem 0 !important;
    }
    
    /* Forzar visibilidad del contenido del dropdown */
    .navbar-nav .dropdown-menu.show .dropdown-item {
        background: #ffffff !important;
        color: #000000 !important;
        font-weight: bold !important;
        font-size: 16px !important;
        padding: 10px !important;
        border: 2px solid #000000 !important;
        margin: 5px 0 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .dropdown-toggle::after {
        display: none !important;
    }
    
    /* Iconos de chevron */
    .fa-chevron-down, .fa-chevron-up {
        transition: transform 0.2s ease-in-out;
    }
    
    .fa-chevron-up {
        transform: rotate(180deg);
    }
    
    /* Tablas responsivas */
    .table-responsive {
        font-size: 0.875rem;
    }
    
    /* Convertir tablas en cards móviles */
    .table {
        display: block !important;
        width: 100% !important;
    }
    
    .table thead {
        display: none !important; /* Ocultar headers en móvil */
    }
    
    .table tbody {
        display: block !important;
        width: 100% !important;
    }
    
    .table tr {
        display: block !important;
        margin-bottom: 1rem !important;
        border: 1px solid #dee2e6 !important;
        border-radius: 0.375rem !important;
        background: white !important;
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
        padding: 1rem !important;
    }
    
    .table td {
        display: block !important;
        border: none !important;
        padding: 0.5rem 0 !important;
        text-align: left !important;
    }
    
    .table td:before {
        content: attr(data-label) " " !important;
        font-weight: bold !important;
        color: #6c757d !important;
        display: inline-block !important;
        min-width: 80px !important;
        margin-right: 8px !important;
    }
    
    /* Reglas específicas para la tabla de tareas */
    .table.table-hover.table-sm {
        display: block !important;
        width: 100% !important;
    }
    
    .table.table-hover.table-sm thead {
        display: none !important;
    }
    
    .table.table-hover.table-sm tbody {
        display: block !important;
        width: 100% !important;
    }
    
    .table.table-hover.table-sm tr {
        display: block !important;
        margin-bottom: 1rem !important;
        border: 1px solid #dee2e6 !important;
        border-radius: 0.375rem !important;
        background: white !important;
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
        padding: 1rem !important;
    }
    
    .table.table-hover.table-sm td {
        display: block !important;
        border: none !important;
        padding: 0.5rem 0 !important;
        text-align: left !important;
    }
    
    .table.table-hover.table-sm td:before {
        content: attr(data-label) ": " !important;
        font-weight: bold !important;
        color: #6c757d !important;
        display: inline-block !important;
        min-width: 90px !important;
        margin-right: 4px !important;
    }
    
    /* Botones más grandes para touch */
    .btn {
        min-height: 44px;
        padding: 8px 16px;
    }
    
    /* Formularios móviles */
    .form-control {
        font-size: 16px; /* Evita zoom en iOS */
        min-height: 44px;
    }
    
    /* Cards más compactas */
    .card {
        margin-bottom: 1rem;
    }
    
    /* Texto más legible */
    body {
        font-size: 16px;
        line-height: 1.5;
    }
    
    /* Prevenir texto vertical */
    * {
        writing-mode: horizontal-tb !important;
        text-orientation: mixed !important;
        direction: ltr !important;
    }
    
    /* Asegurar que el contenido no se salga */
    .row {
        margin-left: 0;
        margin-right: 0;
    }
    
    .col, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
    .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
        padding-left: 5px;
        padding-right: 5px;
    }
    
    /* Mejorar espaciado en móvil */
    .card-body {
        padding: 1rem;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
    }
    
    /* Botones en cards más accesibles */
    .card .btn {
        margin: 0.25rem;
        width: auto;
    }
    
    /* Gráficos responsivos */
    canvas {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Optimizar formularios de filtros en móvil */
    .row.g-3 {
        margin-left: 0;
        margin-right: 0;
    }
    
    .row.g-3 > .col-12 {
        padding-left: 0;
        padding-right: 0;
        margin-bottom: 1rem;
    }
    
    .form-label {
        font-size: 0.9rem;
        font-weight: 500;
        margin-bottom: 0.5rem;
    }
    
    .form-select, .form-control {
        font-size: 1rem;
        min-height: 44px;
        border-radius: 0.375rem;
    }
    
    /* Botones de filtro más compactos */
    .d-flex.gap-2 {
        gap: 0.5rem !important;
    }
    
    .btn-primary.flex-fill {
        min-height: 44px;
        font-size: 1rem;
    }
    
    .btn-outline-secondary {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Limitar altura de dropdowns en móvil */
    .form-select {
        max-height: 200px;
        overflow-y: auto;
    }
    
    /* Mejorar comportamiento de dropdowns nativos */
    select.form-select {
        background-size: 16px 12px;
        padding-right: 2.5rem;
    }
    
    /* Asegurar que los dropdowns no se salgan de la pantalla */
    .dropdown-menu {
        max-height: 300px;
        overflow-y: auto;
        max-width: 100vw;
    }
    
    /* Optimizar textareas en móvil */
    textarea.form-control {
        min-height: 80px;
        max-height: 200px;
        resize: vertical;
        font-size: 16px;
        line-height: 1.4;
        padding: 12px;
        border-radius: 0.375rem;
    }
    
    /* Mejorar visibilidad del texto en textareas */
    textarea.form-control:focus {
        box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
        border-color: #80bdff;
    }
    
    /* Asegurar que el texto sea visible */
    textarea.form-control::placeholder {
        color: #6c757d;
        opacity: 1;
    }
    
    /* Mejorar layout de formularios de comentarios en móvil */
    .d-flex.align-items-center.gap-2 {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.5rem !important;
    }
    
    .d-flex.align-items-center.gap-2 > * {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .d-flex.align-items-center.gap-2 .btn {
        align-self: flex-end;
        width: auto;
        min-width: 44px;
    }
    
    /* Asegurar que los textareas ocupen el ancho completo en móvil */
    textarea.form-control.me-2 {
        width: 100% !important;
        margin-right: 0 !important;
        margin-bottom: 0.5rem;
    }
    
    /* Mejorar layout de botones de acciones en móvil */
    .d-flex.align-items-center.gap-2 {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.5rem !important;
    }
    
    .d-flex.align-items-center.gap-2 > * {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .d-flex.align-items-center.gap-2 .btn {
        align-self: flex-end;
        width: auto;
        min-width: 44px;
    }
    
    /* Layout específico para formularios de comentarios */
    form.d-flex.align-items-center.gap-2 {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }
    
    /* Botones de acciones organizados horizontalmente */
    .actions-buttons {
        display: flex;
        gap: 0.5rem;
        justify-content: flex-start;
        align-items: center;
        flex-wrap: wrap;
        margin-top: 0.5rem;
    }
    
    .actions-buttons .btn {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.875rem;
    }
    
    /* Separar textarea de botones */
    .comment-section {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .comment-textarea {
        width: 100%;
        margin-bottom: 0;
        border-bottom: none;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }
    
    .comment-actions {
        display: flex;
        gap: 0.5rem;
        justify-content: flex-start;
        align-items: center;
        margin-top: 0;
        padding: 0.5rem;
        background: #f8f9fa;
        border: 1px solid #dee2e6;
        border-top: none;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
        border-bottom-left-radius: 0.375rem;
        border-bottom-right-radius: 0.375rem;
    }
    
    .comment-actions .btn {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.875rem;
    }
    
    /* Botones de acciones de tarea */
    .task-actions {
        display: flex;
        gap: 0.5rem;
        justify-content: flex-start;
        align-items: center;
        padding: 0.75rem 0;
    }
    
    .task-actions .btn {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.875rem;
    }
    
    /* Separar visualmente las acciones de tarea */
    .task-actions {
        border-top: 1px solid #dee2e6;
        margin-top: 0.5rem;
        padding-top: 0.75rem;
    }
    
    /* Botones de acciones inline junto a la descripción */
    .task-actions-inline {
        display: flex;
        gap: 0.25rem;
        margin-left: 0.5rem;
        flex-shrink: 0;
    }
    
    .task-actions-inline .btn {
        min-width: 32px;
        min-height: 32px;
        padding: 0.25rem;
        font-size: 0.75rem;
    }
    
    /* Asegurar que la descripción tenga espacio */
    .d-flex.justify-content-between.align-items-start {
        gap: 0.5rem;
    }
    
    .flex-grow-1 {
        min-width: 0;
    }
    
    /* Optimizar botones de acciones del tema en móvil */
    .d-flex.justify-content-between.align-items-center {
        flex-direction: column;
        align-items: center !important;
        gap: 1rem;
        text-align: center;
    }
    
    /* Centrar el contenedor de botones */
    .d-flex.justify-content-between.align-items-center > div:last-child {
        justify-content: center !important;
        width: 100%;
        display: flex;
        flex-direction: row;
        gap: 1rem;
        align-items: center;
        flex-wrap: wrap;
    }
    
    /* Botones de acciones más compactos */
    .btn-group {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
    }
    
    .btn-group .btn {
        flex: 1;
        min-width: 120px;
        max-width: 150px;
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Botones individuales más compactos */
    .d-flex.justify-content-between.align-items-center .btn {
        margin-bottom: 0.5rem;
        width: 100%;
        max-width: none;
        font-size: 0.875rem;
        padding: 0.75rem;
        min-height: 44px;
    }
    
    /* Iconos más pequeños en móvil */
    .btn i {
        font-size: 0.875rem;
        margin-right: 0.5rem;
    }
    
    /* Ocultar texto largo en móvil */
    .btn .d-none-mobile-text {
        display: none;
    }
    
    /* Mostrar solo iconos en móvil para algunos botones */
    .btn-icon-only {
        width: 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
        padding: 0.5rem !important;
    }
    
    .btn-icon-only span {
        display: none;
    }
    
    .btn-icon-only i {
        margin-right: 0 !important;
        font-size: 1rem;
    }
    
    /* Todos los botones de acciones como iconos en móvil */
    .d-flex.justify-content-between.align-items-center .btn {
        width: 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
        padding: 0.5rem !important;
        margin-bottom: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .d-flex.justify-content-between.align-items-center .btn span {
        display: none;
    }
    
    .d-flex.justify-content-between.align-items-center .btn i {
        margin-right: 0 !important;
        font-size: 1.2rem;
    }
    
    /* Layout horizontal para los botones de iconos */
    .d-flex.justify-content-between.align-items-center {
        flex-direction: row !important;
        justify-content: space-between !important;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    /* Contenedor de botones más compacto */
    .d-flex.justify-content-between.align-items-center > div {
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }
    
    /* Optimizar botón "Nuevo Tema" en móvil */
    .btn-primary.btn-sm {
        min-height: 48px;
        padding: 1rem 1.5rem;
        font-size: 1rem;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .btn-primary.btn-sm i {
        font-size: 1rem;
        margin-right: 0.25rem;
    }
    
    /* Asegurar que el icono sea visible */
    .btn i.fas.fa-plus {
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Botón "Nuevo Tema" más grande en móvil */
    .btn-primary.btn-sm {
        min-height: 48px;
        padding: 1rem 1.5rem;
        font-size: 1rem;
        font-weight: 500;
        width: auto;
        min-width: 140px;
    }
    
    /* Mejorar espaciado del icono */
    .btn-primary.btn-sm i.fas.fa-plus {
        font-size: 1.1rem;
        margin-right: 0.5rem;
    }
    
    /* Asegurar que el texto tenga espacio suficiente */
    .btn-primary.btn-sm {
        white-space: nowrap;
        overflow: visible;
        text-overflow: clip;
    }
    
    /* Botón "Nuevo Tema" con ancho fijo para contener todo el texto */
    .btn-primary.btn-sm {
        min-height: 48px;
        padding: 1rem 1.5rem;
        font-size: 1rem;
        font-weight: 500;
        width: 180px !important;
        min-width: 180px !important;
        max-width: 180px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
    }
    
    /* Asegurar que el icono y texto quepan */
    .btn-primary.btn-sm i.fas.fa-plus {
        font-size: 1.1rem;
        margin-right: 0.5rem;
        flex-shrink: 0;
    }
    
    /* Texto del botón */
    .btn-primary.btn-sm span,
    .btn-primary.btn-sm {
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    /* Botón "Nuevo" más grande para contener todo el texto */
    .btn-primary.btn-sm {
        min-height: 52px;
        padding: 1.25rem 2rem;
        font-size: 1.1rem;
        font-weight: 500;
        width: 220px !important;
        min-width: 220px !important;
        max-width: 220px !important;
        white-space: nowrap;
        overflow: visible;
        text-overflow: clip;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.75rem;
    }
    
    /* Icono más grande para el botón "Nuevo" */
    .btn-primary.btn-sm i.fas.fa-plus {
        font-size: 1.2rem;
        margin-right: 0.75rem;
        flex-shrink: 0;
    }
    
    /* Botón "Nuevo Tema" MUCHO más grande para contener todo el texto */
    .btn-primary.btn-sm {
        min-height: 56px;
        padding: 1.5rem 2.5rem;
        font-size: 1.2rem;
        font-weight: 500;
        width: 280px !important;
        min-width: 280px !important;
        max-width: 280px !important;
        white-space: nowrap;
        overflow: visible;
        text-overflow: clip;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 1rem;
    }
    
    /* Icono más grande para "Nuevo Tema" */
    .btn-primary.btn-sm i.fas.fa-plus {
        font-size: 1.3rem;
        margin-right: 1rem;
        flex-shrink: 0;
    }
    
    /* BOTÓN "NUEVO TEMA" - REGLA ÚNICA Y DEFINITIVA */
    .btn-primary.btn-sm {
        min-height: 60px;
        padding: 1.75rem 3rem;
        font-size: 1.3rem;
        font-weight: 600;
        width: 320px !important;
        min-width: 320px !important;
        max-width: 320px !important;
        white-space: nowrap;
        overflow: visible;
        text-overflow: clip;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 1.25rem;
        border-radius: 0.5rem;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }
    
    /* Icono definitivo para "Nuevo Tema" */
    .btn-primary.btn-sm i.fas.fa-plus {
        font-size: 1.5rem;
        margin-right: 1.25rem;
        flex-shrink: 0;
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* FORZAR EXPANSIÓN DEL BOTÓN COMPLETO */
    .btn-primary.btn-sm,
    .card-body .btn-primary.btn-sm,
    .container .btn-primary.btn-sm,
    .btn.btn-primary.btn-sm,
    .card .btn-primary.btn-sm {
        min-height: 100px !important;
        padding: 2.5rem 5rem !important;
        font-size: 1.8rem !important;
        font-weight: 700 !important;
        width: 500px !important;
        min-width: 500px !important;
        max-width: 500px !important;
        white-space: nowrap !important;
        overflow: visible !important;
        text-overflow: clip !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 2rem !important;
        border-radius: 1rem !important;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25) !important;
        margin: 1.5rem auto !important;
        position: relative !important;
        z-index: 1000 !important;
    }
    
    /* Icono definitivo para "Nuevo Tema" */
    .btn-primary.btn-sm i.fas.fa-plus,
    .card-body .btn-primary.btn-sm i.fas.fa-plus,
    .container .btn-primary.btn-sm i.fas.fa-plus,
    .btn.btn-primary.btn-sm i.fas.fa-plus,
    .card .btn-primary.btn-sm i.fas.fa-plus {
        font-size: 2rem !important;
        margin-right: 2rem !important;
        flex-shrink: 0 !important;
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* BOTÓN "NUEVO TEMA" - SELECTOR MÁS ESPECÍFICO Y AGRESIVO */
    .card-header .d-flex.justify-content-between.align-items-center .nuevo-tema-btn,
    .card-header .nuevo-tema-btn,
    .nuevo-tema-btn {
        min-height: 100px !important;
        padding: 3rem 6rem !important;
        font-size: 2rem !important;
        font-weight: 700 !important;
        width: 100vw !important;
        min-width: 100vw !important;
        max-width: 100vw !important;
        white-space: nowrap !important;
        overflow: visible !important;
        text-overflow: clip !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 3rem !important;
        border-radius: 1.5rem !important;
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3) !important;
        margin: 2rem -1rem !important;
        position: relative !important;
        z-index: 9999 !important;
        background-color: #007bff !important;
        border-color: #007bff !important;
        color: white !important;
        transform: scale(1.2) !important;
    }
    
    /* Icono más grande para "Nuevo Tema" */
    .card-header .d-flex.justify-content-between.align-items-center .nuevo-tema-btn i.fas.fa-plus,
    .card-header .nuevo-tema-btn i.fas.fa-plus,
    .nuevo-tema-btn i.fas.fa-plus {
        font-size: 2.5rem !important;
        margin-right: 3rem !important;
        flex-shrink: 0 !important;
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: white !important;
    }
    
    /* BOTÓN "NUEVO TEMA" - EXPANSIÓN AUTOMÁTICA */
    .card-header .d-flex.justify-content-between.align-items-center .nuevo-tema-btn,
    .card-header .nuevo-tema-btn,
    .nuevo-tema-btn {
        min-height: 60px !important;
        padding: 1.5rem 3rem !important;
        font-size: 1.2rem !important;
        font-weight: 600 !important;
        width: auto !important;
        min-width: 200px !important;
        max-width: none !important;
        white-space: nowrap !important;
        overflow: visible !important;
        text-overflow: clip !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 1rem !important;
        border-radius: 0.75rem !important;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
        margin: 1rem auto !important;
        position: relative !important;
        z-index: 1000 !important;
        background-color: #007bff !important;
        border-color: #007bff !important;
        color: white !important;
        transform: none !important;
    }
    
    /* Icono para "Nuevo Tema" con expansión automática */
    .card-header .d-flex.justify-content-between.align-items-center .nuevo-tema-btn i.fas.fa-plus,
    .card-header .nuevo-tema-btn i.fas.fa-plus,
    .nuevo-tema-btn i.fas.fa-plus {
        font-size: 1.3rem !important;
        margin-right: 1rem !important;
        flex-shrink: 0 !important;
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: white !important;
    }
    
    /* Crear una unidad visual integrada */
    .comment-integrated {
        border: 1px solid #dee2e6;
        border-radius: 0.375rem;
        overflow: hidden;
    }
    
    .comment-integrated .comment-textarea {
        border: none;
        border-radius: 0;
        margin-bottom: 0;
    }
    
    .comment-integrated .comment-actions {
        border: none;
        border-radius: 0;
        margin-top: 0;
        background: #f8f9fa;
        border-top: 1px solid #dee2e6;
    }
    
    /* Optimizar carga de archivos en móvil */
    .file-upload-section {
        display: none !important; /* Ocultar completamente en móvil */
    }
    
    .file-upload-section .form-control {
        display: none;
    }
    
    .file-upload-section .btn {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.875rem;
    }
    
    /* Botón de carga de archivos compacto */
    .file-upload-btn {
        background: #007bff;
        color: white;
        border: none;
        border-radius: 0.375rem;
        padding: 0.5rem;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: background-color 0.2s ease;
    }
    
    .file-upload-btn:hover {
        background: #0056b3;
    }
    
    .file-upload-btn i {
        font-size: 1rem;
    }
    
    /* Estado de carga para el botón de archivos */
    .file-upload-btn.loading {
        background: #6c757d;
        pointer-events: none;
    }
    
    .file-upload-btn.loading i {
        animation: spin 1s linear infinite;
    }
    
    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }
    
    /* Ocultar la sección de archivos adjuntos en móvil por defecto */
    .attachments-section {
        display: none;
        margin-top: 1rem;
        padding: 1rem;
        background: #f8f9fa;
        border-radius: 0.375rem;
        border: 1px solid #dee2e6;
    }
    
    .attachments-section.show {
        display: block;
    }
    
    .attachments-header {
        margin-bottom: 0.75rem;
        color: #495057;
        font-size: 0.9rem;
    }
    
    .attachments-list {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .attachment-item {
        padding: 0.5rem;
        background: white;
        border-radius: 0.25rem;
        border: 1px solid #e9ecef;
        transition: background-color 0.2s ease;
    }
    
    .attachment-item:hover {
        background: #f8f9fa;
    }
    
    .attachment-link {
        color: #007bff;
        text-decoration: none;
        font-size: 0.9rem;
        display: flex;
        align-items: center;
        word-break: break-word;
    }
    
    .attachment-link:hover {
        color: #0056b3;
        text-decoration: underline;
    }
    
    .attachment-link i {
        margin-right: 0.5rem;
        color: #6c757d;
    }
    
    /* Estilos para la visualización en iframe */
    .attachment-preview {
        margin-top: 0.5rem;
    }
    
    .attachment-iframe-container {
        border: 1px solid #dee2e6;
        border-radius: 0.375rem;
        background: white;
        margin-top: 0.5rem;
        overflow: hidden;
        position: fixed;
        top: 0;
        left: 0;
        transform: none;
        width: 100vw;
        height: 100vh;
        z-index: 9999;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }
    
    .iframe-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1rem;
        background: #f8f9fa;
        border-bottom: 1px solid #dee2e6;
        position: sticky;
        top: 0;
        z-index: 10000;
        height: 60px;
    }
    
    .iframe-header .filename {
        font-size: 1.1rem;
        font-weight: 500;
        color: #495057;
        flex: 1;
        margin-right: 0.5rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .iframe-header .btn {
        flex-shrink: 0;
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem;
        font-size: 1rem;
    }
    
    .attachment-iframe {
        width: 100%;
        height: calc(100vh - 80px);
        border: none;
        display: block;
    }
    
    /* Estilos específicos para videos */
    .attachment-iframe[src*="video"] {
        height: calc(100vh - 80px);
        background: #000;
    }
    
    /* Reproductor de video personalizado */
    .video-iframe-container {
        position: relative;
        background: #000;
        border-radius: 0;
        overflow: hidden;
    }
    
    .video-iframe-container .attachment-iframe {
        height: calc(100vh - 80px);
        background: #000;
    }
    
    /* Controles de video personalizados */
    .video-controls {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(0, 0, 0, 0.7);
        padding: 0.5rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .video-iframe-container:hover .video-controls {
        opacity: 1;
    }
    
    .video-controls button {
        background: rgba(255, 255, 255, 0.2);
        border: none;
        color: white;
        padding: 0.25rem 0.5rem;
        border-radius: 0.25rem;
        cursor: pointer;
        font-size: 0.875rem;
    }
    
    .video-controls button:hover {
        background: rgba(255, 255, 255, 0.3);
    }
    
    /* Responsive para móvil */
    @media (max-width: 768px) {
        .attachment-iframe {
            height: calc(100vh - 60px);
        }
        
        .video-iframe-container .attachment-iframe {
            height: calc(100vh - 60px);
        }
        
        .attachment-iframe-container {
            width: 100vw;
            height: 100vh;
        }
        
        .iframe-header {
            padding: 0.5rem 0.75rem;
            height: 50px;
        }
        
        .iframe-header .filename {
            font-size: 0.9rem;
        }
    }
    
    /* Desktop - iframe pantalla completa */
    @media (min-width: 769px) {
        .attachment-iframe {
            height: calc(100vh - 80px);
        }
        
        .video-iframe-container .attachment-iframe {
            height: calc(100vh - 80px);
        }
        
        .attachment-iframe-container {
            width: 100vw;
            height: 100vh;
        }
    }
    
    /* Botón para mostrar/ocultar archivos adjuntos */
    .toggle-attachments-btn {
        background: #6c757d;
        color: white;
        border: none;
        border-radius: 0.375rem;
        padding: 0.5rem;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: background-color 0.2s ease;
        margin-left: 0.5rem;
    }
    
    .toggle-attachments-btn:hover {
        background: #545b62;
    }
    
    /* Textarea auto-expandible como WhatsApp */
    textarea.form-control.auto-expand {
        min-height: 44px;
        max-height: 120px;
        resize: none;
        overflow-y: hidden;
        transition: height 0.2s ease;
        line-height: 1.4;
        padding: 12px;
        border-radius: 0.375rem;
        font-size: 16px;
    }
    
    /* Mejorar la experiencia de escritura en móvil */
    textarea.form-control.auto-expand:focus {
        box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
        border-color: #80bdff;
        outline: none;
    }
    
    /* Asegurar que el texto sea visible durante la escritura */
    textarea.form-control.auto-expand::placeholder {
        color: #6c757d;
        opacity: 1;
    }
}

/* Solo para tablets (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Ajustes específicos para tablets */
    .container, .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Navbar más espacioso para tablets */
    .navbar {
        padding: 0.75rem 1.5rem;
    }
    
    /* Dropdowns más grandes para tablets */
    .navbar-nav .dropdown-menu {
        min-width: 250px !important;
        font-size: 1rem;
    }
    
    /* Tablas con mejor espaciado para tablets */
    .table td {
        padding: 0.75rem 0;
    }
    
    .table td:before {
        min-width: 100px;
        font-size: 1rem;
        margin-right: 12px;
    }
    
    /* Cards más espaciadas para tablets */
    .card-body {
        padding: 1.5rem;
    }
    
    .card-header {
        padding: 1rem 1.5rem;
    }
    
    /* Botones más grandes para tablets */
    .btn {
        min-height: 48px;
        padding: 10px 20px;
        font-size: 1rem;
    }
}

/* Solo para pantallas muy pequeñas */
@media (max-width: 576px) {
    .container {
        padding-left: 5px;
        padding-right: 5px;
    }
    
    /* Ocultar elementos no esenciales en móvil */
    .d-none-mobile {
        display: none !important;
    }
    
    /* Mostrar elementos específicos para móvil */
    .d-mobile-only {
        display: block !important;
    }
    
    /* Tablas aún más compactas */
    .table tr {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .table td {
        padding: 0.25rem 0;
    }
    
    .table td:before {
        min-width: 70px;
        font-size: 0.875rem;
    }
    
    /* Navbar más compacto */
    .navbar {
        padding: 0.25rem 0.5rem;
    }
    
    .navbar-collapse {
        margin-top: 0.25rem;
        padding: 0.5rem;
    }
    
    /* Forzar visibilidad del botón hamburguesa */
    .navbar-toggler {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        z-index: 1031 !important;
    }
    
    /* Asegurar que el navbar se expanda correctamente */
    .navbar-collapse.collapse {
        display: none;
    }
    
    .navbar-collapse.collapse.show {
        display: block !important;
    }
    
    /* Asegurar que el contenedor del navbar tenga el espacio correcto */
    .navbar .container-fluid {
        position: relative;
        z-index: 1030;
    }
    
    /* Hacer el botón más visible */
    .navbar-toggler {
        background: rgba(255, 255, 255, 0.95) !important;
        border: 1px solid rgba(0, 0, 0, 0.15) !important;
        min-width: 44px;
        min-height: 44px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
} 

/* BOTÓN "NUEVO TEMA" - REGLA ÚNICA Y LIMPIA */
.nuevo-tema-btn {
    min-height: 50px;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    width: auto;
    min-width: 150px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.nuevo-tema-btn i.fas.fa-plus {
    font-size: 1.1rem;
    margin-right: 0.5rem;
}

/* BOTÓN PERSONALIZADO "NUEVO TEMA" */
.custom-nuevo-tema-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    color: white;
    background-color: #007bff;
    border: 1px solid #007bff;
    border-radius: 0.375rem;
    text-decoration: none;
    white-space: nowrap;
    min-width: 200px;
    width: auto;
    min-height: 50px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.custom-nuevo-tema-btn:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.custom-nuevo-tema-btn:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.custom-nuevo-tema-btn i.fas.fa-plus {
    font-size: 1.1rem;
    margin-right: 0.5rem;
} 

/* BOTÓN PERSONALIZADO "CREAR MINUTA" */
.custom-crear-minuta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    color: white;
    background-color: #007bff;
    border: 1px solid #007bff;
    border-radius: 0.375rem;
    text-decoration: none;
    white-space: nowrap;
    min-width: 200px;
    width: auto;
    min-height: 50px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-right: 1rem;
}

.custom-crear-minuta-btn:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.custom-crear-minuta-btn:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.custom-crear-minuta-btn i.fas.fa-plus {
    font-size: 1.1rem;
    margin-right: 0.5rem;
} 

/* BOTÓN PERSONALIZADO "CREAR TEMA" */
.custom-crear-tema-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    color: white;
    background-color: #198754;
    border: 1px solid #198754;
    border-radius: 0.375rem;
    text-decoration: none;
    white-space: nowrap;
    min-width: 200px;
    width: auto;
    min-height: 50px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.custom-crear-tema-btn:hover {
    background-color: #146c43;
    border-color: #146c43;
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.custom-crear-tema-btn:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
}

.custom-crear-tema-btn i.fas.fa-plus {
    font-size: 1.1rem;
    margin-right: 0.5rem;
} 

/* BOTÓN PERSONALIZADO "EDITAR PERMISOS" */
.custom-editar-permisos-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: white;
    background-color: #007bff;
    border: 1px solid #007bff;
    border-radius: 0.375rem;
    text-decoration: none;
    white-space: nowrap;
    min-width: 180px;
    width: auto;
    min-height: 40px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.custom-editar-permisos-btn:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.custom-editar-permisos-btn:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.custom-editar-permisos-btn i.fas.fa-edit {
    font-size: 1rem;
    margin-right: 0.5rem;
} 

/* BOTÓN PERSONALIZADO "RECALCULAR FECHAS" */
.custom-recalcular-fechas-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    color: white;
    background-color: #ffc107;
    border: 1px solid #ffc107;
    border-radius: 0.375rem;
    text-decoration: none;
    white-space: nowrap;
    min-width: 44px;
    width: 44px;
    height: 44px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.custom-recalcular-fechas-btn:hover {
    background-color: #e0a800;
    border-color: #e0a800;
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.custom-recalcular-fechas-btn:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25);
}

.custom-recalcular-fechas-btn i.fas.fa-calculator {
    font-size: 1.2rem;
    margin: 0;
}

/* BOTÓN PERSONALIZADO "AÑADIR TAREA" */
.custom-anadir-tarea-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: white;
    background-color: #007bff;
    border: 1px solid #007bff;
    border-radius: 0.375rem;
    text-decoration: none;
    white-space: nowrap;
    min-width: 160px;
    width: auto;
    min-height: 44px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.custom-anadir-tarea-btn:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.custom-anadir-tarea-btn:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.custom-anadir-tarea-btn i.fas.fa-plus {
    font-size: 1rem;
    margin-right: 0.5rem;
}

/* CONTENEDOR DE BOTONES EN LA MISMA FILA */
.d-flex.justify-content-between.align-items-center > div:last-child {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
}

/* BOTONES MÁS COMPACTOS PARA CABER EN LA MISMA FILA */
.custom-crear-minuta-btn,
.custom-crear-tema-btn {
    min-width: 150px;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    margin-right: 0;
}

.custom-crear-minuta-btn i.fas.fa-plus,
.custom-crear-tema-btn i.fas.fa-plus {
    font-size: 1rem;
    margin-right: 0.5rem;
} 

/* Estilos para el modal de visor de pantalla completa */
.modal-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    background: rgba(0, 0, 0, 0.8) !important;
}

.modal-fullscreen .modal-dialog {
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    height: 100% !important;
}

.modal-fullscreen .modal-content {
    height: 100% !important;
    border: none !important;
    border-radius: 0 !important;
    background: #000 !important;
}

.modal-fullscreen .modal-header {
    background: #fff !important;
    border-bottom: 1px solid #dee2e6 !important;
    padding: 0.5rem 1rem !important;
    height: 60px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.modal-fullscreen .modal-title {
    font-size: 1rem !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.modal-fullscreen .modal-body {
    padding: 0 !important;
    height: calc(100vh - 60px) !important;
    overflow: hidden !important;
}

.modal-fullscreen iframe {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    background: #000 !important;
    display: block !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

/* Estilos específicos para móviles */
@media (max-width: 768px) {
    .modal-fullscreen {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        z-index: 9999 !important;
    }
    
    .modal-fullscreen .modal-header {
        height: 50px !important;
        padding: 0.25rem 0.5rem !important;
    }
    
    .modal-fullscreen .modal-title {
        font-size: 0.9rem !important;
    }
    
    .modal-fullscreen .modal-body {
        height: calc(100vh - 50px) !important;
    }
    
    .modal-fullscreen iframe {
        width: 100% !important;
        height: 100% !important;
        overflow: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* Estilos específicos para PDFs en móvil */
    .modal-fullscreen iframe[src*=".pdf"] {
        width: 100% !important;
        height: 100% !important;
        overflow: auto !important;
        -webkit-overflow-scrolling: touch !important;
        /* Permitir zoom manual */
        -webkit-user-zoom: zoom !important;
        -moz-user-zoom: zoom !important;
        -ms-user-zoom: zoom !important;
        user-zoom: zoom !important;
        /* Permitir gestos de zoom */
        touch-action: manipulation !important;
    }
} 

/* Estilos para tareas completadas */
.completed-task-attachments,
.completed-task-comments {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-top: 0.5rem;
}

.completed-task-attachments .attachments-header,
.completed-task-comments .comments-header {
    color: #495057;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.5rem;
}

.completed-task-attachments .attachments-list,
.completed-task-comments .comments-content {
    font-size: 0.875rem;
}

.completed-task-attachments .attachment-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 0.25rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.completed-task-comments .comments-content ul {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 0.25rem;
    padding: 0.75rem;
    margin: 0;
}

.completed-task-comments .comments-content li {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f1f3f4;
}

.completed-task-comments .comments-content li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Indicador visual de tarea completada */
.table tr:has(.badge.bg-success) {
    background-color: #f8f9fa !important;
    opacity: 0.9;
}

.table tr:has(.badge.bg-success) td {
    color: #6c757d;
}

/* Estilos específicos para móvil */
@media (max-width: 768px) {
    .completed-task-attachments,
    .completed-task-comments {
        padding: 0.75rem;
        margin-top: 0.25rem;
    }
    
    .completed-task-attachments .attachment-item,
    .completed-task-comments .comments-content ul {
        padding: 0.5rem;
    }
} 

/* Estilos mejorados para dropdown de módulos en móvil - FORZADOS */
@media (max-width: 1024px) {
    /* Dropdown de módulos específico - FORZADO */
    .navbar-nav .dropdown-menu.modules-dropdown {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0.5rem 0 !important;
        margin-top: 0.5rem !important;
        min-width: auto !important;
        width: 100% !important;
        position: static !important;
        transform: none !important;
        float: none !important;
    }
    
    /* Items del dropdown de módulos - FORZADO */
    .navbar-nav .dropdown-menu.modules-dropdown .dropdown-item {
        background: var(--module-color, #6c757d) !important;
        color: white !important;
        border-radius: 12px !important;
        margin: 0.25rem 0 !important;
        padding: 0.75rem 1rem !important;
        border: none !important;
        font-weight: 500 !important;
        transition: all 0.2s ease !important;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
        display: block !important;
        width: 100% !important;
        text-decoration: none !important;
    }
    
    .navbar-nav .dropdown-menu.modules-dropdown .dropdown-item:hover {
        background: var(--module-color-hover, #5a6268) !important;
        color: white !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
        text-decoration: none !important;
    }
    
    .navbar-nav .dropdown-menu.modules-dropdown .dropdown-item:active {
        background: var(--module-color-active, #495057) !important;
        color: white !important;
        transform: translateY(0) !important;
        text-decoration: none !important;
    }
    
    .navbar-nav .dropdown-menu.modules-dropdown .dropdown-item:focus {
        background: var(--module-color, #6c757d) !important;
        color: white !important;
        text-decoration: none !important;
        outline: none !important;
    }
    
    /* Iconos en los items del dropdown - FORZADO */
    .navbar-nav .dropdown-menu.modules-dropdown .dropdown-item i {
        color: white !important;
        margin-right: 0.75rem !important;
        width: 16px !important;
        text-align: center !important;
        display: inline-block !important;
    }
    
    /* Animación de entrada para el dropdown - FORZADO */
    .navbar-nav .dropdown-menu.modules-dropdown.show {
        animation: slideDown 0.3s ease-out !important;
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* Estilos específicos para otros dropdowns (admin, usuario) - FORZADO */
    .navbar-nav .dropdown-menu:not(.modules-dropdown) {
        background: white !important;
        border: 1px solid #dee2e6 !important;
        border-radius: 8px !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
        padding: 0.5rem 0 !important;
    }
    
    .navbar-nav .dropdown-menu:not(.modules-dropdown) .dropdown-item {
        background: white !important;
        color: #495057 !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 0.5rem 1rem !important;
        border: none !important;
        font-weight: normal !important;
    }
    
    .navbar-nav .dropdown-menu:not(.modules-dropdown) .dropdown-item:hover {
        background: #f8f9fa !important;
        color: #495057 !important;
        transform: none !important;
    }
    
    .navbar-nav .dropdown-menu:not(.modules-dropdown) .dropdown-item i {
        color: #6c757d !important;
    }
    
    /* Override de Bootstrap para móvil - FORZADO */
    .navbar-nav .dropdown-menu {
        position: static !important;
        float: none !important;
        width: 100% !important;
        margin-top: 0.5rem !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
    
    /* Asegurar que los módulos se vean como cards */
    .navbar-nav .dropdown-menu.modules-dropdown li {
        margin: 0.25rem 0 !important;
        display: block !important;
    }
    
    /* Forzar el estilo de los módulos incluso si Bootstrap lo sobrescribe */
    .navbar-nav .dropdown-menu.modules-dropdown .dropdown-item,
    .navbar-nav .dropdown-menu.modules-dropdown .dropdown-item:hover,
    .navbar-nav .dropdown-menu.modules-dropdown .dropdown-item:active,
    .navbar-nav .dropdown-menu.modules-dropdown .dropdown-item:focus {
        background: var(--module-color, #6c757d) !important;
        color: white !important;
        border-radius: 12px !important;
        margin: 0.25rem 0 !important;
        padding: 0.75rem 1rem !important;
        border: none !important;
        font-weight: 500 !important;
        transition: all 0.2s ease !important;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
        display: block !important;
        width: 100% !important;
        text-decoration: none !important;
    }
} 

/* Estilos para tabla de temas en móvil - sin tarjetas de estado */
@media (max-width: 1024px) {
    /* Ocultar tarjetas de estado en móvil */
    .table-responsive .d-none.d-md-table-row {
        display: none !important;
    }
    
    /* Ocultar específicamente las tarjetas de estado en móvil */
    .table-responsive .table tbody tr.d-none.d-md-table-row {
        display: none !important;
    }
    
    /* Ocultar filas de tarjetas de estado en móvil */
    .table-responsive .table tbody tr[class*="d-none"] {
        display: none !important;
    }
    
    /* Mejorar espaciado entre temas en móvil */
    .table-responsive .table tbody tr {
        margin-bottom: 0.5rem !important;
        border-radius: 8px !important;
        overflow: hidden !important;
    }
    
    /* Mejorar apariencia de las filas de temas */
    .table-responsive .table tbody tr td {
        padding: 0.75rem 0.5rem !important;
        border-bottom: 1px solid #f0f0f0 !important;
    }
    
    /* Mejorar badges de estado en móvil */
    .table-responsive .badge {
        font-size: 0.75rem !important;
        padding: 0.25rem 0.5rem !important;
        border-radius: 12px !important;
    }
    
    /* Mejorar enlaces de título */
    .table-responsive .table tbody tr td a.fw-bold {
        color: #495057 !important;
        text-decoration: none !important;
        font-size: 1rem !important;
        line-height: 1.3 !important;
    }
    
    .table-responsive .table tbody tr td a.fw-bold:hover {
        color: #007bff !important;
        text-decoration: underline !important;
    }
    
    /* Mejorar texto de área */
    .table-responsive .table tbody tr td small.text-muted {
        font-size: 0.8rem !important;
        color: #6c757d !important;
        margin-top: 0.25rem !important;
        display: block !important;
    }
    
    /* Mejorar botones de acción */
    .table-responsive .table tbody tr td .btn-sm {
        padding: 0.25rem 0.5rem !important;
        font-size: 0.8rem !important;
        border-radius: 6px !important;
    }
    
    /* Mejorar fecha límite */
    .table-responsive .table tbody tr td[data-label="Fecha Límite"] {
        font-size: 0.85rem !important;
        color: #495057 !important;
    }
    
    /* Mejorar responsable */
    .table-responsive .table tbody tr td[data-label="Responsable"] {
        font-size: 0.85rem !important;
        color: #495057 !important;
        font-weight: 500 !important;
    }
    
    /* Mejorar colores de estado en móvil */
    .table-responsive .table-danger {
        background-color: #fff5f5 !important;
        border-left: 4px solid #dc3545 !important;
    }
    
    .table-responsive .table-warning {
        background-color: #fffbf0 !important;
        border-left: 4px solid #ffc107 !important;
    }
    
    .table-responsive .table-info {
        background-color: #f0f8ff !important;
        border-left: 4px solid #17a2b8 !important;
    }
    
    .table-responsive .table-success {
        background-color: #f0fff4 !important;
        border-left: 4px solid #28a745 !important;
    }
} 

/* Estilos para tabla de tareas en móvil - sin tarjetas de estado */
@media (max-width: 1024px) {
    /* Ocultar tarjetas de estado en móvil para tareas */
    .table-responsive .d-none.d-md-table-row {
        display: none !important;
    }
    
    /* Mejorar espaciado entre tareas en móvil */
    .table-responsive .table tbody tr {
        margin-bottom: 0.5rem !important;
        border-radius: 8px !important;
        overflow: hidden !important;
    }
    
    /* Mejorar apariencia de las filas de tareas */
    .table-responsive .table tbody tr td {
        padding: 0.75rem 0.5rem !important;
        border-bottom: 1px solid #f0f0f0 !important;
    }
    
    /* Mejorar badges de estado en móvil para tareas */
    .table-responsive .badge {
        font-size: 0.75rem !important;
        padding: 0.25rem 0.5rem !important;
        border-radius: 12px !important;
    }
    
    /* Mejorar enlaces de descripción de tareas */
    .table-responsive .table tbody tr td a.fw-bold {
        color: #495057 !important;
        text-decoration: none !important;
        font-size: 1rem !important;
        line-height: 1.3 !important;
    }
    
    .table-responsive .table tbody tr td a.fw-bold:hover {
        color: #007bff !important;
        text-decoration: underline !important;
    }
    
    /* Mejorar enlaces de tema asociado */
    .table-responsive .table tbody tr td a.text-muted {
        color: #6c757d !important;
        text-decoration: none !important;
        font-size: 0.85rem !important;
    }
    
    .table-responsive .table tbody tr td a.text-muted:hover {
        color: #495057 !important;
        text-decoration: underline !important;
    }
    
    /* Mejorar botones de acción para tareas */
    .table-responsive .table tbody tr td .btn-sm {
        padding: 0.25rem 0.5rem !important;
        font-size: 0.8rem !important;
        border-radius: 6px !important;
    }
    
    /* Mejorar fecha límite para tareas */
    .table-responsive .table tbody tr td[data-label="Fecha Límite"] {
        font-size: 0.85rem !important;
        color: #495057 !important;
    }
    
    /* Mejorar tema asociado */
    .table-responsive .table tbody tr td[data-label="Tema Asociado"] {
        font-size: 0.85rem !important;
        color: #495057 !important;
    }
    
    /* Mejorar colores de estado en móvil para tareas */
    .table-responsive .table-danger {
        background-color: #fff5f5 !important;
        border-left: 4px solid #dc3545 !important;
    }
    
    .table-responsive .table-warning {
        background-color: #fffbf0 !important;
        border-left: 4px solid #ffc107 !important;
    }
    
    .table-responsive .table-info {
        background-color: #f0f8ff !important;
        border-left: 4px solid #17a2b8 !important;
    }
    
    .table-responsive .table-success {
        background-color: #f0fff4 !important;
        border-left: 4px solid #28a745 !important;
    }
    
    /* Estilos específicos para la tabla de tareas */
    .table-responsive .table-sm tbody tr td {
        padding: 0.5rem 0.25rem !important;
        font-size: 0.9rem !important;
    }
    
    /* Mejorar truncado de texto en móvil */
    .table-responsive .table tbody tr td a {
        word-break: break-word !important;
        hyphens: auto !important;
    }
    
    /* Mejorar botones de acción para tareas */
    .table-responsive .table tbody tr td .btn-sm {
        padding: 0.25rem 0.5rem !important;
        font-size: 0.8rem !important;
        border-radius: 6px !important;
    }
    
    /* Centrar botón de acciones en móvil */
    .table-responsive .table tbody tr td[data-label="Acciones"] {
        text-align: center !important;
        vertical-align: middle !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }
    
    /* Mejorar apariencia del botón de acciones - mantener forma original */
    .table-responsive .table tbody tr td[data-label="Acciones"] .btn {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0.25rem 0.5rem !important;
        /* Mantener forma rectangular, no circular */
        border-radius: 6px !important;
        width: auto !important;
        height: auto !important;
        /* Centrado perfecto */
        margin: 0 !important;
    }
    
    /* Mejorar icono dentro del botón */
    .table-responsive .table tbody tr td[data-label="Acciones"] .btn i {
        font-size: 0.8rem !important;
        margin: 0 !important;
    }
    
    /* Hover effect para el botón */
    .table-responsive .table tbody tr td[data-label="Acciones"] .btn:hover {
        transform: scale(1.05) !important;
        transition: transform 0.2s ease !important;
    }
}