/* ============================================
   VARIABLES Y DISEÑO RAÍZ
   ============================================ */

:root {
    /* Colores principales */
    --primary: #c62828;
    --primary-dark: #8e0000;
    --primary-light: #ff5f52;
    --primary-soft: #ffebee;
    
    /* Secundarios */
    --secondary: #1a1f2e;
    --accent: #e67e22;
    --success: #27ae60;
    --warning: #f39c12;
    --info: #2980b9;
    
    /* Fondos */
    --bg: #f0f2f5;
    --bg-card: #ffffff;
    --bg-hover: #f9fafb;
    --bg-secondary: #f5f5f5;
    --bg-sidebar: linear-gradient(180deg, #1a1f2e 0%, #141824 100%);
    
    /* Texto */
    --text-primary: #1a1f2e;
    --text-secondary: #6c757d;
    --text-muted: #9ca3af;
    --text-white: #ffffff;
    
    /* Bordes */
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.15);
    
    /* Radios */
    --radius: 8px;
    --radius-lg: 12px;
    
    /* Transiciones */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark theme */
[data-theme="dark"] {
    --bg: #0f1419;
    --bg-card: #1a1f2e;
    --bg-hover: #242d3d;
    --bg-secondary: #1e2635;
    --text-primary: #f0f2f5;
    --text-secondary: #b0b8c1;
    --text-muted: #7a8896;
    --border: #2d3748;
    --border-light: #1e2635;
}

/* ============================================
   ESTILOS GENERALES
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
}

/* ============================================
   LOGIN
   ============================================ */

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.login-box {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-img-clean {
    width: 100px;
    height: 100px;
    margin-bottom: 1rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.portal-title {
    font-size: 1.8rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.portal-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 2rem;
}

.login-input {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.login-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.login-btn {
    width: 100%;
    padding: 0.85rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.forgot-password {
    width: 100%;
    background: none;
    border: none;
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.forgot-password:hover {
    color: var(--primary-dark);
}

/* ============================================
   LAYOUT PRINCIPAL
   ============================================ */

.main-app {
    display: flex;
    min-height: 100vh;
    transition: var(--transition);
}

.main-app.hidden {
    display: none;
}

.sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    color: var(--text-white);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

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

.logo-container {
    display: flex;
    justify-content: center;
}

.sidebar-logo {
    width: 45px;
    height: 45px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-link.active {
    background: rgba(198, 40, 40, 0.2);
    color: var(--primary-light);
    border-left-color: var(--primary-light);
    font-weight: 600;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

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

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

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.visible {
    display: block;
}

.main-content {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

/* ============================================
   TOPBAR
   ============================================ */

.topbar {
    background: var(--bg-card);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
}

.topbar-logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    white-space: nowrap;
    min-width: 150px;
}

.topbar-logo-img {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

.topbar-portal-name {
    font-weight: 700;
    color: var(--primary);
    font-size: 1rem;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
}

.menu-toggle:hover {
    color: var(--primary);
}

.search-container {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.search-input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.search-container i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.notif-btn,
.theme-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.15rem;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.notif-btn:hover,
.theme-btn:hover {
    color: var(--primary);
}

.notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--primary);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
}

.notif-badge.hidden {
    display: none;
}

.user-topbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar-top {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
}

/* ============================================
   NOTIFICACIONES
   ============================================ */

.notif-panel {
    position: absolute;
    top: 60px;
    right: 2rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 350px;
    max-height: 500px;
    display: flex;
    flex-direction: column;
    z-index: 200;
}

.notif-panel.hidden {
    display: none;
}

.notif-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notif-header h3 {
    margin: 0;
    font-size: 1rem;
}

.clear-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.clear-btn:hover {
    color: var(--primary-dark);
}

.notif-list {
    overflow-y: auto;
    flex: 1;
}

.notif-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: var(--transition);
}

.notif-item:hover {
    background: var(--bg-secondary);
}

.notif-item.unread {
    background: var(--primary-soft);
}

.notif-text {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.notif-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================
   PÁGINA PRINCIPAL
   ============================================ */

.page-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.page-subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

/* ============================================
   TARJETAS DE CONTENIDO (MODERNIZADAS)
   ============================================ */

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.content-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    position: relative;
}

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

.card-header {
    background: linear-gradient(135deg, var(--primary-soft) 0%, rgba(198, 40, 40, 0.1) 100%);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.card-favorite-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
}

.card-favorite-btn.active {
    color: var(--primary);
}

.card-favorite-btn:hover {
    transform: scale(1.2);
}

.card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    word-break: break-word;
}

.card-description {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.card-badge {
    background: var(--primary-soft);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.card-footer {
    display: flex;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.card-action-btn {
    flex: 1;
    padding: 0.6rem;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    color: var(--text-primary);
    font-family: inherit;
}

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

.card-action-btn.danger:hover {
    background: #d32f2f;
    border-color: #d32f2f;
}

.card-action-btn.success:hover {
    background: var(--success);
    border-color: var(--success);
}

/* ============================================
   TARJETAS DE CAPACITACIÓN
   ============================================ */

.training-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.training-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

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

.training-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.training-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.training-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
}

.training-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.training-btn {
    flex: 1;
    padding: 0.6rem;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
    font-family: inherit;
}

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

.training-btn.primary:hover {
    background: var(--primary-dark);
}

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

/* ============================================
   TARJETAS DE NOVEDADES
   ============================================ */

.news-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
}

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

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

.news-badge {
    background: var(--primary-soft);
    color: var(--primary);
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.news-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.news-content {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.news-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.news-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.news-actions {
    display: flex;
    gap: 0.5rem;
}

.news-action-btn {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    border-radius: var(--radius);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

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

.news-link-btn {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.news-link-btn:hover {
    background: var(--primary-dark);
}

/* ============================================
   MODAL
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.hidden {
    display: none;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-content {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
    background: var(--bg);
    color: var(--text-primary);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* ============================================
   BOTONES
   ============================================ */

.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

/* ============================================
   TOAST
   ============================================ */

.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.toast {
    background: var(--bg-card);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideInRight 0.3s ease;
    color: var(--text-primary);
    border-left: 4px solid var(--info);
}

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

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

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

.toast.error i {
    color: var(--primary);
}

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

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

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

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

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

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

/* ============================================
   GRILLAS Y LAYOUTS
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: absolute;
        left: -100%;
        transition: left 0.3s ease;
    }

    .sidebar.open {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .page-content {
        padding: 1.5rem;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        padding: 1rem;
    }

    .topbar-logo-container {
        min-width: auto;
        gap: 0.5rem;
    }

    .topbar-logo-img {
        width: 32px;
        height: 32px;
    }

    .topbar-portal-name {
        font-size: 0.9rem;
    }

    .search-container {
        max-width: 100%;
    }

    .notif-panel {
        width: calc(100% - 2rem);
        right: 1rem;
    }

    .modal {
        width: 90%;
        max-width: 100%;
    }

    .toast-container {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }

    .toast {
        width: 100%;
    }

    .page-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .sidebar-footer {
        flex-direction: column;
    }

    .user-section {
        width: 100%;
    }

    .content-grid {
        gap: 1rem;
    }

    .card-footer,
    .modal-footer {
        flex-direction: column;
    }

    .card-action-btn,
    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
}

/* ============================================
   ANIMACIONES Y TRANSICIONES
   ============================================ */

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

.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-hover) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: pulse 2s infinite;
}

/* ============================================
   UTILIDADES
   ============================================ */

.hidden {
    display: none !important;
}

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
