/* ===============================
   BASE
================================ */
* {
    box-sizing: border-box;
}

body.app-body {
    margin: 0;
    background: linear-gradient(180deg, #eef6ff 0%, #f8fafc 100%);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: #0f172a;
}

/* ===============================
   TOPBAR
================================ */
.topbar {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 9999;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
}

/* Brand */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.brand-dot {
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #0d6efd, #38bdf8);
    border-radius: 50%;
}

.brand-name {
    font-weight: 900;
    color: #0f172a;
}

.brand-sub {
    font-weight: 700;
    color: #0d6efd;
}

/* Navigation */
.topnav {
    display: flex;
    gap: 10px;
}

.topnav-link {
    text-decoration: none;
    font-weight: 700;
    color: #334155;
    padding: 8px 14px;
    border-radius: 12px;
    transition: all .2s ease;
}

    .topnav-link:hover {
        background: #eef6ff;
        color: #0d6efd;
    }

/* User */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-pill {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 6px 12px;
    font-weight: 700;
    color: #334155;
}

.logout-btn {
    border-radius: 12px;
}

/* ===============================
   MAIN
================================ */
.main-shell {
    padding-top: 24px;
    padding-bottom: 40px;
}

/* ===============================
   HOME HERO
================================ */
.home-shell {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.home-hero {
    background: linear-gradient(135deg, #e0f2fe, #f8fafc);
    border-radius: 24px;
    padding: 28px;
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 24px;
}

.badge-pill {
    display: inline-block;
    background: #0d6efd;
    color: white;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.home-title {
    font-size: 2.2rem;
    font-weight: 900;
    margin-bottom: 8px;
}

.home-subtitle {
    color: #475569;
    max-width: 520px;
}

.home-quick {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

/* ===============================
   KPI
================================ */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.kpi {
    background: white;
    border-radius: 18px;
    padding: 18px;
    border: 1px solid #e2e8f0;
}

.kpi__label {
    font-size: .8rem;
    font-weight: 700;
    color: #64748b;
}

.kpi__value {
    font-size: 2rem;
    font-weight: 900;
    margin: 6px 0;
}

.kpi__hint {
    font-size: .8rem;
    color: #94a3b8;
}

/* ===============================
   MODULES GRID
================================ */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.module-card {
    background: white;
    border-radius: 22px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all .2s ease;
}

    .module-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 10px 30px rgba(0,0,0,.08);
    }

.module-card__header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.module-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #0d6efd, #38bdf8);
    color: white;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
}

.module-title {
    font-weight: 800;
    margin: 0;
}

.module-desc {
    font-size: .85rem;
    color: #64748b;
    margin: 0;
}

.module-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

/* ===============================
   BOTONES
================================ */
.btn {
    border-radius: 14px;
    font-weight: 700;
}

.btn-outline-primary {
    border-width: 2px;
}

/* ===============================
   RESPONSIVE
================================ */
@media (max-width: 992px) {
    .home-hero {
        grid-template-columns: 1fr;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .topnav {
        display: none;
    }
}

@media (max-width: 576px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }
}
