/* =======================================================
   DASHBOARD LAYOUT — sidebar, topbar, content area

   Its own visual identity on desktop (permanent navy-gradient sidebar,
   pill-style active nav state) but the mobile drawer deliberately mirrors
   the guest navbar's offcanvas (guest-layout.scss's .nav-offcanvas): same
   side (offcanvas-end), same width, same "Menu" header treatment - only
   the link list/sections differ. Reuses the same design tokens (base.scss)
   and the brand-name/brand-tagline type scale already established for the
   guest navbar, just re-themed for the dark panel.
   ======================================================= */

/* ===== Shell ===== */
.dash-body {
    background: var(--bg-section);
}
.dash-shell {
    min-height: 100vh;
}
.dash-main {
    min-width: 0;
}

/* Desktop: sidebar and main content are two independently scrolling panes
   (each with its own scrollbar) rather than one long page scroll - the body
   itself is pinned to the viewport height so it never scrolls. */
@media (min-width: 992px) {
    body.dash-body {
        height: 100vh;
        overflow: hidden;
    }
    .dash-shell {
        height: 100vh;
    }
    .dash-main {
        height: 100vh;
        overflow: hidden;
    }
    .dash-content {
        overflow-y: auto;
        flex: 1 1 auto;
    }
}

/* Matches the 16px/500 global body default - this used to run smaller
   (14.5px, with tables/buttons/small-text scaled down further still) on the
   theory that a tighter scale reads as "premium" on a page-dense screen; in
   practice that made the dashboard - where staff do real, repeated data
   entry - noticeably harder to read than the marketing pages, worst for
   exactly the users (older KVK/office staff) least able to compensate for
   it. Kept at parity with the base font size instead; the sidebar/topbar's
   own type scale is untouched. */
.dash-content {
    font-size: 16px;
    line-height: 1.6;
}
.dash-content h2,
.dash-content h3 {
    letter-spacing: -0.01em;
}
.dash-content .card {
    border-radius: 10px;
}
.dash-content .card .h4 {
    font-size: 1.3rem;
}
.dash-content .table {
    font-size: 0.95em;
}
.dash-content .table thead th {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom-width: 1px;
}
.dash-content .btn {
    font-size: 0.95em;
}
.dash-content .form-label {
    font-size: 0.92em;
    font-weight: 600;
    color: var(--text);
}
.dash-content .text-muted.small,
.dash-content small {
    font-size: 0.85em;
}

/* ===== Sidebar ===== */
.dash-sidebar {
    background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
    box-shadow: 4px 0 24px rgba(2, 27, 56, 0.14);
}
@media (max-width: 991.98px) {
    .dash-sidebar {
        width: min(84%, 300px);
    }
    .dash-sidebar .offcanvas-header {
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }
    .dash-sidebar .offcanvas-title {
        color: #fff;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        font-size: 12.5px;
    }
}
@media (min-width: 992px) {
    /* Bootstrap's own `.offcanvas-lg` breakpoint styles (_offcanvas.scss)
       drop the offcanvas back to a plain flow element above `lg` - display
       reverts to block and `.offcanvas-body` goes to flex-grow:0/
       overflow-y:visible, on the assumption that a "desktop sidebar" just
       flows in the page rather than needing its own scroll region. Redone
       here on purpose: fixed-height flex column so the brand header/logout
       button stay put and only #dashNav (the middle flex item) scrolls -
       min-height:0 is required on every flex link in the chain, since flex
       items default to min-height:auto (their content's natural height),
       which otherwise stops them shrinking and pushes the overflow up to
       .dash-sidebar itself instead of scrolling inside #dashNav. */
    .dash-sidebar {
        display: flex;
        flex-direction: column;
        width: 300px;
        /* Without this, .dash-shell's flex row shrinks the sidebar below its
           set width whenever the content column is wide (e.g. a table). */
        flex-shrink: 0;
        height: 100vh;
    }
    .dash-sidebar .offcanvas-body {
        display: flex;
        flex-direction: column;
        flex-grow: 1;
        min-height: 0;
    }
    .dash-sidebar .dash-nav {
        flex-grow: 1;
        overflow-y: auto;
        min-height: 0;
    }
}
.dash-sidebar .brand-name {
    color: #fff;
    font-size: 15px;
    letter-spacing: 0.01em;
}
.dash-sidebar .brand-tagline {
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.dash-nav-section {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.09em;
    color: var(--gold-soft);
    opacity: 0.7;
}

.dash-nav .nav-link {
    position: relative;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: 8px;
    padding: 9px 12px;
    color: rgba(255, 255, 255, 0.72);
    transition:
        background 0.2s ease,
        color 0.2s ease;
}
.dash-nav .nav-link i {
    width: 16px;
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.48);
    transition: color 0.2s ease;
}
.dash-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}
.dash-nav .nav-link:hover i {
    color: var(--gold-soft);
}
.dash-nav .nav-link.active {
    background: var(--gold);
    color: var(--navy-deep);
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(223, 160, 57, 0.35);
}
.dash-nav .nav-link.active i {
    color: var(--navy-deep);
}

