/* ==========================================================================
   Responsive
   ========================================================================== */

/* Mobile header — hidden on desktop; topbar hidden on mobile */
.adv-mobile-header { display: none; }
.adv-mobile-only { display: none; }

/* Theme + language sidebar block — only shown on phone/tablet (see ≤992px). */
.adv-sidebar-mobile-actions { display: none; }

/* Sidebar geometry: the width lives in Radzen's own variable so its native
   collapse (.rz-sidebar-collapsed { width: 0 !important }) actually works —
   the old inline min-width: 190px silently defeated it, which is why the
   sidebar was never collapsible outside the mobile off-canvas mode. The
   body margin animates along with the width transition. */
.rz-layout { --rz-sidebar-width: 190px; }
.rz-body { transition: margin-inline-start 0.25s ease; }
/* Collapsed: keep inner content from reflowing mid-transition. */
.rz-sidebar-collapsed .adv-sidebar-inner { overflow: hidden; white-space: nowrap; }

/* Party detail — the collapsible contact card only exists on phone/tablet;
   hidden by default (desktop), revealed in the ≤992px block below. */
.party-contact-mobile-card { display: none; }

/* Full-screen history modal (opened only from the phone/tablet history button).
   Edge-to-edge, no rounded corners; a flex column so the content area fills the
   remaining height and scrolls all the way to the bottom. */
.party-history-dialog {
    display: flex !important;
    flex-direction: column;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    top: 0 !important;
    left: 0 !important;
    border-radius: 0 !important;
    margin: 0 !important;
}
.party-history-dialog .rz-dialog-titlebar {
    flex: 0 0 auto;
}
.party-history-dialog .rz-dialog-content {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0.75rem 1rem 2rem !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
/* Hide the filter + export buttons on phone/tablet. */
.party-history-dialog .audit-filter-bar {
    display: none !important;
}
/* The inline audit panel caps its body at 380px for the desktop sidebar; in
   the full-screen modal that leaves a tiny nested scroll area (~half the
   screen). Drop the cap and its own overflow so the whole modal scrolls as
   one — the rz-dialog-content above is the single scroll container. */
.party-history-dialog .audit-panel--inline .audit-panel-body {
    max-height: none !important;
    overflow: visible !important;
}

/* Phone/tablet-only header pieces — hidden on desktop. */
.party-back-mobile { display: none; }
.party-status-banner { display: none; }
.party-general-toggle { display: none; }
.party-card-toggle-icon { display: none; }
.party-history-mobile-btn { display: none; }
.party-contact-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}
.party-contact-card-header:hover { opacity: 0.85; }
.party-contact-card-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(74, 159, 213, 0.12);
    color: var(--adv-primary);
}

/* Party detail — linked cases: table on desktop, stacked cards on phone/tablet.
   Cards hidden by default; the ≤992px block swaps grid for cards. */
.party-list-cards { display: none; }
.party-item-card {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border: 2px solid var(--adv-border-strong, var(--adv-border));
    border-radius: 10px;
    background: var(--adv-surface-glass);
    -webkit-backdrop-filter: blur(var(--adv-glass-blur));
    backdrop-filter: blur(var(--adv-glass-blur));
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}

/* Corner banner (top-right) for the item's type — e.g. the address type on the
   Addresses cards. Same folded-tab treatment as the header status banner. */
.party-item-type-banner {
    position: absolute;
    top: 0;
    right: 0;
    padding: 0.15rem 0.7rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    background: var(--adv-primary);
    border-bottom-left-radius: 9px;
    z-index: 1;
}
/* Contacts: linked-party (blue, like the Info badge) vs a plain contact type
   (neutral grey, like the Light badge) — keeps the original colour coding. */
