:root {
    --bg-main: #061426;
    --bg-soft: #0b1f3a;
    --bg-card: rgba(12, 34, 61, 0.92);
    --blue: #1f8cff;
    --blue-soft: #46b7ff;
    --text-main: #f4f8ff;
    --text-muted: #a9bdd6;
    --border: rgba(90, 170, 255, 0.22);
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(31, 140, 255, 0.22), transparent 35%),
        linear-gradient(135deg, #061426 0%, #071c34 55%, #0a2a4b 100%);
    color: var(--text-main);
    min-height: 100vh;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(6, 20, 38, 0.97);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
}

.header-inner {
    width: min(1200px, 94%);
    margin: 0 auto;
    padding: 16px 0 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.brand-box {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.logo {
    width: 92px;
    height: auto;
    display: block;
    flex-shrink: 0;
}

.brand-box h1 {
    margin: 0;
    letter-spacing: 1px;
    font-size: clamp(1.55rem, 4vw, 2.35rem);
}

.brand-box p {
    margin: 5px 0 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.clock-box {
    min-width: 220px;
    padding: 13px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255,255,255,0.05);
    text-align: right;
    box-shadow: 0 10px 25px rgba(0,0,0,0.22);
}

.clock-box span,
.clock-box strong { display: block; }

.clock-box span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.clock-box strong {
    color: var(--blue-soft);
    font-size: 1.55rem;
    margin-top: 4px;
}

.mobile-menu-btn {
    display: none;
    width: 48px;
    height: 48px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(31, 140, 255, 0.18);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    flex-shrink: 0;
}

.main-nav {
    width: min(1200px, 94%);
    margin: 0 auto;
    padding: 10px 0 16px; /* Corrige el corte del botón activo */
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-main);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    border: 1px solid transparent;
    white-space: nowrap;
    transition: 0.25s ease;
}

.main-nav a:hover,
.main-nav a.active {
    border-color: var(--blue-soft);
    background: rgba(31, 140, 255, 0.18);
    transform: translateY(-1px);
    box-shadow: 0 7px 18px rgba(0,0,0,0.22);
}

.container {
    width: min(1200px, 94%);
    margin: 26px auto 70px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.dash-card,
.welcome-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.dash-card {
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.dash-card span { font-size: 2rem; }

.dash-card p {
    margin: 0 0 5px;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.dash-card strong {
    font-size: 1.8rem;
    color: var(--blue-soft);
}

.welcome-card { padding: clamp(22px, 4vw, 38px); }

.welcome-card h2 {
    margin-top: 0;
    font-size: clamp(1.6rem, 4vw, 2.2rem);
}

.welcome-card p {
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 820px;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-top: 26px;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 58px;
    padding: 14px;
    text-decoration: none;
    color: white;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(31, 140, 255, 0.32), rgba(70, 183, 255, 0.14));
    transition: 0.25s ease;
    text-align: center;
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
}

.action-btn.disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 22px;
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--blue-soft));
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    display: none;
    box-shadow: 0 14px 35px rgba(0,0,0,0.4);
    z-index: 100;
}

.back-to-top.show { display: block; }

.app-footer {
    text-align: center;
    padding: 28px 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: rgba(0,0,0,0.16);
}

@media (max-width: 900px) {
    .header-inner {
        padding: 12px 0;
        align-items: center;
        gap: 12px;
    }

    .brand-box { gap: 10px; }

    .logo { width: 72px; }

    .brand-box p { display: none; }

    .clock-box { display: none; }

    .mobile-menu-btn { display: inline-flex; align-items: center; justify-content: center; }

    .main-nav {
        display: none;
        width: min(1200px, 94%);
        padding: 0 0 14px;
        overflow: visible;
        grid-template-columns: 1fr;
    }

    .main-nav.open {
        display: grid;
        gap: 9px;
    }

    .main-nav a {
        width: 100%;
        border-radius: 14px;
        justify-content: flex-start;
        padding: 13px 16px;
        background: rgba(255,255,255,0.07);
    }

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

@media (max-width: 560px) {
    .header-inner { width: min(100% - 22px, 1200px); }

    .brand-box h1 { font-size: 1.25rem; }

    .logo { width: 64px; }

    .container {
        width: min(100% - 22px, 1200px);
        margin-top: 18px;
    }

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

    .dash-card { padding: 16px; }

    .back-to-top {
        right: 14px;
        bottom: 16px;
        width: 48px;
        height: 48px;
    }
}