* {
    box-sizing: border-box;
}

:root {

    /* Colores principales */

    --primary: #5B8DEF;
    --primary-hover: #4B7EE6;
    --primary-light: #DDE9FF;

    --secondary: #6EC6B8;
    --secondary-light: #DDF6F1;

    /* Fondos */

    --background: #F7F9FC;
    --surface: #FFFFFF;
    --surface-alt: #F2F5FA;

    /* Texto */

    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-light: #94A3B8;

    /* Bordes */

    --border: #E2E8F0;

    /* Estados */

    --success: #78C2A4;
    --success-bg: #E6F6EF;

    --warning: #E9B872;
    --warning-bg: #FFF4E5;

    --danger: #E58D8D;
    --danger-bg: #FDECEC;

    --info: #88B7FF;
    --info-bg: #EAF2FF;

    /* Sombras */

    --shadow:
            0 10px 30px rgba(15, 23, 42, 0.06);
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: #f4f6f8;
    color: #1f2937;
}

/* LOGIN */

.login-body {
    min-height: 100vh;
    background:
            radial-gradient(circle at top left, #dbeafe, transparent 35%),
            linear-gradient(135deg, #f8fafc, #eef2f7);
}

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(14px);
    border-radius: 24px;
    padding: 36px;
    box-shadow: 0 25px 80px rgba(15, 23, 42, 0.12);
}

.brand {
    text-align: center;
    margin-bottom: 28px;
}

.brand-logo {

    display: flex;

    justify-content: center;

    align-items: center;

    margin: 0 auto 20px;

}

.brand-logo img {

    width: 240px;

    max-width: 100%;

    height: auto;

    object-fit: contain;

}

.brand h1 {
    margin: 0;
    font-size: 28px;
}

.brand p {
    margin: 8px 0 0;
    color: #6b7280;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form label {
    font-size: 14px;
    font-weight: 600;
}

.form input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 16px;
    outline: none;
    background: white;
}

.form input:focus {
    border-color: #111827;
}

.form button {
    margin-top: 12px;
    border: none;
    border-radius: 14px;
    padding: 15px;
    font-size: 16px;
    font-weight: 700;
    background: #111827;
    color: white;
    cursor: pointer;
}

.form button:hover {
    background: #000;
}

.alert {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 14px;
}

/* APP */

.app-header {
    background: white;
    padding: 22px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 12px rgba(0,0,0,0.06);
}

.app-header h1 {
    margin: 0;
    font-size: 24px;
}

.app-header p {
    margin: 4px 0 0;
    color: #6b7280;
}

.logout-btn {
    text-decoration: none;
    color: white;
    background: #111827;
    padding: 11px 18px;
    border-radius: 12px;
    font-weight: 600;
}

.dashboard {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px;
}

.card{
    background: white;
    border-radius: 22px;
    padding: 26px;
    box-shadow: 0 10px 35px rgba(15, 23, 42, 0.06);
}

.card h2 {
    margin-top: 0;
}

.grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}


/* RESPONSIVE */

@media (max-width: 768px) {
    .app-header {
        padding: 18px;
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .dashboard {
        padding: 18px;
    }

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

    .login-card {
        padding: 28px 22px;
        border-radius: 20px;
    }
}

/* TOPBAR */

.topbar {
    height: 70px;
    background: white;
    box-shadow: 0 1px 10px rgba(0,0,0,0.05);
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

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

.logo img {
    height: 42px;
    width: auto;
    display: block;
}

/* USER MENU */

.user-menu {
    position: relative;
    margin-left: auto;
    flex: 0 0 auto;
}

.user-button {
    border: none;
    background: #f3f4f6;
    padding: 10px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
}

.dropdown {
    position: absolute;
    right: 0;
    top: 50px;
    width: 241px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: none;
    overflow: hidden;
    z-index: 100;
}

.dropdown a {
    display: block;
    padding: 14px 18px;
    color: #1f2937;
    text-decoration: none;
}

.dropdown a:hover {
    background: #f3f4f6;
}

.show {
    display: block;
}

/* LAYOUT */

.layout {
    display: flex;
    min-height: calc(100vh - 70px);
}

/* SIDEBAR */

.sidebar {
    width: 240px;
    background: white;
    padding: 20px;
    border-right: 1px solid #e5e7eb;
}

.menu-item {
    display: block;
    padding: 14px 18px;
    border-radius: 12px;
    text-decoration: none;
    color: #374151;
    margin-bottom: 10px;
    transition: 0.2s;
}

.menu-item:hover {
    background: #f3f4f6;
}

.menu-item.active {
    background: #111827;
    color: white;
}

/* CONTENT */

.content {
    flex: 1;
    padding: 30px;
}
@media (max-width: 768px) {

    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        display: flex;
        overflow-x: auto;
        padding: 10px;
    }

    .menu-item {
        white-space: nowrap;
        margin-right: 10px;
        margin-bottom: 0;
    }

    .content {
        padding: 20px;
    }

    .topbar {
        padding: 0 15px;
        gap: 10px;
    }
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 0 0 auto;
}

.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    padding: 8px;
    border-radius: 12px;
    cursor: pointer;
}

