/* ─── Global ──────────────────────────────────────────────────────────────── */
body {
    font-family: 'Segoe UI', sans-serif;
    background-color: #f0f2f5;
    color: #212529;
}

/* ─── Sidebar ─────────────────────────────────────────────────────────────── */
#sidebar {
    width: 260px;
    min-width: 260px;
    min-height: 100vh;
    background: linear-gradient(180deg, #0d1b2a 0%, #1b2d42 100%);
    color: #c8d6e5;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: width .25s ease;
    z-index: 100;
}

#sidebar .sidebar-brand {
    padding: 22px 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    text-decoration: none;
}
#sidebar .sidebar-brand .brand-icon {
    width: 40px; height: 40px;
    background: #e63946;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; color: #fff; font-weight: 700;
    flex-shrink: 0;
}
#sidebar .brand-text { font-size: .95rem; font-weight: 600; color: #fff; line-height: 1.1; }
#sidebar .brand-sub  { font-size: .72rem; color: #7a9abf; }

#sidebar .sidebar-section {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #4a6a8a;
    padding: 18px 20px 6px;
}

#sidebar .nav-link {
    color: #a0b8d0;
    padding: 9px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 3px solid transparent;
    transition: all .2s;
    font-size: .88rem;
    text-decoration: none;
}
#sidebar .nav-link i { font-size: 1rem; width: 18px; text-align: center; }
#sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,.06);
    border-left-color: #e63946;
}
#sidebar .nav-link.active {
    color: #fff;
    background: rgba(230,57,70,.15);
    border-left-color: #e63946;
    font-weight: 500;
}
#sidebar .nav-link.disabled-menu {
    opacity: .4;
    pointer-events: none;
    cursor: default;
}

/* Sidebar user info */
#sidebar .sidebar-user {
    padding: 14px 18px;
    border-top: 1px solid rgba(255,255,255,.08);
    margin-top: auto;
}
#sidebar .sidebar-user .avatar {
    width: 36px; height: 36px;
    background: #e63946;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .85rem; color: #fff;
    flex-shrink: 0;
}
#sidebar .sidebar-user .user-name  { font-size: .82rem; color: #fff; font-weight: 500; }
#sidebar .sidebar-user .user-role  { font-size: .7rem;  color: #7a9abf; }

/* ─── Main content ────────────────────────────────────────────────────────── */
#main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* ─── Top Navbar ──────────────────────────────────────────────────────────── */
.navbar-top {
    background: #fff;
    border-bottom: 1px solid #e3e8ef;
    padding: 12px 24px;
    position: sticky;
    top: 0;
    z-index: 99;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.navbar-top .page-title { font-size: 1.15rem; font-weight: 600; color: #1b2d42; }
.navbar-top .page-breadcrumb { font-size: .78rem; color: #8898a9; }

/* ─── Content area ────────────────────────────────────────────────────────── */
.content-area { padding: 24px; flex: 1; }

/* ─── KPI Cards ───────────────────────────────────────────────────────────── */
.kpi-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    background: #fff;
    transition: transform .2s, box-shadow .2s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.1); }
.kpi-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
}

/* ─── Cards genéricos ─────────────────────────────────────────────────────── */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,.07);
}
.card-header {
    background: #fff;
    border-bottom: 1px solid #f0f3f7;
    font-weight: 600;
    font-size: .9rem;
    padding: 14px 20px;
}

/* ─── Tabelas ─────────────────────────────────────────────────────────────── */
.table th {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #8898a9;
    border-top: none;
    background: #f8fafc;
}
.table td { vertical-align: middle; font-size: .88rem; }
.table tbody tr:hover { background: #f8fafc; }

/* ─── Badges de status ────────────────────────────────────────────────────── */
.badge-ativo   { background: #d4f4e2; color: #166534; font-weight: 600; }
.badge-inativo { background: #fde8e8; color: #9b1c1c; font-weight: 600; }

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.btn-primary   { background: #1b2d42; border-color: #1b2d42; }
.btn-primary:hover { background: #0d1b2a; border-color: #0d1b2a; }
.btn-danger    { background: #e63946; border-color: #e63946; }

/* ─── Forms ───────────────────────────────────────────────────────────────── */
.form-label { font-weight: 500; font-size: .85rem; color: #374151; }
.form-control, .form-select {
    font-size: .88rem;
    border-color: #d1d9e0;
    border-radius: 8px;
}
.form-control:focus, .form-select:focus {
    border-color: #1b2d42;
    box-shadow: 0 0 0 3px rgba(27,45,66,.1);
}

/* ─── Auth page ───────────────────────────────────────────────────────────── */
.auth-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #0d1b2a 0%, #1b4f72 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    padding: 40px;
}
.auth-logo {
    width: 56px; height: 56px;
    background: #e63946;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; color: #fff; font-weight: 700;
    margin: 0 auto 16px;
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    #sidebar { width: 0; min-width: 0; overflow: hidden; }
    #sidebar.show { width: 260px; min-width: 260px; }
}
