/* assets/css/styles.css */

/* Soporte dark mode para el navegador */
html[data-bs-theme="dark"] {
    color-scheme: dark;
}

/* Paleta y variables propias del sistema */
:root {
    --cp-primary: #0ea5e9;
    --cp-primary-soft: #e0f2fe;
    --cp-sidebar-bg-light: #f8fafc;
    --cp-sidebar-border-light: #e5e7eb;
    --cp-sidebar-link: #4b5563;
    --cp-sidebar-link-active-bg: rgba(14, 165, 233, 0.1);
    --cp-sidebar-link-active-border: #0ea5e9;
    --cp-topbar-bg-light: #ffffff;
    --cp-topbar-border: #e5e7eb;
    --cp-body-bg-light: #f3f4f6;
}

html[data-bs-theme="dark"] {
    --cp-sidebar-bg-light: #020617;
    --cp-sidebar-border-light: #111827;
    --cp-sidebar-link: #9ca3af;
    --cp-sidebar-link-active-bg: rgba(56, 189, 248, 0.16);
    --cp-sidebar-link-active-border: #38bdf8;
    --cp-topbar-bg-light: #020617;
    --cp-topbar-border: #0f172a;
    --cp-body-bg-light: #020617;
}

/* Body general */
body {
    font-size: 0.95rem;
    background-color: var(--cp-body-bg-light);
}

/* TOPBAR (navbar superior) */
.topbar {
    background-color: var(--cp-topbar-bg-light) !important;
    border-bottom: 1px solid var(--cp-topbar-border) !important;
}

.topbar .navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

/* LOGOS light/dark */
.logo-theme {
    height: 58px;
    display: none;
}

html[data-bs-theme="light"] .logo-light {
    display: inline-block;
}

html[data-bs-theme="dark"] .logo-dark {
    display: inline-block;
}

.topbar .brand-logo-dot {
    width: 28px;
    height: 28px;
    border-radius: 0.9rem;
    background: radial-gradient(circle at 20% 20%, #38bdf8 0, #0ea5e9 45%, #0369a1 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #eff6ff;
    font-size: 0.9rem;
    font-weight: 800;
}

.topbar .brand-subtitle {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #9ca3af;
}

html[data-bs-theme="dark"] .topbar .brand-subtitle {
    color: #6b7280;
}

.topbar .navbar-text {
    font-size: 0.8rem;
}

/* SIDEBAR */
.sidebar {
    min-height: calc(100vh - 56px);
    background-color: var(--cp-sidebar-bg-light);
    border-right: 1px solid var(--cp-sidebar-border-light);
    padding-top: 0.75rem;
    padding-bottom: 1.5rem;
}

.sidebar-sticky {
    top: 0.75rem;
}

.sidebar .nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    margin-top: 0.75rem;
    margin-bottom: 0.3rem;
}

html[data-bs-theme="dark"] .sidebar .nav-section-title {
    color: #6b7280;
}

.sidebar .nav-link {
    color: var(--cp-sidebar-link);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
    border-radius: 0.45rem;
    margin: 0.1rem 0.5rem;
    font-size: 0.9rem;
    position: relative;
}

.sidebar .nav-link i {
    width: 1.3rem;
    text-align: center;
    font-size: 0.95rem;
}

.sidebar .nav-link.active {
    font-weight: 600;
    background-color: var(--cp-sidebar-link-active-bg);
    color: var(--cp-primary);
}

.sidebar .nav-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 15%;
    bottom: 15%;
    width: 3px;
    border-radius: 999px;
    background: var(--cp-sidebar-link-active-border);
}

/* Hover */
.sidebar .nav-link:hover {
    background-color: rgba(148, 163, 184, 0.12);
}

html[data-bs-theme="dark"] .sidebar .nav-link:hover {
    background-color: rgba(31, 41, 55, 0.9);
}

/* MAIN CONTENT */
main {
    padding-bottom: 2.5rem;
}

/* KPI Cards */
.card-kpi {
    border-radius: 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.96), #ffffff);
}

html[data-bs-theme="dark"] .card-kpi {
    background: radial-gradient(circle at 0 0, rgba(15, 23, 42, 0.96), #020617);
    border-color: #111827;
}

.card-kpi .icon {
    font-size: 1.8rem;
    opacity: 0.9;
}

/* Tablas compactas */
.table-sm th,
.table-sm td {
    padding: 0.35rem 0.55rem;
}

/* Badges de roles */
.badge-role-admin {
    background-color: rgba(14, 165, 233, 0.15);
    color: #075985;
}

.badge-role-treasurer {
    background-color: rgba(34, 197, 94, 0.16);
    color: #166534;
}

.badge-role-secretary {
    background-color: rgba(250, 204, 21, 0.2);
    color: #92400e;
}

html[data-bs-theme="dark"] .badge-role-admin {
    background-color: rgba(8, 47, 73, 0.9);
    color: #38bdf8;
}

html[data-bs-theme="dark"] .badge-role-treasurer {
    background-color: rgba(5, 46, 22, 0.9);
    color: #4ade80;
}

html[data-bs-theme="dark"] .badge-role-secretary {
    background-color: rgba(69, 26, 3, 0.9);
    color: #facc15;
}

/* Footer */
.footer {
    border-top: 1px solid var(--cp-topbar-border);
    background-color: var(--cp-topbar-bg-light);
    font-size: 0.8rem;
}

/* Formularios más compactos en pantallas grandes */
@media (min-width: 992px) {
    .form-control,
    .form-select {
        font-size: 0.9rem;
        padding-top: 0.4rem;
        padding-bottom: 0.4rem;
    }
}

/* Ajustes de la tarjeta de login/registro */
.auth-card {
    border-radius: 1.1rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

html[data-bs-theme="dark"] .auth-card {
    border-color: #111827;
    background: radial-gradient(circle at 0 0, rgba(15, 23, 42, 0.96), #020617);
}
