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

:root {
    /* Secretaría de Seguridad - Paleta institucional 2026 */
    --navy-deep: #ffffff;         /* principal */
    --navy-institutional: #0F3D63;/* header / sidebar */
    --navy-operational: #1B5E8C;  /* accents */
    --steel-gray: #2F3E46;
    --bg: #F1F4F6;                /* general background */
    --surface: #ffffff;           /* cards and surfaces */
    --green-ok: #1E7F4F;          /* cumplimiento */
    --red-alert: #A12622;         /* alerta */
    --gold: #A98C2C;              /* institucional discreto */
    --text: #0F172A;
    --text-secondary: #64748b;
    --border: #d9dde0;
}

body {
    font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* Login Page - Modern Premium Design */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: url('/fondito.jpeg') no-repeat center center;
    background-size: cover;
}

/* Background overlay with blur */
.login-background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1;
}

/* Loading spinner */
.login-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.login-loader p {
    color: white;
    font-size: 16px;
    font-weight: 500;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.login-container {
    width: 100%;
    max-width: 480px;
    padding: 0;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    animation: slideUp 0.8s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Static circular logo container */
.login-logo-container {
    animation: logoFadeIn 1s ease-out 0.3s both;
}

@keyframes logoFadeIn {
    from {
        opacity: 0;
        transform: scale(0.7) translateY(-30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Simplified logo layout: show actual logo image without decorative circle */
.login-logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 18px;
    padding: 0 12px;
    animation: logoFadeIn 1s ease-out 0.3s both;
}

.login-logo-static {
    width: clamp(320px, 40vw, 500px);
    max-width: 100%;
    height: auto;
    max-height: 240px;
    object-fit: contain;
    object-position: center;
    border-radius: 0;
    background: transparent;
    padding: 0;
    box-shadow: none;
    display: block;
    filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.28));
}

/* Removed separate user avatar (design simplified) */
/* The login page no longer shows the small user avatar under the logo; the logo image is used directly. */

.login-avatar svg {
    width: 48px;
    height: 48px;
    color: white;
}

/* Small user-style button on login, matches navbar-user-info visual language */
.login-user-button {
    margin-top: 12px;
    width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 16px;
    /* Updated: Deep institutional blue gradient similar to reference */
    background: linear-gradient(135deg, #0F3D63 0%, #0B5A8C 40%, #0F78B3 100%);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 28px;
    color: #ffffff;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.2,0.9,0.2,1);
    box-shadow: 0 8px 22px rgba(11,61,99,0.20);
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 1px 0 rgba(0,0,0,0.15);
}

.login-user-button:hover {
    background: linear-gradient(135deg, #0B5A8C 0%, #0F78B3 60%, #2B9CE0 100%);
    transform: translateY(-3px);
    box-shadow: 0 14px 36px rgba(11,61,99,0.26);
}

/* Modern form */
.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: formFadeIn 0.8s ease-out 0.9s both;
}

@keyframes formFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group-modern {
    position: relative;
}

.input-modern {
    width: 50%;
    padding: 18px 24px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 60px;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #ffffff;
    transition: all 0.4s ease;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    margin-left: auto;
    margin-right: auto;
    display: block;
}

/* Ensure the password input leaves space for the eye toggle when inside the password-group */
.password-group .input-modern {
    width: 100%;
    padding-right: 48px; /* room for the toggle */
    box-sizing: border-box;
}

.input-modern::placeholder {
    color: rgba(255, 255, 255, 0.55);
    font-weight: 400;
    font-size: 15px;
}

.input-modern:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.8);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 
        0 0 0 5px rgba(59, 130, 246, 0.2),
        0 8px 30px rgba(59, 130, 246, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
}

/* Password group with eye toggle */
.password-group {
    /* make the password group match the input width so the absolute toggle sits at the input's right */
    position: relative;
    width: 50%;
    margin-left: auto;
    margin-right: auto;
    display: block;
}

.password-toggle {
    position: absolute;
    /* sit at the inner-right edge of the centered password input box */
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.password-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.password-toggle svg {
    width: 24px;
    height: 24px;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
}

.password-toggle:hover svg {
    color: #ffffff;
}

/* Error message - reduced size variant */
.error-message-modern {
    width: 50%;
    margin: 12px auto 0 auto;
    padding: 8px 12px;
    background: rgba(254, 202, 202, 0.22);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fee2e2;
    border-radius: 32px;
    font-size: 12px;
    border: 1.5px solid rgba(254, 226, 226, 0.28);
    font-weight: 600;
    text-align: center;
    animation: shake 0.45s ease;
    box-shadow:
        0 3px 12px rgba(239, 68, 68, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    display: inline-block;
    max-width: 320px;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Responsive */
@media (max-width: 480px) {
    .logo-circle {
        width: 360px;
        height: 360px;
    }
    
    .login-avatar {
        width: 75px;
        height: 75px;
    }
    
    .login-avatar svg {
        width: 40px;
        height: 40px;
    }
    
    .login-container {
        max-width: 100%;
        padding: 0 20px;
        gap: 24px;
    }
    
    .input-modern {
        padding: 16px 22px;
        font-size: 15px;
    }
}

/* Dashboard */
.navbar {
    background: linear-gradient(135deg, #0a2a4a 0%, #0f3a63 100%);
    color: white;
    border-bottom: 1px solid rgba(184, 124, 77, 0.3);
    padding: 20px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-radius: 0 0 20px 20px;
    position: relative;
    overflow: hidden;
}

/* Unified sidebar toggle button - show on all screens */
#sidebarToggle {
    display: inline-flex;
}

/* Animated rust-colored top line */
.navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, 
        transparent 0%,
        #b87c4d 20%,
        #d8b45d 50%,
        #b87c4d 80%,
        transparent 100%);
    animation: lineaBrillo 3s infinite;
}

/* Subtle particle effect */
.navbar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(184, 124, 77, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

@keyframes lineaBrillo {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1 1 auto;
    min-width: 0;
}

.navbar-logo {
    width: clamp(250px, 22vw, 360px);
    height: auto;
    max-height: 96px;
    object-fit: contain;
    object-position: center;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.28));
    /* Animation removed to keep logo static */
    animation: none;
    flex: 0 0 auto;
}

.navbar-brand h1 {
    display: none;
    font-size: 32px;
    font-weight: 700;
    color: white;
    position: relative;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.navbar-brand h1::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 60px;
    height: 3px;
    background: #b87c4d;
    transition: width 0.3s ease;
}

.navbar-brand:hover h1::after {
    width: 100%;
}

@keyframes textShine {
    0% {
        background-position: 0% center;
    }
    50% {
        background-position: 100% center;
    }
    100% {
        background-position: 0% center;
    }
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 0 0 auto;
}

.navbar-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.navbar-user-info:hover {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
}

.navbar-user-info:hover .user-avatar {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.navbar-user span {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}

.btn-logout {
    padding: 10px 20px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.btn-logout:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-logout:active {
    transform: translateY(0);
}

.dashboard-container {
    display: flex;
    height: calc(100vh - 65px);
    position: relative;
    overflow: hidden;
}

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--navy-institutional), rgba(11,61,99,0.98));
    color: #e6f0fb;
    border-right: 1px solid rgba(255,255,255,0.04);
    padding: 20px 0;
    transition: all 0.3s ease;
    position: relative;
    z-index: 100;
    flex-shrink: 0;
}

body.sidebar-collapsed .sidebar {
    width: 70px;
}

body.sidebar-collapsed .sidebar .nav-item span:not(.nav-icon) {
    display: none;
}

body.sidebar-hidden .sidebar {
    transform: translateX(-260px);
}

body.sidebar-hidden .main-content {
    margin-left: 0;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    width: 100%;
    max-width: 100%;
    transition: margin-left 0.3s ease;
}

.nav-menu {
    list-style: none;
}

.nav-item {
    padding: 12px 22px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    color: rgba(230,240,251,0.95);
    font-size: 14px;
    transition: background 0.18s ease;
    border-radius: 4px 0 0 4px;
    margin: 6px 8px;
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: linear-gradient(180deg, var(--primary), var(--primary-light));
    border-radius: 0 4px 4px 0;
    transition: height 0.3s ease;
}

.nav-item:hover {
    background: linear-gradient(90deg, #f0f9ff 0%, transparent 100%);
    color: var(--text);
    padding-left: 28px;
}

.nav-item:hover::before {
    height: 60%;
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(255,255,255,0.03), rgba(255,255,255,0.02));
    color: var(--gold);
    border-right: 3px solid var(--gold);
    font-weight: 700;
}

.nav-item.active::before {
    height: 100%;
}

.nav-icon {
    font-size: 18px;
}

/* GLOBAL TABLE RESPONSIVE WRAPPER */
.table-responsive-global,
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table-responsive-global table,
.table-responsive table {
    min-width: 900px;
    width: 100%;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.view h2 {
    font-size: 28px;
    margin-bottom: 24px;
}

/* Dashboard Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.dashboard-title {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #0F2C59 0%, #1B5E8C 50%, #0F2C59 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    animation: titleGradient 3s ease infinite;
    text-shadow: 0 2px 4px rgba(15, 44, 89, 0.1);
}

@keyframes titleGradient {
    0%, 100% {
        background-position: 0% center;
    }
    50% {
        background-position: 100% center;
    }
}

.dashboard-filters {
    display: flex;
    gap: 12px;
}

.filter-select {
    padding: 10px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    font-size: 14px;
    color: #0f172a;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-select:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.filter-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Row 1: Strategic KPI Cards - Clean Governmental Style */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: #ffffff;
    padding: 20px;
    border-radius: 16px;
    border: 2px solid #eef2f6;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Animated rust-colored gradient border */
.kpi-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 3px;
    background: linear-gradient(135deg, #b87c4d, #d8b45d, #b87c4d);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.kpi-card:hover::before {
    opacity: 1;
}

/* Rust-colored bottom line */
.kpi-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 4px;
    background: linear-gradient(90deg, #b87c4d, #d8b45d);
    transform: translateX(-50%);
    transition: width 0.4s ease;
}

.kpi-card:hover::after {
    width: 90%;
}

.kpi-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 40px -15px rgba(184, 124, 77, 0.3);
    border-color: transparent;
}

.kpi-icon-minimal {
    font-size: 20px;
    color: #6b7280;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.kpi-card:hover .kpi-icon-minimal {
    color: #b87c4d;
    transform: scale(1.15);
}

.kpi-value {
    font-size: 32px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
    margin-bottom: 8px;
    font-variant-numeric: tabular-nums;
    font-family: 'Inter', -apple-system, sans-serif;
    transition: all 0.3s ease;
}

.kpi-card:hover .kpi-value {
    color: #b87c4d;
    transform: scale(1.1);
}

.kpi-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
    position: relative;
    display: inline-block;
    padding-bottom: 5px;
}

