/* ============================================
   SISENF - Sistema de Enfermería
   Estilos Principales
   Versión: 2.0.0
   ============================================ */

/* ===== VARIABLES CSS ===== */
:root {
    /* Colores principales */
    --primary-color: #2c3e50;
    --primary-light: #34495e;
    --primary-dark: #1a252f;
    --secondary-color: #3498db;
    --secondary-light: #5dade2;
    --secondary-dark: #21618c;
    
    /* Colores de estado */
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #17a2b8;
    
    /* Colores neutrales */
    --light-color: #f8f9fa;
    --light-gray: #ecf0f1;
    --medium-gray: #bdc3c7;
    --dark-gray: #7f8c8d;
    --dark-color: #2c3e50;
    
    /* Colores de fondo */
    --bg-body: #f5f7fa;
    --bg-card: #ffffff;
    --bg-sidebar: #2c3e50;
    --bg-header: #ffffff;
    --bg-footer: #2c3e50;
    
    /* Colores de texto */
    --text-primary: #2c3e50;
    --text-secondary: #34495e;
    --text-light: #7f8c8d;
    --text-white: #ffffff;
    --text-muted: #95a5a6;
    
    /* Sombras */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.18);
    
    /* Bordes */
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    --border-radius-pill: 50px;
    
    /* Espaciado */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-xxl: 3rem;
    
    /* Tipografía */
    --font-family-base: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    --font-family-heading: 'Montserrat', var(--font-family-base);
    --font-family-monospace: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    
    /* Transiciones */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Z-index */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-loading: 1080;
}

/* ===== RESET Y BASE ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family-base);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Mejoras de accesibilidad */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    z-index: var(--z-popover);
    text-decoration: none;
}

.skip-to-content:focus {
    top: 0;
}

/* ===== TIPOGRAFÍA ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-heading);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-lg);
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.5rem;
}

h5 {
    font-size: 1.25rem;
}

h6 {
    font-size: 1rem;
}

p {
    margin-bottom: var(--spacing-md);
}

.lead {
    font-size: 1.25rem;
    font-weight: 300;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-center {
    text-align: center !important;
}

.text-right {
    text-align: right !important;
}

.text-left {
    text-align: left !important;
}

/* ===== ENLACES ===== */
a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--secondary-dark);
    text-decoration: underline;
}

a:focus {
    outline: 2px solid var(--secondary-light);
    outline-offset: 2px;
}

/* ===== BOTONES ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.5rem;
    font-family: var(--font-family-base);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    border-radius: var(--border-radius-md);
    transition: all var(--transition-fast);
    gap: 0.5rem;
    min-height: 44px; /* Tamaño mínimo para accesibilidad */
}

.btn:focus {
    outline: 2px solid var(--secondary-light);
    outline-offset: 2px;
}

.btn:disabled,
.btn.disabled {
    opacity: 0.65;
    cursor: not-allowed;
    pointer-events: none;
}

/* Variantes de botones */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-white);
}

.btn-primary:hover {
    background-color: var(--primary-light);
    border-color: var(--primary-light);
    color: var(--text-white);
    text-decoration: none;
}

.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--text-white);
}

.btn-secondary:hover {
    background-color: var(--secondary-light);
    border-color: var(--secondary-light);
    color: var(--text-white);
    text-decoration: none;
}

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

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

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

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

/* Tamaños de botones */
.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    min-height: 36px;
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.125rem;
    min-height: 52px;
}

/* Botón con icono */
.btn-icon {
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
}

