:root {
    --hb-primary: #0d5c46;
    --hb-primary-dark: #093f30;
    --hb-accent: #e8b923;
    --hb-bg: #f3f5f7;
    --sidebar-width: 260px;
}

body {
    background-color: var(--hb-bg);
    font-family: "Segoe UI", "Be Vietnam Pro", system-ui, -apple-system, sans-serif;
}

/* ---------- Topbar ---------- */
.hb-topbar {
    height: 64px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.hb-topbar .brand-title {
    font-weight: 700;
    color: var(--hb-primary);
    font-size: 1.05rem;
    line-height: 1.2;
}

.hb-topbar .brand-sub {
    font-size: .72rem;
    color: #6b7280;
}

/* ---------- Sidebar ---------- */
.hb-sidebar {
    width: var(--sidebar-width);
    min-height: calc(100vh - 64px);
    background: linear-gradient(180deg, var(--hb-primary) 0%, var(--hb-primary-dark) 100%);
    position: sticky;
    top: 64px;
    align-self: flex-start;
    padding: 1.25rem 0.75rem;
    transition: margin-left .25s ease;
}

.hb-sidebar .nav-link {
    color: rgba(255,255,255,.82);
    border-radius: .5rem;
    padding: .65rem .9rem;
    margin-bottom: .25rem;
    font-size: .92rem;
    display: flex;
    align-items: center;
    gap: .65rem;
    transition: background .15s ease;
}

.hb-sidebar .nav-link i { width: 20px; text-align: center; }

.hb-sidebar .nav-link:hover {
    background: rgba(255,255,255,.10);
    color: #fff;
}

.hb-sidebar .nav-link.active {
    background: var(--hb-accent);
    color: #1a1a1a;
    font-weight: 600;
}

.hb-sidebar .nav-section-title {
    color: rgba(255,255,255,.5);
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: .75rem .9rem .25rem;
}

@media (max-width: 991.98px) {
    .hb-sidebar {
        position: fixed;
        left: 0;
        top: 64px;
        margin-left: calc(-1 * var(--sidebar-width));
        z-index: 1040;
        box-shadow: 4px 0 20px rgba(0,0,0,.15);
    }
    .hb-sidebar.show { margin-left: 0; }
    .hb-backdrop {
        display: none;
        position: fixed;
        inset: 64px 0 0 0;
        background: rgba(0,0,0,.35);
        z-index: 1035;
    }
    .hb-backdrop.show { display: block; }
}

/* ---------- Main content ---------- */
.hb-main {
    flex: 1;
    min-width: 0;
    padding: 1.5rem;
}

.page-heading {
    font-weight: 700;
    color: #1f2937;
}

/* ---------- KPI Cards ---------- */
.kpi-card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .06);
    overflow: hidden;
    height: 100%;
}

.kpi-icon {
    width: 52px;
    height: 52px;
    border-radius: .85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.kpi-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #111827;
}

.kpi-target {
    font-size: .78rem;
    color: #6b7280;
}

/* ---------- Generic ---------- */
.card {
    border: none;
    border-radius: .9rem;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .06);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #eef0f2;
    font-weight: 600;
    border-top-left-radius: .9rem !important;
    border-top-right-radius: .9rem !important;
}

.table thead th {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #6b7280;
    border-bottom-width: 1px;
    white-space: nowrap;
}

.table td { vertical-align: middle; }

.badge { font-weight: 500; font-size: .74rem; }

.progress { height: 8px; border-radius: 1rem; }

.avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--hb-accent);
    color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.timeline-item {
    border-left: 2px solid #e5e7eb;
    padding-left: 1rem;
    padding-bottom: 1rem;
    position: relative;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--hb-primary);
}

.news-important { border-left: 4px solid var(--hb-accent); }

.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--hb-primary) 0%, var(--hb-primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card {
    max-width: 420px;
    width: 100%;
    border-radius: 1.2rem;
    overflow: hidden;
}

.btn-hb-primary {
    background: var(--hb-primary);
    border-color: var(--hb-primary);
    color: #fff;
}
.btn-hb-primary:hover {
    background: var(--hb-primary-dark);
    border-color: var(--hb-primary-dark);
    color: #fff;
}

.nav-tabs .nav-link.active { font-weight: 600; color: var(--hb-primary); }
.nav-tabs .nav-link { color: #6b7280; }
