:root {
    --primary-color: #2c3e50;
    --primary-light: #34495e;
    --primary-dark: #1a252f;
    --secondary-color: #3498db;
    --secondary-light: #5dade2;
    --success-color: #27ae60;
    --success-light: #58d68d;
    --warning-color: #f39c12;
    --warning-light: #f7dc6f;
    --danger-color: #e74c3c;
    --danger-light: #ec7063;
    --info-color: #16a085;
    --purple-color: #8e44ad;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --border-color: #dfe6e9;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 15px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.15);
    --gradient-primary: linear-gradient(135deg, #3498db 0%, #2c3e50 100%);
    --gradient-success: linear-gradient(135deg, #27ae60 0%, #1abc9c 100%);
    --gradient-danger: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    --gradient-warning: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    --gradient-purple: linear-gradient(135deg, #8e44ad 0%, #9b59b6 100%);
}

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

body {
    font-family: 'Segoe UI', 'Roboto', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    background-attachment: fixed;
    color: #2c3e50;
    line-height: 1.6;
    min-height: 100vh;
}

.navbar {
    background: linear-gradient(135deg, #1a5276 0%, #2874a6 50%, #2e86de 100%) !important;
    padding: 12px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
}

.navbar-brand {
    color: white !important;
    font-size: 22px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.3s;
}

.navbar-brand:hover {
    transform: scale(1.02);
}

.navbar-brand i {
    font-size: 28px;
    animation: pulse 2s infinite;
}

.unit-name {
    font-size: 14px;
    font-weight: 500;
    display: block;
    margin-left: 35px;
    opacity: 0.9;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.nav-link {
    color: rgba(255,255,255,0.9) !important;
    padding: 10px 18px !important;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link:hover {
    background: rgba(255,255,255,0.15);
    color: white !important;
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.nav-link i {
    margin-right: 8px;
    width: 20px;
    text-align: center;
}

.dropdown-menu {
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 10px;
    animation: slideDown 0.3s ease-out;
}

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

.dropdown-item {
    border-radius: 8px;
    padding: 10px 15px;
    transition: all 0.3s;
    font-weight: 500;
}

.dropdown-item:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateX(5px);
}

.sidebar {
    min-height: calc(100vh - 60px);
    background: white;
    box-shadow: 4px 0 20px rgba(0,0,0,0.08);
    padding: 20px 0;
}

.sidebar .nav-item {
    margin: 4px 12px;
}

.sidebar .nav-link {
    color: var(--dark-color) !important;
    padding: 14px 18px !important;
    border-radius: 10px;
    font-weight: 550;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.sidebar .nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: var(--secondary-color);
    border-radius: 0 4px 4px 0;
    transition: height 0.3s;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: var(--secondary-color) !important;
    transform: translateX(8px);
    box-shadow: var(--shadow-sm);
}

.sidebar .nav-link:hover::after,
.sidebar .nav-link.active::after {
    height: 60%;
}

.sidebar .nav-link i {
    width: 24px;
    text-align: center;
    font-size: 16px;
    color: var(--primary-color);
    transition: all 0.3s;
}

.sidebar .nav-link:hover i,
.sidebar .nav-link.active i {
    color: var(--secondary-color);
    transform: scale(1.1);
}

.sidebar hr {
    margin: 15px 20px;
    border-color: #e0e0e0;
}

.main-content {
    padding: 30px;
    background: transparent;
}

.page-header {
    background: white;
    padding: 25px 30px;
    border-radius: 15px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-title i {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 32px;
}

.card-custom {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: none;
    margin-bottom: 25px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-custom:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-header-custom {
    background: var(--gradient-primary);
    color: white;
    padding: 18px 25px;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: none;
}

.card-header-custom i {
    font-size: 20px;
}

.card-body {
    padding: 25px;
}

.stats-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--gradient-primary);
}

.stats-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: var(--secondary-color);
}

.stats-card.blue { border-left: 5px solid #3498db; }
.stats-card.green { border-left: 5px solid #27ae60; }
.stats-card.red { border-left: 5px solid #e74c3c; }
.stats-card.purple { border-left: 5px solid #8e44ad; }
.stats-card.orange { border-left: 5px solid #e67e22; }
.stats-card.teal { border-left: 5px solid #1abc9c; }

.stats-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 15px;
    color: white;
}

.stats-card.blue .stats-icon { background: linear-gradient(135deg, #3498db, #2980b9); }
.stats-card.green .stats-icon { background: linear-gradient(135deg, #27ae60, #1e8449); }
.stats-card.red .stats-icon { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.stats-card.purple .stats-icon { background: linear-gradient(135deg, #9b59b6, #8e44ad); }
.stats-card.orange .stats-icon { background: linear-gradient(135deg, #e67e22, #d35400); }
.stats-card.teal .stats-icon { background: linear-gradient(135deg, #1abc9c, #16a085); }

.stats-number {
    font-size: 42px;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 8px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stats-label {
    color: #7f8c8d;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-custom {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
}

.table-custom thead th {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 16px 18px;
    font-weight: 600;
    text-align: left;
    border: none;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table-custom thead th:first-child {
    border-radius: 10px 0 0 0;
}

.table-custom thead th:last-child {
    border-radius: 0 10px 0 0;
}

.table-custom tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s;
}

.table-custom tbody tr:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transform: scale(1.01);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.table-custom tbody td {
    padding: 16px 18px;
    vertical-align: middle;
}

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

.table-custom tbody tr:nth-child(even):hover {
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
}

.btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1a5276 100%);
    color: white;
}

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

.btn-success:hover {
    background: linear-gradient(135deg, #1e8449 0%, #196f3d 100%);
    color: white;
}

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

.btn-danger:hover {
    background: linear-gradient(135deg, #c0392b 0%, #922b21 100%);
    color: white;
}

.btn-warning {
    background: var(--gradient-warning);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d35400 0%, #a04000 100%);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #1abc9c, #16a085);
    color: white;
}

.btn-info:hover {
    background: linear-gradient(135deg, #16a085 0%, #0e6655 100%);
    color: white;
}

.btn-primary-custom {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary-custom:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1a5276 100%);
    color: white;
}

.btn-success-custom {
    background: var(--gradient-success);
    color: white;
}

.btn-success-custom:hover {
    background: linear-gradient(135deg, #1e8449 0%, #196f3d 100%);
    color: white;
}

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

.btn-outline-primary {
    border: 2px solid var(--secondary-color);
    background: transparent;
    color: var(--secondary-color);
}

.btn-outline-primary:hover {
    background: var(--secondary-color);
    color: white;
}

.status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.status-completed {
    background: linear-gradient(135deg, #d5f4e6 0%, #a9dfbf 100%);
    color: #1e8449;
    border: 1px solid #a9dfbf;
}

.status-pending {
    background: linear-gradient(135deg, #fef9e7 0%, #f9e79f 100%);
    color: #9a7d0a;
    border: 1px solid #f9e79f;
}

.status-critical {
    background: linear-gradient(135deg, #fadbd8 0%, #f5b7b1 100%);
    color: #c0392b;
    border: 1px solid #f5b7b1;
    animation: pulse-critical 2s infinite;
}

@keyframes pulse-critical {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(231, 76, 60, 0); }
}

.status-eligible {
    background: linear-gradient(135deg, #d1f2eb 0%, #a3e4d7 100%);
    color: #0e6655;
    border: 1px solid #a3e4d7;
}

.search-box {
    padding: 12px 18px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    width: 300px;
    transition: all 0.3s;
    font-size: 14px;
    background: white;
}

.search-box:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.1);
}

.form-control, .form-select {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s;
    font-size: 14px;
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.1);
}

.form-label {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group-text {
    background: var(--gradient-primary);
    border: none;
    color: white;
    border-radius: 10px;
    padding: 12px 16px;
}

.pagination-custom {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}

.pagination-custom a,
.pagination-custom span {
    padding: 10px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 600;
    transition: all 0.3s;
}

.pagination-custom a:hover {
    background: var(--gradient-primary);
    border-color: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
}

.pagination-custom .active {
    background: var(--gradient-primary);
    border-color: var(--secondary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

.alert-custom {
    padding: 18px 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 5px solid;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    animation: slideIn 0.3s ease-out;
}

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

.alert-success-custom {
    background: linear-gradient(135deg, #d5f4e6 0%, #abebc6 100%);
    border-color: var(--success-color);
    color: #196f3d;
}

.alert-danger-custom {
    background: linear-gradient(135deg, #fadbd8 0%, #f5b7b1 100%);
    border-color: var(--danger-color);
    color: #922b21;
}

.alert-warning-custom {
    background: linear-gradient(135deg, #fef9e7 0%, #f9e79f 100%);
    border-color: var(--warning-color);
    color: #7d6608;
}

.alert-info-custom {
    background: linear-gradient(135deg, #d1f2eb 0%, #a3e4d7 100%);
    border-color: var(--info-color);
    color: #0e6655;
}

.badge-custom {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

.badge-civil { 
    background: linear-gradient(135deg, #3498db, #2980b9); 
    color: white; 
}
.badge-pac { 
    background: linear-gradient(135deg, #9b59b6, #8e44ad); 
    color: white; 
}
.badge-grp { 
    background: linear-gradient(135deg, #e67e22, #d35400); 
    color: white; 
}

.quick-action-btn {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px 20px;
    color: var(--dark-color);
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.quick-action-btn:hover {
    background: var(--gradient-primary);
    border-color: var(--secondary-color);
    color: white;
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.quick-action-btn i {
    font-size: 20px;
    width: 30px;
    text-align: center;
}

.footer {
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
    color: white;
    text-align: center;
    padding: 25px;
    margin-top: 40px;
    border-top: 4px solid var(--secondary-color);
}

.footer a {
    color: var(--secondary-light);
    text-decoration: none;
}

.footer a:hover {
    color: white;
}

.progress-bar-custom {
    height: 8px;
    border-radius: 10px;
    background: #e0e0e0;
    overflow: hidden;
}

.progress-bar-custom .progress {
    height: 100%;
    border-radius: 10px;
    transition: width 1s ease-in-out;
}

.modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: var(--gradient-primary);
    color: white;
    border-radius: 16px 16px 0 0;
    padding: 20px 25px;
}

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

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 15px 25px;
    border-top: 1px solid #e0e0e0;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 12px;
}

.avatar-lg {
    width: 60px;
    height: 60px;
    font-size: 24px;
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out;
}

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

.animate-slide-in {
    animation: slideIn 0.5s ease-out;
}

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }

@media print {
    .no-print { display: none !important; }
    .card-custom { box-shadow: none; }
    .table-custom thead th { 
        background: #333 !important; 
        color: white !important; 
        -webkit-print-color-adjust: exact; 
    }
    .print-header {
        display: block !important;
        text-align: center;
        padding: 20px;
        margin-bottom: 20px;
        border-bottom: 2px solid #333;
    }
    .print-header h2 {
        font-size: 24px;
        margin-bottom: 5px;
    }
    .print-header p {
        font-size: 14px;
        color: #666;
    }
}

.print-header {
    display: none;
}

@media (max-width: 992px) {
    .sidebar { 
        display: none; 
    }
    .main-content { 
        padding: 20px; 
    }
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .search-box {
        width: 100%;
    }
    .stats-card {
        margin-bottom: 15px;
    }
    .table-custom {
        font-size: 12px;
    }
    .table-custom thead th,
    .table-custom tbody td {
        padding: 10px 8px;
    }
    .navbar-brand {
        font-size: 18px;
    }
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #95a5a6;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h4 {
    color: #7f8c8d;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 14px;
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease-out;
}

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