/**
 * Estilos principales del portal
 */

/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --bg-color: #f8fafc;
    --sidebar-bg: #1e293b;
    --header-bg: #ffffff;
    --text-color: #1e293b;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
}

/* ===== PÁGINA DE LOGIN ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-color);
    font-size: 28px;
}

/* ===== PÁGINA DASHBOARD ===== */
.dashboard-page {
    height: 100vh;
    overflow: hidden;
}

.dashboard-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    grid-template-rows: 70px 1fr;
    grid-template-areas:
        "header header"
        "sidebar main";
    height: 100vh;
}

/* Header */
.header {
    grid-area: header;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    box-shadow: var(--shadow);
    z-index: 100;
}

.header h1 {
    font-size: 22px;
    color: var(--text-color);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-name {
    color: var(--text-color);
    font-weight: 500;
}

/* Sidebar */
.sidebar {
    grid-area: sidebar;
    background: var(--sidebar-bg);
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.menu {
    padding: 20px 0;
}

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

.menu-item {
    position: relative;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
}

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

.menu-link.active {
    background: var(--primary-color);
    color: white;
    border-left: 4px solid white;
}

.menu-link .icon {
    font-size: 20px;
}

.menu-link .arrow {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.3s;
}

.has-submenu.active > .menu-link .arrow {
    transform: rotate(180deg);
}

/* Submenu */
.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0, 0, 0, 0.2);
}

.has-submenu.active .submenu {
    max-height: 500px;
}

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

.submenu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px 10px 50px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
    cursor: pointer;
}

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

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

/* Main content area */
.main-content {
    grid-area: main;
    overflow: hidden;
    background: var(--bg-color);
}

.main-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ===== FORMULARIOS ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input:disabled {
    background-color: #f1f5f9;
    cursor: not-allowed;
}

/* ===== BOTONES ===== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

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

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

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

.btn-secondary:hover {
    background: #475569;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-edit {
    background: #3b82f6;
    color: white;
}

.btn-edit:hover {
    background: #2563eb;
}

.btn-delete {
    background: var(--error-color);
    color: white;
}

.btn-delete:hover {
    background: #dc2626;
}

/* ===== MENSAJES ===== */
.error-message {
    color: var(--error-color);
    font-size: 14px;
    margin-top: 10px;
    padding: 10px;
    background: #fee2e2;
    border-radius: 6px;
    display: none;
}

.message {
    padding: 12px;
    border-radius: 6px;
    margin-top: 15px;
    font-size: 14px;
}

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

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

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .dashboard-container {
        grid-template-columns: 1fr;
        grid-template-rows: 60px auto 1fr;
        grid-template-areas:
            "header"
            "sidebar"
            "main";
    }

    .sidebar {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s;
    }

    .sidebar.active {
        max-height: 400px;
    }

    .header h1 {
        font-size: 18px;
    }

    .login-box {
        padding: 30px 20px;
    }
}
