
:root {
    --sidebar-width:     240px;
    --sidebar-collapsed: 0px;
    --topbar-height:     58px;
    --sidebar-bg:        #1e2130;
    --sidebar-hover:     rgba(255, 255, 255, 0.08);
    --sidebar-active:    rgba(255, 193, 7, 0.18);
    --transition:        0.25s ease;
}

/
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background-color: #f4f6fb;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 0.93rem;
    color: #2d3748;
    margin: 0;
}


.wrapper {
    min-height: 100vh;
    overflow: hidden;
}


.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background-color: var(--sidebar-bg);
    flex-shrink: 0;
    transition: width var(--transition);
    overflow-x: hidden;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    min-height: var(--topbar-height);
    white-space: nowrap;
}

.sidebar .nav-link {
    border-radius: 8px;
    padding: 0.55rem 0.85rem;
    transition: background var(--transition);
    white-space: nowrap;
    font-size: 0.88rem;
}

.sidebar .nav-link:hover {
    background: var(--sidebar-hover);
}

.sidebar .nav-link.active {
    background: var(--sidebar-active);
    color: #ffc107 !important;
    font-weight: 600;
}


.main-content {
    min-width: 0;        
    overflow-x: hidden;
}


.topbar {
    height: var(--topbar-height);
    position: sticky;
    top: 0;
    z-index: 100;
}


.metric-card {
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: 12px !important;
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.09) !important;
}

.metric-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
}

/* ── Tablas ─────────────────────────────────────────────────── */
.table th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    font-weight: 600;
    border-bottom-width: 1px;
}

.table td {
    vertical-align: middle;
    font-size: 0.88rem;
}

.table-hover tbody tr:hover {
    background-color: #f8faff;
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
    border-radius: 12px !important;
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    font-size: 0.88rem;
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
    font-size: 0.74rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 0.35em 0.65em;
    border-radius: 6px;
}

/* ── Botones ────────────────────────────────────────────────── */
.btn {
    border-radius: 7px;
    font-size: 0.87rem;
}

.btn-sm {
    font-size: 0.8rem;
    padding: 0.3rem 0.65rem;
}

/* ── Formularios ────────────────────────────────────────────── */
.form-control,
.form-select {
    border-radius: 8px;
    font-size: 0.88rem;
    border-color: #d1d5db;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.form-label {
    font-size: 0.84rem;
    margin-bottom: 0.35rem;
    color: #374151;
}

/* ── Input group ────────────────────────────────────────────── */
.input-group-text {
    border-radius: 8px 0 0 8px !important;
    background-color: #f9fafb;
    color: #6b7280;
    border-color: #d1d5db;
}

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
    font-size: 0.78rem;
}

/* ── Alertas ─────────────────────────────────────────────────── */
.alert {
    border-radius: 10px;
    font-size: 0.87rem;
    border: none;
}

/* ── Modales ────────────────────────────────────────────────── */
.modal-content {
    border-radius: 14px;
    border: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

/* ── Responsive: colapsar sidebar en móvil ──────────────────── */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        left: -100%;
        z-index: 1050;
        height: 100vh;
        transition: left var(--transition);
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.45);
        z-index: 1040;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

/* ── Login page ─────────────────────────────────────────────── */
.card .card-header.bg-dark {
    border-radius: 12px 12px 0 0 !important;
}

/* ── Scrollbar personalizada (Chromium) ─────────────────────── */
::-webkit-scrollbar        { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: #f1f1f1; }
::-webkit-scrollbar-thumb  { background: #c1c8d4; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ba6b4; }