/* ===== LAYOUT ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.container-fluid {
    width: 100%;
    padding: 0 var(--spacing-md);
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 calc(-1 * var(--spacing-md));
}

.col {
    flex: 1 0 0%;
    padding: 0 var(--spacing-md);
}

/* Grid responsivo */
@media (min-width: 576px) {
    .col-sm { flex: 1 0 0%; }
    .col-sm-auto { flex: 0 0 auto; }
    .col-sm-1 { flex: 0 0 8.33333%; }
    .col-sm-2 { flex: 0 0 16.66667%; }
    .col-sm-3 { flex: 0 0 25%; }
    .col-sm-4 { flex: 0 0 33.33333%; }
    .col-sm-5 { flex: 0 0 41.66667%; }
    .col-sm-6 { flex: 0 0 50%; }
    .col-sm-7 { flex: 0 0 58.33333%; }
    .col-sm-8 { flex: 0 0 66.66667%; }
    .col-sm-9 { flex: 0 0 75%; }
    .col-sm-10 { flex: 0 0 83.33333%; }
    .col-sm-11 { flex: 0 0 91.66667%; }
    .col-sm-12 { flex: 0 0 100%; }
}

@media (min-width: 768px) {
    .col-md { flex: 1 0 0%; }
    .col-md-auto { flex: 0 0 auto; }
    .col-md-1 { flex: 0 0 8.33333%; }
    .col-md-2 { flex: 0 0 16.66667%; }
    .col-md-3 { flex: 0 0 25%; }
    .col-md-4 { flex: 0 0 33.33333%; }
    .col-md-5 { flex: 0 0 41.66667%; }
    .col-md-6 { flex: 0 0 50%; }
    .col-md-7 { flex: 0 0 58.33333%; }
    .col-md-8 { flex: 0 0 66.66667%; }
    .col-md-9 { flex: 0 0 75%; }
    .col-md-10 { flex: 0 0 83.33333%; }
    .col-md-11 { flex: 0 0 91.66667%; }
    .col-md-12 { flex: 0 0 100%; }
}

@media (min-width: 992px) {
    .col-lg { flex: 1 0 0%; }
    .col-lg-auto { flex: 0 0 auto; }
    .col-lg-1 { flex: 0 0 8.33333%; }
    .col-lg-2 { flex: 0 0 16.66667%; }
    .col-lg-3 { flex: 0 0 25%; }
    .col-lg-4 { flex: 0 0 33.33333%; }
    .col-lg-5 { flex: 0 0 41.66667%; }
    .col-lg-6 { flex: 0 0 50%; }
    .col-lg-7 { flex: 0 0 58.33333%; }
    .col-lg-8 { flex: 0 0 66.66667%; }
    .col-lg-9 { flex: 0 0 75%; }
    .col-lg-10 { flex: 0 0 83.33333%; }
    .col-lg-11 { flex: 0 0 91.66667%; }
    .col-lg-12 { flex: 0 0 100%; }
}

/* ===== HEADER ===== */
.main-header {
    background-color: var(--bg-header);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    padding: var(--spacing-sm) 0;
}

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

.logo a {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.logo-sub {
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 400;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.nav-list {
    display: flex;
    list-style: none;
    gap: var(--spacing-md);
    margin: 0;
    padding: 0;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius-md);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    background-color: var(--light-gray);
    color: var(--primary-color);
    text-decoration: none;
}

.nav-link.active {
    background-color: var(--primary-color);
    color: var(--text-white);
}

.user-info {
    font-size: 0.875rem;
    color: var(--text-light);
    padding: var(--spacing-sm);
}

.logout-link {
    color: var(--danger-color) !important;
    font-weight: 500;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    padding: var(--spacing-xl) 0;
    min-height: calc(100vh - 140px); /* Altura mínima considerando header y footer */
}

/* ===== FOOTER ===== */
.main-footer {
    background-color: var(--bg-footer);
    color: var(--text-white);
    padding: var(--spacing-xl) 0;
    margin-top: auto;
}

.main-footer a {
    color: var(--light-gray);
}

.main-footer a:hover {
    color: var(--text-white);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
}

/* ===== TARJETAS (CARDS) ===== */
.card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--light-gray);
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

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

.card-header {
    padding: var(--spacing-lg);
    background-color: var(--light-gray);
    border-bottom: 1px solid var(--medium-gray);
}

