/* assets/css/app.css */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    background: #f5f6f8;
    color: #343a40;
}


/* ==========================================
   APP
   ========================================== */

.app-container {
    display: flex;
    min-height: 100vh;
}


/* ==========================================
   SIDEBAR
   ========================================== */

.sidebar {
    width: 260px;
    min-width: 260px;
    background: #667eea;
    color: #ffffff;
    min-height: 100vh;
    transition: all 0.25s ease;
}


.sidebar-brand {
    min-height: 70px;
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: #667eea;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}


.brand-icon {
    font-size: 28px;
    margin-right: 12px;
}


.brand-text {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}


/* ==========================================
   MENÚ
   ========================================== */

.sidebar-menu {
    padding: 15px 10px;
}


.menu-section {
    padding: 15px 12px 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.45);
}


.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 11px 12px;
    margin: 3px 0;

    color: rgba(255,255,255,0.82);
    text-decoration: none;

    border-radius: 5px;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}


.menu-item:hover {
    background: rgba(255,255,255,0.08);
    color: #ffffff;
}


.menu-icon {
    width: 24px;
    text-align: center;
}


.menu-disabled {
    opacity: 0.5;
    cursor: default;
}


.menu-disabled:hover {
    background: transparent;
}


.menu-badge {
    margin-left: auto;

    font-size: 9px;

    padding: 3px 6px;

    border-radius: 10px;

    background: rgba(255,255,255,0.1);
}


.menu-logout {
    color: #ffb3b3;
}


.menu-logout:hover {
    background: rgba(220,53,69,0.15);
    color: #ffffff;
}


/* ==========================================
   ÁREA PRINCIPAL
   ========================================== */

.main-area {
    flex: 1;
    min-width: 0;

    display: flex;
    flex-direction: column;

    min-height: 100vh;
}


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

.topbar {
    height: 70px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 25px;

    background: #ffffff;

    border-bottom: 1px solid #e9ecef;
}


.topbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}


.sidebar-toggle {
    border: 0;
    background: transparent;

    font-size: 22px;

    cursor: pointer;

    color: #495057;
}


.page-system-name {
    font-weight: 600;
    color: #495057;
}


.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}


.user-avatar {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #007bff;
    color: #ffffff;

    font-weight: 700;
}


.user-info {
    display: flex;
    flex-direction: column;
}


.user-email {
    font-size: 13px;
    font-weight: 600;
}


.user-role {
    font-size: 11px;
    color: #868e96;
}


/* ==========================================
   CONTENIDO
   ========================================== */

.content {
    flex: 1;

    padding: 30px;
}


/* ==========================================
   FOOTER
   ========================================== */

.footer {
    display: flex;
    justify-content: space-between;

    padding: 15px 30px;

    background: #ffffff;

    border-top: 1px solid #e9ecef;

    color: #868e96;

    font-size: 12px;
}


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

@media (max-width: 768px) {

    .sidebar {
        position: fixed;

        left: -260px;
        top: 0;
        bottom: 0;

        z-index: 1000;
    }


    .sidebar.sidebar-open {
        left: 0;
    }


    .content {
        padding: 20px;
    }


    .page-system-name {
        display: none;
    }


    .user-info {
        display: none;
    }

}

/* ==========================================
   PAGE HEADER
   ========================================== */

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

    margin-bottom: 25px;
}

.page-title {
    margin: 0;

    font-size: 28px;
    font-weight: 600;

    color: #343a40;
}

.page-subtitle {
    margin: 6px 0 0;

    color: #868e96;

    font-size: 14px;
}


/* ==========================================
   DASHBOARD GRID
   ========================================== */

.dashboard-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 20px;

    margin-bottom: 25px;
}


.dashboard-card {
    display: flex;
    align-items: center;

    padding: 22px;

    background: #ffffff;

    border: 1px solid #e9ecef;

    border-radius: 6px;

    box-shadow:
        0 2px 6px rgba(0,0,0,0.04);
}


.dashboard-card-icon {
    width: 50px;
    height: 50px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-right: 15px;

    border-radius: 6px;

    background: #f1f3f5;

    font-size: 23px;
}


.dashboard-card-content {
    display: flex;
    flex-direction: column;

    min-width: 0;
}


.dashboard-card-label {
    margin-bottom: 5px;

    color: #868e96;

    font-size: 12px;

    text-transform: uppercase;

    letter-spacing: 0.4px;
}


.dashboard-card-content strong {
    color: #343a40;

    font-size: 16px;

    overflow: hidden;

    text-overflow: ellipsis;
}


/* ==========================================
   CONTENT CARD
   ========================================== */

