:root {
    --primary-color: #0056b3;
    --sidebar-bg: #1e1e2d;
    --sidebar-color: #a2a3b7;
    --sidebar-hover: #ffffff;
    --sidebar-active-bg: #1b1b28;
    --topbar-bg: #ffffff;
    --body-bg: #f5f8fa;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--body-bg);
    color: #3f4254;
    overflow-x: hidden;
}

/* Sidebar layout */
.has-sidebar {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-color);
    flex-shrink: 0;
    transition: all 0.3s;
    z-index: 1000;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Sleek custom scrollbar for sidebar */
.sidebar ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.sidebar ::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
.sidebar ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-header {
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    background-color: rgba(0,0,0,0.1);
    color: #fff;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.sidebar-menu {
    padding: 1rem 0;
    list-style: none;
    margin: 0;
}

.sidebar-menu li {
    padding: 0.2rem 1rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 0.6rem 1rem;
    color: var(--sidebar-color);
    text-decoration: none;
    border-radius: 0.3rem;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.sidebar-menu a i {
    margin-right: 10px;
    font-size: 1.1rem;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
    color: var(--sidebar-hover);
    background-color: var(--sidebar-active-bg);
}

.sidebar-divider {
    height: 1px;
    background-color: rgba(255,255,255,0.05);
    margin: 1rem 0;
}

.sidebar-heading {
    padding: 0.5rem 2rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.3);
    font-weight: 600;
}

/* ── Sidebar colapsado (solo iconos) ──────────────────────────── */
.sidebar-collapsed .sidebar {
    width: 70px;
}
.sidebar-collapsed .sidebar-header {
    justify-content: center;
    padding: 0;
}
.sidebar-collapsed .sidebar-header span {
    display: none;
}
.sidebar-collapsed .sidebar-header img {
    margin-right: 0 !important;
}
.sidebar-collapsed .sidebar-menu li {
    padding: 0.2rem 0.5rem;
}
.sidebar-collapsed .sidebar-menu a {
    justify-content: center;
    padding: 0.6rem 0;
    position: relative;
}
.sidebar-collapsed .sidebar-menu a i {
    margin-right: 0;
    font-size: 1.25rem;
}
.sidebar-collapsed .sidebar-menu a span:not(.badge) {
    display: none;
}
.sidebar-collapsed .sidebar-menu a .badge {
    position: absolute;
    top: 3px;
    right: 8px;
    margin: 0 !important;
    padding: 0.2em 0.4em;
}
/* Las cabeceras de sección se vuelven una línea divisoria sutil */
.sidebar-collapsed .sidebar-heading {
    height: 1px;
    padding: 0;
    margin: 0.6rem 0.9rem;
    overflow: hidden;
    color: transparent;
    background: rgba(255, 255, 255, 0.08);
}
.sidebar-collapsed .sidebar > .p-3 {
    display: none;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Topbar */
.topbar {
    height: 60px;
    background-color: var(--topbar-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    box-shadow: 0 0 10px rgba(0,0,0,0.02);
    z-index: 900;
}

.content-wrapper {
    flex-grow: 1;
}

/* Cards */
.card {
    border: 0;
    box-shadow: 0 0 20px 0 rgba(76, 87, 125, 0.02);
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid #ebedf3;
    padding: 1.5rem 1.5rem 1rem;
}

/* Tables */
.table th {
    font-weight: 600;
    color: #b5b5c3;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    border-top: 0;
}

.table td {
    vertical-align: middle;
}

/* Auth Pages */
.auth-wrapper {
    width: 100%;
    max-width: 400px;
    padding: 15px;
    margin: auto;
}

.auth-wrapper .card {
    box-shadow: 0 10px 30px 0 rgba(0, 0, 0, 0.05);
}

/* Utilities */
.text-muted {
    color: #b5b5c3 !important;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Custom Searchable Select Dropdown styles */
.custom-searchable-select {
    position: relative;
    z-index: 1050;
}
.custom-searchable-select .dropdown-menu {
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.1) !important;
    z-index: 1060 !important;
}
.custom-searchable-select .option-item {
    transition: all 0.15s ease;
    border-radius: 6px;
    margin-bottom: 2px;
    border: none;
    background: transparent;
    text-align: left;
    width: 100%;
}
.custom-searchable-select .option-item:hover {
    background-color: rgba(13, 110, 253, 0.08);
    color: #0d6efd;
}
.custom-searchable-select .option-item.active {
    background-color: #0d6efd !important;
    color: #ffffff !important;
}
.custom-searchable-select .dropdown-menu::-webkit-scrollbar {
    width: 6px;
}
.custom-searchable-select .dropdown-menu::-webkit-scrollbar-track {
    background: transparent;
}
.custom-searchable-select .dropdown-menu::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
}
.custom-searchable-select .dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}