.kpi-label::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #b87c4d;
    transition: width 0.3s ease;
}

.kpi-card:hover .kpi-label {
    color: #b87c4d;
}

.kpi-card:hover .kpi-label::after {
    width: 100%;
}

.kpi-card.kpi-active {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 40px -15px rgba(184, 124, 77, 0.4);
    border-color: transparent;
    background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
}

.kpi-card.kpi-active::before {
    opacity: 1;
}

.kpi-card.kpi-active::after {
    width: 90%;
}

.kpi-card.kpi-active .kpi-value {
    color: #b87c4d;
}

.kpi-card.kpi-active .kpi-label {
    color: #b87c4d;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Row 2: Project Status Overview - Clean Section */
.status-overview-section {
    margin-bottom: 24px;
}

.status-card-clean {
    background: #ffffff;
    padding: 24px;
    border-radius: 16px;
    border: 2px solid #eef2f6;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.status-card-clean:hover {
    box-shadow: 0 20px 30px -10px rgba(184, 124, 77, 0.2);
    transform: translateY(-5px);
}

.section-title-clean {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #0F2C59;
    padding-bottom: 8px;
}

/* Row 3: Strategic Tracking - Two Columns */
.strategic-tracking-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.tracking-left,
.tracking-right {
    background: #ffffff;
    padding: 24px;
    border-radius: 16px;
    border: 2px solid #eef2f6;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tracking-left:hover,
.tracking-right:hover {
    box-shadow: 0 20px 30px -10px rgba(184, 124, 77, 0.2);
    transform: translateY(-5px);
}

/* Critical Projects Table */
#criticalProjectsTable {
    overflow-x: auto;
}

#criticalProjectsTable table {
    width: 100%;
    border-collapse: collapse;
}

#criticalProjectsTable thead {
    background: #f9fafb;
}

#criticalProjectsTable th {
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e5e7eb;
}

#criticalProjectsTable td {
    padding: 12px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
    color: #374151;
}

#criticalProjectsTable tbody tr {
    transition: all 0.3s ease;
}

#criticalProjectsTable tbody tr:hover {
    background: rgba(184, 124, 77, 0.05);
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#criticalProjectsTable tbody tr:hover td:first-child {
    border-left: 4px solid #b87c4d;
    padding-left: 8px;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .strategic-tracking-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Legacy chart containers (keep for other views) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.15);
    border-color: var(--primary-light);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.chart-container {
    background: var(--surface);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.chart-container h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--text);
}

