﻿/* assets/css/style.css */
:root {
    --primary: #1e3a8a;      /* Azul oscuro profesional */
    --primary-light: #3b82f6; /* Azul brillante para botones */
    --secondary: #ef4444;    /* Rojo para alertas/destacados */
    --accent: #16a34a;       /* Verde para acciones principales */
    --light: #f8fafc;
    --dark: #0f172a;
    --gray: #94a3b8;
    --border: #e2e8f0;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f1f5f9;
    color: var(--dark);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header Fijo */
.main-header {
    background: #1e3a8a; /* Azul sólido */
    color: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.logo img {
    width: 30px;
    height: 30px;
}

.logo h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: white;
}

.logo p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 4px;
    font-weight: 300;
    color: rgba(255,255,255,0.8);
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    align-items: center;
    flex-wrap: wrap;
}

.main-nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0.8rem;
    border-radius: 4px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.main-nav a:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

/* Menú desplegable de usuario */
.user-dropdown-container {
    position: relative;
    display: flex;
    align-items: center;
}

.user-trigger {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0.8rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.user-trigger:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.user-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    box-shadow: var(--shadow);
    border-radius: 8px;
    min-width: 200px;
    z-index: 1000;
    padding: 0.5rem 0;
    animation: fadeIn 0.3s ease-out;
}

.user-dropdown-container:hover .user-dropdown-menu {
    display: block;
}

.user-dropdown-menu a {
    color: #333;
    padding: 0.7rem 1.5rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.user-dropdown-menu a:hover {
    background: #f8fafc;
    color: var(--primary);
}

.user-dropdown-menu .icon {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.user-dropdown-menu .badge {
    background: #e2e8f0;
    color: #475569;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-left: 0.5rem;
}

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

/* Main Content */
.main-content {
    flex: 1;
}

/* Footer */
/* Footer Fijo en la parte inferior de la ventana */
.main-footer {
    background-color: var(--dark);
    color: white;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 999;
}

.main-footer p {
    font-size: 0.95rem;
    opacity: 0.8;
}

.main-footer a {
    color: #60a5fa;
    text-decoration: none;
    font-weight: 500;
}

.main-footer a:hover {
    text-decoration: underline;
}


/* Botones */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn:hover {
    background: #15803d;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

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

.btn-secondary:hover {
    background: #64748b;
}

/* Títulos */
h1, h2, h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-weight: 600;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.2rem;
}

/* Secciones */
.section-title {
    color: var(--accent);
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}

/* Tablas */
.table-responsive {
    overflow-x: auto;
    margin: 1.5rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: var(--shadow);
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background-color: var(--primary);
    color: white;
    font-weight: 600;
}

tr:nth-child(even) {
    background-color: #f8fafc;
}

tr:hover {
    background-color: #eff6ff;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    animation: fadeIn 0.3s ease-out;
}

.modal-header {
    background: var(--accent);
    color: white;
    padding: 1rem 1.5rem;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
}

/* Formularios */
.form-group {
    margin-bottom: 1rem;
}

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

.form-input {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.form-select {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    background: white;
    transition: var(--transition);
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.radio-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.radio-option input[type=radio] {
    accent-color: var(--accent);
}

.number-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.number-input button {
    background: #e2e8f0;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    transition: var(--transition);
}

.number-input button:hover {
    background: #cbd5e1;
}

.number-input input {
    width: 100%;
    text-align: center;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    transition: var(--transition);
}

.number-input input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Mensajes */
.message {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 6px;
    font-weight: 500;
}

.message-success {
    background: #d1fae5;
    color: #059669;
    border: 1px solid #10b981;
}

.message-info {
    background: #dbeafe;
    color: #2563eb;
    border: 1px solid #3b82f6;
}

.message-warning {
    background: #fef3c7;
    color: #f59e0b;
    border: 1px solid #f59e0b;
}

.message-error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #ef4444;
}

/* Responsive */
/* Responsive */
@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .main-nav ul {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 0.8rem;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

    .container {
        width: 95%;
    }

    .modal {
        width: 95%;
    }

    /* Ajustes específicos para móvil */
    .user-dropdown-menu {
        position: static;
        box-shadow: none;
        background: rgba(255,255,255,0.1);
        border-radius: 0;
        margin-top: 0.5rem;
    }

    .user-dropdown-menu a {
        color: white;
    }

    .user-dropdown-menu a:hover {
        background: rgba(255,255,255,0.2);
        color: white;
    }
}

/* Asegurar espacio para el footer fijo (en todas las pantallas) */
body {
    padding-bottom: 60px;
}