:root {
    --mh-sidebar-bg: #1e2a38;
    --mh-sidebar-hover: #2b3d51;
    --mh-topbar-bg: #16222e;
    --mh-accent: #258cfb;
    --mh-gold: #d9b64a;
    --mh-border: #dee2e6;
}

html { font-size: 15px; }
body { background: #f4f6f9; }

/* topbar */
.topbar {
    background: var(--mh-topbar-bg);
    padding: .5rem 1rem;
    z-index: 1045;
}
.brand-logo { height: 44px; width: auto; display: block; }
.brand-logo-lg { width: 75%; height: auto; margin: 0 auto; }

/* sidebar */
.sidebar {
    background: var(--mh-sidebar-bg);
    width: 240px;
    min-height: calc(100vh - 49px);
}
/* BS 5.1 has no .offcanvas-lg — pin the offcanvas in-flow on desktop */
@media (min-width: 992px) {
    .sidebar.offcanvas {
        position: static;
        transform: none;
        visibility: visible;
        z-index: auto;
        border: 0;
    }
}
@media (min-width: 992px) {
    .sidebar { position: sticky; top: 49px; height: calc(100vh - 49px); overflow-y: auto; flex-shrink: 0; }
}
.sidebar-nav .nav-link {
    color: #b8c4d0;
    padding: .55rem 1.1rem;
    font-size: .92rem;
    border-left: 3px solid transparent;
}
.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    color: #fff;
    background: var(--mh-sidebar-hover);
    border-left-color: var(--mh-accent);
}
.sidebar-heading {
    color: #6b7c8d;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 1rem 1.1rem .25rem;
}

/* main */
.main-content {
    padding: 1.25rem;
    min-width: 0;
}
@media (max-width: 576px) {
    .main-content { padding: .75rem; }
}

/* page header */
.page-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #22303e;
    margin-bottom: 0;
}
.page-sub { color: #7c8a99; font-size: .85rem; }

/* cards */
.card { border: 1px solid var(--mh-border); border-radius: .5rem; box-shadow: 0 1px 2px rgba(20,30,40,.04); }
.card-header { background: #fff; font-weight: 600; border-bottom: 1px solid var(--mh-border); }

/* stat cards */
.stat-card .stat-value { font-size: 1.5rem; font-weight: 700; color: #22303e; }
.stat-card .stat-label { font-size: .78rem; color: #7c8a99; text-transform: uppercase; letter-spacing: .04em; }

/* tables */
.table { font-size: .88rem; }
.table thead th {
    background: #f0f3f7;
    color: #4a5a6a;
    font-weight: 600;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    border-bottom: 2px solid var(--mh-border);
    white-space: nowrap;
}
.table td { vertical-align: middle; }
.table-hover tbody tr:hover { background: #f4f8fd; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: ui-monospace, Consolas, monospace; }

/* badges */
.badge-status { font-size: .72rem; font-weight: 600; padding: .3em .6em; border-radius: 1rem; }
.st-active { background: #d7f0dd; color: #1d6b34; }
.st-dormant { background: #fdeec8; color: #8a6116; }
.st-inactive { background: #e2e6ea; color: #56636e; }
.st-full { background: #d7f0dd; color: #1d6b34; }
.st-partial { background: #fdeec8; color: #8a6116; }
.st-none { background: #f8d7da; color: #9c2b35; }
.st-nobill { background: #e2e6ea; color: #56636e; }

/* totals footer */
.totals-row td { font-weight: 700; background: #f0f3f7; }

/* form header (FileMaker-style header band on the order detail) */
.doc-header {
    background: #fff;
    border: 1px solid var(--mh-border);
    border-radius: .5rem;
    padding: 1rem 1.25rem;
}
.doc-header .doc-no { font-size: 1.25rem; font-weight: 700; color: #1d4f8a; font-family: ui-monospace, Consolas, monospace; }
.fld-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: #7c8a99; margin-bottom: .1rem; }
.fld-value { font-size: .95rem; color: #22303e; }

/* filter bar */
.filter-bar { background: #fff; border: 1px solid var(--mh-border); border-radius: .5rem; padding: .75rem 1rem; }
.pager-info { color: #7c8a99; font-size: .82rem; }

/* ============ executive report ============ */
.ex-hero {
    background: linear-gradient(120deg, #16222e 0%, #1e2a38 55%, #2b3d51 100%);
    border-radius: .6rem; color: #fff;
}
.ex-hero .ex-eyebrow { color: var(--mh-gold); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; }
.ex-hero h4 { color: #fff; font-weight: 700; }
.ex-hero .ex-sub { color: rgba(255,255,255,.65); }
.ex-kpi .card-body { padding: .85rem 1rem; }
.ex-kpi .v { font-size: 1.3rem; font-weight: 700; line-height: 1.1; color: #22303e; }
.ex-kpi .l { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: #7c8a99; }
.ex-share-bar { height: .45rem; border-radius: 1rem; background: #e9ecef; overflow: hidden; min-width: 60px; }
.ex-share-bar > div { height: 100%; border-radius: 1rem; }
.ex-chart-wrap { position: relative; height: 300px; }
.ex-rank { display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; font-size: .75rem; font-weight: 700; background: #e9ecef; color: #495057; }
.ex-rank-1 { background: var(--mh-gold); color: #fff; }
.ex-rank-2 { background: #b9bec9; color: #fff; }
.ex-rank-3 { background: #c98d5e; color: #fff; }
.ex-ai { border-left: 3px solid var(--mh-gold); }
.ex-ai-badge { background: var(--mh-gold); color: #fff; font-size: .65rem; font-weight: 700; letter-spacing: .08em; border-radius: .3rem; padding: .15rem .45rem; }
.ex-verdict { background: #f3e6bd; color: #6b5410; }
.ex-dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; margin-right: .35rem; }
.ex-cell { text-align: center; min-width: 4.2rem; }
.fs-xs { font-size: .75rem; }
.fs-sm { font-size: .85rem; }

/* print */
@media print {
    .topbar, .sidebar, .filter-bar, .btn, .no-print { display: none !important; }
    .main-content { padding: 0; }
    body { background: #fff; }
    .card { break-inside: avoid; }
}