.btn-primary, .btn-secondary {
    /* Larger touch targets for mobile friendliness */
    padding: 14px 28px;
    min-height: 44px;         /* ensures 44x44 minimum tap size */
    min-width: 44px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    touch-action: manipulation; /* improve responsiveness on touch devices */
    -webkit-tap-highlight-color: rgba(0,0,0,0); /* reduce tap flash */
}

/* Ensure icon-style buttons and small inline controls meet touch minimums */
.btn-icon {
    padding: 10px 12px;
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 14px;
    touch-action: manipulation;
}

/* Make password visibility toggle easier to tap */
.password-toggle {
    padding: 10px;
    min-height: 44px;
    min-width: 44px;
    border-radius: 10px;
    right: 8px;
}

/* Login primary button larger and touch friendly */
.login-user-button {
    padding: 14px 26px;
    min-height: 48px;
    min-width: 160px;
    font-size: 16px;
    border-radius: 28px;
    touch-action: manipulation;
}

/* Mobile: increase spacing between stacked touch elements */
@media (max-width: 480px) {
    .btn-primary, .btn-secondary {
        padding: 16px 20px;
        font-size: 16px;
        min-height: 50px;
        width: 100%;
    }

    .btn-icon {
        padding: 12px;
        min-height: 48px;
        min-width: 48px;
    }

    .password-group, .form-group-modern, .form-group {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .input-modern {
        width: 100%;
        padding: 16px 20px;
    }

    /* Ensure nav items are easy to tap on mobile */
    .nav-item {
        padding: 14px 18px;
        font-size: 16px;
    }

    .mobile-menu-popup .mobile-menu-item {
        padding: 16px 18px;
        font-size: 16px;
    }
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(59, 130, 246, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-secondary {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.btn-secondary:active {
    transform: translateY(0);
}

.data-table {
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.15s ease;
}

.modal-content {
    background: var(--surface);
    padding: 32px;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    padding: 0;
}

.modal-close:hover {
    color: var(--text);
    background: rgba(0, 0, 0, 0.08);
    transform: scale(1.05);
}

.modal-close:active {
    transform: scale(0.98);
    background: rgba(0, 0, 0, 0.1);
}

.btn-modal-close {
    min-width: 160px;
    max-width: 220px;
    padding: 12px 32px;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-modal-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(59, 130, 246, 0.35);
}

.btn-modal-close:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.reports-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 800px;
}

.report-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: #2563eb;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: var(--bg);
}

table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

table tbody tr {
    transition: all 0.3s ease;
}

table tbody tr:hover {
    background: linear-gradient(90deg, #f0f9ff 0%, transparent 100%);
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
}

table td {
    padding: 16px;
    border-top: 1px solid var(--border);
}

/* Unified badge base for modern, accessible state chips */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 12px;
    min-height: 28px;
    line-height: 1;
    border-radius: 999px; /* fully rounded pill */
    font-size: 12px;
    font-weight: 700; /* bold text per design */
    letter-spacing: -0.01em;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    box-shadow: 0 4px 10px rgba(2, 6, 23, 0.06);
    border: 1px solid rgba(15, 23, 42, 0.06);
    color: #0f172a;
    white-space: nowrap;
}

/* Hover affordance */
.badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(2, 6, 23, 0.08);
}

/* State-specific badges (projects module) */
/* Pendiente - Yellow (not started) */
.badge-pendiente {
    background: linear-gradient(180deg, #fff7cc 0%, #fff0a6 100%); /* soft yellow background */
    color: #6b4a00; /* dark yellow text for contrast */
    border: 1px solid rgba(107,74,0,0.10);
    box-shadow: 0 6px 18px rgba(107,74,0,0.06);
    font-weight: 700;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 999px;
}

/* Proceso - Blue (in execution) */
.badge-proceso {
    background: linear-gradient(180deg, #e7f0ff 0%, #d0e4ff 100%); /* soft blue background */
    color: #073165; /* dark blue text for contrast */
    border: 1px solid rgba(7,49,101,0.10);
    box-shadow: 0 6px 18px rgba(7,49,101,0.06);
    font-weight: 700;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 999px;
}

/* Pausado - Grey (temporarily stopped) */
.badge-pausado {
    background: linear-gradient(180deg, #f3f4f6 0%, #eaedf0 100%); /* light grey background */
    color: #374151; /* dark grey text */
    border: 1px solid rgba(55,65,81,0.08);
    box-shadow: 0 6px 18px rgba(15,23,42,0.04);
    font-weight: 700;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 999px;
}

/* Realizado - Green (completed) */
.badge-realizado {
    background: linear-gradient(180deg, #e9fff0 0%, #c9f8db 100%); /* soft green background */
    color: #064e3b; /* dark green text */
    border: 1px solid rgba(6,78,59,0.08);
    box-shadow: 0 6px 18px rgba(6,78,59,0.06);
    font-weight: 700;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 999px;
}

/* Cancelado - Red (annulled) */
.badge-cancelado {
    background: linear-gradient(180deg, #fff1f1 0%, #ffd6d6 100%); /* soft red background */
    color: #7a1b1b; /* dark red text */
    border: 1px solid rgba(122,27,27,0.08);
    box-shadow: 0 6px 18px rgba(122,27,27,0.06);
    font-weight: 700;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 999px;
}

/* Ensure uniform size across module components */
.phase-badge, .badge, .badge-pendiente, .badge-proceso, .badge-pausado, .badge-realizado, .badge-cancelado {
    min-width: 84px;
    text-align: center;
    padding-left: 10px;
    padding-right: 10px;
}

/* Small responsive tweak */
@media (max-width: 480px) {
    .badge {
        min-width: 68px;
        font-size: 11px;
    }
}

.config-section {
    margin-bottom: 48px;
}

/* Vertical layout: Areas and Sub-areas stacked one below the other */
.contenedor-configuracion {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
}

/* Each card takes full width */
.card-areas,
.card-subareas {
    width: 100%;
}

/* Ensure inner padding / visual consistency */
.card-areas .data-table,
.card-subareas .data-table {
    width: 100%;
}

.config-section h3 {
    font-size: 20px;
    margin-bottom: 16px;
    color: var(--text);
}

.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    min-width: 300px;
    padding: 16px 20px;
    background: var(--surface);
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
    border-left: 4px solid;
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.warning {
    border-left-color: var(--warning);
}

.toast.info {
    border-left-color: var(--primary);
}

.toast-icon {
    font-size: 20px;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: var(--text);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

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

/* Notification Bell Styles */
.btn-notification-bell:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-notification-bell:active {
    transform: translateY(0);
}

.notification-dropdown {
    animation: notificationSlideIn 0.3s ease-out;
}

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

.notification-item {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    gap: 12px;
    align-items: start;
}

.notification-item:hover {
    background: linear-gradient(90deg, #f0f9ff 0%, transparent 100%);
}

.notification-item.unread {
    background: linear-gradient(90deg, #eff6ff 0%, #f8fafc 100%);
}

.notification-item.unread::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}

.notification-item.read::before {
    content: '';
    width: 8px;
    height: 8px;
    background: transparent;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.btn-group {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
}

.btn-cancel {
    padding: 12px 24px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    color: var(--text);
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.btn-cancel:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.btn-cancel:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.action-btns {
    display: flex;
    gap: 8px;
}

.btn-icon {
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-edit {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}

.btn-edit:hover {
    background: linear-gradient(135deg, #bfdbfe 0%, #93c5fd 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.2);
}

.btn-delete {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    position: relative;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-delete:hover {
    background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.2);
}

.btn-delete:active {
    transform: translateY(0);
}

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

/* Tooltip for delete button */
.btn-delete[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: #0f172a;
    color: white;
    font-size: 11px;
    white-space: nowrap;
    border-radius: 4px;
    margin-bottom: 4px;
    z-index: 1000;
}

.btn-view {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #374151;
}

.btn-view:hover {
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-icon:active {
    transform: translateY(0);
}

/* SweetAlert2 Custom Styles */
.swal-custom-popup {
    border-radius: 16px !important;
    padding: 24px !important;
}

.swal-custom-confirm {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 12px 24px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2) !important;
}

.swal-custom-confirm:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3) !important;
}

.swal-custom-cancel {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    color: #0f172a !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 10px !important;
    padding: 12px 24px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.swal-custom-cancel:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

/* GLOBAL RESPONSIVE UTILITIES */
.main-content {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Responsive table wrapper for ALL data tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table-responsive table {
    min-width: 900px;
    width: 100%;
}

/* Unified form row styling */
.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
}

@media (max-width: 1200px) {
    .main-content {
        padding: 24px 16px;
    }
}

@media (max-width: 1024px) {
    .kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .strategic-tracking-section {
        grid-template-columns: 1fr;
    }
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Desktop: collapsible sidebar */
@media (min-width: 768px) {
    body.sidebar-collapsed .sidebar {
        width: 70px;
    }
    
    body.sidebar-collapsed .sidebar .nav-item span:not(.nav-icon) {
        display: none;
    }
}

/* Mobile: overlay sidebar */
@media (max-width: 767px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-260px);
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
        z-index: 100;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    body.sidebar-open .sidebar {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 20px 12px;
    }
    
    .navbar-user-info {
        display: none;
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .dashboard-filters {
        width: 100%;
        flex-direction: column;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .kpi-card {
        padding: 16px;
    }
    
    .kpi-value {
        font-size: 28px;
    }
    
    .main-content {
        padding: 20px 12px;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group button {
        width: 100%;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .toast-container {
        right: 12px;
        left: 12px;
    }
    
    .toast {
        min-width: auto;
    }
    
    .status-grid {
        grid-template-columns: 1fr;
    }
    
    .action-btns {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .table-responsive {
        border-radius: 8px;
    }
    
    .contenedor-configuracion {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-title {
        font-size: 20px;
    }
    
    .navbar-brand h1 {
        font-size: 18px;
    }
    
    .navbar-logo {
        width: clamp(170px, 48vw, 220px);
        height: auto;
        max-height: 60px;
    }
    
    .kpi-value {
        font-size: 24px;
    }
    
    .kpi-label {
        font-size: 10px;
    }
    
    table {
        font-size: 12px;
    }
    
    table th,
    table td {
        padding: 10px 8px;
    }
}




/* =========================================================
   Premium responsive fixes requested by user
   ========================================================= */
@media (max-width: 767px) {
    .navbar {
        padding: 18px 14px;
        gap: 10px;
        flex-wrap: nowrap;
    }

    .navbar-brand {
        gap: 8px;
        min-width: 0;
        flex: 1 1 auto;
    }

    .navbar-brand h1 {
        display: none;
    }

    .navbar-logo {
        width: clamp(175px, 50vw, 235px);
        max-height: 64px;
    }

    .navbar-user {
        gap: 10px;
        margin-left: auto;
    }

    #notificationBell,
    .btn-notification-bell {
        padding: 10px 12px !important;
        min-width: 46px !important;
        min-height: 46px !important;
    }

    .btn-logout {
        padding: 10px 14px;
        font-size: 13px;
        white-space: nowrap;
    }

    .login-logo-static {
        width: clamp(250px, 78vw, 360px);
        max-height: 210px;
    }
}


/* Premium banner optimization */
.navbar-brand {
    max-width: min(42vw, 430px);
}

.navbar-logo {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

@media (min-width: 768px) {
    .navbar-user {
        gap: 14px;
    }

    .btn-logout {
        min-width: 132px;
    }
}

#modal .premium-form .sige-word-toolbar button,
#modal .premium-form .sige-word-toolbar select,
#modal .premium-form .sige-word-toolbar .sige-word-btn,
#modal .premium-form .sige-word-toolbar .sige-word-select,
#modal .premium-form .sige-word-toolbar .sige-color-tool {
    width: auto !important;
    flex: 0 0 auto !important;
}

#modal .premium-form .sige-word-toolbar {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

#modal .premium-form .sige-word-toolbar::-webkit-scrollbar {
    height: 6px;
}

#modal .premium-form .sige-word-toolbar::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.35);
    border-radius: 999px;
}

@media (max-width: 768px) {
    .sige-word-toolbar {
        flex-wrap: nowrap;
        gap: 6px;
        padding-bottom: 10px;
    }

    .sige-word-btn,
    .sige-word-select,
    .sige-color-tool {
        white-space: nowrap;
        flex: 0 0 auto;
    }

    .sige-word-select {
        min-width: 86px;
    }
}

/* Institutional footer */
footer {
    background: var(--navy-deep);
    color: #ffffff;
    padding: 12px 24px;
    text-align: center;
    font-size: 13px;
    position: relative;
    bottom: 0;
    width: 100%;
    z-index: 10;
}

.section-title-note{margin:4px 0 14px 0;font-size:13px;color:#64748b;font-weight:500;}
.dashboard-card-grid{margin-top:20px;}
.dashboard-chart-card{background:#fff;border:1px solid #e5e7eb;border-radius:14px;padding:18px;box-shadow:0 2px 10px rgba(15,23,42,.04);}
.dashboard-card-header h4{margin:0;font-size:14px;color:#1f3b64;font-weight:700;}
.dashboard-card-header p{margin:6px 0 12px 0;font-size:12px;color:#6b7280;}
.dashboard-status-layout{display:flex;gap:18px;align-items:center;justify-content:space-between;flex-wrap:wrap;}
.status-legend-panel{min-width:260px;max-width:320px;flex:0 0 280px;}
.status-legend-row{display:grid;grid-template-columns:18px 1fr auto auto;gap:10px;align-items:center;padding:8px 0;border-bottom:1px solid #f1f5f9;font-size:13px;}
.status-legend-row:last-child{border-bottom:none;}
.status-color{width:14px;height:14px;border-radius:4px;}
.chart-foot-summary{margin-top:10px;padding:10px 12px;border-radius:10px;background:#f8fafc;border:1px solid #e5e7eb;font-size:12px;color:#475569;display:flex;gap:10px;flex-wrap:wrap;}
.chart-foot-pill{background:#eaf2ff;color:#1d4ed8;border-radius:999px;padding:6px 10px;font-weight:700;font-size:12px;}
.chart-inline-summary{margin:8px 0 8px 0;display:inline-flex;align-items:center;gap:8px;background:#f8fafc;border:1px solid #e5e7eb;border-radius:12px;padding:8px 12px;font-size:12px;color:#334155;font-weight:700;}
@media (max-width: 1024px){.status-legend-panel{flex:1 1 100%;max-width:none;}}


/* Premium dashboard live refresh */
#chartProjectsStatusBar,
#chartActivitiesStatus,
#chartProgressByArea,
#criticalProjectsTable,
#comparisonSummary {
  position: relative;
  transition: opacity .18s ease, transform .18s ease, filter .18s ease;
}

#chartProjectsStatusBar.is-refreshing,
#chartActivitiesStatus.is-refreshing,
#chartProgressByArea.is-refreshing,
#criticalProjectsTable.is-refreshing,
#comparisonSummary.is-refreshing {
  opacity: .72;
  filter: saturate(.94);
}

#chartProjectsStatusBar.is-refreshing::after,
#chartActivitiesStatus.is-refreshing::after,
#chartProgressByArea.is-refreshing::after,
#criticalProjectsTable.is-refreshing::after,
#comparisonSummary.is-refreshing::after {
  content: 'Actualizando...';
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  background: rgba(255,255,255,.95);
  color: #0f3d63;
  border: 1px solid #dbe5f0;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2px;
  box-shadow: 0 6px 20px rgba(15,23,42,.08);
}

.dashboard-busy .dashboard-filters .filter-select,
.dashboard-busy .dashboard-filters input,
.dashboard-busy .dashboard-filters button {
  transition: box-shadow .18s ease, border-color .18s ease;
}


/* =========================================================
   PREMIUM RESPONSIVE PERFORMANCE PATCH
   Evita salto horizontal global sin afectar tablas internas.
   ========================================================= */
html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

*, *::before, *::after {
    box-sizing: border-box;
}

.dashboard-container,
.main-content,
.view,
.card,
.modal-content,
.form-row,
.dashboard-filters,
.kpi-grid,
.charts-grid,
.stats-grid {
    min-width: 0;
    max-width: 100%;
}

input,
select,
textarea,
button,
.filter-select,
.input-modern {
    max-width: 100%;
}

.table-responsive,
.table-responsive-global {
    max-width: 100%;
    overscroll-behavior-x: contain;
}

@media (max-width: 768px) {
    .main-content {
        width: 100%;
        min-width: 0;
        padding-left: 12px;
        padding-right: 12px;
    }

    .dashboard-filters > div,
    .dashboard-filters select,
    .dashboard-filters input,
    #activitiesSearch,
    #projectsSearch,
    #activitiesPageSize,
    #projectsPageSize {
        width: 100% !important;
        min-width: 0 !important;
    }

    .table-responsive,
    .table-responsive-global {
        max-width: calc(100vw - 24px);
    }
}

/* =========================================================
   PRODUCCIÓN 2026 - AJUSTES FINALES PREMIUM / RESPONSIVE
   ========================================================= */
:root {
    --app-safe-radius: 16px;
    --app-border-soft: rgba(148, 163, 184, .28);
}

img, svg, canvas, video {
    max-width: 100%;
    height: auto;
}

.card, .stat-card, .kpi-card, .chart-card, .dashboard-card,
.modal-content, .table-container, .content-card {
    border-color: var(--app-border-soft);
    backface-visibility: hidden;
}

button, .btn, .nav-link, .menu-item, input, select, textarea {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible, .btn:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, a:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .28);
    outline-offset: 2px;
}

.swal2-popup {
    border-radius: 20px !important;
}

@media (max-width: 1024px) {
    .dashboard-grid, .charts-grid, .kpi-grid, .stats-grid,
    .cards-grid, .modules-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    .sidebar, .sidebar.active {
        max-width: min(86vw, 320px);
    }

    .dashboard-grid, .charts-grid, .kpi-grid, .stats-grid,
    .cards-grid, .modules-grid, .form-grid, .form-row {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .modal-content {
        width: calc(100vw - 24px) !important;
        max-height: calc(100vh - 24px) !important;
        overflow-y: auto;
        border-radius: 18px !important;
    }

    .modal-body, .modal-header, .modal-footer {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    table {
        min-width: 720px;
    }

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

    .page-header, .view-header, .section-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .page-header .btn, .view-header .btn, .section-header .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 10px !important;
    }

    .card, .stat-card, .kpi-card, .chart-card, .dashboard-card,
    .content-card {
        border-radius: 14px !important;
        padding: 14px !important;
    }

    .swal2-popup {
        width: calc(100vw - 20px) !important;
        padding: 18px !important;
    }
}


/* =========================================================
   FIX PRODUCCIÓN 2026 - MODALES CENTRADOS / FORMULARIOS PREMIUM
   Corrige el ancho global que convertía los formularios en cajas enormes.
   ========================================================= */
#modal.modal {
    align-items: center !important;
    justify-content: center !important;
    padding: clamp(12px, 2vw, 28px) !important;
    overflow: auto !important;
}

#modal .modal-content {
    width: min(760px, calc(100vw - 32px)) !important;
    max-width: 760px !important;
    min-width: 0 !important;
    max-height: calc(100vh - 32px) !important;
    margin: auto !important;
    padding: 28px !important;
    border-radius: 18px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    background: #ffffff !important;
    box-shadow: 0 24px 70px rgba(2, 6, 23, .36) !important;
}

#modalBody > h2:empty,
#modalBody > h2:first-child:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

#modal .premium-form-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
}

#modal .premium-form {
    width: 100% !important;
}

#modal .floating-input,
#modal input,
#modal select,
#modal textarea {
    max-width: 100% !important;
}

#modal .cke,
#modal .cke_chrome {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 10px !important;
    overflow: hidden !important;
}

#modal .cke_contents {
    min-height: 150px !important;
}

.cke_notifications_area,
.cke_notification,
.cke_security_advisor,
.cke_warning,
.cke_advisory,
.cke-advisory,
.cke-dialog__advisory,
.cke_advice,
[class*="cke_notification"],
[class*="cke_security"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

@media (max-width: 768px) {
    #modal.modal {
        padding: 10px !important;
        align-items: flex-start !important;
    }

    #modal .modal-content {
        width: calc(100vw - 20px) !important;
        max-width: calc(100vw - 20px) !important;
        max-height: calc(100vh - 20px) !important;
        padding: 20px !important;
        border-radius: 16px !important;
    }

    #modal .premium-form-header {
        margin: -20px -20px 0 -20px !important;
        padding: 22px 20px !important;
    }

    #modal .premium-form > div,
    #modal .premium-form [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    #modal .premium-form [style*="display: flex"] {
        flex-wrap: wrap !important;
    }

    #modal .premium-form button {
        width: 100% !important;
    }
}


/* SIGE 4.0 ajustes solicitados */
.action-btns{gap:10px;flex-wrap:wrap;align-items:center}.btn-icon{min-width:46px;min-height:46px;padding:11px 14px;font-size:18px;border-radius:12px;justify-content:center;box-shadow:0 8px 18px rgba(15,23,42,.12)}.btn-view{background:linear-gradient(135deg,#e0f2fe,#bae6fd);color:#075985;border:1px solid #7dd3fc}.btn-edit{background:linear-gradient(135deg,#fef3c7,#fde68a);color:#92400e;border:1px solid #fbbf24}.btn-delete{min-width:46px;min-height:46px;padding:11px 14px;font-size:18px;border-radius:12px;background:linear-gradient(135deg,#fee2e2,#fecaca);color:#991b1b;border:1px solid #fca5a5}.alert-pill{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;font-size:12px;font-weight:800;white-space:nowrap}.alert-pill.green{background:#dcfce7;color:#166534}.alert-pill.yellow{background:#fef3c7;color:#92400e}.alert-pill.red{background:#fee2e2;color:#991b1b}.glosario-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:16px}.glosario-card{background:#fff;border:1px solid #e2e8f0;border-radius:16px;padding:18px;box-shadow:0 8px 24px rgba(15,23,42,.07)}.glosario-card h3{margin:0 0 10px 0;color:#0f2c59;font-size:17px}.glosario-card p{margin:0;color:#475569;line-height:1.55;font-size:14px}.project-actions-panel{margin-top:24px;border:1px solid #e2e8f0;border-radius:16px;background:#fff;padding:18px;box-shadow:0 8px 24px rgba(15,23,42,.07)}@media(max-width:768px){.btn-icon,.btn-delete{min-width:50px;min-height:50px;font-size:20px}.action-btns{justify-content:flex-start}}


/* ================================
   SIGE 4.0 - Glosario visible y profesional
   ================================ */
.glosario-manual-hero{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:18px;
    background:linear-gradient(135deg,#0f2c59 0%,#0b3d91 100%);
    color:#ffffff;
    border-radius:20px;
    padding:24px;
    margin-bottom:18px;
    box-shadow:0 14px 34px rgba(15,44,89,.22);
    border:1px solid rgba(255,255,255,.18);
}
.glosario-manual-hero h3{margin:6px 0 8px;font-size:24px;letter-spacing:-.02em;}
.glosario-manual-hero p{margin:0;color:#dbeafe;line-height:1.6;max-width:780px;}
.glosario-eyebrow{font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.08em;color:#f8d76b;}
.glosario-hero-badge{min-width:190px;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.22);border-radius:16px;padding:16px;display:flex;flex-direction:column;align-items:center;text-align:center;gap:4px;}
.glosario-hero-badge span{font-size:36px;}
.glosario-hero-badge strong{font-size:14px;}
.glosario-hero-badge small{font-size:12px;color:#dbeafe;}
.glosario-toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;background:#ffffff;border:1px solid #e2e8f0;border-radius:16px;padding:14px;margin-bottom:18px;box-shadow:0 8px 24px rgba(15,23,42,.06);}
.glosario-toolbar input{flex:1;min-width:260px;padding:13px 16px;border:2px solid #e2e8f0;border-radius:12px;font-size:14px;outline:none;transition:.2s ease;}
.glosario-toolbar input:focus{border-color:#0b3d91;box-shadow:0 0 0 4px rgba(11,61,145,.12);}
.glosario-toolbar span{font-size:13px;font-weight:800;color:#334155;background:#f8fafc;border:1px solid #e2e8f0;border-radius:999px;padding:9px 12px;}
.glosario-category{margin-bottom:24px;}
.glosario-category-title{display:flex;align-items:center;gap:10px;margin:0 0 12px;padding:10px 4px;border-bottom:1px solid #e2e8f0;}
.glosario-category-title h3{margin:0;color:#0f172a;font-size:18px;}
.glosario-category-title small{margin-left:auto;background:#eff6ff;color:#1d4ed8;border-radius:999px;padding:6px 10px;font-weight:800;font-size:12px;}
.glosario-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:16px;}
.glosario-card{background:#fff;border:1px solid #e2e8f0;border-radius:16px;padding:18px;box-shadow:0 8px 24px rgba(15,23,42,.07);transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease;}
.glosario-card:hover{transform:translateY(-2px);box-shadow:0 14px 32px rgba(15,23,42,.11);border-color:#bfdbfe;}
.glosario-card h3{margin:0 0 10px 0;color:#0f2c59;font-size:17px;}
.glosario-card p{margin:0;color:#475569;line-height:1.55;font-size:14px;}
.glosario-empty{background:#ffffff;border:1px dashed #cbd5e1;border-radius:16px;padding:30px;text-align:center;color:#64748b;}
@media(max-width:768px){
    .glosario-manual-hero{flex-direction:column;align-items:flex-start;padding:20px;}
    .glosario-hero-badge{width:100%;}
    .glosario-toolbar input{min-width:100%;}
}


/* =========================================================
   Editor HTML tipo Word - SIGE
   ========================================================= */
.sige-word-editor {
    width: 100%;
    border: 2px solid #cbd5e1;
    border-radius: 14px;
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(15, 44, 89, 0.08);
    font-family: 'Inter', Arial, sans-serif;
}

.sige-word-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
    background: linear-gradient(135deg, #f8fafc 0%, #eef4fb 100%);
    border-bottom: 1px solid #dbe5f0;
}

.sige-word-btn,
.sige-word-select,
.sige-color-tool {
    min-height: 34px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all .18s ease;
}

.sige-word-select {
    min-width: 104px;
    font-weight: 600;
}

.sige-word-btn:hover,
.sige-word-select:hover,
.sige-color-tool:hover {
    background: #e0f2fe;
    border-color: #2563eb;
    color: #0b3d91;
    transform: translateY(-1px);
}

.sige-word-btn:active {
    transform: translateY(0);
    background: #bfdbfe;
}

.sige-toolbar-separator {
    width: 1px;
    height: 28px;
    background: #cbd5e1;
    margin: 0 2px;
}

.sige-color-tool {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sige-color-tool input[type="color"] {
    width: 28px;
    height: 24px;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
}

.sige-word-editable {
    width: 100%;
    min-height: 180px;
    padding: 16px;
    outline: none;
    background: #ffffff;
    color: #111827;
    font-size: 15px;
    line-height: 1.65;
    overflow-y: auto;
}

.sige-word-editable:focus {
    box-shadow: inset 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.sige-word-editable h2,
.sige-word-editable h3 {
    color: #0f2c59;
    margin: 10px 0 8px;
}

.sige-word-editable ul,
.sige-word-editable ol {
    padding-left: 24px;
}

.sige-word-editable:empty::before {
    content: 'Escriba aquí el contenido institucional...';
    color: #94a3b8;
    pointer-events: none;
}

@media (max-width: 768px) {
    .sige-word-toolbar {
        gap: 4px;
        padding: 8px;
    }
    .sige-word-btn,
    .sige-word-select,
    .sige-color-tool {
        min-height: 32px;
        padding: 6px 8px;
        font-size: 11px;
    }
    .sige-word-select {
        min-width: 92px;
    }
    .sige-word-editable {
        min-height: 160px;
        padding: 12px;
    }
}


/* Vista previa de textos con formato guardado desde el editor tipo Word */
.sige-rich-preview {
    color: #334155;
    line-height: 1.45;
    max-height: 4.4em;
    overflow: hidden;
    font-size: 13px;
}
.sige-rich-preview p,
.sige-rich-preview div,
.sige-rich-preview h1,
.sige-rich-preview h2,
.sige-rich-preview h3,
.sige-rich-preview h4,
.sige-rich-preview h5,
.sige-rich-preview h6 {
    margin: 0 0 4px 0;
}
.sige-rich-preview ul,
.sige-rich-preview ol {
    margin: 0;
    padding-left: 18px;
}
.sige-rich-preview strong,
.sige-rich-preview b {
    font-weight: 800;
}
.sige-rich-preview u {
    text-decoration: underline;
}

/* =========================================================
   SIGE - Proyectos / Fases / Acciones y Tareas
   Corrección institucional responsiva
   ========================================================= */
.sige-project-phase-modal,
.sige-phase-config-form,
.sige-action-form {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.sige-project-phase-modal { max-width: 1180px; width: min(1180px, 94vw); }
.phase-summary-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 18px;
    align-items: center;
    background: linear-gradient(135deg, #f8fafc 0%, #eef6ff 100%);
    border: 1px solid #dbeafe;
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 16px;
}
.phase-info-banner {
    background: #eff6ff;
    border-left: 4px solid #2563eb;
    border-radius: 12px;
    padding: 14px 16px;
    color: #1e3a8a;
    font-size: 13px;
    line-height: 1.55;
}
.phase-table th,
.phase-table td { vertical-align: middle; }
.phase-table th { white-space: nowrap; }
.project-actions-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
}
.phase-config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
}
.sige-phase-config-form label,
.sige-action-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}
.sige-phase-config-form input,
.sige-phase-config-form select,
.sige-phase-config-form textarea,
.sige-action-form input,
.sige-action-form select,
.sige-action-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #0f172a;
    background: #ffffff;
}
.sige-phase-config-form input:focus,
.sige-phase-config-form select:focus,
.sige-phase-config-form textarea:focus,
.sige-action-form input:focus,
.sige-action-form select:focus,
.sige-action-form textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.sige-phase-config-form small,
.sige-action-form small {
    display: block;
    color: #64748b;
    font-weight: 600;
    line-height: 1.4;
}
@media (max-width: 768px) {
    .phase-summary-card { grid-template-columns: 1fr; }
    .sige-project-phase-modal { width: 96vw; }
    .project-actions-panel { padding: 12px; }
}

/* =========================================================
   SIGE 4.2 - Módulo Proyectos premium: modal amplio, fases visibles
   ========================================================= */
#modal .modal-content.modal-wide,
#modal .modal-content.modal-project-phases {
    width: min(1240px, calc(100vw - 32px)) !important;
    max-width: 1240px !important;
    overflow-x: hidden !important;
}

#modal .modal-content.modal-phase-config,
#modal .modal-content.modal-project-action {
    width: min(980px, calc(100vw - 32px)) !important;
    max-width: 980px !important;
}

#modal .modal-content.modal-project-edit {
    width: min(860px, calc(100vw - 32px)) !important;
    max-width: 860px !important;
}

#modal .modal-content.modal-project-phases .sige-project-phase-modal {
    width: 100% !important;
    max-width: none !important;
}

#modal .modal-content.modal-project-phases #modalBody > h2 {
    padding-right: 42px;
    line-height: 1.25;
}

#modal .modal-content.modal-project-phases .table-responsive,
#modal .modal-content.modal-project-phases .table-responsive-global {
    border: 1px solid #e2e8f0;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

#modal .modal-content.modal-project-phases .phase-table,
#modal .modal-content.modal-project-phases .project-actions-panel table {
    min-width: 1080px;
}

#modal .modal-content.modal-project-phases .action-btns {
    justify-content: center;
    flex-wrap: nowrap;
}

#modal .modal-content.modal-project-phases .btn-icon {
    min-width: 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    #modal .modal-content.modal-wide,
    #modal .modal-content.modal-project-phases,
    #modal .modal-content.modal-phase-config,
    #modal .modal-content.modal-project-action,
    #modal .modal-content.modal-project-edit {
        width: calc(100vw - 20px) !important;
        max-width: calc(100vw - 20px) !important;
    }

    #modal .modal-content.modal-project-phases .phase-table,
    #modal .modal-content.modal-project-phases .project-actions-panel table {
        min-width: 980px;
    }
}


/* =========================================================
   FIX SIGE - PAGINACIÓN RESPONSIVA EN ACTIVIDADES Y PROYECTOS
   Evita que los botones de página se estiren a pantalla completa
   en celulares y permite seleccionar 5/10/15/20/30/50 registros.
   ========================================================= */
.sige-list-toolbar {
    width: 100%;
    max-width: 100%;
}

.sige-list-toolbar input {
    min-width: min(320px, 100%);
}

.sige-list-toolbar select {
    flex: 0 0 auto;
    min-width: 150px;
}

#activitiesPagination,
#projectsPagination,
.sige-pagination {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    overflow: hidden !important;
}

#activitiesPagination > div:first-child,
#projectsPagination > div:first-child,
.sige-pagination > div:first-child {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
}

#activitiesPagination button,
#projectsPagination button,
.sige-pagination button {
    width: auto !important;
    max-width: none !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    margin-bottom: 0 !important;
    min-width: 42px !important;
    min-height: 42px !important;
    padding: 8px 12px !important;
    border-radius: 12px !important;
    white-space: nowrap !important;
    line-height: 1 !important;
}

#activitiesPagination button[data-page],
#projectsPagination button[data-page],
.sige-pagination button[data-page] {
    min-width: 44px !important;
    font-weight: 800 !important;
}

#activitiesPagination > div:last-child,
#projectsPagination > div:last-child,
.sige-pagination > div:last-child {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-top: 4px !important;
    text-align: center !important;
    line-height: 1.35 !important;
    overflow-wrap: anywhere !important;
}

@media (max-width: 768px) {
    .sige-list-toolbar {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        padding: 10px !important;
    }

    .sige-list-toolbar input,
    .sige-list-toolbar select,
    .sige-list-toolbar button,
    #activitiesSearch,
    #projectsSearch,
    #activitiesPageSize,
    #projectsPageSize {
        width: 100% !important;
        min-width: 0 !important;
    }

    #activitiesPagination > div:first-child,
    #projectsPagination > div:first-child,
    .sige-pagination > div:first-child {
        justify-content: flex-start !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding: 4px 2px 8px !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    #activitiesPagination button,
    #projectsPagination button,
    .sige-pagination button {
        width: auto !important;
        min-width: 42px !important;
        min-height: 42px !important;
        padding: 8px 11px !important;
        font-size: 14px !important;
    }
}

@media (max-width: 480px) {
    #activitiesPagination,
    #projectsPagination,
    .sige-pagination {
        align-items: stretch !important;
    }

    #activitiesPagination button,
    #projectsPagination button,
    .sige-pagination button {
        width: auto !important;
        min-width: 40px !important;
        min-height: 40px !important;
        padding: 8px 10px !important;
        font-size: 14px !important;
    }

    #activitiesPagination button[data-nav],
    #projectsPagination button[data-nav],
    .sige-pagination button[data-nav] {
        min-width: 44px !important;
    }
}

/* =========================================================
   FIX SIGE - FLUIDEZ, ESTADOS VACÍOS Y RESPONSIVE PREMIUM
   Evita avisos repetidos y muestra mensajes vacíos dentro del módulo.
   ========================================================= */
.sige-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    padding: 34px 18px;
    margin: 0;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    color: #64748b;
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}

.sige-empty-state__icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    margin-bottom: 12px;
    border-radius: 18px;
    background: #eaf1f9;
    color: #0F2C59;
    font-size: 26px;
}

.sige-empty-state__title {
    color: #0f172a;
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 5px;
}

.sige-empty-state__text {
    color: #64748b;
    font-size: 14px;
    line-height: 1.45;
}

.view.active {
    contain: layout paint;
}

.table-responsive,
.table-responsive-global {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

#activitiesList,
#projectsList,
#usersList,
#bitacorasList {
    content-visibility: auto;
    contain-intrinsic-size: 720px;
}

@media (max-width: 768px) {
    .sige-empty-state {
        min-height: 130px;
        padding: 28px 14px;
        border-radius: 14px;
    }

    .sige-empty-state__icon {
        width: 48px;
        height: 48px;
        font-size: 23px;
    }

    .toast-container {
        right: 10px !important;
        left: 10px !important;
        width: auto !important;
        max-width: none !important;
        pointer-events: none;
    }

    .toast {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* =========================================================
   AJUSTE SOLICITADO - REPORTES / ACCIONES VISIBLES
   Enfoque exclusivo: botones de acciones en Actividades y Proyectos.
   No modifica lógica, datos, roles, permisos ni flujos del sistema.
   ========================================================= */
#activitiesList td:last-child > div,
#projectsList .action-btns,
#modal .modal-content.modal-project-phases .action-btns {
    gap: 12px !important;
    align-items: center !important;
    justify-content: center !important;
}

#activitiesList td:last-child .btn-icon,
#projectsList .action-btns .btn-icon,
#modal .modal-content.modal-project-phases .action-btns .btn-icon {
    min-width: 56px !important;
    width: 56px !important;
    min-height: 56px !important;
    height: 56px !important;
    padding: 0 !important;
    border-radius: 16px !important;
    font-size: 22px !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    border: 1px solid rgba(148, 163, 184, 0.42) !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14) !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease, background 0.18s ease !important;
}

#activitiesList td:last-child .btn-icon:hover,
#projectsList .action-btns .btn-icon:hover,
#modal .modal-content.modal-project-phases .action-btns .btn-icon:hover,
#activitiesList td:last-child .btn-icon:focus-visible,
#projectsList .action-btns .btn-icon:focus-visible,
#modal .modal-content.modal-project-phases .action-btns .btn-icon:focus-visible {
    transform: translateY(-3px) scale(1.08) !important;
    filter: brightness(1.1) saturate(1.2) !important;
    box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.20), 0 14px 28px rgba(15, 23, 42, 0.22) !important;
    outline: none !important;
}

#activitiesList td:last-child .btn-delete:hover,
#projectsList .action-btns .btn-delete:hover,
#modal .modal-content.modal-project-phases .action-btns .btn-delete:hover,
#activitiesList td:last-child .btn-delete:focus-visible,
#projectsList .action-btns .btn-delete:focus-visible,
#modal .modal-content.modal-project-phases .action-btns .btn-delete:focus-visible {
    box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.24), 0 14px 28px rgba(153, 27, 27, 0.22) !important;
}

#activitiesList td:last-child .btn-edit:hover,
#projectsList .action-btns .btn-edit:hover,
#modal .modal-content.modal-project-phases .action-btns .btn-edit:hover,
#activitiesList td:last-child .btn-edit:focus-visible,
#projectsList .action-btns .btn-edit:focus-visible,
#modal .modal-content.modal-project-phases .action-btns .btn-edit:focus-visible {
    box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.22), 0 14px 28px rgba(30, 64, 175, 0.22) !important;
}

@media (max-width: 768px) {
    #activitiesList td:last-child .btn-icon,
    #projectsList .action-btns .btn-icon,
    #modal .modal-content.modal-project-phases .action-btns .btn-icon {
        min-width: 60px !important;
        width: 60px !important;
        min-height: 60px !important;
        height: 60px !important;
        font-size: 24px !important;
        border-radius: 18px !important;
    }
}
