/* ============================================================================
   SPURA HUB v3 - Mobile Legacy Slice 02
   Mechanical split from mobile-ios.css; preserve load order.
   ============================================================================ */
/* List-table card layout: see mobile/tables-accessible.css */
@media (max-width: 768px) {
    .data-table.bank-transactions-table {
        table-layout: auto;
    }
    .data-table.bank-transactions-table tbody td.tx-actions .tx-actions-wrap {
        opacity: 1;
    }
    .bank-transactions-table .tx-actions {
        position: static;
        box-shadow: var(--shadow-none, none);
        text-align: left;
    }
    .bank-transactions-table .tx-amount {
        padding-right: 0;
        text-align: left;
    }

    .bank-transactions-table .tx-amount-stack {
        align-items: flex-start;
        margin-left: 0;
    }

    .bank-transactions-table .tx-amount-balance {
        align-items: flex-start;
    }
}
@media (max-width: 640px) {
    .page-content [style*="grid-template-columns:repeat(4"],
    .page-content [style*="grid-template-columns: repeat(4"],
    .page-content [style*="grid-template-columns:repeat(3"],
    .page-content [style*="grid-template-columns: repeat(3"],
    .page-content [style*="grid-template-columns:repeat(2"],
    .page-content [style*="grid-template-columns: repeat(2"],
    .page-content [style*="grid-template-columns:1fr 1fr"],
    .page-content [style*="grid-template-columns: 1fr 1fr"],
    .page-content [style*="minmax(200px"],
    .page-content [style*="minmax(220px"],
    .page-content [style*="minmax(240px"],
    .page-content [style*="minmax(260px"],
    .page-content [style*="minmax(300px"],
    .page-content [style*="minmax(320px"] {
        grid-template-columns: minmax(0, 1fr) !important;
    }
    .page-content form [style*="min-width: 200px"],
    .page-content form [style*="min-width:200px"],
    .page-content form [style*="min-width: 220px"],
    .page-content form [style*="min-width:220px"],
    .page-content form [style*="min-width: 240px"],
    .page-content form [style*="min-width:240px"],
    .page-content form [style*="min-width: 260px"],
    .page-content form [style*="min-width:260px"],
    .page-content form [style*="width:220px"],
    .page-content form [style*="max-width:150px"] {
        min-width: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    .stats-row {
        grid-template-columns: minmax(0, 1fr);
    }
    .page-header,
    .data-panel-header {
        flex-direction: column;
        align-items: stretch;
    }
    .page-header-actions .btn,
    .page-header-actions form,
    .publications-filter-actions .btn,
    .publications-toolbar .btn {
        width: 100%;
        justify-content: center;
    }
    .publications-column-selector,
    .publications-column-selector .btn {
        width: 100%;
    }
    .publications-column-selector__panel {
        position: fixed;
        top: auto;
        right: max(0.75rem, var(--safe-area-right));
        bottom: max(0.75rem, var(--safe-area-bottom));
        left: max(0.75rem, var(--safe-area-left));
        min-width: 0;
        max-height: calc(100svh - var(--safe-area-top) - var(--safe-area-bottom) - 1.5rem);
        overflow-y: auto;
    }
    @supports (height: 100dvh) {
        .publications-column-selector__panel {
            max-height: calc(100dvh - var(--safe-area-top) - var(--safe-area-bottom) - 1.5rem);
        }
    }
    .customize-page,
    .product-detail {
        padding-top: 1rem;
        padding-right: max(var(--page-padding-mobile), var(--safe-area-right));
        padding-bottom: calc(1.25rem + var(--safe-area-bottom));
        padding-left: max(var(--page-padding-mobile), var(--safe-area-left));
    }
    .customize-layout,
    .product-layout,
    .showroom-product-detail {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 1rem;
    }
    .design-controls {
        grid-template-columns: minmax(0, 1fr) !important;
    }
    .summary-sidebar,
    .gallery,
    .showroom-product-gallery {
        position: static !important;
    }
    .canvas-shell {
        min-height: 280px;
    }
    .canvas-toolbar .btn,
    .landing-hero-actions > *,
    .showroom-detail-actions .btn {
        width: 100%;
        justify-content: center;
    }
    .option-card {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
    }
    /* Sales dashboard: collapse 2-column layout to single column on mobile */
    .sales-dashboard-layout {
        grid-template-columns: minmax(0, 1fr) !important;
    }
    /* Hide webkit scrollbars on mobile */
    ::-webkit-scrollbar {
        display: none;
    }
}
/* ── Bottom navigation bar (mobile only) ───────────────────────── */
.mobile-bottom-nav {
    display: none; /* hidden by default; shown via media query */
}
.mobile-topbar-heading,
.mobile-topbar-user,
.mobile-search-close,
.mobile-search-title {
    display: none;
}

.mobile-search-heading {
    display: contents;
}
.mobile-hub-panel {
    display: none;
}
.mobile-settings-panel {
    display: none;
}
@media (max-width: 768px) {
    .mobile-hub-panel {
        display: block;
        position: fixed;
        top: 0;
        right: 0;
        bottom: calc(56px + var(--safe-area-bottom, 0px));
        left: 0;
        z-index: 101;
        background: var(--ink-900, var(--ink-950));
        color: var(--glass-white-92);
        overflow: hidden;
    }
    :root[data-theme='light'] .mobile-hub-panel,
    :root:not([data-theme='dark']) .mobile-hub-panel {
        background: var(--bg-main, var(--gray-50));
        color: var(--text-primary, var(--ink-950));
    }
    body.mobile-hub-open .mobile-hub-panel {
        background: var(--ink-900, var(--ink-950)) !important;
    }

    :root[data-theme='light'] body.mobile-hub-open .mobile-hub-panel,
    :root:not([data-theme='dark']) body.mobile-hub-open .mobile-hub-panel {
        background: var(--gray-100, var(--bg-main)) !important;
    }
    .mobile-hub-panel[hidden] {
        display: none;
    }
    .mobile-settings-panel {
        display: block;
        position: fixed;
        top: 0;
        right: 0;
        bottom: calc(56px + var(--safe-area-bottom, 0px));
        left: 0;
        z-index: 120;
        background: var(--bg-primary);
        color: var(--text-primary);
        overflow: hidden;
    }
    :root[data-theme='light'] .mobile-settings-panel,
    :root:not([data-theme='dark']) .mobile-settings-panel {
        background: var(--gray-100);
        color: var(--text-primary);
    }
    .mobile-settings-panel[hidden] {
        display: none;
    }
    body.mobile-hub-open,
    body.mobile-settings-open {
        overflow: hidden;
    }

    body.mobile-settings-open .page-content,
    body.mobile-settings-open .mobile-hub-panel,
    body.mobile-settings-open .mobile-inbox-panel {
        visibility: hidden;
    }

    .mobile-settings-panel .mas-container,
    .mobile-settings-panel .mas-body {
        background: var(--bg-primary);
    }

    :root[data-theme='light'] .mobile-settings-panel .mas-container,
    :root:not([data-theme='dark']) .mobile-settings-panel .mas-container,
    :root[data-theme='light'] .mobile-settings-panel .mas-body,
    :root:not([data-theme='dark']) .mobile-settings-panel .mas-body {
        background: var(--gray-100);
    }

    .mobile-settings-panel .mas-header {
        background: var(--bg-primary);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-none, none);
    }

    :root[data-theme='light'] .mobile-settings-panel .mas-header,
    :root:not([data-theme='dark']) .mobile-settings-panel .mas-header {
        background: var(--gray-100);
    }

    .mobile-settings-panel .mas-back {
        background: var(--bg-secondary);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: var(--shadow-none, none);
        border-color: var(--border-color);
    }

    .mobile-settings-panel .mas-card,
    .mobile-settings-panel .mas-segmented__option,
    .mobile-settings-panel .mas-action-btn,
    .mobile-settings-panel .mas-link-row {
        background: var(--bg-surface);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: var(--shadow-none, none);
        border-color: var(--border-color);
    }

    .mobile-settings-panel .mas-segmented__option.is-active {
        background: var(--glass-brand-08);
        border-color: var(--brand-500);
        color: var(--brand-600);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: var(--shadow-none, none);
    }

    :root[data-theme='dark'] .mobile-settings-panel .mas-card,
    :root[data-theme='dark'] .mobile-settings-panel .mas-segmented__option,
    :root[data-theme='dark'] .mobile-settings-panel .mas-action-btn,
    :root[data-theme='dark'] .mobile-settings-panel .mas-link-row {
        background: var(--bg-secondary);
    }
    .mhp-container {
        height: 100%;
        min-height: 100%;
        max-height: 100%;
        min-width: 0;
        display: flex;
        flex-direction: column;
        background: inherit;
        color: inherit;
    }
    .mhp-header {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 0.5rem;
        padding:
            max(calc(env(safe-area-inset-top, 0px) + 1rem), calc(var(--safe-area-top) + 1rem))
            max(1rem, var(--safe-area-right))
            0.875rem
            max(1rem, var(--safe-area-left));
        position: sticky;
        top: 0;
        z-index: 3;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-none, none);
    }

    :root[data-theme='light'] .mhp-header,
    :root:not([data-theme='dark']) .mhp-header {
        background: var(--gray-100, var(--bg-main));
        border-bottom-color: var(--border-color);
    }

    :root[data-theme='dark'] .mhp-header {
        background: var(--ink-900, var(--ink-950));
        border-bottom-color: var(--border-color);
    }
    .mhp-header__identity,
    .mhp-header__user {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        min-width: 0;
    }
    .mhp-header__identity {
        flex: 0 0 auto;
    }
    .mhp-header__user {
        flex: 1 1 auto;
        min-width: 0;
    }
    .mhp-logo {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.875rem;
        height: 2.875rem;
        flex: 0 0 auto;
        border-radius: var(--sp-radius-md);
        background: var(--bg-surface);
        border: 1px solid var(--border-color);
        box-shadow: var(--shadow-xs);
    }
    .mhp-logo__img {
        display: block;
        width: 2.1rem;
        height: 2.1rem;
        object-fit: contain;
    }
    .mhp-logo__img--dark {
        display: none;
    }
    :root[data-theme='dark'] .mhp-logo {
        background-color: var(--bg-secondary);
        border: 1px solid var(--border-color);
        box-shadow: var(--shadow-none, none);
    }
    :root[data-theme='dark'] .mhp-logo__img--light {
        display: none;
    }
    :root[data-theme='dark'] .mhp-logo__img--dark {
        display: block;
    }
    .mhp-module-name {
        color: inherit;
    }
    .mhp-user-info {
        min-width: 0;
        flex: 0 1 auto;
    }
    .mhp-user-role,
    .mhp-version,
    .mhp-section-label {
        color: var(--glass-slate-90);
    }
    :root[data-theme='light'] .mhp-user-role,
    :root:not([data-theme='dark']) .mhp-user-role,
    :root[data-theme='light'] .mhp-version,
    :root:not([data-theme='dark']) .mhp-version,
    :root[data-theme='light'] .mhp-section-label,
    :root:not([data-theme='dark']) .mhp-section-label {
        color: var(--text-muted, var(--ink-400));
    }
    .mhp-user-role {
        font-size: 0.8rem;
        line-height: 1.1;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .mhp-avatar,
    .mhp-logout-btn,
    .mhp-close,
    .mhp-settings-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.5rem;
        height: 2.5rem;
        flex: 0 0 auto;
        border-radius: var(--radius-full);
    }
    .mhp-avatar {
        background: var(--glass-brand-14);
        color: var(--brand-300, var(--brand-300));
        font-size: 1rem;
        font-weight: 800;
    }
    :root[data-theme='light'] .mhp-avatar,
    :root:not([data-theme='dark']) .mhp-avatar {
        background: rgba(var(--brand-500-rgb), 0.12);
        color: var(--brand-700, var(--brand-600));
    }
    .mhp-logout-form {
        display: contents;
    }
    .mhp-logout-btn,
    .mhp-close,
    .mhp-settings-btn {
        border: 1px solid var(--border-color);
        background: var(--bg-surface);
        color: inherit;
        cursor: pointer;
        box-shadow: var(--shadow-none, none);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    :root[data-theme='dark'] .mhp-logout-btn,
    :root[data-theme='dark'] .mhp-close,
    :root[data-theme='dark'] .mhp-settings-btn {
        background: var(--bg-secondary);
    }
    .mhp-settings-btn i {
        font-size: 1rem;
        line-height: 1;
    }
    .mhp-settings-btn {
        margin-left: auto;
        margin-right: 0.125rem;
    }
    .mas-container {
        height: 100%;
        min-height: 100%;
        display: flex;
        flex-direction: column;
        background: inherit;
        color: inherit;
    }
    .mas-header {
        display: flex;
        align-items: center;
        gap: 0.875rem;
        padding:
            max(calc(env(safe-area-inset-top, 0px) + 1rem), calc(var(--safe-area-top) + 1rem))
            max(1rem, var(--safe-area-right))
            0.875rem
            max(1rem, var(--safe-area-left));
        position: sticky;
        top: 0;
        z-index: 4;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-none, none);
    }
    .mas-back {
        width: 2.5rem;
        height: 2.5rem;
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: var(--radius-full);
        border: 1px solid var(--glass-control-border);
        background: var(--glass-control-bg);
        color: inherit;
        cursor: pointer;
        box-shadow: var(--glass-control-shadow);
        backdrop-filter: var(--glass-filter-control);
        -webkit-backdrop-filter: var(--glass-filter-control);
    }
    .mas-header-copy {
        min-width: 0;
    }
    .mas-title {
        margin: 0;
        font-size: 1.05rem;
        font-weight: 800;
        line-height: 1.2;
    }
    .mas-subtitle,
    .mas-card-copy,
    .mas-footnote,
    .mas-setting-value,
    .mas-meta-list dt {
        color: var(--glass-slate-92);
    }
    :root[data-theme='light'] .mas-subtitle,
    :root:not([data-theme='dark']) .mas-subtitle,
    :root[data-theme='light'] .mas-card-copy,
    :root:not([data-theme='dark']) .mas-card-copy,
    :root[data-theme='light'] .mas-footnote,
    :root:not([data-theme='dark']) .mas-footnote,
    :root[data-theme='light'] .mas-setting-value,
    :root:not([data-theme='dark']) .mas-setting-value,
    :root[data-theme='light'] .mas-meta-list dt,
    :root:not([data-theme='dark']) .mas-meta-list dt {
        color: var(--text-muted, var(--ink-400));
    }
    .mas-subtitle {
        margin: 0.2rem 0 0;
        font-size: 0.82rem;
        line-height: 1.35;
    }
    .mas-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 1rem max(1rem, var(--safe-area-right)) calc(1rem + var(--safe-area-bottom, 0px)) max(1rem, var(--safe-area-left));
        display: flex;
        flex-direction: column;
        gap: 0.875rem;
    }
    .mas-card {
        padding: 1rem;
        border-radius: var(--radius-xl);
        border: 1px solid var(--border-color);
        background: var(--bg-surface);
        box-shadow: var(--shadow-none, none);
    }
    .mas-card + .mas-card {
        margin-top: 0;
    }
    .mas-card-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.75rem;
        margin-bottom: 0.85rem;
    }
    .mas-card-title {
        margin: 0;
        font-size: 0.98rem;
        font-weight: 800;
        line-height: 1.2;
    }
    .mas-card-copy,
    .mas-footnote {
        margin: 0.25rem 0 0;
        font-size: 0.82rem;
        line-height: 1.4;
    }
    .mas-segmented {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .mas-segmented__option,
    .mas-action-btn,
    .mas-link-row {
        min-height: 2.9rem;
        border-radius: var(--sp-radius-md);
        font: inherit;
    }
    .mas-segmented__option {
        width: 100%;
        padding: 0.8rem 0.95rem;
        border: 1px solid var(--border-color);
        background: var(--bg-surface);
        color: inherit;
        text-align: left;
        font-size: 0.9rem;
        font-weight: 700;
        cursor: pointer;
        box-shadow: var(--shadow-none, none);
    }
    .mas-segmented__option.is-active {
        border-color: var(--brand-500);
        background: var(--glass-brand-08);
        box-shadow: var(--shadow-none, none);
        color: var(--brand-600);
    }
    .mas-setting-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        margin-bottom: 0.9rem;
    }
    .mas-setting-copy {
        min-width: 0;
        flex: 1 1 auto;
    }
    .mas-setting-title {
        font-size: 0.9rem;
        font-weight: 800;
        line-height: 1.2;
    }
    .mas-setting-value {
        margin-top: 0.22rem;
        font-size: 0.82rem;
        line-height: 1.35;
    }
    .mas-status-pill {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 4.4rem;
        min-height: 1.9rem;
        padding: 0.2rem 0.7rem;
        border-radius: var(--radius-full);
        background: var(--glass-slate-14);
        color: var(--text-muted, var(--sp-text-3));
        font-size: 0.75rem;
        font-weight: 800;
        text-align: center;
    }
    .mas-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }
    .mas-action-btn {
        padding: 0.8rem 0.95rem;
        border: 1px solid var(--glass-panel-border);
        background: var(--glass-panel-bg);
        color: inherit;
        font-size: 0.9rem;
        font-weight: 700;
        cursor: pointer;
        box-shadow: var(--glass-panel-shadow);
        backdrop-filter: var(--glass-filter-panel);
        -webkit-backdrop-filter: var(--glass-filter-panel);
    }
    .mas-action-btn--primary {
        background: var(--glass-accent-bg);
        border-color: var(--glass-accent-border);
        box-shadow: var(--glass-accent-shadow);
        color: var(--glass-accent-text, var(--brand-100));
    }
    .mas-action-btn:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }
    .mas-link-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.85rem 0.95rem;
        color: inherit;
        text-decoration: none;
        border: 1px solid var(--glass-panel-border);
        background: var(--glass-panel-bg);
        box-shadow: var(--glass-panel-shadow);
        backdrop-filter: var(--glass-filter-panel);
        -webkit-backdrop-filter: var(--glass-filter-panel);
    }
    .mas-link-copy {
        display: flex;
        flex-direction: column;
        gap: 0.16rem;
        min-width: 0;
    }
    .mas-link-copy strong {
        font-size: 0.92rem;
        line-height: 1.2;
    }
    .mas-link-copy span {
        color: var(--glass-slate-92);
        font-size: 0.8rem;
        line-height: 1.35;
    }
    :root[data-theme='light'] .mas-link-copy span,
    :root:not([data-theme='dark']) .mas-link-copy span {
        color: var(--text-muted, var(--ink-400));
    }
    .mas-meta-list {
        margin: 0;
        display: grid;
        gap: 0.7rem;
    }
    .mas-meta-list div {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 1rem;
    }
    .mas-meta-list dt,
    .mas-meta-list dd {
        margin: 0;
        font-size: 0.84rem;
        line-height: 1.35;
    }
    .mas-meta-list dd {
        color: inherit;
        text-align: right;
        font-weight: 700;
    }
    .mhp-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 1rem max(1rem, var(--safe-area-right)) calc(1rem + var(--safe-area-bottom, 0px)) max(1rem, var(--safe-area-left));
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    .mhp-work-section,
    .mhp-nav-section {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
    .mhp-section-label {
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }
    .mhp-pills {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    .mhp-pill {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        min-height: 44px;
        padding: 0.625rem 0.875rem;
        border-radius: var(--radius-full);
        color: inherit;
        text-decoration: none;
        background: var(--bg-surface);
        border: 1px solid var(--border-color);
        box-shadow: var(--shadow-none, none);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
    .mhp-pill__icon,
    .mhp-pill__count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .mhp-pill__icon {
        width: 1.5rem;
        height: 1.5rem;
    }
    .mhp-pill__icon .app-icon {
        font-size: 0.95rem;
    }
    .mhp-pill__label,
    .mhp-pill__count {
        font-size: 0.82rem;
        font-weight: 700;
    }
    .mhp-pill__count {
        min-width: 1.5rem;
        height: 1.5rem;
        padding: 0 0.4rem;
        border-radius: var(--radius-full);
        background: var(--glass-white-12);
    }
    .mhp-pill--green {
        background: var(--glass-success-12);
        border-color: var(--glass-success-18);
        color: var(--green-300);
    }
    .mhp-pill--red {
        background: var(--glass-danger-12);
        border-color: var(--glass-danger-18);
        color: var(--danger-300);
    }
    :root[data-theme='light'] .mhp-pill--green,
    :root:not([data-theme='dark']) .mhp-pill--green {
        color: var(--green-700);
    }
    :root[data-theme='light'] .mhp-pill--red,
    :root:not([data-theme='dark']) .mhp-pill--red {
        color: var(--red-700);
    }
    .mhp-module-grid {
        display: flex;
        flex-direction: column;
        gap: 0.625rem;
    }
    .mhp-module-group {
        display: flex;
        flex-direction: column;
        gap: 0.45rem;
        position: relative;
    }
    .mhp-module-row {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto auto;
        align-items: center;
        gap: 0.875rem;
        min-height: 52px;
        padding: 0.72rem 0.95rem;
        border-radius: var(--sp-radius-md);
        border: 1px solid var(--border-color);
        background: var(--bg-surface);
        color: inherit;
        text-decoration: none;
        box-shadow: var(--shadow-none, none);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
    .mhp-module-row--button {
        width: 100%;
        appearance: none;
        -webkit-appearance: none;
        font: inherit;
        text-align: left;
        cursor: pointer;
    }
    .mhp-module-row--active {
        border-color: var(--glass-accent-border);
        background: var(--glass-accent-bg);
        box-shadow: var(--glass-accent-shadow);
    }
    .mhp-module-group.is-open .mhp-module-row--button {
        border-color: var(--glass-accent-border);
        background: var(--glass-accent-bg);
        box-shadow: var(--glass-accent-shadow);
    }
    .mhp-module-children {
        display: none;
        flex-direction: column;
        gap: 0;
        position: absolute;
        top: calc(100% - 0.3rem);
        right: 0;
        left: 3.35rem;
        z-index: 12;
        padding: 0.55rem 0.85rem;
        border-radius: 1.35rem;
        background: var(--glass-floating-bg);
        border: 1px solid var(--glass-floating-border);
        box-shadow: var(--glass-floating-shadow);
        -webkit-backdrop-filter: var(--glass-filter-floating);
        backdrop-filter: var(--glass-filter-floating);
        overflow: hidden;
    }
    .mhp-module-group.is-open .mhp-module-children {
        display: flex;
    }
    .mhp-module-child {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        min-height: 3rem;
        padding: 0.85rem 0.15rem;
        color: var(--text-primary, var(--sp-bg-0));
        text-decoration: none;
        background: transparent;
        border: none;
        border-bottom: 1px solid var(--glass-white-08);
        font-size: 0.92rem;
        font-weight: 650;
        line-height: 1.25;
    }
    .mhp-module-child:last-child {
        border-bottom: none;
    }
    .mhp-module-child.active {
        color: var(--brand-300, var(--brand-300));
        background: var(--glass-brand-08);
    }
    :root[data-theme='light'] .mhp-module-child,
    :root:not([data-theme='dark']) .mhp-module-child {
        color: var(--text-primary, var(--ink-950));
        border-bottom-color: var(--glass-ink-08);
    }
    :root[data-theme='light'] .mhp-module-child.active,
    :root:not([data-theme='dark']) .mhp-module-child.active {
        color: var(--brand-700, var(--brand-600));
        background: rgba(var(--brand-500-rgb), 0.08);
    }
    .mhp-child-chevron {
        flex: 0 0 auto;
        color: var(--text-muted, var(--sp-text-3));
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 0.75rem;
    }
    .mhp-module-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.5rem;
        height: 2.5rem;
        border-radius: var(--radius-none, 0).875rem;
        flex: 0 0 auto;
        background: var(--glass-slate-12);
        color: var(--glass-white-92);
    }
    .mhp-module-icon .app-icon {
        font-size: 1rem;
    }
    :root[data-theme='light'] .mhp-module-icon,
    :root:not([data-theme='dark']) .mhp-module-icon {
        color: var(--text-primary, var(--ink-950));
    }

    .mhp-module-icon--identity,
    .mhp-module-icon--general,
    .mhp-module-icon--sistema,
    .mhp-module-icon--admin,
    .mhp-module-icon--acceso-rapido,
    .mhp-module-icon--inicio {
        background: color-mix(in srgb, var(--purple-600) 16%, transparent);
        color: var(--brand-300);
    }

    .mhp-module-icon--ventas,
    .mhp-module-icon--sales {
        background: color-mix(in srgb, var(--success-500) 16%, transparent);
        color: var(--success-500);
    }

    .mhp-module-icon--compras {
        background: color-mix(in srgb, var(--warning-500) 16%, transparent);
        color: var(--warning-500);
    }

    .mhp-module-icon--produccion {
        background: color-mix(in srgb, var(--info-500) 16%, transparent);
        color: var(--info-500);
    }

    .mhp-module-icon--logistica,
    .mhp-module-icon--assignments,
    .mhp-module-icon--logistics {
        background: color-mix(in srgb, var(--brand-400) 16%, transparent);
        color: var(--brand-300);
    }

    .mhp-module-icon--productos {
        background: color-mix(in srgb, var(--warning-600) 16%, transparent);
        color: var(--warning-500);
    }

    .mhp-module-icon--marketing {
        background: color-mix(in srgb, var(--danger-500) 16%, transparent);
        color: var(--danger-300);
    }

    .mhp-module-icon--plataformas {
        background: color-mix(in srgb, var(--info-600) 16%, transparent);
        color: var(--info-500);
    }

    .mhp-module-icon--contabilidad,
    .mhp-module-icon--accounting {
        background: color-mix(in srgb, var(--purple-600) 16%, transparent);
        color: var(--purple-600);
    }

    .mhp-module-icon--finanzas,
    .mhp-module-icon--finance {
        background: color-mix(in srgb, var(--success-600) 16%, transparent);
        color: var(--success-500);
    }

    .mhp-module-icon--publico,
    .mhp-module-icon--contracts,
    .mhp-module-icon--showroom,
    .mhp-module-icon--tunea {
        background: color-mix(in srgb, var(--brand-500) 16%, transparent);
        color: var(--brand-400);
    }

    :root[data-theme='light'] .mhp-module-icon--identity,
    :root:not([data-theme='dark']) .mhp-module-icon--identity,
    :root[data-theme='light'] .mhp-module-icon--general,
    :root:not([data-theme='dark']) .mhp-module-icon--general,
    :root[data-theme='light'] .mhp-module-icon--sistema,
    :root:not([data-theme='dark']) .mhp-module-icon--sistema,
    :root[data-theme='light'] .mhp-module-icon--admin,
    :root:not([data-theme='dark']) .mhp-module-icon--admin,
    :root[data-theme='light'] .mhp-module-icon--acceso-rapido,
    :root:not([data-theme='dark']) .mhp-module-icon--acceso-rapido,
    :root[data-theme='light'] .mhp-module-icon--inicio,
    :root:not([data-theme='dark']) .mhp-module-icon--inicio {
        color: var(--purple-600);
    }

    :root[data-theme='light'] .mhp-module-icon--ventas,
    :root:not([data-theme='dark']) .mhp-module-icon--ventas,
    :root[data-theme='light'] .mhp-module-icon--sales,
    :root:not([data-theme='dark']) .mhp-module-icon--sales {
        color: var(--success-600);
    }

    :root[data-theme='light'] .mhp-module-icon--compras,
    :root:not([data-theme='dark']) .mhp-module-icon--compras {
        color: var(--warning-600);
    }

    :root[data-theme='light'] .mhp-module-icon--produccion,
    :root:not([data-theme='dark']) .mhp-module-icon--produccion {
        color: var(--info-600);
    }

    :root[data-theme='light'] .mhp-module-icon--logistica,
    :root:not([data-theme='dark']) .mhp-module-icon--logistica,
    :root[data-theme='light'] .mhp-module-icon--assignments,
    :root:not([data-theme='dark']) .mhp-module-icon--assignments,
    :root[data-theme='light'] .mhp-module-icon--logistics,
    :root:not([data-theme='dark']) .mhp-module-icon--logistics {
        color: var(--brand-600);
    }

    :root[data-theme='light'] .mhp-module-icon--productos,
    :root:not([data-theme='dark']) .mhp-module-icon--productos {
        color: var(--warning-600);
    }

    :root[data-theme='light'] .mhp-module-icon--marketing,
    :root:not([data-theme='dark']) .mhp-module-icon--marketing {
        color: var(--danger-600);
    }

    :root[data-theme='light'] .mhp-module-icon--plataformas,
    :root:not([data-theme='dark']) .mhp-module-icon--plataformas {
        color: var(--info-600);
    }

    :root[data-theme='light'] .mhp-module-icon--contabilidad,
    :root:not([data-theme='dark']) .mhp-module-icon--contabilidad,
    :root[data-theme='light'] .mhp-module-icon--accounting,
    :root:not([data-theme='dark']) .mhp-module-icon--accounting {
        color: var(--purple-600);
    }

    :root[data-theme='light'] .mhp-module-icon--finanzas,
    :root:not([data-theme='dark']) .mhp-module-icon--finanzas,
    :root[data-theme='light'] .mhp-module-icon--finance,
    :root:not([data-theme='dark']) .mhp-module-icon--finance {
        color: var(--success-600);
    }

    :root[data-theme='light'] .mhp-module-icon--publico,
    :root:not([data-theme='dark']) .mhp-module-icon--publico,
    :root[data-theme='light'] .mhp-module-icon--contracts,
    :root:not([data-theme='dark']) .mhp-module-icon--contracts,
    :root[data-theme='light'] .mhp-module-icon--showroom,
    :root:not([data-theme='dark']) .mhp-module-icon--showroom,
    :root[data-theme='light'] .mhp-module-icon--tunea,
    :root:not([data-theme='dark']) .mhp-module-icon--tunea {
        color: var(--brand-700);
    }

    .mhp-module-icon i {
        font-size: 1rem;
        line-height: 1;
    }



    .mhp-module-name {
        min-width: 0;
        font-size: 0.94rem;
        font-weight: 700;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }
    .mhp-module-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 1.5rem;
        height: 1.5rem;
        padding: 0 0.4rem;
        border-radius: var(--radius-full);
        background: var(--glass-danger-16);
        color: var(--danger-400, var(--red-400));
        font-size: 0.75rem;
        font-weight: 700;
    }
    .mhp-module-badge--count {
        background: var(--glass-slate-14);
        color: var(--text-muted, var(--sp-text-3));
    }
    .mhp-module-chevron {
        color: var(--glass-slate-90);
        flex: 0 0 auto;
        transition: transform var(--transition-fast);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 0.8rem;
    }
    .mhp-module-group.is-open .mhp-module-row--button > .mhp-module-chevron {
        transform: rotate(90deg);
    }
    :root[data-theme='light'] .mhp-module-chevron,
    :root:not([data-theme='dark']) .mhp-module-chevron {
        color: var(--text-muted, var(--ink-400));
    }
    .mhp-version {
        margin-top: 0.25rem;
        padding-bottom: 0.25rem;
        font-size: 0.78rem;
        text-align: center;
    }
    .mobile-topbar-user {
        cursor: pointer;
    }
    .mobile-topbar-user:active {
        transform: scale(0.97);
    }
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 98; /* below sidebar (100) but above content */
        height: calc(56px + var(--safe-area-bottom, 0px));
        padding-bottom: var(--safe-area-bottom, 0px);
        background: var(--ink-900, var(--ink-950));
        border-top: 1px solid var(--glass-white-08);
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
        align-items: stretch;
        justify-content: space-around;
        transition: transform var(--transition-fast), opacity 0.18s ease, background-color 0.15s ease, border-color 0.15s ease;
    }
    :root[data-theme='light'] .mobile-bottom-nav,
    :root:not([data-theme='dark']) .mobile-bottom-nav {
        background: var(--bg-surface, var(--bg-surface));
        border-top-color: var(--border-color, var(--sp-bg-2));
    }
    .mobile-bottom-nav__item {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        flex: 1;
        gap: 3px;
        padding: 0 0.25rem;
        background: transparent;
        border: none;
        color: var(--glass-white-75);
        font-size: 11px;
        font-weight: 500;
        letter-spacing: 0.01em;
        text-decoration: none;
        cursor: pointer;
        transition: color var(--transition-fast) ease, background-color 0.15s ease;
        -webkit-tap-highlight-color: transparent;
        min-height: 56px;
        border-radius: var(--radius-none, 0).875rem;
    }
    :root[data-theme='light'] .mobile-bottom-nav__item,
    :root:not([data-theme='dark']) .mobile-bottom-nav__item {
        color: var(--text-muted, var(--ink-400));
    }
    .mobile-bottom-nav__item .app-icon {
        width: 22px;
        height: 22px;
        flex-shrink: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 1.125rem;
    }
    .mobile-bottom-nav__item:hover,
    .mobile-bottom-nav__item:active {
        background: var(--glass-white-04);
        color: var(--brand-400, var(--brand-500));
    }
    :root[data-theme='light'] .mobile-bottom-nav__item:hover,
    :root:not([data-theme='dark']) .mobile-bottom-nav__item:hover,
    :root[data-theme='light'] .mobile-bottom-nav__item:active,
    :root:not([data-theme='dark']) .mobile-bottom-nav__item:active {
        color: var(--brand-600, var(--brand-500));
    }
    .mobile-bottom-nav__item.active {
        background: transparent;
        color: var(--brand-500);
    }
    :root[data-theme='light'] .mobile-bottom-nav__item.active,
    :root:not([data-theme='dark']) .mobile-bottom-nav__item.active {
        background: transparent;
        color: var(--brand-600, var(--brand-500));
    }
    .mobile-bottom-nav__icon-wrap {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 1.75rem;
        height: 1.75rem;
        flex: 0 0 auto;
    }
    .mobile-bottom-nav__badge {
        position: absolute;
        top: -0.3rem;
        right: -0.55rem;
        min-width: 1.2rem;
        height: 1.2rem;
        padding: 0 0.3rem;
        border-radius: var(--radius-full);
        background: var(--danger-500, var(--danger-500));
        color: var(--bg-surface);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 0.625rem;
        font-weight: 700;
        line-height: 1;
        box-shadow: 0 0 0 2px var(--ink-900, var(--ink-950));
        z-index: 3;
        pointer-events: none;
    }
    :root[data-theme='light'] .mobile-bottom-nav__badge,
    :root:not([data-theme='dark']) .mobile-bottom-nav__badge {
        box-shadow: 0 0 0 2px var(--bg-surface, var(--bg-surface));
    }
    body.native-keyboard-visible .mobile-bottom-nav,
    body.mobile-visual-keyboard-visible .mobile-bottom-nav {
        transform: translateY(calc(100% + var(--safe-area-bottom, 0px)));
        opacity: 0;
        pointer-events: none;
    }

    /* Clearance for the fixed bottom nav + optional on-screen keyboard */
    :root {
        --mobile-keyboard-inset-effective: max(
            var(--native-keyboard-height, 0px),
            var(--mobile-visual-keyboard-inset, 0px)
        );
        --mobile-page-nav-clearance: calc(
            var(--mobile-bottom-nav-offset, 56px) + var(--safe-area-bottom, 0px) + 1.25rem
        );
    }

    .page-content {
        padding-bottom: var(--mobile-page-nav-clearance);
        scroll-padding-bottom: var(--mobile-page-nav-clearance);
    }

    body.native-keyboard-visible:not(.cmd-palette-active) .page-content,
    body.mobile-visual-keyboard-visible:not(.cmd-palette-active) .page-content {
        padding-bottom: max(
            1.25rem,
            calc(var(--mobile-keyboard-inset-effective) + var(--safe-area-bottom, 0px) + 1rem)
        );
        scroll-padding-bottom: max(
            1.25rem,
            calc(var(--mobile-keyboard-inset-effective) + var(--safe-area-bottom, 0px) + 1rem)
        );
    }

    body.native-keyboard-visible .card-footer,
    body.mobile-visual-keyboard-visible .card-footer,
    body.native-keyboard-visible .modal-footer,
    body.mobile-visual-keyboard-visible .modal-footer {
        scroll-margin-bottom: max(
            1rem,
            calc(var(--mobile-keyboard-inset-effective) + var(--safe-area-bottom, 0px))
        );
    }

    /* Also pad the technician checklist sticky bar */
    body.technician-checklist-page .page-content {
        padding-bottom: calc(var(--mobile-bottom-nav-offset, 56px) + var(--safe-area-bottom, 0px) + 4rem);
    }
}