.dash-sidebar-foot {
    border-top-color: rgba(255, 255, 255, 0.12) !important;
}
.dash-sidebar-foot .btn {
    border-color: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.85);
    font-size: 13.5px;
}
.dash-sidebar-foot .btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

/* ===== Topbar =====
   padding-top/bottom is the shared --topbar-py token (base.scss) - same
   value .site-navbar (the guest navbar) uses, so "the navbar/topbar" is one
   consistent height/style across both layouts rather than two independently-
   tuned ones. Horizontal padding stays layout-specific (px-3 px-lg-4 utility
   classes in the blade markup) since the guest navbar has no equivalent. */
.dash-topbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 12px rgba(2, 27, 56, 0.04);
    z-index: 20;
    padding-top: var(--topbar-py);
    padding-bottom: var(--topbar-py);
}
.dash-heading {
    font-size: 19px;
    color: var(--heading);
}
.dash-breadcrumb {
    font-size: 12px;
    color: var(--text-muted);
}
@media (max-width: 991.98px) {
    .dash-topbar {
        min-height: 0;
    }
    .dash-heading {
        font-size: 16px;
    }
}

/* Topbar profile dropdown trigger - not Bootstrap's btn-light (a fixed
   light-gray variant that ignores data-bs-theme), so it needs its own
   background/border/hover states routed through this app's theme-aware vars. */
.profile-toggle {
    background: var(--bg-section);
    border: 1px solid var(--border);
    color: var(--text);
}
.profile-toggle:hover,
.profile-toggle:focus,
.profile-toggle:active {
    background: var(--bg-section) !important;
    border-color: var(--gold) !important;
    color: var(--text) !important;
}

.av {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: linear-gradient(160deg, var(--gold), #b9781f);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}
.uname {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--heading);
}

.dash-topbar .dropdown-menu {
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 14px 32px rgba(2, 27, 56, 0.16);
}
@media (max-width: 575.98px) {
    .dash-topbar .av {
        width: 32px;
        height: 32px;
        min-width: 32px;
        font-size: 12.5px;
    }
    .dash-topbar .navbar-toggler {
        padding: 4px 8px;
        font-size: 15px;
    }
}

/* ===== Greeting banner ===== */
.greet-banner {
    background: linear-gradient(120deg, var(--navy) 0%, #0a2c54 100%);
    border-radius: 12px;
    padding: 26px 28px;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.greet-banner::after {
    content: "";
    position: absolute;
    right: -40px;
    top: -40px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(223, 160, 57, 0.12);
}
.greet-banner .eyebrow {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold-soft);
    margin-bottom: 8px;
}
.greet-banner h2 {
    position: relative;
    font-family: "Lora", serif;
    color: #fff;
    font-size: 24px;
    margin-bottom: 6px;
}
.greet-banner p {
    position: relative;
    color: #c4cee0;
    font-size: 13.5px;
    max-width: 560px;
    margin: 0;
}

/* ===== Filter card ===== */
.dash-filter-card .card-body {
    padding: 14px 18px;
}
.dash-filter-card .form-select {
    border-color: var(--border);
    font-size: 13.5px;
}

/* ===== Stat cards (dashboard activity-cards partial) ===== */
.stat-card {
    border: 1px solid var(--border) !important;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}
.stat-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--gold);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 28px rgba(2, 27, 56, 0.1) !important;
    border-color: var(--gold) !important;
}
.stat-card:hover::before {
    transform: scaleY(1);
}
.stat-card .stat-icon {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: 10px;
    background: linear-gradient(160deg, rgba(223, 160, 57, 0.16), rgba(223, 160, 57, 0.05));
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.stat-card .stat-value {
    font-family: "Lora", serif;
    font-weight: 700;
    font-size: 22px;
    color: var(--heading);
    line-height: 1.2;
}
.stat-card .stat-label {
    font-size: 12.5px;
    color: var(--text-muted);
    font-weight: 600;
}
.stat-card .stat-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
}

/* ===== Print =====
   Sidebar/topbar/action buttons only make sense on screen - a printed record
   should read as a plain A4 report, not a clipped screenshot of the app
   chrome. .dash-content's own screen rules pin it to a scrolling viewport
   pane (see the min-width:992px block above); print needs plain document
   flow instead so the browser can paginate the real content height. */
@media print {
    @page {
        size: A4;
        margin: 14mm;
    }
    .dash-sidebar,
    .dash-topbar,
    .no-print {
        display: none !important;
    }
    body.dash-body {
        height: auto;
        overflow: visible;
        background: #fff;
    }
    .dash-shell,
    .dash-main,
    .dash-content {
        height: auto !important;
        overflow: visible !important;
        display: block;
    }
    .dash-content {
        padding: 0;
    }
    .card {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        break-inside: avoid;
    }
}

@media (max-width: 980px) {
    .hero .container {
        grid-template-columns: 1fr;
    }
    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .coverage .container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .cov-item {
        border-left: none;
        padding-left: 0;
    }
    .greet-banner {
        padding: 20px;
    }
}