.card-title {
    margin: 0;
    font-size: 1.25rem;
}

.card-body {
    padding: var(--spacing-lg);
}

.card-footer {
    padding: var(--spacing-lg);
    background-color: var(--light-gray);
    border-top: 1px solid var(--medium-gray);
}

/* ===== FORMULARIOS ===== */
.form-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-xl);
}

.form-title {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    color: var(--primary-color);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--light-gray);
}

.form-section {
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg);
    background-color: var(--light-gray);
    border-radius: var(--border-radius-md);
}

.section-title {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-lg);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
}

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group label.required::after {
    content: " *";
    color: var(--danger-color);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-card);
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

.form-control.error {
    border-color: var(--danger-color);
}

.form-control.error:focus {
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.25);
}

.help-text {
    display: block;
    margin-top: var(--spacing-xs);
    font-size: 0.875rem;
    color: var(--text-light);
}

.error-message {
    display: none;
    margin-top: var(--spacing-xs);
    font-size: 0.875rem;
    color: var(--danger-color);
}

.error-message.show {
    display: block;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--light-gray);
}

/* ===== TABLAS ===== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--spacing-lg);
}

.table th,
.table td {
    padding: var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--light-gray);
}

.table th {
    background-color: var(--light-gray);
    font-weight: 600;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
}

.table tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.05);
}

.table .actions {
    white-space: nowrap;
}

/* ===== ALERTAS Y MENSAJES ===== */
.alert {
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border: 1px solid transparent;
    border-radius: var(--border-radius-md);
    position: relative;
}

.alert-success {
    background-color: rgba(39, 174, 96, 0.1);
    border-color: rgba(39, 174, 96, 0.2);
    color: var(--success-color);
}

.alert-danger {
    background-color: rgba(231, 76, 60, 0.1);
    border-color: rgba(231, 76, 60, 0.2);
    color: var(--danger-color);
}

.alert-warning {
    background-color: rgba(243, 156, 18, 0.1);
    border-color: rgba(243, 156, 18, 0.2);
    color: var(--warning-color);
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.1);
    border-color: rgba(23, 162, 184, 0.2);
    color: var(--info-color);
}

.alert-close {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    background: none;
    border: none;
    font-size: 1.25rem;
    line-height: 1;
    color: inherit;
    cursor: pointer;
    padding: var(--spacing-xs);
}

.flash-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: var(--z-popover);
    max-width: 400px;
}

/* ===== LOADING ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: var(--z-loading);
    backdrop-filter: blur(3px);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--light-gray);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--spacing-md);
}

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

.loading-text {
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 500;
}

/* Spinner pequeño */
.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--light-gray);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin-fast 0.6s linear infinite;
    margin-right: var(--spacing-sm);
}

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

