/* ═══════════════════════════════════════════════════════════════════════════
   FHC Desk Brand Design System Tokens & Global Application
   This file is the single parent stylesheet for Frappe Desk brand consistency.
   ═══════════════════════════════════════════════════════════════════════════ */

:root,
.kinetix-theme .kinetix-content-body,
body,
#housing-board,
#allocation-portal,
#housing-sources {
  --fhc-brand: var(--fhc-custom-brand, #315da8);
  --fhc-ink: var(--fhc-custom-ink, var(--text-color, #172b4d));
  --fhc-muted: var(--fhc-custom-text_muted, var(--text-muted, #6c757d));
  --fhc-surface: var(--fhc-custom-surface, var(--card-bg, #ffffff));
  --fhc-border: var(--fhc-custom-border_color, var(--border-color, #dbe4f0));
  --fhc-table-header: var(--fhc-custom-table-header, #edf3fd);
  --fhc-table-heading-ink: var(--fhc-custom-header_ink, var(--fhc-custom-table-ink, #244775));
  --fhc-table-hover: var(--fhc-custom-hover, var(--control-bg, #f4f7fc));
  --fhc-radius: var(--fhc-custom-radius, 10px);
  --fhc-gap: var(--fhc-custom-gap, 16px);
  --fhc-btn-radius: var(--fhc-custom-btn_radius, 8px);
  --fhc-input-radius: var(--fhc-custom-input_radius, 10px);
  --fhc-badge-radius: var(--fhc-custom-badge_radius, 12px);
  --fhc-dashboard-banner-bg: var(--fhc-custom-dashboard_banner_bg, #173b6c);
  --fhc-dashboard-banner-ink: var(--fhc-custom-dashboard_banner_ink, #ffffff);
  --fhc-kpi-1: var(--fhc-custom-kpi_accent_1, #3b82f6);
  --fhc-kpi-2: var(--fhc-custom-kpi_accent_2, #f97316);
  --fhc-kpi-3: var(--fhc-custom-kpi_accent_3, #22c55e);
  --fhc-kpi-4: var(--fhc-custom-kpi_accent_4, #8b5cf6);

  /* Portal-specific variables unified with FHC Brand */
  --teal: var(--fhc-brand, #315da8) !important;
  --line: var(--fhc-border, #dbe4f0) !important;
}

[data-theme="dark"] :root,
[data-theme="dark"] .kinetix-theme .kinetix-content-body,
.kinetix-theme .kinetix-content-body[data-theme="dark"] {
  --fhc-brand: var(--fhc-custom-brand, #a9c7ff);
  --fhc-ink: var(--fhc-custom-ink, #f1f5f9);
  --fhc-muted: var(--fhc-custom-text_muted, #94a3b8);
  --fhc-surface: var(--fhc-custom-surface, #1e293b);
  --fhc-border: var(--fhc-custom-border_color, #334155);
  --fhc-table-header: var(--fhc-custom-table-header, #263651);
  --fhc-table-heading-ink: var(--fhc-custom-header_ink, var(--fhc-custom-table-ink, #e0ebff));
  --fhc-table-hover: var(--fhc-custom-hover, #2c3e50);
  --fhc-dashboard-banner-bg: var(--fhc-custom-dashboard_banner_bg, #0f172a);
  --fhc-dashboard-banner-ink: var(--fhc-custom-dashboard_banner_ink, #f8fafc);
  --fhc-kpi-1: var(--fhc-custom-kpi_accent_1, #60a5fa);
  --fhc-kpi-2: var(--fhc-custom-kpi_accent_2, #fb923c);
  --fhc-kpi-3: var(--fhc-custom-kpi_accent_3, #4ade80);
  --fhc-kpi-4: var(--fhc-custom-kpi_accent_4, #a78bfa);
}

@media screen {

  /* ── 1. Top Navigation Bar ─────────────────────────────────────────────── */
  html[data-fhc-theme-navbar] .navbar {
    background: var(--fhc-custom-navbar) !important;
  }

  html[data-fhc-theme-navbar] .navbar :is(.nav-link, .nav-toggle, .nav-item, .navbar-nav, .dropdown-toggle) {
    color: var(--fhc-custom-navbar_ink, var(--fhc-custom-navbar-ink, #ffffff)) !important;
  }

  html[data-fhc-theme-navbar] .navbar .navbar-nav svg.icon {
    --icon-stroke: var(--fhc-custom-navbar_ink, var(--fhc-custom-navbar-ink, #ffffff)) !important;
  }

  html[data-fhc-theme-search_bg] .search-bar .awesomplete input,
  html[data-fhc-theme-search_bg] .navbar .search-bar input {
    background: var(--fhc-custom-search_bg) !important;
  }

  .search-bar .awesomplete input,
  .navbar .search-bar input {
    border-radius: var(--fhc-input-radius) !important;
  }

  /* ── 2. Sidebar Navigation ─────────────────────────────────────────────── */
  html[data-fhc-theme-sidebar] .kinetix-sidebar {
    background-color: var(--fhc-custom-sidebar) !important;
  }

  html[data-fhc-theme-sidebar_width] .kinetix-sidebar {
    width: var(--fhc-custom-sidebar_width, 16.2rem) !important;
  }

  html[data-fhc-theme-sidebar_width] .kinetix-content-body {
    margin-left: var(--fhc-custom-sidebar_width, 16.2rem) !important;
    width: calc(100% - var(--fhc-custom-sidebar_width, 16.2rem)) !important;
  }

  html[data-fhc-theme-sidebar] .kinetix-sidebar :is(.standard-sidebar-label, .sidebar-item-label, .sidebar-item-icon .icon) {
    color: var(--fhc-custom-sidebar_ink, var(--fhc-custom-sidebar-ink, #ffffff)) !important;
    --icon-stroke: var(--fhc-custom-sidebar_ink, var(--fhc-custom-sidebar-ink, #ffffff)) !important;
  }

  html[data-fhc-theme-sidebar_hover] .kinetix-sidebar :is(.standard-sidebar-item:hover, .standard-sidebar-item.selected) {
    background-color: var(--fhc-custom-sidebar_hover, rgba(243, 243, 243, 0.4)) !important;
  }

  html[data-fhc-theme-sidebar_active] .kinetix-sidebar :is(.standard-sidebar-item.selected .sidebar-item-label,
    .widget.links-widget-box .widget-head .widget-label .widget-title,
    .link-text,
    .shortcut-widget-box .widget-head .widget-control > *) {
    color: var(--fhc-custom-sidebar_active) !important;
    --icon-stroke: var(--fhc-custom-sidebar_active) !important;
  }

  /* ── 3. Desk Canvas & Page Background ──────────────────────────────────── */
  html[data-fhc-theme-page_bg],
  html[data-fhc-theme-page_bg] body,
  html[data-fhc-theme-page_bg] .kinetix-theme,
  html[data-fhc-theme-page_bg] .kinetix-content-body,
  html[data-fhc-theme-page_bg] .page-head,
  html[data-fhc-theme-page_bg] .page-container,
  html[data-fhc-theme-page_bg] .web-page-container,
  html[data-fhc-theme-page_bg] main,
  html[data-fhc-theme-page_bg] :is(#allocation-portal, #housing-sources, #housing-board),
  html[data-fhc-theme-page_bg] [data-page-route="Workspaces"] .layout-main-section-wrapper,
  html[data-fhc-theme-page_bg] [data-page-route="Workspaces"] .layout-main .layout-main-section {
    background-color: var(--fhc-custom-page_bg) !important;
  }

  /* ── 4. Typography, Titles & Headings ─────────────────────────────────── */
  html[data-fhc-theme-font_size] .kinetix-content-body {
    font-size: var(--fhc-custom-font_size, 13px) !important;
  }

  .kinetix-theme .kinetix-content-body :is(.page-title .title-text, .fhc-page-title),
  .kinetix-theme .kinetix-content-body h1,
  .kinetix-theme .kinetix-content-body h2,
  .kinetix-theme .kinetix-content-body h3,
  .kinetix-theme .kinetix-content-body h4,
  .kinetix-theme .kinetix-content-body h5,
  .kinetix-theme .kinetix-content-body h6,
  .widget-title {
    color: var(--fhc-ink);
    font-weight: 700;
  }

  html[data-fhc-theme-section_header] .form-section .section-head,
  .form-section .section-head {
    color: var(--fhc-custom-section_header, var(--fhc-ink)) !important;
    font-weight: 700;
    border-bottom: 1px solid var(--fhc-border);
  }

  html[data-fhc-theme-text_muted] .text-muted,
  html[data-fhc-theme-text_muted] .form-message,
  html[data-fhc-theme-text_muted] .comment-header,
  html[data-fhc-theme-text_muted] .help-box {
    color: var(--fhc-muted) !important;
  }

  html[data-fhc-theme-link_color] a:not(.btn):not(.nav-link):not(.sidebar-logo-link) {
    color: var(--fhc-custom-link_color) !important;
  }

  /* ── 5. Buttons & Interactive Controls ─────────────────────────────────── */
  html[data-fhc-theme-primary] :is(.kinetix-theme .kinetix-content-body .btn.btn-primary:not(.btn-danger):not(.btn-success),
    .btn.btn-primary:not(.btn-danger):not(.btn-success),
    button.primary,
    :is(#allocation-portal, #housing-sources, #housing-board) button.primary,
    :is(#allocation-portal, #housing-sources, #housing-board) button#board-begin,
    :is(#allocation-portal, #housing-sources, #housing-board) button#board-confirm,
    #committee-editor button.primary),
  .btn.btn-primary:not(.btn-danger):not(.btn-success),
  :is(#allocation-portal, #housing-sources, #housing-board) button.primary,
  :is(#allocation-portal, #housing-sources, #housing-board) button#board-begin,
  :is(#allocation-portal, #housing-sources, #housing-board) button#board-confirm,
  #committee-editor button.primary {
    background-color: var(--fhc-custom-primary, #f3946e) !important;
    border-color: var(--fhc-custom-primary, #f3946e) !important;
    color: var(--fhc-custom-primary-ink, #ffffff) !important;
  }

  .btn.btn-primary:not(:disabled):hover,
  button.primary:not(:disabled):hover,
  :is(#allocation-portal, #housing-sources, #housing-board) button.primary:not(:disabled):hover {
    filter: brightness(0.95);
    text-decoration: none;
  }

  html[data-fhc-theme-secondary_btn] :is(.btn.btn-secondary, .btn.btn-default,
    :is(#allocation-portal, #housing-sources, #housing-board) button:not(.primary):not(.danger),
    #committee-editor button:not(.primary):not(.danger)),
  :is(.btn.btn-secondary, .btn.btn-default,
    :is(#allocation-portal, #housing-sources, #housing-board) button:not(.primary):not(.danger),
    #committee-editor button:not(.primary):not(.danger)) {
    background-color: var(--fhc-custom-secondary_btn, #edf3fd) !important;
    border: 1px solid var(--fhc-border) !important;
    color: var(--fhc-ink) !important;
  }

  html[data-fhc-theme-btn_success] :is(.btn.btn-success, button.btn-success) {
    background-color: var(--fhc-custom-btn_success, #28a745) !important;
    border-color: var(--fhc-custom-btn_success, #28a745) !important;
    color: var(--fhc-custom-btn_success-ink, #ffffff) !important;
  }

  html[data-fhc-theme-btn_danger] :is(.btn.btn-danger, button.danger,
    :is(#allocation-portal, #housing-sources, #housing-board) button.danger,
    #committee-editor button.danger) {
    background-color: var(--fhc-custom-btn_danger, #e04f5f) !important;
    border-color: var(--fhc-custom-btn_danger, #e04f5f) !important;
    color: var(--fhc-custom-btn_danger-ink, #ffffff) !important;
  }

  .btn,
  button,
  :is(#allocation-portal, #housing-sources, #housing-board) button,
  #committee-editor button {
    border-radius: var(--fhc-btn-radius) !important;
    transition: all 0.15s ease;
  }

  /* ── 6. Forms, Inputs & DocType Views ──────────────────────────────────── */
  :is(.kinetix-theme .kinetix-content-body :is(.frappe-control .form-control, .form-control, .fhc-control),
    .kinetix-theme .kinetix-content-body input[type="text"],
    .kinetix-theme .kinetix-content-body input[type="email"],
    .kinetix-theme .kinetix-content-body input[type="password"],
    .kinetix-theme .kinetix-content-body input[type="number"],
    .kinetix-theme .kinetix-content-body select.form-control,
    .kinetix-theme .kinetix-content-body textarea.form-control,
    .kinetix-theme .kinetix-content-body .awesomplete .input-with-feedback,
    :is(#allocation-portal, #housing-sources, #housing-board) :is(input, select, textarea),
    #committee-editor :is(input, select, textarea)) {
    background-color: var(--fhc-custom-input_bg, #ffffff) !important;
    border: 1px solid var(--fhc-custom-input_border, var(--fhc-border)) !important;
    border-radius: var(--fhc-input-radius) !important;
    color: var(--fhc-ink) !important;
  }

  :is(.kinetix-theme .kinetix-content-body :is(.frappe-control .form-control, .form-control, .fhc-control):focus,
    .kinetix-theme .kinetix-content-body input:focus,
    .kinetix-theme .kinetix-content-body select:focus,
    .kinetix-theme .kinetix-content-body textarea:focus,
    :is(#allocation-portal, #housing-sources, #housing-board) :is(input, select, textarea):focus,
    #committee-editor :is(input, select, textarea):focus) {
    outline: 2px solid var(--fhc-brand) !important;
    outline-offset: 1px !important;
    border-color: var(--fhc-brand) !important;
    box-shadow: 0 0 0 3px rgba(49, 93, 168, 0.15);
  }

  .form-tabs .nav-link.active,
  .nav-tabs .nav-link.active {
    border-bottom: 3px solid var(--fhc-brand) !important;
    color: var(--fhc-brand) !important;
    font-weight: 600;
  }

  /* ── 7. Tables, Grids & Report Views ───────────────────────────────────── */
  :is(.kinetix-theme .kinetix-content-body :is(.list-row-head, .grid-heading-row .grid-row, .dt-header .dt-cell, .fhc-table thead th, .table thead th),
    :is(#allocation-portal, #housing-sources, #housing-board) table thead th,
    :is(#allocation-portal, #housing-sources, #housing-board) th) {
    background-color: var(--fhc-table-header) !important;
    color: var(--fhc-table-heading-ink) !important;
    border-bottom: 1px solid var(--fhc-custom-table_border, var(--fhc-border)) !important;
    font-weight: 600;
  }

  :is(.kinetix-theme .kinetix-content-body :is(.list-row-container .list-row:hover, .grid-body .grid-row:hover, .dt-scrollable .dt-row:hover .dt-cell, .fhc-table tbody tr:hover, .table tbody tr:hover),
    :is(#allocation-portal, #housing-sources, #housing-board) table tbody tr:hover td,
    :is(#allocation-portal, #housing-sources, #housing-board) tr:hover td) {
    background-color: var(--fhc-table-hover) !important;
    color: var(--fhc-custom-hover-ink, inherit);
  }

  html[data-fhc-theme-table_zebra] :is(.kinetix-theme .kinetix-content-body :is(.fhc-table tbody tr:nth-child(even), .table tbody tr:nth-child(even), .dt-row:nth-child(even) .dt-cell),
    :is(#allocation-portal, #housing-sources, #housing-board) table tbody tr:nth-child(even) td) {
    background-color: var(--fhc-custom-table_zebra, #fafbfd);
  }

  .kinetix-theme .kinetix-content-body .fhc-table,
  .kinetix-theme .kinetix-content-body .table,
  :is(#allocation-portal, #housing-sources, #housing-board) table {
    width: 100%;
    border-collapse: collapse;
  }

  .kinetix-theme .kinetix-content-body .fhc-table :is(th, td),
  .kinetix-theme .kinetix-content-body .table :is(th, td),
  .kinetix-theme .kinetix-content-body .grid-row .grid-static-col,
  .kinetix-theme .kinetix-content-body .dt-cell,
  :is(#allocation-portal, #housing-sources, #housing-board) table :is(th, td) {
    text-align: start;
    padding: var(--fhc-custom-row_padding, 8px) 12px !important;
    border-bottom: 1px solid var(--fhc-custom-table_border, var(--fhc-border));
  }

  .grid-row,
  .list-row,
  .dt-row {
    border-color: var(--fhc-custom-table_border, var(--fhc-border)) !important;
  }

  /* ── 8. Cards, Widgets & Dashboards ────────────────────────────────────── */
  html[data-fhc-theme-surface] :is(.kinetix-theme .kinetix-content-body :is(.number-widget-box, .dashboard-widget-box, .shortcut-widget-box, .links-widget-box, .fhc-card, .widget),
    :is(#allocation-portal, #housing-sources, #housing-board) :is(section, .panel, .card),
    .panel, .card) {
    background-color: var(--fhc-custom-surface) !important;
    color: var(--fhc-custom-surface-ink, var(--fhc-ink)) !important;
  }

  html[data-fhc-theme-surface] .widget.links-widget-box .widget-head .widget-label .widget-title,
  html[data-fhc-theme-surface] :is(.widget.links-widget-box, .links-widget-box) :is(.widget-title, .link-item, .link-text, a) {
    color: var(--fhc-custom-surface-ink, var(--fhc-ink)) !important;
  }

  :is(.kinetix-theme .kinetix-content-body :is(.number-widget-box, .dashboard-widget-box, .fhc-card, .widget),
    :is(#allocation-portal, #housing-sources, #housing-board) :is(section, .panel, .card),
    .panel, .card) {
    background-color: var(--fhc-surface);
    border: 1px solid var(--fhc-custom-card_border, var(--fhc-border)) !important;
    border-radius: var(--fhc-radius) !important;
  }

  .widget.number-widget-box .number {
    color: var(--fhc-brand) !important;
  }

  .fhc-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: var(--fhc-gap);
  }

  .fhc-card {
    padding: var(--fhc-gap);
    min-width: 0;
  }

  .fhc-accent {
    border-inline-start: 4px solid var(--fhc-brand) !important;
  }

  /* ── 9. Modals & Dialogs ───────────────────────────────────────────────── */
  :is(.modal-content, dialog, #committee-editor, [class*="dialog"]) {
    border-radius: var(--fhc-radius) !important;
    border: 1px solid var(--fhc-border) !important;
    overflow: hidden;
  }

  html[data-fhc-theme-modal_header] :is(.modal-header, dialog .modal-head, #committee-editor .modal-head),
  :is(.modal-header, dialog .modal-head, #committee-editor .modal-head) {
    background-color: var(--fhc-custom-modal_header, #f8fafd) !important;
    border-bottom: 1px solid var(--fhc-border) !important;
  }

  :is(.modal-title, dialog h3, #committee-editor h3) {
    color: var(--fhc-ink) !important;
    font-weight: 700;
  }

  :is(.modal-footer, dialog .modal-foot, #committee-editor .modal-foot) {
    border-top: 1px solid var(--fhc-border) !important;
    background-color: var(--fhc-surface, #ffffff) !important;
  }

  /* ── 10. Status Badges & Pills ─────────────────────────────────────────── */
  :is(.indicator-pill, .badge, [class*="badge"], [class*="indicator"], #housing-board .badge) {
    border-radius: var(--fhc-badge-radius, 12px) !important;
  }

  html[data-fhc-theme-badge_success] :is(.badge-success, .indicator-pill.green, #housing-board .badge.assigned, [class*="badge-success"], [class*="green"]),
  :is(.badge-success, .indicator-pill.green, #housing-board .badge.assigned) {
    background-color: var(--fhc-custom-badge_success, #28a745) !important;
    color: #ffffff !important;
  }

  html[data-fhc-theme-badge_warning] :is(.badge-warning, .indicator-pill.orange, .indicator-pill.yellow, [class*="badge-warning"], [class*="orange"], [class*="yellow"]),
  :is(.badge-warning, .indicator-pill.orange, .indicator-pill.yellow) {
    background-color: var(--fhc-custom-badge_warning, #ffc107) !important;
    color: #212529 !important;
  }

  html[data-fhc-theme-badge_danger] :is(.badge-danger, .indicator-pill.red, #housing-board .badge.rejected, [class*="badge-danger"], [class*="red"]),
  :is(.badge-danger, .indicator-pill.red) {
    background-color: var(--fhc-custom-badge_danger, #dc3545) !important;
    color: #ffffff !important;
  }

  /* ── Sidebar Logo Protection ───────────────────────────────────────────── */
  .sidebar-logo-img {
    max-height: 48px;
    max-width: 175px;
    object-fit: contain;
    display: block;
    margin: 4px auto;
  }

  .sidebar-logo-img.sidebar-logo-collapsed {
    max-width: 36px;
    max-height: 36px;
  }

  /* ── 11. Subtle Branded Scrollbars ─────────────────────────────────────── */
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--fhc-border) transparent;
  }

  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  ::-webkit-scrollbar-track {
    background: transparent;
  }

  ::-webkit-scrollbar-thumb {
    background: var(--fhc-border);
    border-radius: 999px;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: var(--fhc-brand);
  }

  /* ── 12. Unified FHC Dashboards & Custom Pages (Legal, HR, Procurement, House Allocation, Portals) ───────── */
  /* Universal Dashboard Banners & Mastheads (Harmonizes HR dark teal, Housing dark navy, with FHC Brand Theme) */
  :is(.kinetix-theme .kinetix-content-body :is(.dashboard-header, .fhc-dashboard-header, .banner, .dashboard-banner, .hr-header, [class*="dashboard-header"], [class*="-banner"]),
    :is(#allocation-portal, #housing-sources, #housing-board, .web-page-container, main) header,
    :is(#allocation-portal, #housing-sources, #housing-board) .masthead,
    header.masthead,
    .dashboard-header,
    .fhc-dashboard-header,
    .banner,
    .dashboard-banner,
    .masthead,
    [class*="dashboard-header"],
    [class*="-banner"],
    [class*="masthead"],
    div[style*="#004d40"], div[style*="rgb(0, 77, 64)"], div[style*="#004b49"],
    div[style*="background: #004d40"], div[style*="background:#004d40"],
    div[style*="#142e3d"], div[style*="#15364c"], div[style*="#132f45"], div[style*="#173541"],
    div[style*="background: #142e3d"], div[style*="background:#142e3d"],
    div[style*="background: #15364c"], div[style*="background:#15364c"]) {
    background: var(--fhc-dashboard-banner-bg, linear-gradient(135deg, var(--fhc-brand), var(--fhc-custom-navbar, #4d7dd6))) !important;
    color: var(--fhc-dashboard-banner-ink, #ffffff) !important;
    border-radius: var(--fhc-radius, 10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
  }

  :is(.kinetix-theme .kinetix-content-body :is(.dashboard-header, .banner, .dashboard-banner),
    :is(#allocation-portal, #housing-sources, #housing-board) header,
    header.masthead,
    .masthead,
    div[style*="#004d40"], div[style*="#142e3d"], div[style*="#15364c"]) :is(h1, h2, h3, h4, p, span, div, strong) {
    color: var(--fhc-dashboard-banner-ink, #ffffff) !important;
  }

  :is(#allocation-portal, #housing-sources, #housing-board) header:before {
    background: var(--fhc-custom-primary, #f3946e) !important;
  }

  :is(#allocation-portal, #housing-sources, #housing-board) header .eyebrow {
    color: var(--fhc-dashboard-banner-ink, #ffffff) !important;
    opacity: 0.85;
  }

  :is(#allocation-portal, #housing-sources, #housing-board) header .subtitle {
    color: var(--fhc-dashboard-banner-ink, #ffffff) !important;
    opacity: 0.9;
  }

  :is(#allocation-portal, #housing-sources, #housing-board) header a {
    color: var(--fhc-dashboard-banner-ink, #ffffff) !important;
    text-decoration: underline;
    opacity: 0.95;
  }

  :is(.kinetix-theme .kinetix-content-body :is(.dashboard-header, .banner, .dashboard-banner),
    :is(#allocation-portal, #housing-sources, #housing-board) header,
    header.masthead,
    .masthead,
    div[style*="#004d40"], div[style*="#142e3d"], div[style*="#15364c"]) button {
    background: rgba(255, 255, 255, 0.22) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.45) !important;
    border-radius: var(--fhc-btn-radius, 8px) !important;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
  }

  :is(.kinetix-theme .kinetix-content-body :is(.dashboard-header, .banner, .dashboard-banner),
    :is(#allocation-portal, #housing-sources, #housing-board) header,
    header.masthead,
    .masthead,
    div[style*="#004d40"], div[style*="#142e3d"], div[style*="#15364c"]) button:hover {
    background: rgba(255, 255, 255, 0.38) !important;
    border-color: #ffffff !important;
  }

  /* Universal Stat Cards & Grids (Matches Legal, HR, & Housing Portal Cards) */
  :is(.kinetix-theme .kinetix-content-body :is(.stat-card, .stats-card, .kpi-card, .metric-card, [class*="stat-card"]),
    :is(#allocation-portal, #housing-sources, #housing-board) .stat) {
    background-color: var(--fhc-surface) !important;
    border: 1px solid var(--fhc-custom-card_border, var(--fhc-border)) !important;
    border-radius: var(--fhc-radius) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  :is(.kinetix-theme .kinetix-content-body :is(.stat-card, .stats-card, .kpi-card, .metric-card, [class*="stat-card"]),
    :is(#allocation-portal, #housing-sources, #housing-board) .stat):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
  }

  /* Stat Card Top Accent Borders (Sequential & Class-based) */
  :is(.kinetix-theme .kinetix-content-body :is(.stat-card, .stats-card, .kpi-card, [class*="stat-card"]),
    :is(#allocation-portal, #housing-sources, #housing-board) .stat):is(.blue-card, :nth-child(5n+1)) {
    border-top: 4px solid var(--fhc-kpi-1, #3b82f6) !important;
  }

  :is(.kinetix-theme .kinetix-content-body :is(.stat-card, .stats-card, .kpi-card, [class*="stat-card"]),
    :is(#allocation-portal, #housing-sources, #housing-board) .stat):is(.orange-card, :nth-child(5n+2)) {
    border-top: 4px solid var(--fhc-kpi-2, #f97316) !important;
  }

  :is(.kinetix-theme .kinetix-content-body :is(.stat-card, .stats-card, .kpi-card, [class*="stat-card"]),
    :is(#allocation-portal, #housing-sources, #housing-board) .stat):is(.green-card, :nth-child(5n+3)) {
    border-top: 4px solid var(--fhc-kpi-3, #22c55e) !important;
  }

  :is(.kinetix-theme .kinetix-content-body :is(.stat-card, .stats-card, .kpi-card, [class*="stat-card"]),
    :is(#allocation-portal, #housing-sources, #housing-board) .stat):is(.purple-card, :nth-child(5n+4)) {
    border-top: 4px solid var(--fhc-kpi-4, #8b5cf6) !important;
  }

  :is(.kinetix-theme .kinetix-content-body :is(.stat-card, .stats-card, .kpi-card, [class*="stat-card"]),
    :is(#allocation-portal, #housing-sources, #housing-board) .stat):is(.red-card, :nth-child(5n+5)) {
    border-top: 4px solid var(--fhc-custom-btn_danger, #e04f5f) !important;
  }

  /* Stat Card Icon Boxes */
  :is(.kinetix-theme .kinetix-content-body :is(.stat-card, .stats-card, .kpi-card):is(.blue-card, :nth-child(5n+1)) :is(.stat-icon, .icon-box, [class*="icon"]),
    :is(#allocation-portal, #housing-sources, #housing-board) .stat:nth-child(5n+1) :is(.stat-icon, .icon-box)) {
    background: rgba(59, 130, 246, 0.12) !important;
    color: var(--fhc-kpi-1, #3b82f6) !important;
  }

  :is(.kinetix-theme .kinetix-content-body :is(.stat-card, .stats-card, .kpi-card):is(.orange-card, :nth-child(5n+2)) :is(.stat-icon, .icon-box, [class*="icon"]),
    :is(#allocation-portal, #housing-sources, #housing-board) .stat:nth-child(5n+2) :is(.stat-icon, .icon-box)) {
    background: rgba(249, 115, 22, 0.12) !important;
    color: var(--fhc-kpi-2, #f97316) !important;
  }

  :is(.kinetix-theme .kinetix-content-body :is(.stat-card, .stats-card, .kpi-card):is(.green-card, :nth-child(5n+3)) :is(.stat-icon, .icon-box, [class*="icon"]),
    :is(#allocation-portal, #housing-sources, #housing-board) .stat:nth-child(5n+3) :is(.stat-icon, .icon-box)) {
    background: rgba(34, 197, 94, 0.12) !important;
    color: var(--fhc-kpi-3, #22c55e) !important;
  }

  :is(.kinetix-theme .kinetix-content-body :is(.stat-card, .stats-card, .kpi-card):is(.purple-card, :nth-child(5n+4)) :is(.stat-icon, .icon-box, [class*="icon"]),
    :is(#allocation-portal, #housing-sources, #housing-board) .stat:nth-child(5n+4) :is(.stat-icon, .icon-box)) {
    background: rgba(139, 92, 246, 0.12) !important;
    color: var(--fhc-kpi-4, #8b5cf6) !important;
  }

  :is(.kinetix-theme .kinetix-content-body :is(.stat-card, .stats-card, .kpi-card):is(.red-card, :nth-child(5n+5)) :is(.stat-icon, .icon-box, [class*="icon"]),
    :is(#allocation-portal, #housing-sources, #housing-board) .stat:nth-child(5n+5) :is(.stat-icon, .icon-box)) {
    background: rgba(224, 79, 95, 0.12) !important;
    color: var(--fhc-custom-btn_danger, #e04f5f) !important;
  }

  /* Universal Chart Cards & Grid */
  .kinetix-theme .kinetix-content-body :is(.chart-card, .charts-grid > div, [class*="chart-card"], .dashboard-graph-card, .custom-html-block .card) {
    background-color: var(--fhc-surface) !important;
    border: 1px solid var(--fhc-custom-card_border, var(--fhc-border)) !important;
    border-radius: var(--fhc-radius) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  }

  .kinetix-theme .kinetix-content-body :is(.chart-card, .charts-grid > div, [class*="chart-card"], .custom-html-block .card) :is(.chart-header, .card-header, h3, h4, h5, .title) {
    color: var(--fhc-ink) !important;
    font-weight: 700;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CLEAN DESK SIDEBAR: Hide drag handles & 3-dot settings buttons everywhere
   ═══════════════════════════════════════════════════════════════════════════ */
.desk-sidebar .drag-handle,
.desk-sidebar .setting-btn,
.desk-sidebar .sidebar-item-control,
.desk-sidebar .sidebar-item-actions,
.kinetix-sidebar .drag-handle,
.kinetix-sidebar .setting-btn,
.kinetix-sidebar .sidebar-item-control,
.kinetix-sidebar .sidebar-item-actions,
.page-sidebar .drag-handle,
.page-sidebar .setting-btn,
.page-sidebar .sidebar-item-control,
.page-sidebar .sidebar-item-actions,
.sidebar-item-container .drag-handle,
.sidebar-item-container .setting-btn,
.sidebar-item-container .sidebar-item-control,
.sidebar-item-container .sidebar-item-actions,
.standard-sidebar-item .drag-handle,
.standard-sidebar-item .setting-btn,
.standard-sidebar-item .sidebar-item-control,
.standard-sidebar-item .sidebar-item-actions {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Hide Frappe hidden workspace indicator badges from Desk Sidebar */
.desk-sidebar .hidden-workspace,
.sidebar-item-container.is-hidden,
.sidebar-item-container[data-is-hidden="1"],
.standard-sidebar-item.is-hidden,
.standard-sidebar-item[data-is-hidden="1"],
.sidebar-item-container:has(.is-hidden),
.sidebar-item-container:has([data-is-hidden="1"]),
.sidebar-item-container:has(.hidden-workspace) {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FHC UNIFIED WORKSPACE DASHBOARD WIDGETS
   ═══════════════════════════════════════════════════════════════════════════ */
.fhc-workspace-dashboard-wrapper {
  margin-bottom: 24px;
  width: 100%;
}

.fhc-dash-banner {
  border-radius: 10px;
  padding: 20px 24px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.fhc-dash-banner h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: inherit;
}

.fhc-dash-banner p {
  font-size: 13px;
  margin: 0;
  opacity: 0.9;
  color: inherit;
}

.fhc-dash-banner-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.fhc-dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.fhc-dash-kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.fhc-dash-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.fhc-dash-kpi-card .kpi-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  margin-bottom: 6px;
}

.fhc-dash-kpi-card .kpi-value {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
}

.fhc-dash-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.fhc-dash-card-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.fhc-dash-card-box .box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.fhc-dash-card-box .box-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.fhc-dash-table-wrapper {
  overflow-x: auto;
}

.fhc-dash-table {
  width: 100%;
  font-size: 13px;
  border-collapse: separate;
  border-spacing: 0;
}

.fhc-dash-table th {
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
}

.fhc-dash-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}

.fhc-dash-table tr:hover td {
  background: #f8fafc;
}

/* ── Broadcast Alert Banner ── */
.fhc-dash-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
}

.fhc-dash-alert.alert-info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.fhc-dash-alert.alert-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.fhc-dash-alert.alert-success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.fhc-dash-alert.alert-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

/* ── Quick Navigation Shortcuts ── */
.fhc-dash-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.fhc-dash-shortcut-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.fhc-dash-shortcut-chip:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
  transform: translateY(-1px);
}

.fhc-dash-shortcut-chip .badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  background: #e2e8f0;
  color: #475569;
}

/* ── Status Color Badges ── */
.fhc-dash-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}

.fhc-dash-badge.badge-blue {
  background: #dbeafe;
  color: #1e40af;
}

.fhc-dash-badge.badge-green {
  background: #dcfce7;
  color: #15803d;
}

.fhc-dash-badge.badge-orange {
  background: #ffedd5;
  color: #c2410c;
}

.fhc-dash-badge.badge-purple {
  background: #f3e8ff;
  color: #6b21a8;
}

.fhc-dash-badge.badge-red {
  background: #fee2e2;
  color: #b91c1c;
}

.fhc-dash-badge.badge-gray {
  background: #f1f5f9;
  color: #475569;
}

/* ── Universal Workspace Quick Access Shortcuts Legibility Fix ── */
.workspace-page .shortcut-widget-box,
.widget.shortcut-widget-box,
.shortcut-widget-box {
  background-color: var(--fhc-custom-surface, #ffffff) !important;
  border: 1px solid var(--fhc-custom-card_border, #e2e8f0) !important;
  border-radius: var(--fhc-card-radius, 10px) !important;
}

.workspace-page .shortcut-widget-box .widget-head .widget-label .widget-title,
.widget.shortcut-widget-box .widget-head .widget-label .widget-title,
.shortcut-widget-box .widget-head .widget-label .widget-title,
.shortcut-widget-box .widget-title {
  color: var(--fhc-custom-ink, #172b4d) !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.workspace-page .shortcut-widget-box:hover .widget-head .widget-label .widget-title,
.widget.shortcut-widget-box:hover .widget-title,
.shortcut-widget-box:hover .widget-title {
  color: var(--fhc-custom-brand, #315da8) !important;
}

.shortcut-widget-box .widget-head .widget-control>* {
  background: #f1f5f9 !important;
  color: var(--fhc-custom-brand, #315da8) !important;
  --icon-stroke: var(--fhc-custom-brand, #315da8) !important;
  border-radius: 6px !important;
}



/* ═══════════════════════════════════════════════════════════════════════════
   Website / Brand Visual Styles (Typography, Elevation, Gradients, Density)
   Loaded dynamically ONLY when a non-Classic theme is active.
   ═══════════════════════════════════════════════════════════════════════════ */

html[data-fhc-font-family="inter"] body,
html[data-fhc-font-family="inter"] :is(.frappe-card, .btn, .form-control, .desk-sidebar, .navbar) {
  font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif !important;
}

html[data-fhc-font-family="poppins"] body,
html[data-fhc-font-family="poppins"] :is(.frappe-card, .btn, .form-control, .desk-sidebar, .navbar) {
  font-family: "Poppins", "Century Gothic", "Segoe UI", -apple-system, sans-serif !important;
}

html[data-fhc-font-family="jakarta"] body,
html[data-fhc-font-family="jakarta"] :is(.frappe-card, .btn, .form-control, .desk-sidebar, .navbar) {
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif !important;
}

html[data-fhc-font-family="roboto"] body,
html[data-fhc-font-family="roboto"] :is(.frappe-card, .btn, .form-control, .desk-sidebar, .navbar) {
  font-family: "Roboto", "Segoe UI", Arial, sans-serif !important;
}

html[data-fhc-font-family="serif"] body,
html[data-fhc-font-family="serif"] :is(.frappe-card, .btn, .form-control, .desk-sidebar, .navbar) {
  font-family: "Georgia", "Cambria", "Times New Roman", serif !important;
}

html[data-fhc-font-family="mono"] body,
html[data-fhc-font-family="mono"] :is(.frappe-card, .btn, .form-control, .desk-sidebar, .navbar) {
  font-family: "JetBrains Mono", "Cascadia Code", "Consolas", monospace !important;
}

html[data-fhc-heading-weight="600"] :is(.page-title .title-text, h1, h2, h3, .section-head, .widget-title) {
  font-weight: 600 !important;
}

html[data-fhc-heading-weight="700"] :is(.page-title .title-text, h1, h2, h3, .section-head, .widget-title) {
  font-weight: 700 !important;
}

html[data-fhc-heading-weight="800"] :is(.page-title .title-text, h1, h2, h3, .section-head, .widget-title) {
  font-weight: 800 !important;
  letter-spacing: -0.015em !important;
}

html[data-fhc-navbar-style="gradient"] .navbar {
  background: linear-gradient(135deg, var(--fhc-custom-navbar, #4d7dd6) 0%, var(--fhc-custom-accent_2, #6366f1) 100%) !important;
  border-bottom: none !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12) !important;
}

html[data-fhc-navbar-style="glass"] .navbar {
  background: color-mix(in srgb, var(--fhc-custom-navbar, #4d7dd6) 86%, transparent) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08) !important;
}

html[data-fhc-sidebar-style="gradient"] :is(.desk-sidebar, .layout-side-section .overlay-sidebar, .layout-side-section) {
  background: linear-gradient(180deg, var(--fhc-custom-sidebar, #4d7dd6) 0%, var(--fhc-custom-accent_2, #1e293b) 100%) !important;
}

html[data-fhc-sidebar-style="deep"] :is(.desk-sidebar, .layout-side-section) {
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08), 4px 0 24px rgba(15, 23, 42, 0.12) !important;
}

html[data-fhc-card-elevation="flat"] :is(.frappe-card, .widget, .form-dashboard-section, .list-row-container) {
  box-shadow: none !important;
}

html[data-fhc-card-elevation="elevated"] :is(.frappe-card, .widget, .form-dashboard-section, .list-row-container) {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

html[data-fhc-card-elevation="glass"] :is(.frappe-card, .widget, .form-dashboard-section) {
  background: color-mix(in srgb, var(--fhc-custom-surface, #ffffff) 82%, transparent) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.07) !important;
}

html[data-fhc-button-style="gradient"] .btn-primary {
  background: linear-gradient(135deg, var(--fhc-custom-primary, #f3946e) 0%, var(--fhc-custom-accent_2, #6366f1) 100%) !important;
  border-color: transparent !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.14) !important;
}

html[data-fhc-button-style="pill"] :is(.btn-primary, .btn-secondary, .btn-default, .btn-success, .btn-danger) {
  border-radius: 999px !important;
  padding-left: 16px !important;
  padding-right: 16px !important;
}

html[data-fhc-table-density="compact"] :is(.list-row, .grid-row, table.table td, table.table th) {
  padding-top: 4px !important;
  padding-bottom: 4px !important;
}

html[data-fhc-table-density="comfortable"] :is(.list-row, .grid-row, table.table td, table.table th) {
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PINNED SIDEBAR FOOTER & USER PROFILE SUPPRESSION
   ═══════════════════════════════════════════════════════════════════════════ */
.fhc-sidebar-pinned-footer {
  flex-shrink: 0 !important;
  margin-top: auto !important;
  padding: 10px 14px 14px 14px !important;
  background: var(--sidebar-bg, var(--fhc-custom-sidebar, #315da8)) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.18) !important;
  z-index: 100 !important;
  box-sizing: border-box !important;
}

.fhc-pinned-role-card {
  background: rgba(0, 0, 0, 0.14) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  border-radius: 8px !important;
  padding: 10px 12px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.fhc-pinned-role-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fhc-pinned-role-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fhc-pinned-role-meta {
  overflow: hidden;
}

.fhc-pinned-role-label {
  font-size: 9px;
  letter-spacing: 0.06em;
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82) !important;
  line-height: 1.1;
}

.fhc-pinned-role-title {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.fhc-pinned-tasks-pill {
  background: #ffffff !important;
  color: #1e3a8a !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  border-radius: 6px !important;
  padding: 6px 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12) !important;
  transition: all 0.15s ease-in-out !important;
  text-decoration: none !important;
}

.fhc-pinned-tasks-pill:hover {
  background: #f8fafc !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.18) !important;
  color: #1e3a8a !important;
  text-decoration: none !important;
}

.fhc-pinned-tasks-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fhc-pinned-sparkle {
  color: #2563eb;
  font-size: 13px;
  font-weight: 700;
}

.fhc-pinned-tasks-text {
  color: #1e3a8a !important;
}

.fhc-pinned-tasks-badge {
  background: #dbeafe !important;
  color: #1e40af !important;
  border-radius: 999px !important;
  padding: 1px 7px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  min-width: 18px !important;
  text-align: center !important;
}

[data-page-route*="user-profile"] .energy-points-section,
[data-page-route*="user-profile"] .heatmap-container,
[data-page-route*="user-profile"] .recent-activity-section,
[data-page-route*="user-profile"] .user-stats,
[data-page-route*="user-profile"] .user-profile-header,
[data-page-route*="user-profile"] .user-profile-page,
[id*="page-user-profile"] .energy-points-section,
[id*="page-user-profile"] .heatmap-container,
[id*="page-user-profile"] .recent-activity-section,
[id*="page-user-profile"] .user-stats,
[id*="page-user-profile"] .user-profile-header,
[id*="page-user-profile"] .user-profile-page,
[data-page-route*="user-profile"] .layout-main-section>div:not(#fhc-my-profile-portal):not(#fhc-profile-modal-backdrop),
[id*="page-user-profile"] .layout-main-section>div:not(#fhc-my-profile-portal):not(#fhc-profile-modal-backdrop),
.page[data-page-route*="user-profile"] .layout-main-section>div:not(#fhc-my-profile-portal):not(#fhc-profile-modal-backdrop) {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

#fhc-my-profile-portal {
  display: block !important;
  visibility: visible !important;
  height: auto !important;
  max-height: none !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}.icm-support-launcher {
	position: fixed; right: 24px; bottom: 24px; z-index: 1050; border: 0;
	border-radius: 999px; padding: 13px 18px; color: #fff; font-weight: 700;
	background: linear-gradient(135deg, #173f73, #087f8c); box-shadow: 0 10px 28px rgba(20, 65, 115, .30);
}
.icm-support-panel {
	position: fixed; right: 24px; bottom: 82px; z-index: 1051; width: min(380px, calc(100vw - 32px));
	max-height: min(600px, calc(100vh - 116px)); overflow: auto; display: none; padding: 18px;
	border: 1px solid #dce5ef; border-radius: 16px; background: #fff; box-shadow: 0 16px 44px rgba(16, 41, 69, .24);
}
.icm-support-panel.is-open { display: block; }
.icm-support-panel [hidden] { display: none !important; }
.icm-support-panel { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 13px; line-height: 1.5; color: #243b53; }
.icm-support-panel .form-control { font-family: inherit; font-size: 13px; border: 1px solid #cbdce8; border-radius: 10px; padding: 10px 12px; background: #fff; color: #243b53; box-shadow: none; }
.icm-support-panel .form-control:focus { border-color: #087f8c; box-shadow: 0 0 0 3px rgba(8,127,140,.12); }
.icm-support-panel .icm-support-head h4 { font-family: inherit; font-size: 18px; font-weight: 700; }
.icm-support-head small { display: block; margin-top: 4px; color: #68788a; line-height: 1.5; }
.icm-support-browser-results { max-height: 240px; overflow-y: auto; overscroll-behavior: contain; }
.icm-support-panel .icm-support-actions .btn { border-radius: 9px; padding: 9px 12px; font-family: inherit; font-size: 12px; font-weight: 600; }
.icm-support-panel .icm-support-actions .btn-primary { background: #087f8c; border-color: #087f8c; color: #fff; flex: 1 1 100%; }
.icm-support-panel button:focus-visible { outline: 3px solid rgba(8,127,140,.3); outline-offset: 2px; }
.icm-support-head { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; }
.icm-support-head h4 { margin:0; color:#173f73; }
.icm-support-close { border:0; background:transparent; font-size:23px; line-height:1; color:#536477; }
.icm-support-answer { margin:14px 0; padding:12px; border-left:3px solid #087f8c; border-radius:6px; background:#f4fbfb; white-space:pre-wrap; }
.icm-support-sources { color:#68788a; font-size:12px; margin-bottom:12px; }
.icm-support-topic-wrap {
	margin: 16px 0;
	padding: 12px;
	border: 1px solid #e3edf4;
	border-radius: 12px;
	background: #f8fbfd;
}
.icm-support-topic-label {
	margin-bottom: 10px;
	color: #344b63;
	font-size: 12px;
	font-weight: 700;
}
.icm-support-topics {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.icm-support-browse {
	width: 100%; margin: 10px 0 0; padding: 7px 0 0; border: 0;
	background: transparent; color: #087f8c; font-size: 12px; font-weight: 700;
	text-align: left;
}
.icm-support-browse span { font-size: 14px; }
.icm-support-topic-browser {
	margin: 16px 0; padding: 12px; border: 1px solid #e3edf4;
	border-radius: 12px; background: #f8fbfd;
}
.icm-support-browser-head { display: flex; gap: 9px; align-items: flex-start; margin-bottom: 11px; }
.icm-support-browser-head strong { color: #173f73; display: block; font-size: 13px; }
.icm-support-browser-head small { color: #68788a; display: block; font-size: 11px; line-height: 1.35; margin-top: 2px; }
.icm-support-browser-back { border: 0; border-radius: 8px; background: #e7f5f6; color: #087f8c; font-size: 17px; line-height: 1; padding: 5px 8px; }
.icm-support-topic-search { margin-bottom: 12px; font-size: 12px; }
.icm-support-browser-group + .icm-support-browser-group { border-top: 1px solid #e1ebf1; margin-top: 11px; padding-top: 11px; }
.icm-support-browser-group-title { color: #526b83; font-size: 11px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.icm-support-browser-topic-list { display: grid; gap: 6px; margin-top: 7px; }
button.icm-support-browser-topic { border-radius: 9px !important; font-size: 12px !important; text-align: left; width: 100%; }
button.icm-support-topic {
	appearance: none !important;
	-webkit-appearance: none !important;
	margin: 0 !important;
	min-height: 34px;
	border: 1px solid #cbdce8 !important;
	border-radius: 999px !important;
	background: #fff !important;
	box-shadow: none !important;
	color: #24547a !important;
	cursor: pointer;
	font-family: inherit;
	font-size: 12px !important;
	font-weight: 600 !important;
	line-height: 1.2;
	padding: 8px 12px !important;
	text-align: left;
	transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
button.icm-support-topic::before {
	content: "";
	display: inline-block;
	width: 7px;
	height: 7px;
	margin: 0 7px 1px 0;
	border-radius: 50%;
	background: #13b9c6;
}
button.icm-support-topic:hover {
	border-color: #1b8a98 !important;
	background: #edfafa !important;
	color: #0d6270 !important;
	transform: translateY(-1px);
}
button.icm-support-topic.is-selected {
	border-color: #087f8c !important;
	background: #087f8c !important;
	color: #fff !important;
}
button.icm-support-topic.is-selected::before { background: #a3f3f3; }
button.icm-support-topic-unsure {
	border-style: dashed !important;
	color: #65778a !important;
}
button.icm-support-topic-unsure::before { background: #93a4b5; }
button.icm-support-topic:focus-visible {
	outline: 3px solid rgba(19, 185, 198, .28);
	outline-offset: 2px;
}
.icm-support-panel textarea { resize:vertical; min-height:82px; }
.icm-support-feedback { align-items:center; display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; color:#536477; font-size:12px; }
.icm-support-feedback .btn { font-size:12px; padding:3px 7px; }
.icm-support-guide-link { display:inline-block; margin-top:12px; color:#087f8c; font-size:12px; font-weight:600; }
.icm-support-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }
.icm-support-status { margin-top:10px; color:#68788a; font-size:13px; }
@media (max-width: 600px) { .icm-support-launcher { right:16px; bottom:16px; } .icm-support-panel { right:16px; bottom:74px; } }
