/* =====================================================================
   HOOLA FOS — DESKTOP PORTAL UI (admin + manager on a laptop)
   Same design language as mobile-app.css (tokens defined there).
   Presentation only: scoped to .app-desk (the #view-admin-dashboard screen)
   and .app-desk-modal (the add / edit user dialog).
   ===================================================================== */

.app-desk, .app-desk-modal { font-family: var(--font); color: var(--ink); }
.app-desk { background: var(--ground) !important; }
/* Hidden stays hidden, except elements that are only hidden on small screens
   (Tailwind "hidden lg:flex" etc.): their breakpoint class must still win */
.app-desk .hidden:not([class*=":"]), .app-desk-modal.hidden, .app-desk-modal .hidden:not([class*=":"]) { display: none !important; }

/* ---------- Sidebar ---------- */
.app-desk-side {
    background: var(--ink) !important;
    width: 100%;
}
@media (min-width: 768px) { .app-desk-side { width: 248px !important; min-height: 100vh; } }
.app-desk-brand { padding: 28px 22px 20px !important; border: 0 !important; }
.app-desk-brand h1 { font-size: 24px !important; font-weight: 800 !important; letter-spacing: -0.025em; color: #fff !important; }
.app-desk-brand h1 > span:first-child { display: none; }   /* old icon slot the scripts still write */
.app-desk-brand p { font-size: 14px !important; color: rgba(255,255,255,.62) !important; margin-top: 2px !important; }
.app-desk-navlist { padding: 4px 12px !important; display: flex; flex-direction: column; gap: 4px; }
.app-desk-nav {
    width: 100%; display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border-radius: 14px;
    color: rgba(255,255,255,.72); font-weight: 600; font-size: 15px; text-align: left;
    transition: background-color .15s ease, color .15s ease;
}
.app-desk-nav svg { width: 20px; height: 20px; flex-shrink: 0; }
.app-desk-nav:hover { background: rgba(255,255,255,.07); color: #fff; }
.app-desk-nav.is-active { background: var(--accent); color: #fff; }
.app-desk-foot { padding: 14px 12px 18px !important; border: 0 !important; background: transparent !important; display: flex; gap: 6px; }
.app-desk-foot-btn {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 12px; border-radius: 12px; font-size: 14px; font-weight: 600;
    color: rgba(255,255,255,.72); background: rgba(255,255,255,.06);
    transition: background-color .15s ease, color .15s ease;
}
.app-desk-foot-btn svg { width: 17px; height: 17px; }
.app-desk-foot-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.app-desk-foot-btn.is-danger { color: #FCA5A5; }

/* ---------- Main area ---------- */
.app-desk main { background: var(--ground); }
.app-desk-page { padding: 32px 36px !important; }
.app-desk-title { font-size: 30px !important; font-weight: 800 !important; letter-spacing: -0.03em; color: var(--ink) !important; line-height: 1.1; }
.app-desk-sub { font-size: 15px; color: var(--ink-2); font-weight: 500; margin-top: 4px; }
.app-desk-card { background: var(--surface) !important; border: 0 !important; box-shadow: none !important; border-radius: 22px !important; }

.app-desk-primary {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 46px; padding: 0 20px !important;
    border-radius: 999px !important; background: var(--accent) !important; color: #fff !important;
    font-weight: 700 !important; font-size: 15px !important; box-shadow: none !important;
    transition: background-color .15s ease, transform .1s ease;
}
.app-desk-primary:hover { background: var(--accent-press) !important; }
.app-desk-primary:active { transform: scale(.98); }
.app-desk-primary svg { width: 18px; height: 18px; }

/* ---------- Users table ---------- */
.app-desk-table { width: 100%; border-collapse: separate; border-spacing: 0; white-space: normal !important; }
.app-desk-table thead tr { background: transparent !important; border: 0 !important; }
.app-desk-table th {
    padding: 18px 16px 10px !important; text-align: left;
    font-size: 13px !important; font-weight: 600 !important; color: var(--ink-3) !important;
    text-transform: none !important; letter-spacing: 0 !important; white-space: nowrap;
}
.app-desk-table td { padding: 14px 16px !important; border: 0 !important; vertical-align: middle; font-size: 14px; color: var(--ink-2); }
.app-desk-table tbody tr { transition: background-color .12s ease; }
.app-desk-table tbody tr + tr td { box-shadow: inset 0 1px 0 var(--ground); }
.app-desk-table tbody tr:hover td { background: #FAF9FC; }
.app-desk-table tbody tr td:first-child { border-radius: 14px 0 0 14px; }
.app-desk-table tbody tr td:last-child { border-radius: 0 14px 14px 0; }
.app-desk-name { font-weight: 700; color: var(--ink); font-size: 15px; }
.app-desk-email { font-size: 13px; color: var(--ink-3); margin-top: 1px; }

.app-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: 999px;
    font-size: 13px; font-weight: 600; line-height: 1.5; white-space: nowrap;
    background: var(--surface-2); color: var(--ink-2);
}
.app-chip-role { text-transform: lowercase; }
.app-chip-role::first-letter { text-transform: uppercase; }
.app-chip-role-admin { background: var(--ink); color: #fff; }
.app-chip-role-manager { background: var(--accent-soft); color: var(--accent); }
.app-chip-ok { background: var(--ok-soft); color: var(--ok); }
.app-chip-ok::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.app-chip-muted { background: var(--ground); color: var(--ink-3); font-size: 12px; }

.app-desk-btn, .app-desk-btn-danger {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 600;
    transition: background-color .15s ease;
}
.app-desk-btn { background: var(--surface-2); color: var(--ink); }
.app-desk-btn:hover { background: var(--surface-3); }
.app-desk-btn-danger { background: transparent; color: var(--danger); }
.app-desk-btn-danger:hover { background: #FDE8E8; }
.app-desk-btn svg, .app-desk-btn-danger svg { width: 15px; height: 15px; }
.app-desk-note { font-size: 13px; color: var(--ink-3); }
.app-desk-actions { display: flex; justify-content: flex-end; gap: 6px; }

/* ---------- Reports: three panels ---------- */
.app-desk .admin-report-container { display: grid !important; grid-template-columns: 280px minmax(0, 1fr) 340px; gap: 16px !important; margin: 0 !important; padding: 0 !important; max-width: none !important; align-items: start; }
.app-desk .admin-report-container:not(:has(#admin-summary-panel:not(.hidden))) { grid-template-columns: 280px minmax(0, 1fr); }
@media (max-width: 1100px) { .app-desk .admin-report-container, .app-desk .admin-report-container:not(:has(#admin-summary-panel:not(.hidden))) { grid-template-columns: 1fr; } }
.app-desk .admin-tree-sidebar, .app-desk .admin-report-main, .app-desk .admin-summary-sidebar {
    width: auto !important; background: var(--surface) !important; border: 0 !important; box-shadow: none !important; border-radius: 22px !important;
}
.app-desk .admin-tree-sidebar { padding: 16px 12px !important; max-height: calc(100vh - 150px) !important; }
.app-desk .admin-report-main { padding: 16px !important; height: calc(100vh - 150px) !important; }
.app-desk .admin-summary-sidebar { max-height: calc(100vh - 150px) !important; overflow: hidden; }

/* Tree */
.app-desk .tree-title { font-size: 16px !important; font-weight: 700 !important; color: var(--ink) !important; border: 0 !important; padding: 2px 6px 8px !important; margin: 0 !important; }
.app-desk-refresh { display: inline-flex; align-items: center; gap: 6px; font-size: 13px !important; font-weight: 600; color: var(--accent) !important; padding: 5px 10px; border-radius: 999px; }
.app-desk-refresh:hover { background: var(--accent-soft); }
.app-desk-refresh svg { width: 14px; height: 14px; }
.app-desk .tree-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px !important; margin: 1px 0 !important; border-radius: 12px !important;
    border: 0 !important; background: transparent !important; color: var(--ink) !important; cursor: pointer;
    transition: background-color .12s ease;
}
.app-desk .tree-item:hover { background: var(--ground) !important; }
.app-desk .tree-item.active { background: var(--accent-soft) !important; color: var(--accent) !important; }
.app-desk .tree-item svg { width: 18px; height: 18px; color: var(--ink-3); flex-shrink: 0; }
.app-desk .tree-item.active svg { color: var(--accent); }
.app-desk .tree-item .font-medium { font-weight: 600 !important; font-size: 14px; }
.app-desk .tree-children { border-left: 2px solid var(--ground) !important; margin-left: 18px !important; padding-left: 6px !important; }
.app-desk .badge-role {
    font-size: 12px !important; font-weight: 600 !important; padding: 2px 8px !important; border-radius: 999px !important;
    background: var(--ground) !important; color: var(--ink-3) !important; border: 0 !important;
    text-transform: lowercase !important; letter-spacing: 0 !important;
}
.app-desk .badge-role::first-letter { text-transform: uppercase; }

/* Timeline header */
.app-desk-tl-head { background: var(--ground) !important; border: 0 !important; border-radius: 18px !important; padding: 14px 16px !important; }
.app-desk-tl-head #admin-report-target-name { font-size: 20px !important; font-weight: 800 !important; letter-spacing: -0.02em; color: var(--ink) !important; }
.app-desk-tl-head #admin-report-target-role { font-size: 14px !important; font-weight: 600 !important; color: var(--ink-3) !important; text-transform: lowercase !important; letter-spacing: 0 !important; }
.app-desk-tl-head #admin-report-target-role::first-letter { text-transform: uppercase; }
.app-desk-date { background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; }
.app-desk input[type="date"] {
    background: var(--surface) !important; border: 2px solid transparent !important; border-radius: 12px !important;
    color: var(--ink) !important; font-family: var(--font); font-size: 15px !important; font-weight: 600 !important;
    min-height: 42px; padding: 6px 12px !important; box-shadow: none !important;
}
.app-desk input[type="date"]:focus { outline: none; border-color: var(--accent) !important; }
.app-desk-days { border: 0 !important; padding-top: 10px !important; margin-top: 6px !important; gap: 6px !important; }
.app-desk-days-label { font-size: 13px; font-weight: 600; color: var(--ink-3); margin-right: 4px; }
.app-desk-daychip {
    font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 999px;
    background: var(--surface); color: var(--ink-2); flex-shrink: 0;
    transition: background-color .12s ease, color .12s ease;
}
.app-desk-daychip:hover { background: var(--accent-soft); color: var(--accent); }
.app-desk-tl-scroll { background: transparent !important; border: 0 !important; border-radius: 0 !important; }
.app-desk-tl-scroll > ul { padding: 8px 4px !important; border: 0 !important; }
.app-desk-tl-scroll > ul > li + li { border-top: 0 !important; }
.app-desk-empty { background: var(--surface) !important; color: var(--ink-2); }
.app-desk-empty svg { width: 40px; height: 40px; color: var(--ink-3); margin-bottom: 10px; }
.app-desk-empty p { font-size: 16px; color: var(--ink-2) !important; }

/* Timeline items: the mobile tl-* cards, on the grey ground */
.app-desk .tl-card { background: var(--ground) !important; }
.app-desk .tl-foot, .app-desk .tl-lead-box { background: var(--surface) !important; }
.app-desk .tl-note {
    margin-top: 10px; background: var(--surface); border-radius: 14px; padding: 10px 12px;
    font-size: 14px; line-height: 1.5; color: var(--ink-2);
}

/* Field summary */
.app-desk-sum-head { background: transparent !important; border: 0 !important; padding: 18px 18px 6px !important; }
.app-desk-sum-head h3 { font-size: 17px !important; font-weight: 700 !important; color: var(--ink) !important; }
.app-desk-sum-head svg { width: 20px; height: 20px; color: var(--accent); }
.app-desk-sum-body { background: transparent !important; padding: 8px 14px 16px !important; }
.sum-who { background: var(--accent); color: #fff; border-radius: 18px; padding: 14px 16px; margin-bottom: 12px; }
.sum-who-name { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.sum-who-date { font-size: 14px; font-weight: 500; color: rgba(255,255,255,.82); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.sum-who-date svg { width: 15px; height: 15px; }
.sum-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.sum-stat { background: var(--ground); border-radius: 16px; padding: 12px 14px; }
.sum-stat-num { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.sum-stat-label { font-size: 13px; font-weight: 600; color: var(--ink-3); margin-top: 4px; display: flex; align-items: center; gap: 5px; }
.sum-stat-label svg { width: 14px; height: 14px; }
.sum-block { background: var(--ground); border-radius: 16px; padding: 12px 14px; margin-bottom: 10px; }
.sum-block-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.sum-block-title > span { display: inline-flex; align-items: center; gap: 7px; }
.sum-block-title svg { width: 16px; height: 16px; color: var(--accent); }
.sum-count { background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; padding: 1px 9px; border-radius: 999px; }
.sum-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--ink-2); padding: 4px 0; }
.sum-row strong { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.sum-visit { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; }
.sum-visit + .sum-visit { box-shadow: inset 0 1px 0 var(--surface-2); }
.sum-visit-name { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.sum-visit-time { font-size: 13px; color: var(--ink-3); }
.sum-photo { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--accent); background: var(--surface); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.sum-photo svg { width: 14px; height: 14px; }
.sum-nophoto { font-size: 13px; color: var(--ink-3); white-space: nowrap; }

/* ---------- Add / edit user dialog ---------- */
.app-desk-modal { background: rgba(27, 21, 48, .48) !important; backdrop-filter: none !important; }
.app-desk-modal-card { background: var(--surface) !important; border-radius: 26px !important; box-shadow: 0 24px 64px rgba(27, 21, 48, .28) !important; }
.app-desk-modal-head { background: transparent !important; border: 0 !important; padding: 22px 24px 4px !important; }
.app-desk-modal-head h3 { font-size: 22px !important; font-weight: 800 !important; letter-spacing: -0.02em; color: var(--ink) !important; }
.app-desk-modal-close { width: 40px; height: 40px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2) !important; background: var(--surface-2); }
.app-desk-modal-close:hover { background: var(--surface-3); }
.app-desk-modal-close svg { width: 18px; height: 18px; }
.app-desk-modal form { padding: 16px 24px 24px !important; }
.app-desk-modal label.block { font-size: 14px !important; font-weight: 600 !important; color: var(--ink-2) !important; margin-bottom: 8px !important; }
.app-desk-modal input:not([type="hidden"]), .app-desk-modal select {
    width: 100%; background-color: var(--surface-2) !important; border: 2px solid transparent !important;
    border-radius: var(--radius-field) !important; color: var(--ink) !important;
    font-family: var(--font); font-size: 15px; font-weight: 500; min-height: 48px; padding: 10px 14px !important; box-shadow: none !important;
}
.app-desk-modal input:focus, .app-desk-modal select:focus { outline: none; border-color: var(--accent) !important; background-color: var(--surface) !important; }
.app-desk-modal input[readonly] { background-color: var(--ground) !important; color: var(--ink-2) !important; }
.app-desk-modal button[type="submit"] {
    background: var(--accent) !important; color: #fff !important; border-radius: 999px !important;
    min-height: 52px; font-weight: 700 !important; font-size: 16px !important; box-shadow: none !important;
}
.app-desk-modal button[type="submit"]:hover { background: var(--accent-press) !important; }

/* Admin update banner: same card as the app's, floating at the top */
.app-desk:has(#admin-update-banner:not(.hidden)) main { padding-top: 76px; }

@media (prefers-reduced-motion: reduce) { .app-desk *, .app-desk-modal * { transition: none !important; } }

/* ---------- Users table: fit laptop widths ---------- */
.app-desk #admin-tab-users { max-width: none !important; }
.app-desk-table th, .app-desk-table td { padding-left: 12px !important; padding-right: 12px !important; }
.app-desk-table td:nth-child(4) { overflow-wrap: anywhere; min-width: 130px; }
.app-desk-table td:first-child { min-width: 170px; }
.app-desk-email { overflow-wrap: anywhere; }
.app-chip-muted { white-space: normal; overflow-wrap: anywhere; }
.app-desk-btn, .app-desk-btn-danger { padding: 6px 11px; }
/* ::first-letter needs a block-level box: chips that capitalise their first letter stay inline-block */
.app-chip-role, .app-desk .badge-role { display: inline-block !important; }

/* Laptop widths: slimmer side panels so the timeline keeps its room */
@media (max-width: 1500px) and (min-width: 1101px) {
    .app-desk .admin-report-container { grid-template-columns: 240px minmax(0, 1fr) 300px; }
    .app-desk .admin-report-container:not(:has(#admin-summary-panel:not(.hidden))) { grid-template-columns: 240px minmax(0, 1fr); }
    .app-desk-page { padding: 28px 28px !important; }
}

/* =====================================================================
   ADMIN REVIEW DASHBOARD  (#admin-tab-dashboard, static/js/admin-dashboard.js)
   ===================================================================== */
.app-desk .dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 14px; }
.app-desk .dash-filters { position: sticky; top: -1px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 0 14px; background: var(--ground); }
.app-desk .dash-filter { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 999px; padding: 4px 6px 4px 14px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.app-desk .dash-filter select { border: 0; background: var(--surface-2); border-radius: 999px; padding: 7px 12px; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; }
.app-desk .dash-status { font-size: 12.5px; color: var(--ink-3); margin-left: auto; }
.app-desk .dash-body { display: flex; flex-direction: column; gap: 18px; padding-bottom: 40px; transition: opacity .2s; }
.app-desk .dash-body.is-loading { opacity: .5; pointer-events: none; }

/* stat tiles */
.app-desk .dash-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.app-desk .dash-kpis.is-small { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 6px 0 18px; }
.app-desk #dash-bde-panel { scroll-margin-top: 76px; }  /* clears the sticky filter row */
.app-desk .dash-tile { background: var(--surface); border-radius: 18px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.app-desk .dash-kpis.is-small .dash-tile { background: var(--ground); }
.app-desk .dash-tile.is-hero { grid-row: span 2; background: var(--accent); color: #fff; justify-content: space-between; }
.app-desk .dash-tile-label { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.app-desk .dash-tile-label svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.app-desk .dash-tile-value { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; color: var(--ink); }
.app-desk .dash-tile.is-hero .dash-tile-value { font-size: 56px; color: #fff; }
.app-desk .dash-tile.is-hero .dash-tile-label, .app-desk .dash-tile.is-hero .dash-tile-label svg, .app-desk .dash-tile.is-hero .dash-tile-sub { color: rgba(255,255,255,.88); }
.app-desk .dash-tile-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.app-desk .dash-tile-sub { font-size: 12.5px; color: var(--ink-3); line-height: 1.35; }
.app-desk .dash-delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 700; padding: 2px 8px 2px 5px; border-radius: 999px; }
.app-desk .dash-delta svg { width: 14px; height: 14px; }
.app-desk .dash-delta.is-good { background: var(--ok-soft); color: #0f5f2e; }
.app-desk .dash-delta.is-bad { background: #FBE3E3; color: var(--danger); }
.app-desk .dash-delta.is-flat { background: var(--surface-2); color: var(--ink-2); }
.app-desk .dash-tile.is-hero .dash-delta { background: rgba(255,255,255,.95); }

/* cards */
.app-desk .dash-card { background: var(--surface); border-radius: var(--radius-card); padding: 20px 22px; min-width: 0; }
.app-desk .dash-grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.app-desk .dash-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.app-desk .dash-card-head.is-sub { margin-top: 4px; }
.app-desk .dash-card h3 { font-size: 17px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.app-desk .dash-card h4, .app-desk .dash-h4 { font-size: 14.5px; font-weight: 700; color: var(--ink); margin: 14px 0 8px; }
.app-desk .dash-card-head h4 { margin: 0; }
.app-desk .dash-card-head p { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.app-desk .dash-hint { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); }
.app-desk .dash-hint svg { width: 14px; height: 14px; }
.app-desk .dash-actions { display: flex; gap: 8px; }
.app-desk .dash-note { font-size: 12.5px; color: var(--ink-3); margin-top: 12px; line-height: 1.45; }
.app-desk .dash-chart { position: relative; height: 260px; }
.app-desk .dash-legend { display: flex; flex-wrap: wrap; gap: 14px; }
.app-desk .dash-legend-item { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); }
.app-desk .dash-legend-item strong { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink); }
.app-desk .dash-key-line { width: 16px; height: 2px; border-radius: 2px; }
.app-desk .dash-key-box { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.app-desk .dash-tableview { margin-top: 8px; font-size: 13px; }
.app-desk .dash-tableview summary { cursor: pointer; color: var(--accent); font-weight: 600; width: fit-content; }
.app-desk .dash-mini-table { margin-top: 8px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.app-desk .dash-mini-table th, .app-desk .dash-mini-table td { padding: 3px 14px 3px 0; text-align: left; color: var(--ink-2); }
.app-desk .dash-mini-table th { color: var(--ink-3); font-weight: 600; }
.app-desk .dash-empty-line { font-size: 13px; color: var(--ink-3); padding: 6px 0; }

/* funnel */
.app-desk .dash-funnel { display: flex; flex-direction: column; gap: 14px; padding-top: 6px; }
.app-desk .dash-funnel-label { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--ink-2); margin-bottom: 5px; }
.app-desk .dash-funnel-label strong { font-size: 15px; color: var(--ink); }
.app-desk .dash-funnel-track { height: 22px; }
.app-desk .dash-funnel-bar { height: 100%; border-radius: 0 4px 4px 0; transition: width .4s, filter .15s; outline: none; }
.app-desk .dash-funnel-bar:hover, .app-desk .dash-funnel-bar:focus { filter: brightness(1.12); }

/* tables */
.app-desk .dash-scroll { overflow-x: auto; }
.app-desk .dash-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.app-desk .dash-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 0 10px 8px; border-bottom: 1px solid var(--surface-2); white-space: nowrap; }
.app-desk .dash-table td { padding: 10px; border-bottom: 1px solid var(--surface-2); color: var(--ink-2); vertical-align: middle; }
.app-desk .dash-table .is-num { text-align: right; font-variant-numeric: tabular-nums; }
.app-desk .dash-table th.is-num .dash-sort { margin-left: auto; }
.app-desk .dash-table.is-compact td { padding: 7px 10px; }
.app-desk .dash-table tbody tr { cursor: default; }
.app-desk #dash-leaderboard tbody tr { cursor: pointer; }
.app-desk #dash-leaderboard tbody tr:hover { background: var(--ground); }
.app-desk .dash-table tbody tr.is-selected { background: var(--accent-soft); }
.app-desk .dash-sort { display: inline-flex; align-items: center; gap: 3px; font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
.app-desk .dash-sort.is-active { color: var(--accent); }
.app-desk .dash-sort svg { width: 13px; height: 13px; }
.app-desk .dash-bde-name { font-weight: 700; color: var(--ink); white-space: nowrap; }
.app-desk .dash-bde-tag { font-size: 11.5px; color: var(--ink-3); }

/* diverging bar around the team average */
.app-desk .dash-div-val { display: block; font-size: 12.5px; color: var(--ink); margin-bottom: 4px; }
.app-desk .dash-div { display: flex; align-items: center; height: 14px; min-width: 150px; outline: none; }
.app-desk .dash-div-half { flex: 1; display: flex; height: 12px; }
.app-desk .dash-div-half.is-neg { justify-content: flex-end; }
.app-desk .dash-div-mid { width: 1px; height: 18px; background: #c3c2b7; }
.app-desk .dash-div-bar { height: 100%; }
.app-desk .dash-div-half.is-neg .dash-div-bar { border-radius: 4px 0 0 4px; }
.app-desk .dash-div-half.is-pos .dash-div-bar { border-radius: 0 4px 4px 0; }
.app-desk .dash-div:hover .dash-div-bar, .app-desk .dash-div:focus .dash-div-bar { filter: brightness(1.12); }

/* clinic bars */
.app-desk .dash-hbar-val { display: block; }
.app-desk .dash-hbar { height: 6px; background: var(--surface-2); border-radius: 4px; margin-top: 4px; min-width: 120px; outline: none; }
.app-desk .dash-hbar-fill { height: 100%; border-radius: 4px; }

/* stacked share bar */
.app-desk .dash-stack { display: flex; gap: 2px; height: 34px; margin: 6px 0 16px; }
.app-desk .dash-stack-seg { display: flex; align-items: center; justify-content: center; min-width: 3px; outline: none; transition: filter .15s; }
.app-desk .dash-stack-seg:first-child { border-radius: 4px 0 0 4px; }
.app-desk .dash-stack-seg:last-child { border-radius: 0 4px 4px 0; }
.app-desk .dash-stack-seg:hover, .app-desk .dash-stack-seg:focus { filter: brightness(1.1); }
.app-desk .dash-stack-label { font-size: 12px; font-weight: 700; color: #fff; text-shadow: 0 0 3px rgba(0,0,0,.35); white-space: nowrap; }
.app-desk .dash-stack-legend { display: grid; grid-template-columns: 1fr; gap: 8px; }

/* hygiene + how-to */
.app-desk .dash-hyg { background: var(--ground); border-radius: 16px; padding: 12px 14px; }
.app-desk .dash-hyg summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink); }
.app-desk .dash-hyg summary strong { margin-left: auto; font-size: 18px; }
.app-desk .dash-hyg[open] summary { margin-bottom: 10px; }
.app-desk .dash-status-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 2px 8px; }
.app-desk .dash-status-chip svg { width: 13px; height: 13px; }
.app-desk .dash-status-chip.is-warn { background: var(--warm-soft); color: var(--warm); }
.app-desk .dash-howto summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 700; color: var(--ink); }
.app-desk .dash-howto summary svg { width: 16px; height: 16px; color: var(--accent); }
.app-desk .dash-howto ul { margin: 12px 0 0 18px; list-style: disc; font-size: 13.5px; color: var(--ink-2); line-height: 1.55; display: flex; flex-direction: column; gap: 6px; }

/* tooltip (lives on <body>) */
.dash-tip { position: fixed; z-index: 9999; pointer-events: none; opacity: 0; transition: opacity .1s; background: #fff; border: 1px solid #ECE8F4; border-radius: 10px; padding: 8px 10px; box-shadow: 0 8px 24px rgba(27,21,48,.12); font: 13px "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif; }
.dash-tip.is-on { opacity: 1; }
.dash-tip-row { display: flex; gap: 8px; align-items: baseline; white-space: nowrap; }
.dash-tip-row strong { color: #1B1530; font-weight: 800; }
.dash-tip-row span { color: #6E6787; }

@media (max-width: 1250px) {
    .app-desk .dash-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .app-desk .dash-grid-2 { grid-template-columns: minmax(0, 1fr); }
}

/* =====================================================================
   VIEW ACCESS: Users-tab switches (BDE Mobile / Desktop View / tabs)
   ===================================================================== */
.app-desk .app-access { display: flex; flex-direction: column; gap: 6px; min-width: 170px; }
.app-desk .app-access-tabs { display: flex; flex-direction: column; gap: 5px; margin: 2px 0 0 10px; padding-left: 10px; border-left: 2px solid var(--surface-2); }
.app-desk .app-access-tabs .app-switch-label { font-size: 12px; color: var(--ink-2); }
.app-desk .app-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.app-desk .app-switch.is-locked { cursor: default; opacity: .7; }
.app-desk .app-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.app-desk .app-switch-track { position: relative; flex: none; width: 32px; height: 18px; border-radius: 999px; background: var(--surface-3); transition: background .15s; }
.app-desk .app-switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(27,21,48,.25); transition: transform .15s; }
.app-desk .app-switch input:checked + .app-switch-track { background: var(--accent); }
.app-desk .app-switch input:checked + .app-switch-track::after { transform: translateX(14px); }
.app-desk .app-switch input:focus-visible + .app-switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.app-desk .app-switch-label { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.app-desk .app-access-full { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.app-desk .app-access-full svg { width: 15px; height: 15px; color: var(--accent); }

/* Reports tree: manager shown under each person's name */
.app-desk .tree-item .tree-name-wrap { line-height: 1.25; }
.app-desk .tree-item .tree-manager { font-size: 11.5px; font-weight: 500; color: var(--ink-3); }
.app-desk .tree-item.active .tree-manager { color: var(--accent); opacity: .8; }