.party-item-type-banner.is-linked { background: var(--adv-primary); }
.party-item-type-banner.is-type { background: var(--adv-text-muted); }
.party-item-card:hover {
    background: rgba(74, 159, 213, 0.04);
    border-color: var(--adv-primary);
}
/* Row-clickable cards (cases, appointments) get the pointer + lift. */
.party-item-card--click {
    cursor: pointer;
}
.party-item-card--click:hover {
    box-shadow: 0 4px 16px rgba(74, 159, 213, 0.18);
    transform: translateY(-1px);
}
/* Edit/delete cluster, pinned top-right of the card. */
.party-item-card-actions {
    display: flex;
    gap: 0.15rem;
    flex-shrink: 0;
    align-self: flex-start;
}
.party-item-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(74, 159, 213, 0.12);
    color: var(--adv-primary);
}
.party-item-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    flex: 1;
}
.party-item-card-title {
    font-weight: 600;
    color: var(--adv-primary-dark);
    font-size: 0.9rem;
}
.party-item-card-sub {
    color: var(--adv-text);
    font-size: 0.9rem;
    word-break: break-word;
}
/* Sub-line prefixed with a leading icon (contact phone/mail/title). */
.party-item-card-sub--icon {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.party-item-card-sub--icon .rzi,
.party-item-card-sub--icon .material-icons {
    font-size: 1rem;
    color: var(--adv-text-muted);
    flex-shrink: 0;
}
.party-item-card-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    margin-top: 0.15rem;
}

/* One role badge per line (linked-cases table + cards). */
.party-role-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
}
.party-list-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem;
    color: var(--adv-text-muted);
}