.menu-toggle:hover {
    background: var(--surface-alt);
}

.menu-toggle .material-symbols-outlined {
    font-size: 28px;
}

.sidebar {
    width: 270px;
    background: white;
    padding: 18px;
    border-right: 1px solid #e5e7eb;
    transition: all 0.25s ease;
}

.sidebar-hidden {
    margin-left: -270px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    font-weight: 700;
    color: #111827;
}

.sidebar-header button {
    border: none;
    background: #f3f4f6;
    border-radius: 10px;
    width: 34px;
    height: 34px;
    font-size: 20px;
    cursor: pointer;
}

.nav-group {
    margin-bottom: 10px;
}

.nav-parent {
    width: 100%;
    border: none;
    background: transparent;
    color: #374151;
    padding: 14px 16px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 15px;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-parent:hover,
.nav-parent.active {
    background: #111827;
    color: white;
}

.personalm-item {
    width: 100%;
    border: none;
    background: transparent;
    color: #374151;
    padding: 14px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 15px;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.submenu {
    display: none;
    padding: 8px 0 8px 18px;
}

.submenu.open {
    display: block;
}

.submenu a {
    display: block;
    text-decoration: none;
    color: #6b7280;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
}

.submenu a:hover {
    background: #f3f4f6;
    color: #111827;
}

.overlay {
    display: none;
}

/* MÓVIL */

@media (max-width: 768px) {
    .layout {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 200;
        transform: translateX(-100%);
        margin-left: 0;
        box-shadow: 20px 0 50px rgba(0,0,0,0.18);
    }

    .sidebar.sidebar-hidden {
        transform: translateX(0);
    }

    .overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        z-index: 150;
    }

    .show-overlay {
        display: block;
    }

    .content {
        padding: 20px;
    }

    .logo {
        font-size: 20px;
    }
}
/* TABLET */

@media (max-width: 1024px) {
    .brand-logo img {
        width: 200px;
    }
}

/* TELÉFONO */

@media (max-width: 768px) {
    .brand-logo img {
        width: 160px;
    }
}

/* TELÉFONOS PEQUEÑOS */

@media (max-width: 480px) {
    .brand-logo img {
        width: 130px;
    }
}

.material-symbols-outlined {
    vertical-align: middle;
    margin-right: 10px;
}

/* Tablet */
@media (max-width: 1024px) {
    .logo img {
        height: 36px;
    }
}

/* Móvil */
@media (max-width: 768px) {
    .logo img {
        height: 30px;
    }
    .sidebar-header { display: none;}
}

/* Móviles pequeños */
@media (max-width: 480px) {
    .logo img {
        height: 26px;
    }
    .sidebar-header { display: none;}
}

.install-banner {
    display: none;
    margin-top: 25px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.install-text {
    display: flex;
    flex-direction: column;
}

.install-text strong {
    font-size: 15px;
}

.install-text span {
    color: var(--text-secondary);
    font-size: 13px;
}

#installButton {
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    padding: 10px 18px;
    cursor: pointer;
}

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

    display: flex;
    flex-direction: column;

    gap: 20px;
}

.install-banner {
    display: none;

    background: white;
    border-radius: 18px;
    padding: 18px 20px;

    box-shadow: 0 10px 30px rgba(15,23,42,0.08);

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

    gap: 16px;
}