
    :root {
        --primary: #6366f1;
        --primary-dark: #4f46e5;
        --success: #10b981;
        --warning: #f59e0b;
        --danger: #ef4444;
        --info: #3b82f6;
        --gray-50: #f9fafb;
        --gray-100: #f3f4f6;
        --gray-200: #e5e7eb;
        --gray-500: #6b7280;
        --gray-700: #374151;
        --gray-900: #111827;
    }

    body {
        background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
        min-height: 100vh;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 240px;
        height: 100vh;
        background: linear-gradient(180deg, var(--gray-900) 0%, #1e293b 100%);
        padding: 1.5rem;
        z-index: 1000;
    }

    .sidebar-back {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.1);
        color: var(--gray-200);
        text-decoration: none;
        transition: all 0.2s;
        margin-bottom: 1rem;
    }

    .sidebar-back:hover {
        background: var(--primary);
        color: #fff;
    }

    .sidebar-brand {
        color: #fff;
        font-weight: 700;
        font-size: 1.25rem;
        margin-bottom: 2rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .sidebar-brand,
    .sidebar-brand * {
        text-decoration: none !important;
        border-bottom: 0 !important;
        color: #fff;
    }

    .sidebar-brand-button {
        cursor: pointer;
    }

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

    .sidebar-nav li {
        margin-bottom: 0.25rem;
    }

    .sidebar-nav a {
        color: var(--gray-200);
        text-decoration: none;
        padding: 0.75rem 1rem;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        border-radius: 8px;
        transition: all 0.2s;
    }

    .sidebar-nav a:hover,
    .sidebar-nav a.active {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
    }

    .sidebar-nav a.active {
        background: var(--primary);
    }

    .sidebar-panel-link {
        position: absolute;
        bottom: 1.5rem;
        left: 1.5rem;
        right: 1.5rem;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        color: var(--gray-200);
        text-decoration: none;
        font-size: 0.9rem;
        transition: all 0.2s;
    }

    .sidebar-panel-link:hover {
        background: var(--primary);
        border-color: var(--primary);
        color: #fff;
    }

    .main-content {
        margin-left: 240px;
        padding: 1.5rem 2rem;
    }

    .card {
        border: none;
        border-radius: 16px;
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
        background: #fff;
    }

    .kpi-card {
        background: #fff;
        border-radius: 16px;
        padding: 1.5rem;
        position: relative;
        overflow: hidden;
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    }

    .kpi-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 4px;
        height: 100%;
    }

    .kpi-card.primary::before {
        background: var(--primary);
    }

    .kpi-card.success::before {
        background: var(--success);
    }

    .kpi-card.warning::before {
        background: var(--warning);
    }

    .kpi-card.danger::before {
        background: var(--danger);
    }

    .kpi-card.info::before {
        background: var(--info);
    }

    .kpi-value {
        font-size: 2.5rem;
        font-weight: 700;
        line-height: 1;
        color: var(--gray-900);
    }

    .kpi-label {
        color: var(--gray-500);
        font-size: 0.875rem;
        margin-top: 0.5rem;
    }

    .kpi-trend {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
        border-radius: 20px;
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
    }

    .kpi-trend.up {
        background: #d1fae5;
        color: #065f46;
    }

    .kpi-trend.down {
        background: #fee2e2;
        color: #991b1b;
    }

    .funnel-container {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .funnel-bar {
        position: relative;
        height: 40px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 1rem;
        color: #fff;
        font-weight: 500;
        transition: all 0.3s;
    }

    .funnel-bar:hover {
        transform: translateX(4px);
    }

    .temp-badge {
        padding: 0.35rem 0.75rem;
        border-radius: 20px;
        font-size: 0.75rem;
        font-weight: 600;
    }

    .temp-fria {
        background: #dbeafe;
        color: #1e40af;
    }

    .temp-templada {
        background: #fef3c7;
        color: #92400e;
    }

    .temp-caliente {
        background: #fee2e2;
        color: #991b1b;
    }

    .activity-item {
        display: flex;
        gap: 1rem;
        padding: 1rem;
        border-radius: 12px;
        background: var(--gray-50);
        margin-bottom: 0.75rem;
        transition: all 0.2s;
    }

    .activity-item:hover {
        background: var(--gray-100);
    }

    .activity-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .activity-icon.correo {
        background: #dbeafe;
        color: #2563eb;
    }

    .activity-icon.seguimiento {
        background: #d1fae5;
        color: #059669;
    }

    .priority-card {
        border: 1px solid var(--gray-200);
        border-radius: 12px;
        padding: 1rem;
        margin-bottom: 0.75rem;
        transition: all 0.2s;
        cursor: pointer;
    }

    .priority-card:hover {
        border-color: var(--primary);
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
    }

    .progress-bar-custom {
        height: 8px;
        border-radius: 4px;
        background: var(--gray-200);
        overflow: hidden;
    }

    .progress-bar-custom .fill {
        height: 100%;
        border-radius: 4px;
        transition: width 0.5s ease;
    }

    .alert-card {
        padding: 1rem;
        border-radius: 12px;
        margin-bottom: 0.75rem;
        border-left: 4px solid;
    }

    .alert-card.warning {
        background: #fffbeb;
        border-color: var(--warning);
    }

    .alert-card.danger {
        background: #fef2f2;
        border-color: var(--danger);
    }

    .alert-card.success {
        background: #f0fdf4;
        border-color: var(--success);
    }

    .alert-card.info {
        background: #eff6ff;
        border-color: var(--info);
    }

    .section-title {
        font-weight: 700;
        font-size: 1.125rem;
        color: var(--gray-900);
        margin-bottom: 1rem;
    }

    .kanban-mini {
        display: flex;
        gap: 0.5rem;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .kanban-col {
        min-width: 140px;
        background: var(--gray-50);
        border-radius: 12px;
        padding: 0.75rem;
    }

    .kanban-col-title {
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--gray-500);
        text-transform: uppercase;
        margin-bottom: 0.5rem;
    }

    .kanban-count {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--gray-900);
    }

    .sector-tag {
        display: inline-block;
        padding: 0.25rem 0.75rem;
        background: var(--gray-100);
        border-radius: 20px;
        font-size: 0.75rem;
        color: var(--gray-700);
        margin: 0.25rem;
    }

    .chart-placeholder {
        height: 200px;
        background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
        border-radius: 12px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .bar-chart {
        display: flex;
        align-items: flex-end;
        gap: 0.5rem;
        height: 120px;
        padding: 1rem 0;
    }

    .bar-chart .bar {
        flex: 1;
        background: var(--primary);
        border-radius: 4px 4px 0 0;
        min-height: 8px;
        position: relative;
        transition: all 0.3s;
    }

    .bar-chart .bar:hover {
        opacity: 0.8;
    }

    .bar-chart .bar-label {
        position: absolute;
        bottom: -20px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 0.65rem;
        color: var(--gray-500);
    }

    /* ========================================= */
    /* SEARCH COMPONENT */
    /* ========================================= */
    .search-btn {
        background: var(--gray-100);
        border: 1px solid var(--gray-200);
        border-radius: 10px;
        padding: 0.5rem 1rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        color: var(--gray-500);
        cursor: pointer;
        transition: all 0.2s;
    }

    .search-btn:hover {
        background: var(--gray-200);
        color: var(--gray-700);
    }

    .search-modal .modal-content {
        border: none;
        border-radius: 16px;
        overflow: hidden;
    }

    .search-modal .modal-header {
        background: var(--gray-50);
        border-bottom: 1px solid var(--gray-200);
        padding: 1rem 1.5rem;
    }

    .search-modal .modal-body {
        padding: 1.5rem;
    }

    .search-input-group {
        position: relative;
    }

    .search-input-group .form-control {
        padding-left: 2.75rem;
        border-radius: 12px;
        border: 2px solid var(--gray-200);
        transition: all 0.2s;
    }

    .search-input-group .form-control:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    }

    .search-input-group .search-icon {
        position: absolute;
        left: 1rem;
        top: 50%;
        transform: translateY(-50%);
        color: var(--gray-500);
        pointer-events: none;
    }

    .search-filters {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: 1rem;
    }

    .filter-chip {
        padding: 0.35rem 0.75rem;
        border-radius: 20px;
        font-size: 0.8rem;
        border: 1px solid var(--gray-200);
        background: #fff;
        color: var(--gray-700);
        cursor: pointer;
        transition: all 0.2s;
    }

    .filter-chip:hover {
        border-color: var(--primary);
        color: var(--primary);
    }

    .filter-chip.active {
        background: var(--primary);
        border-color: var(--primary);
        color: #fff;
    }

    .search-results {
        margin-top: 1.5rem;
        max-height: 400px;
        overflow-y: auto;
    }

    .search-result-item {
        display: flex;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem;
        border-radius: 12px;
        background: var(--gray-50);
        margin-bottom: 0.75rem;
        cursor: pointer;
        transition: all 0.2s;
        text-decoration: none;
        color: inherit;
    }

    .search-result-item:hover {
        background: var(--gray-100);
        transform: translateX(4px);
    }

    .search-result-avatar {
        width: 48px;
        height: 48px;
        border-radius: 12px;
        background: var(--primary);
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: 1.1rem;
        flex-shrink: 0;
    }

    .search-result-info {
        flex: 1;
        min-width: 0;
    }

    .search-result-name {
        font-weight: 600;
        color: var(--gray-900);
        margin-bottom: 0.25rem;
    }

    .search-result-meta {
        font-size: 0.8rem;
        color: var(--gray-500);
    }

    .search-result-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
        margin-top: 0.5rem;
    }

    .search-empty {
        text-align: center;
        padding: 2rem;
        color: var(--gray-500);
    }

    .search-empty svg {
        width: 64px;
        height: 64px;
        margin-bottom: 1rem;
        opacity: 0.5;
    }

    /* ========================================= */
    /* FICHA EMPRESA MODAL */
    /* ========================================= */
    .ficha-header {
        display: flex;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
        padding-bottom: 1.5rem;
        border-bottom: 1px solid var(--gray-200);
    }

    .ficha-avatar {
        width: 64px;
        height: 64px;
        border-radius: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: 1.5rem;
        color: #fff;
        flex-shrink: 0;
    }

    .ficha-title-group {
        flex: 1;
    }

    .ficha-badges {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: 0.5rem;
    }

    .ficha-section {
        margin-bottom: 1.5rem;
    }

    .ficha-section-title {
        font-weight: 600;
        font-size: 0.875rem;
        color: var(--gray-500);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 0.75rem;
    }

    .ficha-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    @media (max-width: 576px) {
        .ficha-grid {
            grid-template-columns: 1fr;
        }
    }

    .ficha-field {
        background: var(--gray-50);
        padding: 0.75rem 1rem;
        border-radius: 10px;
    }

    .ficha-field-label {
        font-size: 0.75rem;
        color: var(--gray-500);
        margin-bottom: 0.25rem;
    }

    .ficha-field-value {
        font-weight: 500;
        color: var(--gray-900);
        word-break: break-word;
    }

    .ficha-field-value a {
        color: var(--primary);
        text-decoration: none;
    }

    .ficha-field-value a:hover {
        text-decoration: underline;
    }

    .ficha-notas {
        background: var(--gray-50);
        padding: 1rem;
        border-radius: 10px;
        white-space: pre-wrap;
        font-size: 0.9rem;
        color: var(--gray-700);
    }

    .ficha-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--gray-200);
    }

    .ficha-action-btn {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
        border-radius: 8px;
        font-size: 0.875rem;
        text-decoration: none;
        transition: all 0.2s;
    }

    .ficha-action-btn.email {
        background: #dbeafe;
        color: #1e40af;
    }

    .ficha-action-btn.phone {
        background: #d1fae5;
        color: #065f46;
    }

    .ficha-action-btn.web {
        background: #e0e7ff;
        color: #3730a3;
    }

    .ficha-action-btn:hover {
        opacity: 0.8;
        transform: translateY(-1px);
    }

    /* ========================================= */
    /* SEGUIMIENTO GLOBAL STYLES */
    /* ========================================= */
    .seguimiento-timeline {
        position: relative;
        padding-left: 1.5rem;
    }

    .seguimiento-timeline::before {
        content: '';
        position: absolute;
        left: 0.5rem;
        top: 0;
        bottom: 0;
        width: 2px;
        background: var(--gray-200);
    }

    .seguimiento-item {
        position: relative;
        padding-bottom: 1.5rem;
    }

    .seguimiento-item:last-child {
        padding-bottom: 0;
    }

    .seguimiento-item::before {
        content: '';
        position: absolute;
        left: -1.25rem;
        top: 0.25rem;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: var(--primary);
        border: 2px solid #fff;
        box-shadow: 0 0 0 2px var(--gray-200);
    }

    .seguimiento-item.completado::before {
        background: var(--success);
    }

    .seguimiento-item.pendiente::before {
        background: var(--warning);
    }

    .seguimiento-card {
        background: var(--gray-50);
        border-radius: 10px;
        padding: 1rem;
    }

    .seguimiento-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 0.5rem;
    }

    .seguimiento-hito {
        font-weight: 600;
        color: var(--gray-900);
        font-size: 0.9rem;
    }

    .seguimiento-fecha {
        font-size: 0.75rem;
        color: var(--gray-500);
    }

    .seguimiento-notas {
        font-size: 0.85rem;
        color: var(--gray-700);
        white-space: pre-wrap;
        line-height: 1.5;
        margin-top: 0.5rem;
    }

    .seguimiento-adjuntos {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: 0.75rem;
    }

    .adjunto-item {
        display: flex;
        align-items: center;
        gap: 0.35rem;
        padding: 0.35rem 0.6rem;
        background: #fff;
        border: 1px solid var(--gray-200);
        border-radius: 6px;
        font-size: 0.75rem;
        color: var(--gray-700);
        text-decoration: none;
        transition: all 0.2s;
    }

    .adjunto-item:hover {
        border-color: var(--primary);
        color: var(--primary);
    }

    .adjunto-item svg {
        width: 14px;
        height: 14px;
    }

    .estado-badge {
        font-size: 0.65rem;
        padding: 0.15rem 0.4rem;
        border-radius: 4px;
        text-transform: uppercase;
        font-weight: 600;
    }

    .estado-badge.pendiente {
        background: #fef3c7;
        color: #92400e;
    }

    .estado-badge.completado {
        background: #d1fae5;
        color: #065f46;
    }

    .estado-badge.en-proceso {
        background: #dbeafe;
        color: #1e40af;
    }

    .seguimiento-form textarea {
        min-height: 120px;
        resize: vertical;
    }

    .file-upload-area {
        border: 2px dashed var(--gray-300);
        border-radius: 10px;
        padding: 1.5rem;
        text-align: center;
        cursor: pointer;
        transition: all 0.2s;
        background: var(--gray-50);
    }

    .file-upload-area:hover {
        border-color: var(--primary);
        background: rgba(99, 102, 241, 0.05);
    }

    .file-list {
        margin-top: 1rem;
    }

    .file-list-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.5rem 0.75rem;
        background: var(--gray-50);
        border-radius: 6px;
        margin-bottom: 0.5rem;
        font-size: 0.85rem;
    }

    .file-list-item .remove-file {
        background: none;
        border: none;
        color: var(--danger);
        cursor: pointer;
        padding: 0.25rem;
    }

    #fichaEmpresaModal .modal-header {
        background: linear-gradient(135deg, var(--gray-900) 0%, #1e293b 100%);
        color: #fff;
        border-bottom: none;
    }

    #fichaEmpresaModal .modal-header .btn-close {
        filter: invert(1);
    }

    #fichaEmpresaModal .modal-header .text-muted {
        color: rgba(255, 255, 255, 0.7) !important;
    }

    /* ========================================= */
    /* MOBILE FIRST - RESPONSIVE STYLES */
    /* ========================================= */

    /* Bottom Navigation for Mobile */
    .mobile-nav {
        display: none;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--gray-900);
        padding: 0.5rem 0;
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
        z-index: 1100;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    }

    .mobile-nav-list {
        display: flex;
        justify-content: space-around;
        align-items: center;
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .mobile-nav-item {
        flex: 1;
    }

    .mobile-nav-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 0.5rem;
        color: var(--gray-500);
        text-decoration: none;
        font-size: 0.65rem;
        gap: 0.25rem;
        transition: color 0.2s;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-nav-link.active {
        color: var(--primary);
    }

    .mobile-nav-link svg {
        width: 24px;
        height: 24px;
    }

    /* Mobile Header */
    .mobile-header {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: var(--gray-900);
        color: #fff;
        padding: 1rem;
        padding-top: calc(1rem + env(safe-area-inset-top));
        z-index: 1050;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

    .mobile-header-title {
        font-weight: 700;
        font-size: 1.1rem;
    }

    /* Quick Action Button (FAB) */
    .fab-container {
        display: none;
        position: fixed;
        bottom: 80px;
        right: 1rem;
        z-index: 1050;
    }

    .fab-btn {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: var(--primary);
        color: #fff;
        border: none;
        box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
        display: flex;
        align-items: center;
        justify-content: center;
        -webkit-tap-highlight-color: transparent;
    }

    .fab-btn svg {
        width: 24px;
        height: 24px;
    }

    .fab-menu {
        position: absolute;
        bottom: 70px;
        right: 0;
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        padding: 0.5rem;
        display: none;
        min-width: 180px;
    }

    .fab-menu.show {
        display: block;
    }

    .fab-menu-item {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
        color: var(--gray-700);
        text-decoration: none;
        border-radius: 8px;
        font-size: 0.9rem;
    }

    .fab-menu-item:hover,
    .fab-menu-item:active {
        background: var(--gray-50);
        color: var(--primary);
    }

    @media (max-width: 991px) {
        .sidebar {
            display: none !important;
        }

        .mobile-nav {
            display: block;
        }

        .mobile-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .fab-container {
            display: block;
        }

        .main-content {
            margin-left: 0;
            padding: 1rem;
            padding-top: calc(70px + env(safe-area-inset-top));
            padding-bottom: calc(80px + env(safe-area-inset-bottom));
        }

        /* Larger touch targets */
        .form-control,
        .form-select {
            min-height: 48px;
            font-size: 16px !important;
            /* Prevents iOS zoom */
        }

        .btn {
            min-height: 48px;
            font-size: 1rem;
        }

        /* KPI cards mobile */
        .kpi-value {
            font-size: 1.75rem;
        }

        .kpi-card {
            padding: 1rem;
        }

        /* Cards mobile */
        .card {
            border-radius: 12px;
        }

        .card-body {
            padding: 1rem;
        }

        /* Funnel bars mobile */
        .funnel-bar {
            height: 36px;
            font-size: 0.8rem;
        }

        /* Hide non-essential on mobile */
        .hide-mobile {
            display: none !important;
        }

        /* Section titles mobile */
        .section-title {
            font-size: 1rem;
        }

        /* Activity items mobile */
        .activity-item {
            padding: 0.75rem;
        }

        .activity-icon {
            width: 36px;
            height: 36px;
        }

        /* Priority cards mobile */
        .priority-card {
            padding: 0.875rem;
        }

        /* Alert cards mobile */
        .alert-card {
            padding: 0.875rem;
        }
    }

    @media (max-width: 576px) {
        .main-content {
            padding: 0.75rem;
            padding-top: calc(65px + env(safe-area-inset-top));
            padding-bottom: calc(75px + env(safe-area-inset-bottom));
        }

        .row.g-3 {
            --bs-gutter-y: 0.75rem;
            --bs-gutter-x: 0.75rem;
        }

        .row.g-4 {
            --bs-gutter-y: 1rem;
            --bs-gutter-x: 1rem;
        }

        /* Even smaller KPIs */
        .kpi-value {
            font-size: 1.5rem;
        }

        .kpi-label {
            font-size: 0.75rem;
        }

        /* Kanban mini mobile */
        .kanban-col {
            min-width: 100px;
            padding: 0.5rem;
        }

        .kanban-col-title {
            font-size: 0.65rem;
        }

        .kanban-count {
            font-size: 1.25rem;
        }

        /* Mobile header */
        h1.h3,
        h2.h4 {
            font-size: 1.25rem;
        }
    }

    /* Pull to refresh indicator (visual only) */
    .ptr-indicator {
        display: none;
        position: fixed;
        top: calc(60px + env(safe-area-inset-top));
        left: 50%;
        transform: translateX(-50%);
        background: #fff;
        padding: 0.5rem 1rem;
        border-radius: 20px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        font-size: 0.8rem;
        color: var(--gray-500);
        z-index: 1000;
    }

    /* Touch-friendly select in kanban */
    @media (max-width: 991px) {
        .kanban-card-footer {
            flex-direction: column;
            gap: 0.5rem;
        }

        .kanban-card-footer form {
            width: 100%;
        }

        .kanban-card-footer select {
            width: 100% !important;
            min-height: 40px;
        }
    }

    /* Swipe hint for kanban */
    .swipe-hint {
        display: none;
        text-align: center;
        padding: 0.5rem;
        color: var(--gray-500);
        font-size: 0.75rem;
    }

    @media (max-width: 991px) {
        .swipe-hint {
            display: block;
        }
    }

    /* ========================================= */
    /* MOBILE MODAL OPTIMIZATION */
    /* ========================================= */
    @media (max-width: 991px) {
        /* Full screen modals on mobile */
        .modal-dialog.modal-lg,
        .modal-dialog.modal-xl {
            margin: 0;
            max-width: 100%;
            min-height: 100vh;
        }
        .modal-dialog.modal-lg .modal-content,
        .modal-dialog.modal-xl .modal-content {
            border-radius: 0;
            min-height: 100vh;
            border: none;
        }
        .modal-dialog-scrollable .modal-content {
            max-height: 100vh;
        }
        .modal-body {
            padding: 1rem;
        }
        .modal-footer {
            padding: 0.75rem 1rem;
            gap: 0.5rem;
            flex-wrap: wrap;
        }
        .modal-footer .btn {
            flex: 1;
            min-height: 48px;
        }
        /* Form columns stack on mobile */
        .modal-body .col-md-3,
        .modal-body .col-md-4,
        .modal-body .col-md-5,
        .modal-body .col-md-6,
        .modal-body .col-md-8 {
            flex: 0 0 100%;
            max-width: 100%;
        }
        /* Two columns for smaller items */
        .modal-body .col-md-3 {
            flex: 0 0 50%;
            max-width: 50%;
        }
    }

    @media (max-width: 576px) {
        /* Smaller modal padding on very small screens */
        .modal-body {
            padding: 0.75rem;
        }
        .modal-body .row.g-3 {
            --bs-gutter-y: 0.75rem;
            --bs-gutter-x: 0.75rem;
        }
        /* All columns full width on very small */
        .modal-body .col-md-3 {
            flex: 0 0 100%;
            max-width: 100%;
        }
        /* Sticky footer on mobile */
        .modal-footer {
            position: sticky;
            bottom: 0;
            background: #fff;
            border-top: 1px solid var(--gray-200);
            margin: 0 -0.75rem -0.75rem;
            padding: 0.75rem;
            width: calc(100% + 1.5rem);
        }
    }

    /* ========================================= */
    /* TOUCH IMPROVEMENTS */
    /* ========================================= */
    @media (max-width: 991px) {
        /* Ensure minimum touch target size */
        .btn-sm {
            min-height: 40px;
            min-width: 40px;
            padding: 0.5rem 0.75rem;
        }
        /* Better touch feedback */
        .btn:active,
        .card:active,
        .activity-item:active {
            transform: scale(0.98);
        }
        /* Remove hover effects that look stuck on mobile */
        .priority-card:hover,
        .kanban-card:hover,
        .activity-item:hover {
            transform: none;
            box-shadow: none;
        }
        .priority-card:active,
        .kanban-card:active {
            transform: scale(0.98);
            border-color: var(--primary);
        }
    }

    /* ========================================= */
    /* FICHA EMPRESA MOBILE */
    /* ========================================= */
    @media (max-width: 991px) {
        .ficha-header {
            flex-direction: column;
            text-align: center;
        }
        .ficha-avatar {
            margin: 0 auto 1rem;
        }
        .ficha-badges {
            justify-content: center;
        }
        .ficha-actions {
            justify-content: center;
        }
        .ficha-action-btn {
            flex: 1;
            justify-content: center;
            min-height: 44px;
        }
    }

    @media (max-width: 576px) {
        .ficha-action-btn {
            flex: 0 0 100%;
        }
    }

    /* ========================================= */
    /* DASHBOARD MOBILE */
    /* ========================================= */
    @media (max-width: 991px) {
        /* Table responsive improvements */
        .table-responsive {
            margin: 0 -1rem;
            padding: 0 1rem;
        }
        .table th,
        .table td {
            padding: 0.5rem 0.25rem;
            font-size: 0.85rem;
        }
        /* Hide less important columns on mobile */
        .table th:nth-child(4),
        .table td:nth-child(4) {
            display: none;
        }
    }

    @media (max-width: 576px) {
        /* Even more compact table */
        .table th:nth-child(2),
        .table td:nth-child(2) {
            display: none;
        }
        .table th,
        .table td {
            padding: 0.4rem 0.2rem;
            font-size: 0.8rem;
        }
        /* Dashboard alerts */
        .alert {
            font-size: 0.9rem;
            padding: 0.75rem;
        }
        /* Kanban mini scroll */
        .kanban-mini {
            -webkit-overflow-scrolling: touch;
        }
    }