/* Tablet (≤992px) */
@media (max-width: 992px) {
    .adv-content { padding: 0 1rem 1rem; }
    .adv-content > .rz-row:first-child,
    .adv-content > div:first-child { padding: 1rem; }
    .dash-kpi-value { font-size: 1.4rem; }
    .dash-header { flex-wrap: wrap; gap: 0.5rem; }

    /* Hide the timer widget from the top bar on phone/tablet. */
    .topbar-timer-btn { display: none !important; }

    /* Logo in the mobile header: the bar is primary-blue in both themes, so
       render the artwork white for contrast (dark artwork would vanish on
       blue once the old white plate was removed). */
    .adv-mobile-header img {
        filter: brightness(0) invert(1);
        background: transparent !important;
    }

    /* Theme toggle + language move from the top bar into the side menu. */
    .topbar-theme-btn,
    .topbar-lang {
        display: none !important;
    }
    .adv-sidebar-mobile-actions {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem 0 0.75rem;
        margin-bottom: 0.5rem;
        border-bottom: 1px solid var(--adv-border);
    }
    .adv-sidebar-mobile-actions .adv-sidebar-action-btn {
        justify-content: flex-start;
        width: 100%;
    }
    /* Language dropdown: full width, no white fill (blend into the sidebar),
       white text/arrow to match the sidebar. */
    .adv-sidebar-mobile-actions .rz-dropdown {
        width: 100% !important;
        background: transparent !important;
        border-color: var(--adv-border) !important;
    }
    .adv-sidebar-mobile-actions .rz-dropdown,
    .adv-sidebar-mobile-actions .rz-dropdown .rz-dropdown-label,
    .adv-sidebar-mobile-actions .rz-dropdown .rz-inputtext,
    .adv-sidebar-mobile-actions .rz-dropdown .rz-dropdown-trigger,
    .adv-sidebar-mobile-actions .rz-dropdown .rz-dropdown-trigger .rzi {
        color: #fff !important;
    }

    /* KPI cards inside a Radzen grid row (detail pages: party, case,
       performances, bank statement) collapse to icon-only, equal-height on
       phone + tablet. The dashboard uses its own CSS grid (not rz-col), so its
       cards are excluded here and keep their values. */
    [class*="rz-col"] .dash-kpi-title,
    [class*="rz-col"] .dash-kpi-label {
        display: none !important;
    }
    /* The count lives inside the folded banner (top-left). */
    [class*="rz-col"] .dash-kpi-value {
        position: absolute;
        top: 3px;
        left: 7px;
        z-index: 2;
        font-size: 0.8rem !important;
        font-weight: 700;
        line-height: 1;
        color: #fff;
    }
    [class*="rz-col"] .dash-kpi-header {
        margin-bottom: 0;
        justify-content: center;
        position: relative;
        z-index: 1;
    }
    [class*="rz-col"] .dash-kpi-card {
        height: 100%;
        align-items: center;
        justify-content: center;
        padding: 0.85rem !important;
    }

    /* Full-colour fill: the whole card takes its accent colour (no white/glass),
       the icon badge goes transparent and the glyph turns white so only a large
       icon on a solid colour block shows. */
    [class*="rz-col"] .dash-kpi-card--primary { background: rgba(var(--adv-primary-rgb), 0.72) !important; }
    [class*="rz-col"] .dash-kpi-card--success { background: rgba(var(--adv-success-rgb), 0.72) !important; }
    [class*="rz-col"] .dash-kpi-card--warning { background: rgba(var(--adv-warning-rgb), 0.72) !important; }
    [class*="rz-col"] .dash-kpi-card--purple  { background: rgba(var(--adv-purple-rgb), 0.72) !important; }

    /* Dark mode: the fills are semi-transparent, so on a dark page ~28% bleeds
       through and the colour blocks look muddy — raise the opacity so they stay
       vibrant, and lighten the folded corner so it still reads as "darker". */
    .dark-theme [class*="rz-col"] .dash-kpi-card--primary { background: rgba(var(--adv-primary-rgb), 0.92) !important; }
    .dark-theme [class*="rz-col"] .dash-kpi-card--success { background: rgba(var(--adv-success-rgb), 0.92) !important; }
    .dark-theme [class*="rz-col"] .dash-kpi-card--warning { background: rgba(var(--adv-warning-rgb), 0.92) !important; }
    .dark-theme [class*="rz-col"] .dash-kpi-card--purple  { background: rgba(var(--adv-purple-rgb), 0.92) !important; }
    .dark-theme [class*="rz-col"] .dash-kpi-card::before { background: rgba(0, 0, 0, 0.28); }

    /* Dark mode: lift the tinted icon badges so they don't sink into the dark
       glass cards (parties category icons keep their own inline colours). */
    .dark-theme .party-item-card-icon,
    .dark-theme .party-card-toggle-icon,
    .dark-theme .party-contact-card-icon {
        background: rgba(109, 185, 230, 0.16);
        color: var(--adv-primary-dark);
    }

    /* Dark mode: the translucent glass cards blend into the near-black page —
       give them a solid raised surface + a clearer edge so they read as cards. */
    .dark-theme .party-item-card,
    .dark-theme .party-detail-page .dash-card,
    .dark-theme .party-detail-body > .party-detail-header {
        background: #232f47 !important;
        border-color: rgba(255, 255, 255, 0.18) !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }

    /* Case cards: a coloured left border marks the status (green = Active) instead
       of a pill. Declared after the dark surface rule so it keeps the accent
       colour on the left edge in dark mode too. */
    .party-item-card--active { border-left: 4px solid var(--adv-success) !important; }
    .party-item-card--inactive { border-left: 4px solid var(--adv-text-muted) !important; }
    .dark-theme .party-item-card--active { border-left-color: var(--adv-success) !important; }
    .dark-theme .party-item-card--inactive { border-left-color: var(--adv-text-muted) !important; }
    [class*="rz-col"] .dash-kpi-card {
        position: relative;
        overflow: hidden;
        border: none !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }
    /* Folded-banner corner: a darker triangle in the top-left. A translucent
       black overlay darkens the underlying accent colour, so it stays the same
       hue for every card variant. */
    [class*="rz-col"] .dash-kpi-card::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 60%;
        aspect-ratio: 1;
        background: rgba(0, 0, 0, 0.18);
        clip-path: polygon(0 0, 100% 0, 0 100%);
        pointer-events: none;
    }
    [class*="rz-col"] .dash-kpi-icon {
        background: transparent !important;
        color: #fff !important;
        width: auto;
        height: auto;
    }
    [class*="rz-col"] .dash-kpi-icon .rzi,
    [class*="rz-col"] .dash-kpi-icon .material-icons {
        font-size: 30px !important;
        color: #fff !important;
    }

    /* Pack the cards onto a single equal-width row so the icons line up at the
       same height. */
    .rz-row:has([class*="rz-col"] .dash-kpi-card) {
        flex-wrap: nowrap;
        align-items: stretch;
    }
    [class*="rz-col"]:has(.dash-kpi-card) {
        flex: 1 1 0 !important;
        width: auto !important;
        max-width: none !important;
    }

    /* Party detail: hide the breadcrumb and the header action row
       (Find duplicates / Export / more) on phone + tablet. */
    .party-detail-page .adv-breadcrumb,
    .party-detail-page .party-header-actions {
        display: none !important;
    }

    /* Parties list: hide the header action buttons (DPA search / Import /
       Export / New), the breadcrumb and the saved-filters menu on phone/tablet. */
    .parties-page .parties-header__actions,
    .parties-page .adv-breadcrumb,
    .parties-page .saved-filters {
        display: none !important;
    }

    /* Parties list: swap the (too-wide) table for a card list, but keep the
       grid's pager so server-side paging still works. */
    .parties-page .rz-datatable-header,
    .parties-page .rz-grid-table,
    .parties-page .rz-datatable-emptymessage {
        display: none !important;
    }
    .parties-page .parties-cards {
        margin-top: 0.5rem;
    }

    /* Parties list: no pager on phone/tablet — the card list lazy-loads instead. */
    .parties-page .rz-pager,
    .parties-page .rz-paginator {
        display: none !important;
    }
    .parties-cards-loading {
        display: flex;
        justify-content: center;
        padding: 0.75rem;
    }
    .parties-cards-sentinel {
        height: 1px;
    }

    /* Party detail: hide the tab strip (General, Details, …) on phone/tablet —
       navigation is driven by the KPI cards / default tab content instead. */
    .party-detail-page .rz-tabview-nav {
        display: none !important;
    }
    /* Hide the Details (free-fields) card when the party has none filled in. */
    .party-details-empty-col {
        display: none !important;
    }

    /* Keep left/right page margins symmetric — neutralise Radzen's row gutters
       (negative side margins) which otherwise pull content tighter on the left. */
    .party-detail-page .rz-row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    /* No residual border/spacing where the tab strip was. */
    .party-detail-page .rz-tabview,
    .party-detail-page .rz-tabview-panels,
    .party-detail-page .rz-tabview-panel {
        border: none !important;
        margin: 0 !important;
    }

    /* General-info card: hide empty fields, make it a collapsible card (starts
       closed), and let it span the full width like the header card. */
    .party-detail-page .party-field--empty {
        display: none !important;
    }
    .party-general-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        cursor: pointer;
        user-select: none;
    }
    .party-general-toggle {
        display: inline-flex;
        color: var(--adv-text-muted);
    }
    /* Leading icon badge on each collapsible card header. */
    .party-card-toggle-icon {
        width: 34px;
        height: 34px;
        border-radius: 9px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        background: rgba(74, 159, 213, 0.12);
        color: var(--adv-primary);
    }
    .party-general-card.is-collapsed .party-general-fields,
    .party-details-card.is-collapsed .party-details-scroll,
    .party-details-card.is-collapsed .party-details-header-actions {
        display: none !important;
    }
    /* Collapsed = just the title row; don't let dash-card's height:100% or the
       row's stretch keep it tall. */
    .party-detail-page .party-details-wrap {
        height: auto !important;
        min-height: 0 !important;
    }
    .party-detail-page .party-general-card,
    .party-detail-page .party-details-card,
    .party-detail-page .party-bank-card,
    .party-contact-mobile-card .dash-card {
        height: auto !important;
        min-height: 0 !important;
    }
    /* Collapsed: the three cards (Partijgegevens / Contactgegevens / Details)
       share one fixed height. Drop the vertical padding + the dash-card-header's
       1rem margin so only the centered title row sets the height. */
    .party-general-card.is-collapsed,
    .party-details-card.is-collapsed,
    .party-bank-card.is-collapsed,
    .party-contact-mobile-card .dash-card.is-collapsed {
        height: 4.25rem !important;
        min-height: 4.25rem !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        gap: 0 !important;
    }
    .party-general-card.is-collapsed .dash-card-header,
    .party-details-card.is-collapsed .party-details-header,
    .party-bank-card.is-collapsed .dash-card-header,
    .party-contact-mobile-card .dash-card.is-collapsed .party-contact-card-header {
        margin: 0 !important;
        flex: 0 0 auto;
        align-items: center !important;
    }
    .party-detail-page .rz-tabview-panel .rz-row {
        align-items: flex-start !important;
    }

    /* History: an ordinary full-width button that opens a full-page modal,
       instead of the inline toggle card. */
    .party-detail-page .party-audit-section {
        display: none !important;
    }
    .party-history-mobile-btn {
        display: flex !important;
        width: 100%;
        justify-content: center;
    }
    /* Full-bleed the General tab layout so the card matches the header width;
       drop the top padding so the header card's margin is the only gap before
       the first card (consistent with the card-to-card gaps). */
    .party-detail-page .rz-tabview-panel,
    .party-detail-page .case-tab-content {
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-top: 0 !important;
    }
    .party-detail-page [class*="rz-col"] {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Party detail: on phone/tablet the KPI cards come first, then the header —
       rendered as a card — then the rest. Flex ordering keeps desktop markup
       order intact. */
    .party-detail-body {
        display: flex;
        flex-direction: column;
    }
    .party-detail-body > .party-kpi-row {
        order: -2;
    }
    .party-detail-body > .party-detail-header {
        order: -1;
        position: relative;
        overflow: hidden;
        background: var(--adv-surface-glass) !important;
        -webkit-backdrop-filter: blur(var(--adv-glass-blur));
        backdrop-filter: blur(var(--adv-glass-blur));
        border: 1px solid var(--adv-glass-border);
        border-radius: 10px;
        box-shadow: var(--adv-shadow-card);
        padding: 0.85rem 1rem !important;
        margin-bottom: 1.5rem;
    }
    /* Full-width back button, pinned above the KPI cards. */
    .party-detail-body > .party-back-mobile {
        order: -3;
        display: flex !important;
        justify-content: center;
        width: 100%;
        margin-bottom: 0.75rem;
    }
    /* The inline back button + status pill move into dedicated mobile treatments. */
    .party-back-desktop,
    .party-header-status-badge {
        display: none !important;
    }
    /* Status corner banner on the header card. */
    .party-status-banner {
        display: block;
        position: absolute;
        top: 0;
        right: 0;
        padding: 0.15rem 0.7rem;
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.02em;
        color: #fff;
        border-bottom-left-radius: 9px;
        z-index: 1;
    }
    .party-status-banner.is-active { background: var(--adv-success); }
    .party-status-banner.is-inactive { background: var(--adv-text-muted); }

    /* Party detail: phone/mobile/email move out of the main details card into
       the collapsible contact card. */
    .party-contact-inline-field {
        display: none !important;
    }

    /* Party detail: fields already shown in the header/title (name, first name,
       category, active status) are redundant in the card on phone/tablet. */
    .party-title-dup-field {
        display: none !important;
    }

    /* Party detail: swap the linked-cases table for stacked cards. */
    .party-list-grid {
        display: none;
    }
    .party-list-cards {
        display: flex;
        flex-direction: column;
        gap: 0.6rem;
    }
    .party-contact-mobile-card {
        display: block;
    }

    /* Party detail is read-only on phone/tablet: hide every editing affordance
       (inline-edit pencils, card edit/delete/set-primary, add buttons). Viewing,
       navigation and the tab/widget toggles stay active. */
    .party-detail-page .inline-field-pencil,
    .party-detail-page .party-item-card-actions,
    .party-detail-page .case-tab-toolbar,
    .party-detail-page .party-details-header-actions button,
    .party-detail-page .party-edit-only {
        display: none !important;
    }

    /* Bankrekeningen with no accounts is noise on phone/tablet — hide the whole
       card there (it stays visible on desktop for adding the first account). */
    .party-detail-page .party-bank-card--empty {
        display: none !important;
    }
}

