:root {
    --sidebar-width: 250px;
    --sidebar-bg: #1a1d24;
    --sidebar-hover: #2a2d34;
    --sidebar-active: #0d6efd;
    --topbar-bg: #1a1d24;
    --content-bg: #212529;
    --card-bg: #2b3036;
    --accent: #0d6efd;
}

html {
    font-size: 15px;
}

body {
    margin: 0;
    background: var(--content-bg);
    color: #dee2e6;
}

.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-bottom: 1px solid #2a2d34;
}

.sidebar-header i {
    font-size: 1.5rem;
    color: var(--accent);
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #fff;
}

.sidebar-nav {
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
}

.sidebar-section {
    padding: 0.75rem 1.5rem 0.25rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6c757d;
    font-weight: 600;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1.5rem;
    color: #adb5bd;
    text-decoration: none;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
    border-left-color: var(--accent);
}

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

/* Main content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    background: var(--topbar-bg);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    border-bottom: 1px solid #2a2d34;
    position: sticky;
    top: 0;
    z-index: 999;
}

.topbar-toggler {
    background: none;
    border: none;
    color: #adb5bd;
    font-size: 1.4rem;
    cursor: pointer;
    display: none;
}

.content-body {
    padding: 1.5rem;
    flex: 1;
}

/* Login partial in topbar */
.topbar .navbar-nav {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.topbar .nav-link {
    color: #adb5bd !important;
    padding: 0.35rem 0.5rem !important;
}

.topbar .nav-link:hover {
    color: #fff !important;
}

.topbar .btn-link {
    color: #adb5bd !important;
    text-decoration: none;
}

.topbar .btn-link:hover {
    color: #fff !important;
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid #3a3f47;
    border-radius: 0.6rem;
}

.card-header {
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid #3a3f47;
    font-weight: 600;
    padding: 0.85rem 1.25rem;
}

.card-body {
    padding: 1.25rem;
}

/* Tables */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: #dee2e6;
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    background-color: transparent;
    color: #dee2e6;
    padding: 0.7rem 1rem;
    border-color: #3a3f47;
}

.table thead th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
    border-bottom: 2px solid #3a3f47;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(255, 255, 255, 0.02);
}

.table-hover > tbody > tr:hover > * {
    background-color: rgba(13, 110, 253, 0.08);
}

/* Badges */
.badge {
    font-weight: 500;
    font-size: 0.72rem;
    padding: 0.35em 0.6em;
}

/* Buttons */
.btn {
    border-radius: 0.4rem;
    font-weight: 500;
}

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

.btn-outline-secondary {
    --bs-btn-color: #adb5bd;
    --bs-btn-border-color: #3a3f47;
}

/* Forms */
.form-control, .form-select {
    background-color: #2b3036;
    border-color: #3a3f47;
    color: #dee2e6;
}

.form-control:focus, .form-select:focus {
    background-color: #2b3036;
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.form-label {
    color: #adb5bd;
    font-weight: 500;
    margin-bottom: 0.35rem;
}

/* Dashboard cards */
.dash-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    padding: 1.75rem 1rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dash-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.3);
}

.dash-card i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.dash-card-label {
    font-size: 0.95rem;
    font-weight: 600;
}

/* Login page */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--content-bg);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--card-bg);
    border: 1px solid #3a3f47;
    border-radius: 0.75rem;
    padding: 2.5rem 2rem;
}

.login-icon {
    font-size: 3rem;
    color: var(--accent);
    text-align: center;
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .topbar-toggler {
        display: block;
        margin-right: auto;
    }
}