/* ============================================================================
   iOS GROUP / CELL — settings-style navigation list
   Used for mobile-only sections (e.g., admin/integrations connections tab).
   ============================================================================ */

.ios-group {
    margin-bottom: 1.5rem;
}
.ios-group__label {
    padding: 0 1rem 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary, var(--ink-400));
}
.ios-group__cells {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-surface, var(--sp-bg-1));
    border: 1px solid var(--border-default, var(--glass-ink-08));
}
:root[data-theme='light'] .ios-group__cells,
:root:not([data-theme='dark']) .ios-group__cells {
    background: var(--glass-white-90, #fff);
    border-color: var(--glass-ink-08);
}

.ios-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-primary, var(--ink-50));
    border-bottom: 1px solid var(--border-default, var(--glass-ink-06));
    transition: background var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    min-height: 52px;
}
.ios-cell:last-child {
    border-bottom: none;
}
.ios-cell:active {
    background: var(--glass-white-06);
}
:root[data-theme='light'] .ios-cell:active,
:root:not([data-theme='dark']) .ios-cell:active {
    background: var(--bg-secondary, var(--sp-bg-0));
}

.ios-cell__leading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}
.ios-cell__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}
.ios-cell__label {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary, var(--ink-50));
    min-width: 0;
}
.ios-cell__sublabel {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-secondary, var(--ink-400));
}
.ios-cell__trailing {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
    color: var(--text-secondary, var(--ink-400));
}
.ios-cell__chevron {
    width: 14px;
    height: 14px;
    opacity: 0.4;
}

/* ── Admin integrations: show ios-group on mobile, content-grid on desktop ── */
.admin-integrations-ios-list {
    display: none;
}
@media (max-width: 768px) {
    .admin-integrations-connections-grid {
        display: none !important;
    }
    .admin-integrations-ios-list {
        display: block !important;
    }
}
