:root {
    --hbs-bg: #f4f7fb;
    --hbs-panel: #ffffff;
    --hbs-border: #dce3ec;
    --hbs-sidebar: #152238;
    --hbs-sidebar-muted: #8ea0b8;
    --hbs-text: #1f2937;
    --hbs-muted: #687589;
    --hbs-primary: #0f6fb5;
    --hbs-primary-dark: #0b5c97;
    --hbs-success: #0f8a5f;
    --hbs-warning: #b7791f;
    --hbs-danger: #c24141;
}

body {
    background: var(--hbs-bg);
    color: var(--hbs-text);
    font-size: 15px;
}

.app-wrapper {
    min-height: 100vh;
}

.app-header {
    border-bottom: 1px solid var(--hbs-border);
    left: 250px;
    min-height: 58px;
    position: sticky;
    right: 0;
    box-shadow: 0 1px 12px rgba(15, 23, 42, 0.04);
    top: 0;
    z-index: 1020;
}

.navbar-brand {
    color: var(--hbs-text);
    font-weight: 700;
}

.mobile-menu-button {
    align-items: center;
    border: 1px solid var(--hbs-border);
    border-radius: 8px;
    display: none;
    height: 40px;
    justify-content: center;
    width: 42px;
}

.mobile-menu-button span,
.mobile-menu-button::before,
.mobile-menu-button::after {
    background: var(--hbs-text);
    border-radius: 999px;
    content: "";
    display: block;
    height: 2px;
    width: 18px;
}

.mobile-menu-button span {
    margin: 4px 0;
}

.app-sidebar {
    background: var(--hbs-sidebar) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    bottom: 0;
    left: 0;
    overflow-y: auto;
    position: fixed;
    top: 0;
    width: 250px;
    z-index: 1030;
}

.sidebar-brand {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 64px;
    padding: 18px 20px;
}

.brand-link {
    font-size: 17px;
    font-weight: 700;
}

.sidebar-menu {
    gap: 4px;
    padding: 10px;
}

.sidebar-menu .nav-link {
    align-items: center;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.82) !important;
    display: flex;
    font-weight: 600;
    gap: 10px;
    min-height: 42px;
    padding: 10px 12px;
}

.sidebar-menu .nav-link:hover,
.sidebar-menu .nav-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff !important;
}

.sidebar-menu .nav-link.active {
    box-shadow: inset 3px 0 0 #52b6ff;
}

.nav-mark {
    align-items: center;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 7px;
    color: #fff;
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    height: 26px;
    justify-content: center;
    width: 30px;
}

.app-content-header {
    margin-left: 250px;
    padding: 20px 0 10px;
}

.app-content-header h1 {
    color: var(--hbs-text);
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 750;
    letter-spacing: 0;
}

.app-content {
    margin-left: 250px;
    padding-bottom: 28px;
}

.card {
    border: 1px solid var(--hbs-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--hbs-border);
    font-weight: 700;
}

.metric-card {
    min-height: 118px;
}

.metric-card .metric-label {
    color: var(--hbs-muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.metric-card .metric-value {
    color: var(--hbs-text);
    font-size: 26px;
    font-weight: 800;
    margin-top: 10px;
}

.table {
    --bs-table-bg: #fff;
}

.table thead th {
    background: #f7f9fc;
    color: #475569;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.table td,
.table th {
    vertical-align: middle;
}

.form-control,
.form-select {
    border-color: #ccd6e2;
    border-radius: 8px;
    min-height: 42px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--hbs-primary);
    box-shadow: 0 0 0 0.2rem rgba(15, 111, 181, 0.14);
}

.btn {
    border-radius: 8px;
    font-weight: 700;
    min-height: 40px;
}

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

.btn-primary:hover,
.btn-primary:focus {
    background: var(--hbs-primary-dark);
    border-color: var(--hbs-primary-dark);
}

.btn-sm {
    min-height: 32px;
}

.alert {
    border-radius: 8px;
}

.list-group-item {
    border-color: var(--hbs-border);
}

.report-card-entry {
    min-width: 860px;
}

.report-card-sa-entry {
    min-width: 620px;
}

.report-card-entry th,
.report-card-entry td {
    padding: 8px;
}

.report-card-entry .form-control-sm {
    font-size: 15px;
    min-height: 42px;
    min-width: 76px;
    padding: 8px 10px;
    text-align: center;
}

.report-card-entry td:first-child,
.report-card-entry th:first-child {
    background: #fff;
    left: 0;
    position: sticky;
    z-index: 1;
}

.report-card-entry th:first-child {
    z-index: 2;
}

.sidebar-backdrop {
    background: rgba(15, 23, 42, 0.42);
    bottom: 0;
    display: none;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 1030;
}

.auth-page {
    background: radial-gradient(circle at top left, #dbeafe, transparent 32%), var(--hbs-bg);
}

.auth-card {
    border: 1px solid var(--hbs-border);
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.10);
}

@media (max-width: 991.98px) {
    body {
        font-size: 14px;
    }

    .mobile-menu-button {
        display: inline-flex;
        flex-direction: column;
    }

    .app-sidebar {
        bottom: 0;
        left: 0;
        max-width: 82vw;
        position: fixed !important;
        top: 0;
        transform: translateX(-105%);
        transition: transform 180ms ease;
        width: 270px;
        z-index: 1040;
    }

    body.sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
    }

    .app-main {
        margin-left: 0 !important;
    }

    .app-header {
        left: 0;
    }

    .app-content,
    .app-content-header {
        margin-left: 0;
    }

    .app-content-header {
        padding-top: 16px;
    }

    .container-fluid {
        padding-left: 14px;
        padding-right: 14px;
    }

    .card-body {
        padding: 16px;
    }

    .table-responsive {
        border-radius: 8px;
    }
}