.content-card {
    margin-bottom: 25px;

    background: #ffffff;

    border: 1px solid #e9ecef;

    border-radius: 6px;

    box-shadow:
        0 2px 6px rgba(0,0,0,0.04);
}


.content-card-header {
    padding: 20px;

    border-bottom: 1px solid #e9ecef;
}


.content-card-header h2 {
    margin: 0;

    font-size: 18px;

    font-weight: 600;

    color: #343a40;
}


.content-card-header p {
    margin: 5px 0 0;

    color: #868e96;

    font-size: 13px;
}


/* ==========================================
   QUICK ACTIONS
   ========================================== */

.quick-actions {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 15px;

    padding: 20px;
}


.quick-action {
    display: flex;
    align-items: center;

    gap: 15px;

    padding: 16px;

    text-decoration: none;

    color: #343a40;

    border: 1px solid #e9ecef;

    border-radius: 6px;

    transition: all 0.2s ease;
}


.quick-action:hover {
    background: #f8f9fa;

    border-color: #ced4da;

    transform: translateY(-1px);
}


.quick-action-icon {
    width: 45px;
    height: 45px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 6px;

    background: #f1f3f5;

    font-size: 20px;
}


.quick-action span:last-child {
    display: flex;
    flex-direction: column;
}


.quick-action strong {
    font-size: 14px;
}


.quick-action small {
    margin-top: 4px;

    color: #868e96;

    font-size: 12px;
}


/* ==========================================
   SYSTEM INFO
   ========================================== */

.system-info {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 20px;

    padding: 20px;
}


.system-info div {
    display: flex;
    flex-direction: column;

    gap: 5px;
}


.system-info span {
    color: #868e96;

    font-size: 12px;
}


.system-info strong {
    font-size: 14px;

    color: #343a40;
}


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

@media (max-width: 1100px) {

    .dashboard-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }


    .system-info {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


@media (max-width: 600px) {

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


    .quick-actions {
        grid-template-columns: 1fr;
    }


    .system-info {
        grid-template-columns: 1fr;
    }


    .page-title {
        font-size: 24px;
    }

}

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

.login-page {
    min-height: 100vh;

    margin: 0;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #f1f3f5;
}


.login-wrapper {
    width: 100%;
    max-width: 440px;

    padding: 25px;
}


.login-card {
    background: #ffffff;

    border: 1px solid #e9ecef;

    border-radius: 8px;

    padding: 40px;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.08);
}


.login-logo {
    width: 64px;
    height: 64px;

    margin: 0 auto 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #f1f3f5;

    font-size: 28px;
}


.login-card h1 {
    margin: 0;

    text-align: center;

    color: #343a40;

    font-size: 24px;

    font-weight: 600;

    line-height: 1.3;
}


.login-subtitle {
    margin: 10px 0 30px;

    text-align: center;

    color: #868e96;

    font-size: 14px;

    line-height: 1.5;
}


.login-alert {
    margin-bottom: 20px;

    padding: 12px 14px;

    border: 1px solid #f5c2c7;

    border-radius: 5px;

    background: #f8d7da;

    color: #842029;

    font-size: 13px;
}


.login-form {
    width: 100%;
}


.login-form-group {
    margin-bottom: 20px;
}


.login-form-group label {
    display: block;

    margin-bottom: 7px;

    color: #495057;

    font-size: 13px;

    font-weight: 600;
}


.login-form-group input {
    width: 100%;

    box-sizing: border-box;

    padding: 12px 13px;

    border: 1px solid #ced4da;

    border-radius: 5px;

    background: #ffffff;

    color: #343a40;

    font-size: 14px;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}


.login-form-group input:focus {
    border-color: #80bdff;

    box-shadow:
        0 0 0 3px rgba(0, 123, 255, 0.12);
}


.login-form-group input::placeholder {
    color: #adb5bd;
}


.login-button {
    width: 100%;

    padding: 12px 16px;

    border: 0;

    border-radius: 5px;

    background: #007bff;

    color: #ffffff;

    font-size: 14px;

    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.1s ease;
}


.login-button:hover {
    background: #0069d9;
}


.login-button:active {
    transform: translateY(1px);
}


.login-footer {
    margin-top: 30px;

    padding-top: 20px;

    border-top: 1px solid #e9ecef;

    text-align: center;
}


.login-footer p {
    margin: 0 0 5px;

    color: #495057;

    font-size: 12px;

    font-weight: 600;
}


.login-footer span {
    color: #adb5bd;

    font-size: 11px;
}


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

@media (max-width: 480px) {

    .login-wrapper {
        padding: 15px;
    }


    .login-card {
        padding: 30px 22px;
    }


    .login-card h1 {
        font-size: 21px;
    }

}