/* Mobile (≤768px) */
@media (max-width: 768px) {
    /* Radzen 5's RadzenLayout is a CSS GRID (areas: "rz-header rz-header" /
       "rz-sidebar rz-body"). The custom mobile header is a grid child of it
       and MUST be pinned to the header area: unassigned, auto-placement
       drops it into the sidebar column — a header-wide white block top-left,
       a blank sidebar column under it, and the body shoved right by that
       column's width (the pre-Radzen-5 flex-era CSS below never accounted
       for this). */
    .adv-mobile-header { grid-area: rz-header; }

    /* Sidebar: off-canvas overlay, out of the grid flow so its column
       collapses to zero width */
    .rz-sidebar {
        position: fixed !important;
        z-index: 1100 !important;
        height: 100vh !important;
        height: 100dvh !important;
        width: 190px !important;
        min-width: 0 !important;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }
    .rz-sidebar-expanded {
        transform: translateX(0);
    }
    .rz-sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: var(--adv-overlay-bg);
        z-index: 1099;
    }

    /* Body: full width, override Radzen inline margin. Zero BOTH side paddings —
       leaving only padding-left at 0 kept Radzen's right padding, which shifted
       all content left (left margin smaller than right). */
    .rz-layout > .rz-body,
    .rz-body[style] {
        width: 100% !important;
        margin-left: 0 !important;
        margin-inline-start: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    .adv-content { padding: 0 0.75rem 0.75rem; }
    .adv-content > .rz-row:first-child,
    .adv-content > div:first-child {
        padding: 0.75rem;
        border-radius: 8px;
        min-height: auto;
    }

    /* Mobile top bar — the app-bar pattern: primary-blue bar, buttons as
       translucent white chips (one colour family, no clash), white title,
       and a small white plate behind the logo so the artwork stays
       readable on any blue. */
    .adv-mobile-header {
        display: flex;
        align-items: center;
        padding: 0.5rem 0.75rem;
        background: var(--adv-primary);
        color: #fff;
        box-shadow: var(--adv-shadow-mobile-header);
        position: sticky;
        top: 0;
        z-index: 1000;
    }
    .adv-mobile-header .rz-text,
    .adv-mobile-header [class*="rz-text-"] { color: #fff !important; }
    .adv-mobile-header img,
    .adv-mobile-header .rz-image {
        background: transparent;
    }
    .adv-mobile-header .rz-button,
    .adv-mobile-header .adv-topbar-actions .rz-button {
        color: #fff !important;
        background: rgba(255, 255, 255, 0.16) !important;
    }
    .adv-mobile-header .rz-button:hover,
    .adv-mobile-header .adv-topbar-actions .rz-button:hover {
        color: #fff !important;
        background: rgba(255, 255, 255, 0.30) !important;
    }
    .adv-mobile-only { display: block; }
    .adv-topbar { display: none; }

    /* DataGrid: smaller font on mobile (horizontal scroll is always enabled globally) */
    .rz-datatable { font-size: 0.8rem; }

    /* Stack toolbar inputs */
    .rz-stack[style*="Horizontal"] { flex-wrap: wrap !important; }
}

/* Small mobile (≤480px) */
@media (max-width: 480px) {
    /* The action cluster outgrows tiny screens — let the header wrap. */
    .adv-mobile-header { flex-wrap: wrap; row-gap: 0.25rem; }
    .adv-content { padding: 0 0.5rem 0.5rem; }
    .adv-content > .rz-row:first-child,
    .adv-content > div:first-child { padding: 0.5rem; }
    .dash-kpi-value { font-size: 1.2rem; }
    .dash-kpi-card { padding: 0.75rem !important; }
    .dash-kpi-icon { width: 32px; height: 32px; border-radius: 8px; }
    .dash-kpi-icon .rzi,
    .dash-kpi-icon .material-icons { font-size: 16px !important; }
    .dash-card-header { flex-wrap: wrap; gap: 0.5rem; }
    .dashboard .rz-chart { min-height: 220px; }
    .dash-agenda-type { font-size: 0.6rem; padding: 0.15rem 0.35rem; }
}
