:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1a1d29;
    --brand-accent: #6366f1;
}

body {
    background: #f4f6f9;
    overflow-x: hidden;
}

#wrapper {
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg) !important;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    z-index: 1040;
}

.sidebar .nav-link {
    border-radius: 0.375rem;
    margin-bottom: 2px;
    padding: 0.6rem 1rem;
    white-space: nowrap;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav {
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.brand-icon {
    color: var(--brand-accent);
    font-size: 1.35rem;
    flex-shrink: 0;
}

.brand-name {
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    text-transform: lowercase;
}

.brand-tagline {
    font-size: 0.7rem;
    line-height: 1.2;
}

#page-content-wrapper {
    background: #f4f6f9;
    min-width: 0;
}

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

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

.stat-card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
}

.table-card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.badge-status {
    font-weight: 500;
}

.app-footer a {
    color: var(--brand-accent);
}

.app-footer a:hover {
    color: #4f46e5;
}

.login-page {
    background: linear-gradient(135deg, #1a1d29 0%, #2d3748 100%);
    min-height: 100vh;
}

.login-brand {
    color: #fff;
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-brand .brand-slug {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: lowercase;
}

.login-brand .brand-sub {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.95rem;
}

.login-card {
    border: none;
    border-radius: 1rem;
}

.login-footer {
    color: rgba(255, 255, 255, 0.75);
}

.login-footer a {
    color: #a5b4fc;
    text-decoration: none;
    font-weight: 600;
}

.login-footer a:hover {
    color: #c7d2fe;
}

.page-header {
    gap: 0.75rem;
}

.page-header .btn,
.page-header .btn-group {
    flex-shrink: 0;
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        transform: translateX(-100%);
        box-shadow: 0 0 24px rgba(0, 0, 0, 0.25);
    }

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

    .stat-card .stat-value {
        font-size: 1.45rem;
    }
}

@media (max-width: 767.98px) {
    .card-body {
        padding: 1rem;
    }

    .stat-card .stat-value {
        font-size: 1.25rem;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch !important;
    }

    .page-header .btn {
        width: 100%;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        text-align: left;
        margin-bottom: 0.75rem;
    }

    .dataTables_wrapper .dataTables_paginate {
        margin-top: 0.75rem;
    }

    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .login-page .card-body {
        padding: 1.5rem !important;
    }
}

@media (max-width: 575.98px) {
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    h1.h3 {
        font-size: 1.25rem;
    }
}

@media (min-width: 992px) {
    #sidebarToggle,
    .sidebar-close {
        display: none !important;
    }
}

.pac-container {
    z-index: 2000 !important;
}

.card .pagination {
    margin-bottom: 0;
}

.card nav[role="navigation"] {
    padding-top: 0.5rem;
}