/* ===== NOTIFICACIONES (TOAST) ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-tooltip);
    animation: slideIn 0.3s ease;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.notification::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 1.25rem;
}

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

.notification-success::before {
    content: "✓";
}

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

.notification-error::before {
    content: "✗";
}

.notification-warning {
    background-color: var(--warning-color);
    color: black;
}

.notification-warning::before {
    content: "⚠";
}

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

/* ===== SIDEBAR (Menú Lateral) ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    background-color: var(--bg-sidebar);
    color: var(--text-white);
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    z-index: var(--z-fixed);
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.menu-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.menu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    color: var(--text-white);
    text-decoration: none;
    transition: background-color var(--transition-fast);
}

.menu-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.menu-link.active {
    background-color: var(--secondary-color);
}

.menu-icon {
    margin-right: var(--spacing-sm);
    width: 20px;
    text-align: center;
}

.menu-arrow {
    transition: transform var(--transition-fast);
}

.menu-item.open .menu-arrow {
    transform: rotate(180deg);
}

.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: rgba(0, 0, 0, 0.2);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
}

.menu-item.open .submenu {
    max-height: 500px;
}

.submenu-item {
    padding: var(--spacing-sm) var(--spacing-lg) var(--spacing-sm) 3rem;
}

.submenu-item a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    display: block;
}

.submenu-item a:hover {
    color: var(--text-white);
}

/* ===== PAGINACIÓN ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-xl);
}

.page-item {
    list-style: none;
}

.page-link {
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--bg-card);
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.page-link:hover {
    background-color: var(--light-gray);
    border-color: var(--dark-gray);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-white);
}

.page-item.disabled .page-link {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 0.75em;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: var(--border-radius-pill);
}

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

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

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

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

.badge-warning {
    background-color: var(--warning-color);
    color: black;
}

/* ===== UTILIDADES ===== */
.d-none { display: none !important; }
.d-flex { display: flex !important; }
.d-block { display: block !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: var(--spacing-sm) !important; }
.mt-2 { margin-top: var(--spacing-md) !important; }
.mt-3 { margin-top: var(--spacing-lg) !important; }
.mt-4 { margin-top: var(--spacing-xl) !important; }
.mt-5 { margin-top: var(--spacing-xxl) !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: var(--spacing-sm) !important; }
.mb-2 { margin-bottom: var(--spacing-md) !important; }
.mb-3 { margin-bottom: var(--spacing-lg) !important; }
.mb-4 { margin-bottom: var(--spacing-xl) !important; }
.mb-5 { margin-bottom: var(--spacing-xxl) !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: var(--spacing-sm) !important; }
.p-2 { padding: var(--spacing-md) !important; }
.p-3 { padding: var(--spacing-lg) !important; }
.p-4 { padding: var(--spacing-xl) !important; }
.p-5 { padding: var(--spacing-xxl) !important; }

.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rounded { border-radius: var(--border-radius-md) !important; }
.rounded-circle { border-radius: 50% !important; }
.rounded-pill { border-radius: var(--border-radius-pill) !important; }

.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .header-content {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .main-nav {
        flex-direction: column;
        width: 100%;
    }
    
    .nav-list {
        flex-direction: column;
        width: 100%;
    }
    
    .nav-link {
        width: 100%;
        text-align: center;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .notification {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}

@media (max-width: 576px) {
    .card-body,
    .card-header,
    .card-footer {
        padding: var(--spacing-md);
    }
    
    .form-container {
        padding: var(--spacing-md);
        margin: var(--spacing-sm);
    }
    
    .flash-messages {
        left: 10px;
        right: 10px;
        max-width: none;
    }
}

/* ===== IMPRESIÓN ===== */
@media print {
    .main-header,
    .main-footer,
    .btn,
    .form-actions,
    .sidebar-toggle {
        display: none !important;
    }
    
    .main-content {
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    a {
        color: #000 !important;
        text-decoration: none !important;
    }
    
    .table th {
        background-color: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
}

/* ===== ANIMACIONES ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.fade-in {
    animation: fadeIn var(--transition-normal);
}

.slide-up {
    animation: slideUp var(--transition-normal);
}

/* ===== ESTILOS ESPECÍFICOS PARA SISENF ===== */
/* Logo personalizado */
.logo-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.25rem;
}

/* Estilos para el dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.dashboard-card {
    text-align: center;
    padding: var(--spacing-xl);
}

.dashboard-card .card-title {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: var(--spacing-sm);
}

.dashboard-card .card-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}

.dashboard-card .card-change {
    font-size: 0.875rem;
    color: var(--success-color);
}

.dashboard-card .card-change.negative {
    color: var(--danger-color);
}

/* Estilos para resultados de búsqueda */
.search-results {
    margin-top: var(--spacing-xl);
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    background-color: var(--bg-card);
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius-md);
    margin-bottom: var(--spacing-sm);
    transition: all var(--transition-fast);
}

.result-item:hover {
    background-color: rgba(52, 152, 219, 0.05);
    border-color: var(--secondary-color);
    transform: translateX(4px);
}

.result-info {
    flex: 1;
}

.result-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.result-details {
    font-size: 0.875rem;
    color: var