/* ============================================================
   WorkGlass App UI — production design system (from mockup)
   ============================================================ */

:root {
    --brand: #5b4fe8;
    --brand-hover: #4a3fd4;
    --brand-soft: #eeecfd;
    --brand-ink: #3d36a8;
    --ink: #1a1d26;
    --muted: #6b7285;
    --muted-2: #9aa0b0;
    --line: #e6e8ef;
    --line-strong: #d5d8e3;
    --canvas: #f3f4f8;
    --surface: #ffffff;
    --success: #15803d;
    --success-soft: #e8f7ee;
    --warn: #c2410c;
    --warn-soft: #fff1e7;
    --danger: #b91c1c;
    --danger-soft: #fdecec;
    --info: #0369a1;
    --info-soft: #e8f4fb;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --shadow: 0 1px 2px rgba(26, 29, 38, 0.04), 0 8px 24px rgba(26, 29, 38, 0.04);
    --shadow-sm: 0 1px 2px rgba(26, 29, 38, 0.05);
    --sidebar-w: 248px;
    --header-h: 64px;
    --footer-h: 44px;
    --font: "Plus Jakarta Sans", "Segoe UI", sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, monospace;

    /* Back-compat aliases used by earlier app-ui rules */
    --wg-brand: var(--brand);
    --wg-brand-soft: var(--brand-soft);
    --wg-ink: var(--ink);
    --wg-muted: var(--muted);
    --wg-border: var(--line);
    --wg-surface: var(--surface);
    --wg-canvas: var(--canvas);
    --wg-radius: var(--radius);
    --wg-radius-sm: var(--radius-sm);
    --wg-shadow: var(--shadow-sm);
}

/* ---- Global auth chrome ---- */
body.g-sidenav-show {
    font-family: var(--font) !important;
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

body.g-sidenav-show.bg-gray-200 {
    background: var(--canvas) !important;
}

body.g-sidenav-show .main-content {
    font-family: var(--font);
}

.wg-app-shell {
    display: flex;
    min-height: 100vh;
    background: var(--canvas);
}

.wg-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    min-height: 100vh;
    margin-left: var(--sidebar-w);
    background: var(--canvas);
}

/* Tools screens: fill viewport; scroll inside panels, not the page */
.wg-main:has(.premium-tariff-admin),
.wg-main:has(.premium-calculator-wizard),
.wg-main:has(.glass-chat-root) {
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

.wg-main:has(.premium-tariff-admin) .wg-main-body,
.wg-main:has(.premium-calculator-wizard) .wg-main-body,
.wg-main:has(.glass-chat-root) .wg-main-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.wg-main:has(.premium-tariff-admin) .wg-main-body > div,
.wg-main:has(.premium-calculator-wizard) .wg-main-body > div,
.wg-main:has(.glass-chat-root) .wg-main-body > div {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.wg-main:has(.premium-tariff-admin) .wg-footer,
.wg-main:has(.premium-calculator-wizard) .wg-footer,
.wg-main:has(.glass-chat-root) .wg-footer {
    display: none;
}

@media (max-width: 1199.98px) {
    .wg-main {
        margin-left: 0;
    }
}

.wg-main-body {
    flex: 1 0 auto;
    padding: 0.35rem 0 0;
}

.wg-topbar.navbar-main {
    height: auto;
    min-height: var(--header-h);
    margin: 0 !important;
    padding: 1rem 1.5rem !important;
    background: rgba(243, 244, 248, 0.9) !important;
    backdrop-filter: blur(8px);
    border-bottom: 1px solid transparent;
    border-radius: 0 !important;
    position: sticky;
    top: 0;
    z-index: 15;
    box-shadow: none !important;
    display: flex;
    align-items: flex-start;
}

.wg-topbar > .container-fluid {
    min-height: unset;
    align-items: flex-start;
}

.wg-topbar-start {
    min-width: 0;
    padding-top: 0.15rem;
}

.wg-sidenav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0.35rem !important;
    margin-top: 0.1rem;
}

.wg-topbar .page-title,
.breadcrumb-title {
    margin: 0 !important;
    color: var(--ink) !important;
    font-size: 1.25rem !important;
    font-weight: 720 !important;
    letter-spacing: -0.03em;
    font-family: var(--font) !important;
}

.wg-page-sub,
.page-sub {
    margin: 0.15rem 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 500;
}

.wg-footer.footer {
    height: var(--footer-h);
    min-height: var(--footer-h);
    display: flex;
    align-items: center;
    margin-top: auto;
    padding: 0 1.5rem !important;
    border-top: 1px solid var(--line);
    background: var(--canvas);
    flex-shrink: 0;
}

.wg-footer .copyright,
.wg-footer .text-muted {
    color: var(--muted-2) !important;
    font-size: 0.75rem !important;
}

.wg-footer a {
    color: var(--brand);
}

/* ---- Sidebar (mockup look over file-system tree) ---- */
.file-system-sidebar,
.file-system-sidebar.navbar,
#sidenav-main.file-system-sidebar {
    width: var(--sidebar-w) !important;
    max-width: var(--sidebar-w) !important;
    background: var(--surface) !important;
    border-right: 1px solid var(--line) !important;
    box-shadow: none !important;
    font-family: var(--font) !important;
    padding: 1rem 0.85rem !important;
}

.file-system-header {
    background: transparent !important;
    border-bottom: 1px solid var(--line) !important;
    padding: 0.35rem 0.55rem 1rem !important;
    margin-bottom: 0.85rem;
}

.file-system-header::after {
    display: none !important;
}

.file-system-header .navbar-brand {
    gap: 0.65rem;
    margin: 0 !important;
}

.file-system-header .navbar-brand-img {
    width: 34px !important;
    max-width: 34px !important;
    height: 34px !important;
    object-fit: contain;
}

.file-system-header .navbar-brand::after {
    content: none !important;
    display: none !important;
}

.file-system-sidebar .tree-children .tree-node::before,
.file-system-sidebar .tree-children .tree-node.active::before {
    display: none !important;
    content: none !important;
}

.file-system-sidebar .tree-children {
    padding-left: 0.5rem !important;
    margin-left: 0.35rem !important;
    border-left: 1px solid var(--line);
}

.file-system-sidebar .tree-node {
    border-radius: var(--radius-sm);
    color: var(--muted) !important;
    font-weight: 550;
    font-size: 0.9rem;
    padding: 0.55rem 0.7rem !important;
}

.file-system-sidebar .tree-node:hover {
    background: #f6f7fb !important;
    color: var(--ink) !important;
    border-radius: var(--radius-sm);
}

.file-system-sidebar .tree-node.active {
    background: var(--brand-soft) !important;
    color: var(--brand-ink) !important;
    border-radius: var(--radius-sm);
}

.file-system-sidebar .tree-icon {
    color: inherit !important;
    opacity: 0.9;
}

.file-system-sidebar .tree-label {
    color: inherit !important;
}

.file-system-sidebar .sidebar-logout,
.file-system-sidebar .btn-logout,
.file-system-sidebar [wire\:click*="logout"] .btn,
.file-system-sidebar .livewire-logout .btn {
    width: 100%;
    justify-content: center;
}

/* ---- Content / cards ---- */
.main-content .container-fluid.py-4,
.main-content .container-fluid.px-4 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.25rem !important;
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
}

.main-content .card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: none;
    background: var(--surface);
}

.main-content .card.shadow-sm,
.main-content .card.my-4.shadow-sm {
    box-shadow: none !important;
}

.main-content .card:has(table.table) {
    box-shadow: none !important;
}

.main-content .card.my-4 {
    margin-top: 0.75rem !important;
    margin-bottom: 1rem !important;
}

.main-content .card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--line);
    padding: 0.85rem 1.15rem;
}

.main-content .card .card-header.pb-0 {
    padding-bottom: 0.85rem !important;
    border-bottom: 0;
}

.main-content .container {
    max-width: 1100px;
}

/* ---- User chip ---- */
.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.3rem 0.55rem 0.3rem 0.3rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
    max-width: 280px;
}

.user-chip__avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), #7c74f0);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-chip__meta {
    min-width: 0;
    line-height: 1.15;
}

.user-chip__name {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-chip__role {
    display: block;
    font-size: 0.68rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-title-duplicate {
    display: none !important;
}

/* ---- Button system (map MD/Bootstrap to mockup) ---- */
.main-content .btn,
.wg-main .btn,
.file-system-sidebar .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    height: 38px;
    padding: 0 0.95rem;
    margin: 0 !important;
    border-radius: var(--radius-sm) !important;
    border: 1px solid transparent;
    font-weight: 650;
    font-size: 0.84rem;
    font-family: var(--font);
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.main-content .btn.btn-sm,
.wg-main .btn.btn-sm {
    height: 32px;
    padding: 0 0.7rem;
    font-size: 0.78rem;
    border-radius: var(--radius-xs) !important;
}

.main-content .btn.bg-gradient-primary,
.main-content .btn.btn-primary,
.wg-main .btn.bg-gradient-primary,
.wg-main .btn.btn-primary {
    background: var(--brand) !important;
    background-image: none !important;
    color: #fff !important;
    border-color: transparent !important;
}

.main-content .btn.bg-gradient-primary:hover,
.main-content .btn.btn-primary:hover,
.wg-main .btn.bg-gradient-primary:hover,
.wg-main .btn.btn-primary:hover {
    background: var(--brand-hover) !important;
    color: #fff !important;
}

.main-content .btn.btn-outline-primary,
.main-content .btn.btn-outline-secondary,
.main-content .btn.btn-secondary,
.wg-main .btn.btn-outline-primary,
.wg-main .btn.btn-outline-secondary,
.wg-main .btn.btn-secondary {
    background: var(--surface) !important;
    border-color: var(--line-strong) !important;
    color: var(--ink) !important;
}

.main-content .btn.btn-outline-primary:hover,
.main-content .btn.btn-outline-secondary:hover,
.main-content .btn.btn-secondary:hover,
.wg-main .btn.btn-outline-primary:hover,
.wg-main .btn.btn-outline-secondary:hover,
.wg-main .btn.btn-secondary:hover {
    background: #f7f8fc !important;
    color: var(--ink) !important;
}

.main-content .btn.btn-danger,
.main-content .btn.bg-gradient-danger,
.wg-main .btn.btn-danger {
    background: var(--danger-soft) !important;
    background-image: none !important;
    color: var(--danger) !important;
    border-color: #f3c4c4 !important;
}

.main-content .btn.btn-link,
.main-content .btn.btn-ghost,
.wg-main .btn.btn-link,
.wg-main .btn.btn-ghost {
    background: transparent !important;
    color: var(--muted) !important;
    border-color: transparent !important;
}

.main-content .btn.btn-link:hover,
.main-content .btn.btn-ghost:hover,
.wg-main .btn.btn-link:hover,
.wg-main .btn.btn-ghost:hover {
    background: #f0f1f6 !important;
    color: var(--ink) !important;
}

.main-content .btn.btn-success,
.wg-main .btn.btn-success {
    background: var(--success-soft) !important;
    background-image: none !important;
    color: var(--success) !important;
    border-color: #bfe5cd !important;
}

/* KPI / metric card icons — style the BOX only, never the glyph itself.
   Material Dashboard uses .icon-shape i { position:relative; top:11px } / .icon-lg i { top:31% }
   which must be fully reset. Material Icons Round / FA glyphs also sit optically high in their
   em/viewBox, so a small translateY nudge is required for true visual centering. */
.main-content .card-header-icon.icon-shape,
.wg-main .card-header-icon.icon-shape {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    background: var(--brand-soft) !important;
    color: var(--brand) !important;
    box-shadow: none !important;
    border-radius: 10px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0;
    overflow: visible;
    position: relative;
    line-height: 0 !important;
}

.main-content .card .card-header.p-3.pt-2 {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.main-content .card-header-icon.icon-shape i,
.main-content .card-header-icon.icon-lg i,
.main-content .card-header-icon .material-icons,
.main-content .card-header-icon .dashboard-material-icon,
.wg-main .card-header-icon.icon-shape i,
.wg-main .card-header-icon.icon-lg i,
.wg-main .card-header-icon .material-icons,
.wg-main .card-header-icon .dashboard-material-icon {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    /* Optical center: Material Icons Round paints slightly high in the em-square */
    transform: translateY(1px) !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    font-size: 22px !important;
    line-height: 1 !important;
    overflow: visible !important;
    opacity: 1 !important;
    color: var(--brand) !important;
    text-align: center;
}

.main-content .card .card-header.p-3.pt-2 .mt-3.pt-1 {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.main-content .card .card-header.p-3.pt-2 p.text-sm {
    font-size: 0.72rem !important;
    font-weight: 650;
    color: var(--muted) !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.15rem !important;
}

.main-content .card .card-header.p-3.pt-2 h4 {
    font-size: 1.25rem !important;
    font-weight: 750;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.main-content .card-footer.p-3 {
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.8rem;
}

.attachments-dropzone,
.wg-dropzone {
    border: 1.5px dashed var(--line-strong) !important;
    border-radius: var(--radius);
    background: #fafbfe !important;
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--muted);
}

.form-card .card-header.bg-primary,
.upload-form-header {
    background: var(--brand-soft) !important;
    color: var(--brand-ink) !important;
    border-bottom: 1px solid var(--line);
}

.btn-split {
    padding-right: 0.35rem;
    gap: 0.25rem;
}

.btn-split .split {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-left: 0.2rem;
    border-left: 1px solid rgba(255, 255, 255, 0.28);
    padding-left: 0.35rem;
}

/* ---- Toolbars ---- */
.page-toolbar,
.wg-toolbar,
.list-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    margin: 0 0 0.85rem;
    padding: 0;
}

.page-toolbar__actions,
.wg-toolbar__actions,
.list-toolbar__actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
    flex: 0 1 auto;
    min-width: 0;
}

/* Tip 5: date range chip matches toolbar button height + vertical center */
.page-toolbar__actions {
    align-items: center !important;
}

.page-toolbar__actions .dropdown {
    display: inline-flex !important;
    align-items: center;
    height: 38px;
}

.page-toolbar__actions .badge.bg-secondary,
.page-toolbar .toolbar-date-badge,
.toolbar-date-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.4rem;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    padding: 0 0.95rem !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: var(--radius-sm) !important;
    font-family: var(--font);
    font-size: 0.84rem !important;
    font-weight: 650 !important;
    letter-spacing: 0.01em;
    line-height: 1 !important;
    white-space: nowrap;
    box-sizing: border-box !important;
    vertical-align: middle;
    text-transform: none !important;
}

.page-toolbar__actions .btn,
.page-toolbar__actions .btn.btn-primary,
.page-toolbar__actions .btn-split {
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    margin: 0 !important;
    align-self: center;
}

.page-toolbar__actions .badge.bg-secondary .material-icons,
.page-toolbar .toolbar-date-badge .material-icons,
.toolbar-date-badge .material-icons,
.page-toolbar__actions .badge.bg-secondary .filter-icon-inline,
.page-toolbar .toolbar-date-badge .filter-icon-inline,
.toolbar-date-badge .filter-icon-inline {
    font-size: 18px !important;
    line-height: 1 !important;
    width: 18px;
    height: 18px;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

@media (max-width: 575.98px) {
    .page-toolbar__actions,
    .wg-toolbar__actions,
    .list-toolbar__actions {
        flex-wrap: wrap;
        width: 100%;
    }
}

.list-toolbar__search,
.wg-toolbar__search {
    position: relative;
    flex: 1 1 240px;
    max-width: 320px;
    margin: 0;
}

.list-toolbar__search .form-control,
.wg-toolbar__search .form-control {
    height: 40px;
    padding: 0 2.25rem 0 0.9rem;
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--line-strong) !important;
    font-size: 0.875rem;
    background: var(--surface) !important;
}

.list-toolbar__search .form-control:focus,
.wg-toolbar__search .form-control:focus {
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.list-toolbar__search .search-icon {
    position: absolute;
    right: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted-2);
    pointer-events: none;
}

.list-toolbar__actions .form-control,
.list-toolbar__actions .form-select:not(.selectize-dropdown):not(.selectize-control),
.audit-user-filter:not(.selectize-dropdown):not(.selectize-control) {
    height: 40px;
    width: auto;
    min-width: 160px;
    max-width: 220px;
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--line-strong) !important;
    background: var(--surface) !important;
    font-size: 0.85rem;
    padding: 0 0.75rem !important;
}

.audit-user-filter-wrap {
    min-width: 180px;
    max-width: 220px;
    flex: 0 0 200px;
}

.audit-user-filter-wrap .selectize-control {
    width: 100% !important;
}

.audit-user-filter-wrap .selectize-input {
    min-width: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

.list-toolbar__actions input[type="date"] {
    min-width: 140px;
    max-width: 150px;
    flex: 0 0 145px;
    color: var(--ink);
    color-scheme: light;
}

/* ---- Fields / selects with custom chevron ----
   IMPORTANT: Selectize copies .form-select onto BOTH .selectize-control and
   .selectize-dropdown — never apply field chrome to those wrappers. */
.main-content .form-control.border,
.main-content .form-control:not(.selectize-dropdown):not(.selectize-control):not(.selectize-input),
.main-content .form-select:not(.selectize-dropdown):not(.selectize-control),
.wg-main .form-control:not(.selectize-dropdown):not(.selectize-control):not(.selectize-input),
.wg-main .form-select:not(.selectize-dropdown):not(.selectize-control) {
    height: 40px;
    padding-left: 0.9rem !important;
    padding-right: 0.9rem !important;
    border-radius: var(--radius-sm) !important;
    border-color: var(--line-strong) !important;
    font-family: var(--font);
    font-size: 0.86rem;
}

.main-content textarea.form-control,
.wg-main textarea.form-control {
    height: auto;
    min-height: 96px;
}

.main-content .form-control:not(.selectize-dropdown):not(.selectize-control):not(.selectize-input):focus,
.main-content .form-select:not(.selectize-dropdown):not(.selectize-control):focus,
.wg-main .form-control:not(.selectize-dropdown):not(.selectize-control):not(.selectize-input):focus,
.wg-main .form-select:not(.selectize-dropdown):not(.selectize-control):focus {
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 3px var(--brand-soft);
}

/* Login fields: single border, no soft ring */
.main-content .login-form .login-field__input.form-control:focus,
.login-view .login-form .login-field__input.form-control:focus {
    border-color: #5b4fe8 !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Tip 1: outline login fields handled in login.css (single continuous border) */
.main-content .input-group.input-group-outline .form-label:before,
.main-content .input-group.input-group-outline .form-label:after {
    display: none !important;
    content: none !important;
}

.main-content select.form-select,
.main-content select.form-control,
.wg-main select.form-select,
.wg-main select.form-control,
.list-toolbar__actions select:not(.selectized) {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.4rem !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7285' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 16px !important;
    background-color: var(--surface) !important;
}

.main-content .form-select.form-select-sm:not(.selectize-dropdown):not(.selectize-control),
.wg-main .form-select.form-select-sm:not(.selectize-dropdown):not(.selectize-control) {
    height: 40px !important;
    min-height: 40px !important;
    padding-top: 0.45rem !important;
    padding-bottom: 0.45rem !important;
    padding-left: 0.9rem !important;
    padding-right: 2.4rem !important;
    font-size: 0.86rem !important;
}

/* Global Selectize control reset — wins over page-local .form-select chrome */
.selectize-control.form-select,
.selectize-control.form-control,
.form-select.selectize-control,
.form-control.selectize-control {
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    overflow: visible !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

.main-content .selectize-input,
.wg-main .selectize-input {
    min-height: 40px !important;
    height: auto !important;
    padding: 0.45rem 2.25rem 0.45rem 0.9rem !important;
    border: 1px solid var(--line-strong) !important;
    border-radius: var(--radius-sm) !important;
    background: var(--surface) !important;
    background-image: none !important;
    box-shadow: none !important;
    font-family: var(--font);
    font-size: 0.86rem;
    line-height: 1.35 !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.import-models-select {
    margin-bottom: 1.25rem !important;
}

.import-models-select .selectize-control {
    margin-bottom: 0.75rem !important;
}

.main-content .selectize-input.focus,
.wg-main .selectize-input.focus {
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 3px var(--brand-soft) !important;
}

.main-content .selectize-input input,
.wg-main .selectize-input input {
    font-size: 0.86rem !important;
    line-height: 1.35 !important;
}

.main-content .selectize-dropdown,
.wg-main .selectize-dropdown,
.main-content .selectize-dropdown.form-select,
.wg-main .selectize-dropdown.form-select,
.main-content .selectize-dropdown.form-control,
.wg-main .selectize-dropdown.form-control {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 0 !important;
    margin-top: 4px !important;
    border: 1px solid var(--line-strong) !important;
    border-radius: var(--radius-sm) !important;
    background: #fff !important;
    background-color: #fff !important;
    background-image: none !important;
    box-shadow: 0 10px 28px rgba(26, 29, 38, 0.14) !important;
    z-index: 1080 !important;
    overflow: hidden !important;
    color: var(--ink) !important;
}

.main-content .selectize-dropdown-content,
.wg-main .selectize-dropdown-content {
    max-height: 260px !important;
    overflow-y: auto !important;
    background: #fff !important;
    padding: 0.35rem 0 !important;
}

.main-content .selectize-dropdown .option,
.main-content .selectize-dropdown .optgroup-header,
.main-content .selectize-dropdown .create,
.main-content .selectize-dropdown .no-results,
.wg-main .selectize-dropdown .option,
.wg-main .selectize-dropdown .optgroup-header,
.wg-main .selectize-dropdown .create,
.wg-main .selectize-dropdown .no-results {
    height: auto !important;
    min-height: 0 !important;
    padding: 0.55rem 0.95rem !important;
    line-height: 1.35 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    background: transparent !important;
    background-image: none !important;
    color: var(--ink) !important;
    border: 0 !important;
    border-radius: 0 !important;
}

.main-content .selectize-dropdown .option.active,
.main-content .selectize-dropdown .option:hover,
.wg-main .selectize-dropdown .option.active,
.wg-main .selectize-dropdown .option:hover {
    background: #f3f4f8 !important;
    color: var(--ink) !important;
}

.main-content .selectize-dropdown .option.selected,
.wg-main .selectize-dropdown .option.selected {
    background: var(--brand-soft) !important;
    color: var(--brand-ink) !important;
}

/* ---- Filters ---- */
.filters-section,
.wg-filters {
    background: var(--surface) !important;
    border: 1px solid var(--line) !important;
    border-radius: var(--radius) !important;
    margin-bottom: 0.85rem !important;
    padding: 1rem 1.1rem 1.15rem;
    box-shadow: var(--shadow-sm);
}

.filters-section .form-label,
.wg-filters .form-label {
    display: block;
    margin-bottom: 0.5rem !important;
    font-size: 0.78rem;
    font-weight: 650;
    color: var(--muted);
}

.filters-section .row.g-3,
.wg-filters .row.g-3 {
    --bs-gutter-x: 1.15rem;
    --bs-gutter-y: 1.15rem;
}

.filters-section .row + .row,
.filters-section .d-flex.flex-wrap.gap-2 + .row,
.filters-section .mb-3 + .row,
.filters-section .mb-4 + .row {
    margin-top: 0.35rem;
}

.filters-section .btn-group-presets,
.filters-section .quick-filter-tabs,
.payment-quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.filters-section.is-collapsed {
    padding: 0 !important;
}

.filters-section.is-collapsed > .filters-section__header {
    border-bottom: 0 !important;
    margin-bottom: 0 !important;
    padding: 0.65rem 0.9rem !important;
}

.filters-section__header,
.wg-filters__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.15rem 0 0.85rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: 0.85rem;
}

.filters-section.is-collapsed .filters-section__header {
    margin-bottom: 0;
    padding-bottom: 0;
}

.filters-section__title,
.wg-filters__title {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.filters-section__title .material-icons {
    font-size: 18px;
    color: var(--muted);
}

.card > .card-header.filters-card-header {
    padding: 0.65rem 1rem;
}

.card.is-filters-collapsed > .card-header.filters-card-header {
    border-bottom: 0;
}

.wg-filters-grid,
.filters-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (max-width: 1100px) {
    .wg-filters-grid,
    .filters-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .wg-filters-grid,
    .filters-grid {
        grid-template-columns: 1fr;
    }
}

.wg-seg,
.seg {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.25rem;
    background: #f1f2f7;
    border-radius: var(--radius-sm);
}

.wg-seg button,
.wg-seg .seg-btn,
.seg button,
.seg .seg-btn {
    border: 0;
    background: transparent;
    height: 32px;
    padding: 0 0.75rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 650;
    color: var(--muted);
    cursor: pointer;
}

.wg-seg button.active,
.wg-seg .seg-btn.active,
.wg-seg button.is-active,
.wg-seg .seg-btn.is-active,
.seg button.active,
.seg .seg-btn.active,
.seg button.is-active,
.seg .seg-btn.is-active {
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}

.hint {
    font-size: 0.75rem;
    color: var(--muted);
}

/* ---- Tables ---- */
.main-content .table thead th {
    font-size: 0.7rem !important;
    letter-spacing: 0.05em;
    color: var(--muted) !important;
    opacity: 1 !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    border-bottom: 1px solid var(--line) !important;
    padding: 0.7rem 0.9rem;
    background: #f8f9fc;
    white-space: nowrap;
}

.main-content .table tbody tr {
    transition: background-color 0.12s ease;
}

.main-content .table tbody tr:hover {
    background-color: #fafbfe;
}

.main-content .table tbody td {
    padding: 0.75rem 0.9rem;
    border-color: #eef0f5;
    vertical-align: middle;
    font-size: 0.86rem;
    color: var(--ink) !important;
    opacity: 1 !important;
}

.main-content .table tbody td.text-secondary,
.main-content .table tbody .text-secondary,
.main-content .table tbody .opacity-7,
.main-content .table tbody td.opacity-7,
.main-content .table tbody a.text-secondary {
    color: var(--ink) !important;
    opacity: 1 !important;
}

.main-content .table thead th.text-secondary,
.main-content .table thead .opacity-7 {
    color: var(--muted) !important;
    opacity: 1 !important;
}

.font-monospace,
.mono {
    font-family: var(--mono) !important;
    font-size: 0.8rem;
}

.role-badge,
.wg-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    height: 24px;
    padding: 0 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.role-badge,
.badge-brand,
.wg-badge.badge-brand {
    background: var(--brand-soft);
    color: var(--brand-ink);
}

.badge-neutral,
.wg-badge.badge-neutral,
.badge.badge-neutral {
    background: #eef0f5 !important;
    color: #4b5568 !important;
    border: 0 !important;
    box-shadow: none !important;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
}

.badge-success,
.wg-badge.badge-success,
.badge-status-success {
    background: var(--success-soft);
    color: var(--success);
}

.badge-warn,
.wg-badge.badge-warn,
.badge-status-warn {
    background: var(--warn-soft);
    color: var(--warn);
}

.badge-danger,
.wg-badge.badge-danger,
.badge-status-danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.badge-info,
.wg-badge.badge-info {
    background: var(--info-soft);
    color: var(--info);
}

.wg-dot,
.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge-status {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.badge-status.overdue {
    background: var(--danger-soft);
    color: var(--danger);
}

/* ---- Pagination (rectangular) ---- */
.main-content .pagination,
.wg-main .pagination {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #f3f4f8;
    padding: 0.2rem;
    border-radius: var(--radius-sm);
    margin: 0;
}

.main-content .pagination .page-item .page-link,
.wg-main .pagination .page-item .page-link,
.main-content .pagination .page-item span.page-link,
.wg-main .pagination .page-item span.page-link,
.main-content .pagination .page-item button.page-link,
.wg-main .pagination .page-item button.page-link {
    min-width: 32px !important;
    width: auto;
    height: 32px !important;
    min-height: 32px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border: 0 !important;
    background: transparent !important;
    border-radius: 6px !important;
    color: var(--muted) !important;
    font-size: 0.8rem;
    font-weight: 650;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 0.55rem !important;
    line-height: 1 !important;
    box-sizing: border-box;
    flex-shrink: 0;
}

.main-content .pagination .page-item.active .page-link,
.wg-main .pagination .page-item.active .page-link {
    background: var(--surface) !important;
    color: var(--ink) !important;
    box-shadow: var(--shadow-sm) !important;
}

.main-content .pagination .page-item.disabled .page-link,
.wg-main .pagination .page-item.disabled .page-link,
.main-content .pagination .page-item.disabled span.page-link,
.wg-main .pagination .page-item.disabled span.page-link {
    min-width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
    opacity: 0.55 !important;
    color: var(--muted) !important;
    pointer-events: none;
}

.main-content .pagination .page-item .page-link:hover,
.wg-main .pagination .page-item .page-link:hover {
    background: #e8eaf1 !important;
    color: var(--ink) !important;
}

.wg-pager,
.pager {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--line);
    width: 100%;
}

.wg-pager > *,
.pager > * {
    width: 100%;
    min-width: 0;
}

.wg-pager > nav,
.wg-pager > nav.d-flex,
.wg-pager nav.d-flex {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start !important;
    gap: 0.75rem;
}

.wg-pager nav > .d-flex.justify-content-between,
.wg-pager nav > div.d-flex,
.wg-pager nav > .d-none.flex-sm-fill,
.wg-pager nav > .d-none.d-sm-flex,
.wg-pager nav > .justify-content-sm-between {
    width: 100% !important;
    flex: 1 1 100% !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.85rem !important;
}

.wg-pager nav p,
.wg-pager .small.text-muted,
.wg-pager p.small {
    margin: 0 !important;
    font-size: 0.8rem !important;
    color: var(--muted) !important;
    white-space: nowrap;
}

.wg-pager__meta,
.pager-meta {
    font-size: 0.8rem;
    color: var(--muted);
    white-space: nowrap;
}

/* Hide Laravel meta when a custom meta sibling exists (legacy) */
.wg-pager:has(.wg-pager__meta) nav > .d-flex > div:first-child:has(p),
.wg-pager:has(.wg-pager__meta) nav > .d-none.d-sm-flex > div:first-child:has(p) {
    display: none !important;
}

.wg-pager:has(.wg-pager__meta) nav > .d-flex,
.wg-pager:has(.wg-pager__meta) nav > .d-none.d-sm-flex {
    justify-content: flex-start !important;
}

/* Keep meta + controls as one left cluster (wide tables) */
.wg-pager .d-flex.justify-content-center:has(.pagination),
.wg-pager .justify-content-sm-between,
.wg-pager .justify-content-between {
    width: 100%;
    justify-content: flex-start !important;
    gap: 0.85rem !important;
}

/* Also catch bare Laravel links() outside wg-pager */
.wg-main nav.d-flex.justify-content-between,
.main-content nav.d-flex.justify-content-between {
    justify-content: flex-start !important;
    gap: 0.85rem;
}

.wg-main nav .justify-content-sm-between,
.main-content nav .justify-content-sm-between {
    justify-content: flex-start !important;
    gap: 0.85rem !important;
}

/* ---- Floating bulk bar ---- */
.floating-bulk-action-bar,
.float-bar {
    --bulk-bar-left: calc(var(--sidebar-w) + 1rem);
    position: fixed !important;
    left: var(--bulk-bar-left) !important;
    right: 1rem !important;
    bottom: max(1rem, calc(env(safe-area-inset-bottom, 0px) + 0.75rem)) !important;
    transform: none !important;
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 0 !important;
    background: var(--surface-inverse, #1a1d26) !important;
    color: var(--on-inverse, #fff) !important;
    border: 1px solid var(--inverse-line, transparent) !important;
    border-radius: 1rem !important;
    box-shadow: 0 12px 32px rgba(26, 29, 38, 0.28) !important;
    backdrop-filter: none !important;
    z-index: 1080 !important;
    overflow: visible !important;
}

.floating-bulk-action-bar .floating-bulk-panel,
.floating-bulk-action-bar .floating-bulk-card {
    overflow: visible !important;
}

@media (max-width: 1199.98px) {
    .floating-bulk-action-bar,
    .float-bar {
        --bulk-bar-left: 1rem;
    }
}

.floating-bulk-chip {
    display: none !important;
}

.floating-bulk-scrim {
    display: none !important;
}

.floating-bulk-panel,
.floating-bulk-card {
    display: block;
    min-width: 0;
}

.floating-bulk-sheet-handle {
    display: none;
}

.floating-bulk-action-bar .bulk-action-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    width: 100%;
    min-width: 0;
    padding: 0.6rem 0.75rem 0.6rem 1.1rem !important;
    overflow: visible;
}

.floating-bulk-action-bar .bulk-action-left {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.floating-bulk-action-bar .bulk-action-meta {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.floating-bulk-action-bar .bulk-action-right {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    justify-content: flex-end;
    gap: 0.45rem;
    min-width: 0;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.floating-bulk-action-bar .bulk-action-right::-webkit-scrollbar {
    height: 4px;
}

.floating-bulk-action-bar .selected-count,
.float-bar strong {
    font-size: 0.84rem !important;
    font-weight: 600 !important;
    color: var(--on-inverse, #fff) !important;
    white-space: nowrap;
}

.floating-bulk-action-bar .selected-subtitle {
    font-size: 0.72rem;
    font-weight: 500;
    color: color-mix(in srgb, var(--on-inverse, #fff) 55%, transparent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 18rem;
}

.floating-bulk-close {
    display: none;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.floating-bulk-close:hover,
.floating-bulk-close:focus {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.bulk-action-group-label {
    display: none;
    width: 100%;
    margin: 0.15rem 0 0.05rem;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.42);
}

.floating-bulk-action-bar .bulk-action-btn.is-primary,
.floating-bulk-action-bar .bulk-action-btn.is-primary:link,
.floating-bulk-action-bar .bulk-action-btn.is-primary:visited,
.floating-bulk-action-bar a.bulk-action-btn.is-primary,
.floating-bulk-action-bar button.bulk-action-btn.is-primary {
    background: var(--on-inverse, #fff) !important;
    background-image: none !important;
    border-color: transparent !important;
    color: var(--surface-inverse, #1a1d26) !important;
}

.floating-bulk-action-bar .bulk-action-btn.is-primary i,
.floating-bulk-action-bar .bulk-action-btn.is-primary span:not(.badge),
.floating-bulk-action-bar .bulk-action-btn.is-primary svg,
.floating-bulk-action-bar .bulk-action-btn.is-primary:hover i,
.floating-bulk-action-bar .bulk-action-btn.is-primary:hover span:not(.badge),
.floating-bulk-action-bar .bulk-action-btn.is-primary:hover svg {
    color: var(--surface-inverse, #1a1d26) !important;
    fill: var(--surface-inverse, #1a1d26) !important;
}

.floating-bulk-action-bar .bulk-action-btn.is-primary:hover,
.floating-bulk-action-bar .bulk-action-btn.is-primary:focus,
.floating-bulk-action-bar .bulk-action-btn.is-primary:focus-visible,
.floating-bulk-action-bar .bulk-action-btn.is-primary:active {
    background: color-mix(in srgb, var(--on-inverse, #fff) 88%, var(--surface-inverse, #1a1d26)) !important;
    border-color: transparent !important;
    color: var(--surface-inverse, #1a1d26) !important;
}

/* Default dark glass buttons — override material-dashboard white pills */
.floating-bulk-action-bar .bulk-action-btn,
.floating-bulk-action-bar .bulk-action-btn:link,
.floating-bulk-action-bar .bulk-action-btn:visited,
.floating-bulk-action-bar .bulk-action-btn:hover,
.floating-bulk-action-bar .bulk-action-btn:focus,
.floating-bulk-action-bar .bulk-action-btn:focus-visible,
.floating-bulk-action-bar .bulk-action-btn:active,
.floating-bulk-action-bar a.bulk-action-btn,
.floating-bulk-action-bar button.bulk-action-btn,
.floating-bulk-action-bar .btn,
.floating-bulk-action-bar .btn:hover,
.floating-bulk-action-bar .btn:focus,
.floating-bulk-action-bar .btn:active,
.floating-bulk-action-bar .btn:focus-visible,
.float-bar .btn,
.float-bar .btn:hover,
.float-bar .btn:focus,
.float-bar .btn:active {
    height: 34px !important;
    flex: 0 0 auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.4rem !important;
    padding: 0 0.85rem !important;
    border-radius: 999px !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em;
    text-transform: uppercase !important;
    text-decoration: none !important;
    box-shadow: none !important;
    transform: none !important;
    margin: 0 !important;
    background: color-mix(in srgb, var(--on-inverse, #fff) 10%, transparent) !important;
    background-image: none !important;
    border: 1px solid color-mix(in srgb, var(--on-inverse, #fff) 18%, transparent) !important;
    color: var(--on-inverse, #fff) !important;
    filter: none !important;
    outline: none !important;
    opacity: 1 !important;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap !important;
}

.floating-bulk-action-bar .bulk-action-btn i,
.floating-bulk-action-bar .bulk-action-btn span:not(.badge),
.floating-bulk-action-bar .bulk-action-btn svg,
.floating-bulk-action-bar .bulk-action-btn:hover i,
.floating-bulk-action-bar .bulk-action-btn:hover span:not(.badge),
.floating-bulk-action-bar .bulk-action-btn:hover svg,
.floating-bulk-action-bar .bulk-action-btn:focus i,
.floating-bulk-action-bar .bulk-action-btn:focus span:not(.badge),
.floating-bulk-action-bar .bulk-action-btn:active i,
.floating-bulk-action-bar .bulk-action-btn:active span:not(.badge),
.floating-bulk-action-bar .bulk-action-btn:active svg {
    color: var(--on-inverse, #fff) !important;
    fill: var(--on-inverse, #fff) !important;
}

.floating-bulk-action-bar .bulk-action-btn:hover,
.floating-bulk-action-bar .bulk-action-btn:focus,
.floating-bulk-action-bar .bulk-action-btn:focus-visible,
.floating-bulk-action-bar .bulk-action-btn:active,
.floating-bulk-action-bar .btn:hover,
.floating-bulk-action-bar .btn:focus,
.floating-bulk-action-bar .btn:active {
    background: color-mix(in srgb, var(--on-inverse, #fff) 18%, transparent) !important;
    background-image: none !important;
    border-color: color-mix(in srgb, var(--on-inverse, #fff) 28%, transparent) !important;
    color: var(--on-inverse, #fff) !important;
}

.floating-bulk-action-bar .bulk-action-btn.btn-danger,
.floating-bulk-action-bar .bulk-action-btn.delete-btn,
.floating-bulk-action-bar .btn-danger,
.floating-bulk-action-bar .delete-btn,
.floating-bulk-action-bar .delete-btn:hover,
.floating-bulk-action-bar .delete-btn:focus,
.floating-bulk-action-bar .delete-btn:active,
.floating-bulk-action-bar .delete-btn:focus-visible {
    background: #ef4444 !important;
    background-image: none !important;
    border-color: transparent !important;
    color: #fff !important;
}

.floating-bulk-action-bar .delete-btn:hover,
.floating-bulk-action-bar .delete-btn:focus,
.floating-bulk-action-bar .delete-btn:active {
    background: #dc2626 !important;
}

.floating-bulk-action-bar .bulk-action-btn.documents-btn {
    padding-right: 0.85rem !important;
}

/*
 * Phone + phone-landscape: chip → sheet.
 * iPhone landscape is ~874px wide, so max-width alone is not enough —
 * also match short landscape viewports (max-height).
 */
@media (max-width: 767.98px), (orientation: landscape) and (max-height: 520px) {
    .floating-bulk-action-bar:has(.floating-bulk-chip),
    .float-bar:has(.floating-bulk-chip) {
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        bottom: 0 !important;
        width: 100% !important;
        max-width: none !important;
        height: 0 !important;
        overflow: visible !important;
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        pointer-events: none !important;
    }

    .floating-bulk-action-bar:has(.floating-bulk-chip).is-open {
        top: 0 !important;
        height: 100% !important;
        pointer-events: auto !important;
    }

    .floating-bulk-action-bar:not(:has(.floating-bulk-chip)),
    .float-bar:not(:has(.floating-bulk-chip)) {
        left: max(0.75rem, env(safe-area-inset-left, 0px)) !important;
        right: max(0.75rem, env(safe-area-inset-right, 0px)) !important;
        width: auto !important;
        max-width: none !important;
        bottom: max(0.75rem, calc(env(safe-area-inset-bottom, 0px) + 0.65rem)) !important;
        border-radius: 1.15rem !important;
    }

    .floating-bulk-action-bar:not(:has(.floating-bulk-chip)) .bulk-action-content {
        flex-direction: column;
        align-items: stretch;
        gap: 0.55rem;
        padding: 0.7rem 0.75rem !important;
    }

    .floating-bulk-action-bar:not(:has(.floating-bulk-chip)) .bulk-action-right {
        max-width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
    }

    .floating-bulk-chip {
        pointer-events: auto !important;
        display: inline-flex !important;
        align-items: center;
        gap: 0.55rem;
        position: fixed !important;
        left: 50%;
        bottom: max(0.75rem, calc(env(safe-area-inset-bottom, 0px) + 0.65rem));
        transform: translateX(-50%);
        z-index: 1081;
        border: 0;
        background: var(--ink) !important;
        color: #fff !important;
        border-radius: 999px;
        padding: 0.65rem 1rem 0.65rem 0.65rem;
        box-shadow: 0 12px 32px rgba(26, 29, 38, 0.4);
        font: inherit;
        font-size: 0.82rem;
        font-weight: 700;
        cursor: pointer;
        white-space: nowrap;
    }

    .floating-bulk-chip__count {
        min-width: 24px;
        height: 24px;
        border-radius: 999px;
        background: var(--brand);
        color: #fff;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 0.72rem;
        font-weight: 700;
    }

    .floating-bulk-chip__chev {
        opacity: 0.7;
        font-size: 0.72rem;
    }

    .floating-bulk-action-bar.is-open .floating-bulk-chip {
        display: none !important;
    }

    .floating-bulk-action-bar:has(.floating-bulk-chip) .floating-bulk-panel {
        display: none;
        position: absolute;
        inset: 0;
        z-index: 1;
    }

    .floating-bulk-action-bar.is-open .floating-bulk-panel {
        display: block !important;
    }

    .floating-bulk-action-bar:has(.floating-bulk-chip) .floating-bulk-scrim {
        display: block !important;
        position: absolute;
        inset: 0;
        z-index: 1;
        border: 0;
        padding: 0;
        margin: 0;
        background: rgba(15, 17, 23, 0.48);
        cursor: pointer;
        pointer-events: auto !important;
    }

    .floating-bulk-action-bar:has(.floating-bulk-chip) .floating-bulk-card {
        display: block !important;
        position: absolute;
        left: max(0.65rem, env(safe-area-inset-left, 0px));
        right: max(0.65rem, env(safe-area-inset-right, 0px));
        bottom: max(0.55rem, calc(env(safe-area-inset-bottom, 0px) + 0.45rem));
        z-index: 2;
        max-height: min(78vh, calc(100% - 1rem));
        overflow: auto;
        -webkit-overflow-scrolling: touch;
        background: var(--ink) !important;
        color: #fff !important;
        border-radius: 1.35rem;
        box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
        pointer-events: auto !important;
    }

    .floating-bulk-action-bar:has(.floating-bulk-chip) .bulk-action-content {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
        padding: 0.85rem 0.8rem 0.95rem !important;
    }

    .floating-bulk-action-bar:has(.floating-bulk-chip) .bulk-action-left {
        width: 100%;
        justify-content: space-between;
        align-items: flex-start;
    }

    .floating-bulk-action-bar:has(.floating-bulk-chip) .floating-bulk-close {
        display: inline-flex !important;
    }

    .floating-bulk-action-bar:has(.floating-bulk-chip) .bulk-action-group-label {
        display: block;
    }

    .floating-bulk-action-bar:has(.floating-bulk-chip) .bulk-action-right {
        flex-direction: column;
        align-items: stretch;
        flex-wrap: nowrap !important;
        justify-content: flex-start;
        gap: 0.4rem;
        max-width: none;
        overflow: visible;
    }

    .floating-bulk-action-bar:has(.floating-bulk-chip) .bulk-action-btn,
    .floating-bulk-action-bar:has(.floating-bulk-chip) .btn {
        width: 100% !important;
        height: 44px !important;
        justify-content: flex-start !important;
        border-radius: 12px !important;
        font-size: 0.78rem !important;
        padding: 0 0.9rem !important;
        pointer-events: auto !important;
    }

    .floating-bulk-sheet-handle {
        display: block;
        width: 36px;
        height: 4px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.22);
        margin: 0.15rem auto 0.35rem;
    }

    body:has(.floating-bulk-action-bar) .main-content,
    body:has(.floating-bulk-action-bar) .wg-main {
        padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* Phone landscape: right-docked side sheet + 2-col actions */
    @media (orientation: landscape) {
        .floating-bulk-action-bar:has(.floating-bulk-chip) .floating-bulk-card {
            left: auto;
            right: max(0.55rem, env(safe-area-inset-right, 0px));
            width: min(420px, 58vw);
            bottom: max(0.45rem, env(safe-area-inset-bottom, 0px));
            max-height: calc(100% - 0.9rem);
        }

        .floating-bulk-chip {
            left: auto;
            right: max(0.75rem, env(safe-area-inset-right, 0px));
            transform: none;
            bottom: max(0.55rem, calc(env(safe-area-inset-bottom, 0px) + 0.45rem));
        }

        .floating-bulk-sheet-handle {
            display: none;
        }

        .floating-bulk-action-bar:has(.floating-bulk-chip) .bulk-action-right {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.35rem;
        }

        .floating-bulk-action-bar:has(.floating-bulk-chip) .bulk-action-right .bulk-action-group-label,
        .floating-bulk-action-bar:has(.floating-bulk-chip) .bulk-action-right .clear-btn,
        .floating-bulk-action-bar:has(.floating-bulk-chip) .bulk-action-right .delete-btn,
        .floating-bulk-action-bar:has(.floating-bulk-chip) .bulk-action-right .view-btn,
        .floating-bulk-action-bar:has(.floating-bulk-chip) .bulk-action-right .is-primary {
            grid-column: 1 / -1;
        }
    }
}

/* ---- KPI cards ---- */
.wg-kpi,
.metric-card-modern {
    border-radius: var(--radius);
}

.wg-kpi {
    padding: 1rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.wg-kpi__icon,
.kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand);
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0;
    line-height: 0 !important;
    overflow: visible;
}

.wg-kpi__icon i,
.wg-kpi__icon .svg-inline--fa,
.kpi-icon i,
.kpi-icon .svg-inline--fa {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    /* FA/Material glyphs sit optically high — nudge down for visual center */
    transform: translateY(1px) !important;
    color: var(--brand) !important;
    display: block !important;
}

.metric-card-modern .card-header-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.wg-kpi__label,
.kpi-label,
.policy-metric-label {
    font-size: 0.72rem;
    font-weight: 650;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.wg-kpi__value,
.kpi-value,
.policy-metric-value {
    font-size: 1.25rem;
    font-weight: 750;
    letter-spacing: -0.03em;
    margin-top: 0.15rem;
    font-variant-numeric: tabular-nums;
}

.metric-card-modern .card-header {
    border-bottom: 0;
}

.metric-card-modern .card-header-icon {
    background: var(--brand-soft) !important;
    box-shadow: none !important;
}

.wg-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem; }
.wg-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.85rem; }
.wg-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.85rem; }
.wg-grid-5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.85rem; }

@media (max-width: 1200px) {
    .wg-grid-5 { grid-template-columns: repeat(3, 1fr); }
    .wg-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .wg-grid-2,
    .wg-grid-3,
    .wg-grid-4,
    .wg-grid-5 { grid-template-columns: 1fr; }
}

/* ---- Forms & tabs ---- */
.form-card .card-header {
    font-size: 1rem;
    font-weight: 650;
    color: var(--ink);
}

.wg-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem 1.25rem;
}

@media (max-width: 991.98px) {
    .wg-form-grid {
        grid-template-columns: 1fr;
    }
}

.wg-form-grid .form-span-2 {
    grid-column: 1 / -1;
}

.main-content .nav-tabs {
    border-bottom: 1px solid var(--line);
    gap: 0.25rem;
}

.main-content .nav-tabs .nav-link {
    border: 0;
    border-radius: 0;
    color: var(--muted);
    font-weight: 650;
    font-size: 0.86rem;
    padding: 0.7rem 0.9rem;
    background: transparent;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.main-content .nav-tabs .nav-link.active {
    color: var(--brand);
    background: transparent;
    box-shadow: none;
    border-bottom-color: var(--brand);
}

/* ---- Dropzone / empty ---- */
.wg-dropzone,
.org-logo-dropzone,
.dropzone {
    border: 1.5px dashed var(--line-strong) !important;
    border-radius: var(--radius);
    background: #fafbfe !important;
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--muted);
}

.wg-empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--muted);
}

.wg-empty-state__icon {
    font-size: 2.5rem;
    opacity: 0.45;
    margin-bottom: 0.75rem;
}

/* ---- Display money / date ---- */
.display-money {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.display-money--positive { color: var(--success); }
.display-money--warning { color: var(--warn); }
.display-money--muted { color: var(--muted); }
.display-money--negative { color: var(--danger); }
.display-date { white-space: nowrap; }

.alert-session-flash { border: 0; }
.alert-session-flash .material-icons { vertical-align: middle; }

.policy-data-table { min-width: 1100px; }
.policy-data-table .table-select-checkbox { width: 18px; height: 18px; accent-color: var(--brand); }
.policy-data-table .table-select-label { font-size: 10px; }
.policy-data-table .date-col,
.policy-data-table .money-col { white-space: nowrap; }

.filter-icon-xs { font-size: 14px; }
.filter-icon-sm { font-size: 16px; }
.filter-icon-md { font-size: 20px; }
.filter-icon-inline { font-size: 15px; vertical-align: middle; }

.sortable-col,
.sortable-th { cursor: pointer; }

.table-responsive-x {
    overflow-x: auto;
    max-width: 100%;
    scrollbar-width: thin;
    scrollbar-color: #c9ceda transparent;
}

.table-responsive-x::-webkit-scrollbar {
    height: 8px;
}

.table-responsive-x::-webkit-scrollbar-thumb {
    background: #c9ceda;
    border-radius: 999px;
}

.chart-filters {
    display: flex !important;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1.15rem 1.35rem;
    grid-template-columns: none;
}

.chart-filters .filter-field {
    flex: 1 1 180px;
    min-width: 160px;
    max-width: 260px;
}

.chart-filters .filter-field .form-label {
    display: block !important;
    margin-bottom: 0.65rem !important;
    font-size: 0.78rem;
    font-weight: 650;
    color: var(--muted);
}

.chart-filters .filter-field .form-select:not(.selectize-dropdown):not(.selectize-control),
.chart-filters .filter-field .form-control:not(.selectize-dropdown):not(.selectize-control):not(.selectize-input) {
    height: 42px !important;
    padding: 0.6rem 2.5rem 0.6rem 1.1rem !important;
    border: 1px solid var(--line-strong) !important;
    border-radius: var(--radius-sm) !important;
    background-color: var(--surface) !important;
    line-height: 1.25 !important;
    text-indent: 0 !important;
}

.chart-filters .selectize-control,
.chart-filters .selectize-control.form-select,
.chart-filters .selectize-control.form-control {
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    overflow: visible !important;
}

.chart-filters .selectize-input {
    min-height: 42px !important;
    height: auto !important;
    padding: 0.55rem 2.25rem 0.55rem 0.9rem !important;
    border: 1px solid var(--line-strong) !important;
    border-radius: var(--radius-sm) !important;
    background: var(--surface) !important;
    line-height: 1.25 !important;
}

.chart-filters .filter-field--hidden {
    display: none !important;
}

.chart-filters .filter-field--action {
    flex: 0 0 48px;
    min-width: 48px;
    max-width: 48px;
    margin-left: 0.25rem;
}

.chart-filters .filter-field--action .btn {
    height: 42px;
    width: 48px;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Quick date presets: even gaps */
.quick-date-presets,
.filters-section .btn-group-presets,
.date-preset-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.wg-callout {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-radius: var(--radius);
    background: var(--brand-soft);
    border: 1px solid rgba(91, 79, 232, 0.18);
    color: var(--brand-ink);
}

.wg-callout i {
    margin-top: 0.15rem;
    color: var(--brand);
}

.wg-callout p {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.45;
}

.report-stat-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.report-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    background: #f3f4f8;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 650;
}

.report-stat strong {
    color: var(--ink);
    font-weight: 750;
}

.report-stat--brand {
    background: var(--brand-soft);
    color: var(--brand-ink);
}

.report-stat--danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.payment-meta-date {
    flex: 0 0 auto;
    white-space: nowrap;
}

.chart-canvas-lg { max-height: 400px; }
.chart-canvas-md { max-height: 300px; }

.main-content .chart {
    position: relative;
    width: 100%;
}

.main-content .chart-canvas {
    width: 100% !important;
    max-width: 100%;
}

@media (max-width: 991.98px) {
    .main-content .chart {
        min-height: 220px;
    }

    .main-content .chart-canvas {
        min-height: 220px !important;
        height: 220px !important;
    }
}

@media (max-width: 575.98px) {
    .main-content .chart {
        min-height: 260px;
    }

    .main-content .chart-canvas {
        min-height: 260px !important;
        height: 260px !important;
    }
}

.types-search {
    min-width: 220px;
    max-width: 280px;
}

.types-category-filter {
    min-width: 160px;
    max-width: 200px;
}

.types-confirm-modal { background: transparent; }
.types-confirm-modal .modal-content {
    border: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.portfolio-stat-value.display-money {
    font-size: 17px;
    font-weight: 700;
    color: var(--ink);
}

@media (max-width: 576px) {
    .portfolio-stat-value.display-money {
        font-size: 14px;
    }
}

.soft-card .card-header .btn .material-icons {
    font-size: 16px;
    vertical-align: middle;
}

.check,
input[type="checkbox"] {
    accent-color: var(--brand);
}

/* ---- Audit ---- */
.audit-user-filter {
    min-width: 180px;
    max-width: 220px;
}

.audit-view-btn {
    white-space: nowrap;
}

.audit-summary {
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--ink);
    background: #f8fafc !important;
    border-color: var(--line) !important;
}

.audit-changes-table .audit-old-value {
    color: var(--muted);
}

.audit-changes-table .audit-new-value {
    color: var(--ink);
    font-weight: 600;
}

.wg-alert {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--info-soft);
    color: var(--info);
    font-size: 0.86rem;
    border: 1px solid #cfe6f5;
}

.row-actions {
    display: flex;
    gap: 0.35rem;
    justify-content: flex-end;
}

/* ---- Force mockup shell widths over file-system-sidebar.css ---- */
aside.file-system-sidebar,
aside#sidenav-main.file-system-sidebar,
.file-system-sidebar.navbar.navbar-vertical,
#sidenav-main.file-system-sidebar {
    width: var(--sidebar-w) !important;
    min-width: var(--sidebar-w) !important;
    max-width: var(--sidebar-w) !important;
}

.g-sidenav-show .main-content,
.g-sidenav-show .wg-main.main-content {
    margin-left: var(--sidebar-w) !important;
}

@media (max-width: 1199.98px) {
    .g-sidenav-show .main-content,
    .g-sidenav-show .wg-main.main-content {
        margin-left: 0 !important;
    }
}

.file-system-sidebar .logout-btn,
.file-system-sidebar .btn.logout-btn {
    width: 100%;
    margin-top: 0.75rem;
    background: var(--danger-soft) !important;
    color: var(--danger) !important;
    border: 1px solid #f3c4c4 !important;
}

.file-system-sidebar .logout-btn:hover {
    background: #fadede !important;
}

.file-system-sidebar #sidenav-collapse-main {
    display: flex !important;
    flex-direction: column;
    height: calc(100vh - 5.5rem) !important;
    overflow: hidden;
}

.file-system-sidebar .file-system-tree {
    flex: 1;
    overflow: auto;
    padding-right: 0.15rem;
}

.portfolio-stat-total .portfolio-stat-icon,
.portfolio-stat-gross .portfolio-stat-icon,
.portfolio-stat-net .portfolio-stat-icon,
.portfolio-stat-paid .portfolio-stat-icon,
.portfolio-stat-outstanding .portfolio-stat-icon {
    background: var(--brand-soft) !important;
}

.portfolio-stat-icon .material-icons {
    color: var(--brand) !important;
}

.portfolio-stat-card {
    border-color: var(--line) !important;
    box-shadow: var(--shadow-sm) !important;
    border-radius: var(--radius-sm) !important;
}

.portfolio-stats-bar {
    background: var(--surface) !important;
    border-top: 1px solid var(--line) !important;
}

.portfolio-stat-label {
    color: var(--muted) !important;
}

.main-content .btn.btn-outline-primary:not(:hover),
.wg-main .btn.btn-outline-primary:not(:hover) {
    background: var(--surface) !important;
    border-color: var(--line-strong) !important;
    color: var(--ink) !important;
}

.main-content .btn.btn-outline-success,
.main-content .btn.btn-outline-danger,
.main-content .btn.btn-outline-warning,
.main-content .btn.btn-outline-info,
.wg-main .btn.btn-outline-success,
.wg-main .btn.btn-outline-danger,
.wg-main .btn.btn-outline-warning,
.wg-main .btn.btn-outline-info {
    background: var(--surface) !important;
    border-color: var(--line-strong) !important;
    color: var(--ink) !important;
}

.main-content .btn.btn-warning,
.wg-main .btn.btn-warning {
    background: var(--warn-soft) !important;
    color: var(--warn) !important;
    border-color: #f3d0b0 !important;
    background-image: none !important;
}

.main-content .badge.bg-primary,
.main-content .badge.bg-secondary,
.wg-main .badge.bg-primary {
    background: var(--brand-soft) !important;
    color: var(--brand-ink) !important;
}

.main-content .badge.bg-success {
    background: var(--success-soft) !important;
    color: var(--success) !important;
}

.main-content .badge.bg-danger {
    background: var(--danger-soft) !important;
    color: var(--danger) !important;
}

.main-content .badge.bg-warning {
    background: var(--warn-soft) !important;
    color: var(--warn) !important;
}



/* ============================================================
   Mockup-matching sidebar (replaces file-system tree chrome)
   ============================================================ */
.wg-sidebar.sidebar,
aside.wg-sidebar#sidenav-main {
    position: fixed !important;
    top: 0;
    left: 0;
    z-index: 20;
    width: var(--sidebar-w) !important;
    min-width: var(--sidebar-w) !important;
    max-width: var(--sidebar-w) !important;
    height: 100vh !important;
    background: var(--surface) !important;
    border-right: 1px solid var(--line) !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 1rem 0.85rem !important;
    font-family: var(--font) !important;
    overflow: hidden;
}

.wg-sidebar .brand {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
    min-height: unset;
    padding: 0.15rem 0.55rem 0.85rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: 0.85rem;
    box-sizing: border-box;
}

.wg-sidebar .brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none !important;
    color: inherit;
    min-width: 0;
}

.wg-sidebar .brand img {
    width: 48px !important;
    height: 48px !important;
    max-width: 48px !important;
    object-fit: contain;
    flex-shrink: 0;
}

.wg-sidebar .brand-link--custom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
}

.wg-sidebar .brand-link--custom > img {
    width: auto !important;
    max-width: 180px !important;
    height: 40px !important;
}

.wg-sidebar .brand-wordmark {
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -0.04em;
    color: var(--brand);
    line-height: 1;
}

.wg-sidebar .brand-trademark {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 500;
    font-size: 0.72rem;
    letter-spacing: -0.02em;
    color: var(--brand);
    line-height: 1;
    opacity: 0.9;
}

.wg-sidebar .brand-trademark__mark {
    width: 14px !important;
    height: 14px !important;
    max-width: 14px !important;
}

.wg-sidebar .brand span {
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -0.04em;
    color: var(--brand);
    line-height: 1;
}

.wg-sidebar .brand .brand-trademark {
    font-weight: 500;
    font-size: 0.72rem;
}

.wg-sidebar-close,
.wg-sidebar-collapse {
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 0.35rem;
    border-radius: 8px;
    line-height: 1;
    cursor: pointer;
}

.wg-sidebar-collapse {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
}

@media (min-width: 1200px) {
    .wg-topbar .wg-sidebar-collapse {
        display: inline-flex;
    }
}

.wg-sidebar-collapse .material-icons {
    font-size: 22px;
}

.wg-sidebar-collapse:hover,
.wg-sidebar-close:hover {
    background: var(--brand-soft);
    color: var(--brand);
}

@media (min-width: 1200px) {
    body.wg-sidebar-collapsed .wg-sidebar.sidebar,
    body.wg-sidebar-collapsed aside.wg-sidebar#sidenav-main {
        width: 76px !important;
        min-width: 76px !important;
        max-width: 76px !important;
        padding: 0.85rem 0.4rem !important;
    }

    body.wg-sidebar-collapsed.g-sidenav-show .main-content,
    body.wg-sidebar-collapsed.g-sidenav-show .wg-main.main-content {
        margin-left: 76px !important;
    }

    body.wg-sidebar-collapsed .wg-sidebar .brand {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }

    body.wg-sidebar-collapsed .wg-sidebar .brand-link,
    body.wg-sidebar-collapsed .wg-sidebar .nav-label,
    body.wg-sidebar-collapsed .wg-sidebar .logout-btn span {
        display: none;
    }

    body.wg-sidebar-collapsed .wg-sidebar .nav-item,
    body.wg-sidebar-collapsed .wg-sidebar .nav-item.sub {
        justify-content: center;
        font-size: 0;
        gap: 0;
        padding: 0.55rem 0.35rem;
    }

    body.wg-sidebar-collapsed .wg-sidebar .nav-item svg {
        width: 20px;
        height: 20px;
    }

    body.wg-sidebar-collapsed .wg-sidebar .logout-btn .me-1 {
        margin-right: 0 !important;
    }
}

.wg-sidebar .nav-scroll {
    flex: 1;
    overflow: auto;
    padding-right: 0.25rem;
    scrollbar-width: thin;
    scrollbar-color: #c9ceda transparent;
}

.wg-sidebar .nav-scroll::-webkit-scrollbar {
    width: 6px;
}

.wg-sidebar .nav-scroll::-webkit-scrollbar-thumb {
    background: #c9ceda;
    border-radius: 999px;
}

.wg-sidebar .nav-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.wg-sidebar .nav-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted-2);
    padding: 0.75rem 0.65rem 0.35rem;
}

.wg-sidebar .nav-label .tree-chevron {
    width: 7px;
    height: 7px;
    margin-right: 0.2rem;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    flex: 0 0 7px;
}

.wg-sidebar .nav-label .tree-chevron.collapsed {
    transform: rotate(-45deg);
}

.wg-sidebar .nav-section__items.collapsed {
    display: none;
}

body.wg-sidebar-collapsed .wg-sidebar .nav-section__items.collapsed {
    display: block;
}

.wg-sidebar .nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 0.55rem 0.7rem;
    border-radius: var(--radius-sm);
    color: var(--muted) !important;
    font-weight: 550;
    font-size: 0.9rem;
    text-decoration: none !important;
    transition: background 0.15s, color 0.15s;
}

.wg-sidebar .nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.wg-sidebar .nav-item:hover {
    background: #f6f7fb;
    color: var(--ink) !important;
}

.wg-sidebar .nav-item.active {
    background: var(--brand-soft);
    color: var(--brand-ink) !important;
}

.wg-sidebar .nav-item.sub {
    padding-left: 2.35rem;
    font-size: 0.86rem;
    font-weight: 500;
}

.wg-sidebar .sidebar-foot {
    border-top: 1px solid var(--line);
    padding: 0.85rem 0.15rem 0.35rem;
    margin-top: auto;
}

.wg-sidebar .sidebar-foot .logout-btn,
.wg-sidebar .sidebar-foot .btn {
    width: 100%;
    justify-content: center;
    margin: 0 !important;
    line-height: 1.25 !important;
}

.wg-history-card .card-header.pb-0 {
    padding: 1rem 1.15rem 0.85rem !important;
}

@media (max-width: 1199.98px) {
    .wg-sidebar.sidebar,
    aside.wg-sidebar#sidenav-main {
        transform: translateX(-100%);
    }

    body.g-sidenav-pinned aside.wg-sidebar#sidenav-main,
    body.g-sidenav-pinned .wg-sidebar.sidebar,
    body.g-sidenav-show.g-sidenav-pinned aside.wg-sidebar#sidenav-main,
    body.g-sidenav-show.g-sidenav-pinned .wg-sidebar {
        transform: translateX(0);
    }
}

/* ---- Role permissions accordion ---- */
.role-body {
    padding-top: 1.1rem;
}

.role-form-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.role-form-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 720;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.role-form-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.82rem;
    color: var(--muted);
}

.role-perm-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
}

.role-perm-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.9rem 1.05rem;
    border-bottom: 1px solid var(--line);
    background: #f8f9fc;
}

.role-perm-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 720;
    color: var(--ink);
}

.role-perm-meta {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.role-selected-chip {
    font-size: 0.78rem;
    font-weight: 650;
    color: var(--brand-ink);
    background: var(--brand-soft);
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
}

.role-perm-select-all .form-check-label,
.role-group-select .form-check-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ink);
}

.role-perm-empty {
    padding: 1.5rem 1.05rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.86rem;
}

.role-perm-empty p {
    margin: 0;
}

.role-accordion {
    display: flex;
    flex-direction: column;
}

.role-group {
    border-bottom: 1px solid var(--line);
}

.role-group:last-child {
    border-bottom: 0;
}

.role-group-bar {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.55rem 0.75rem 0.55rem 0.35rem;
    background: #f3f5fb;
    transition: background 0.15s;
}

.role-group-bar:hover {
    background: #eceff8;
}

.role-group-head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 1;
    min-width: 0;
    padding: 0.3rem 0.3rem 0.3rem 0.7rem;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
    border-radius: var(--radius-xs, 6px);
    color: inherit;
}

.role-group-head:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
}

.role-group-chevron {
    font-size: 1.15rem !important;
    width: 1.15rem;
    height: 1.15rem;
    line-height: 1;
    color: var(--muted);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.role-group.is-open .role-group-chevron,
.role-group.is-search-open .role-group-chevron {
    transform: rotate(180deg);
}

.role-group-title {
    font-size: 0.78rem;
    font-weight: 780;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--brand-ink);
}

.role-group-count {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--brand-soft);
    color: var(--brand-ink);
}

.role-group-select {
    margin-left: auto;
    margin-right: 0.35rem;
    flex-shrink: 0;
}

.role-group-select .form-check-label {
    font-size: 0.75rem;
    color: var(--muted);
}

.role-group-body {
    display: none;
    border-top: 1px solid var(--line);
}

.role-group.is-open .role-group-body,
.role-group.is-search-open .role-group-body {
    display: block;
}

.role-group.is-search-hidden,
.role-perm-table tbody tr.is-search-hidden {
    display: none !important;
}

.role-perm-empty-search {
    display: none;
}

.role-perm-panel.has-no-search-matches .role-perm-empty-search {
    display: block;
}

.role-perm-panel.has-no-search-matches .role-accordion {
    display: none;
}

.role-perm-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.role-perm-table thead th {
    text-align: left;
    font-size: 0.68rem;
    font-weight: 720;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    background: #fafbfe;
    border-bottom: 1px solid var(--line);
    padding: 0.55rem 1.05rem;
}

.role-perm-table tbody tr {
    border-bottom: 1px solid #eef0f5;
}

.role-perm-table tbody tr:nth-child(even) {
    background: #fafbfe;
}

.role-perm-table tbody tr:last-child {
    border-bottom: 0;
}

.role-perm-table tbody tr:hover {
    background: #f3f5fb;
}

.role-perm-table td {
    padding: 0.8rem 1.05rem;
    vertical-align: top;
    font-size: 0.86rem;
}

.role-perm-table .perm-col {
    width: 34%;
    min-width: 200px;
}

.role-perm-table .desc-col {
    width: 66%;
}

.role-perm-check .role-perm-key {
    font-family: var(--mono, "IBM Plex Mono", ui-monospace, monospace);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ink);
}

.role-perm-desc {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
    font-size: 0.84rem;
}

.role-form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.55rem;
    margin-top: 1.1rem;
}

.role-form-loading {
    display: inline-flex;
    align-items: center;
}

@media (max-width: 720px) {
    .role-form-head {
        flex-direction: column;
    }

    .role-perm-table .perm-col,
    .role-perm-table .desc-col {
        display: block;
        width: 100%;
    }

    .role-perm-table thead {
        display: none;
    }

    .role-perm-table tbody tr {
        display: block;
        padding: 0.35rem 0;
    }

    .role-perm-table td {
        display: block;
        padding: 0.35rem 1.05rem;
    }

    .role-perm-table .desc-col {
        padding-top: 0;
        padding-left: 2.55rem;
    }
}

/*
 * Floating-bar document count — dedicated class (not Bootstrap .badge/.bg-danger).
 * Inline (not absolute) so .bulk-action-right overflow cannot clip it behind the bar.
 */
/* Glass AI chat */
.glass-chat-root {
    --glass-chat-sidebar-width: 300px;
    --glass-chat-line: rgba(52, 71, 103, 0.1);
    --glass-chat-user-grad: linear-gradient(135deg, #7928ca 0%, #cb0c9f 100%);
    --glass-chat-brand: #5b4fe8;
    --glass-chat-radius: 14px;
    --glass-chat-safe-bottom: env(safe-area-inset-bottom, 0px);
    position: relative;
    min-height: calc(100dvh - 8.5rem);
}

.glass-chat-layout {
    display: grid;
    grid-template-columns: var(--glass-chat-sidebar-width) 1fr;
    gap: 1rem;
    min-height: calc(100dvh - 8.5rem);
    height: calc(100dvh - 8.5rem);
}

.glass-chat-root .panel {
    background: #fff;
    border-radius: var(--glass-chat-radius);
    border: 1px solid var(--glass-chat-line);
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.glass-chat-sidebar {
    flex: 0 0 var(--glass-chat-sidebar-width);
    max-height: 100%;
}

.glass-chat-sidebar-head,
.glass-chat-main-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.95rem 1.05rem;
    border-bottom: 1px solid var(--glass-chat-line);
    flex-shrink: 0;
}

.glass-chat-panel-title {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #1e293b;
    margin: 0;
}

.glass-chat-new-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background-image: var(--glass-chat-user-grad) !important;
    border: 0 !important;
    box-shadow: 0 4px 12px rgba(203, 12, 159, 0.25);
}

.glass-chat-search-wrap {
    padding: 0.65rem 0.85rem 0.3rem;
    flex-shrink: 0;
}

.glass-chat-search {
    width: 100%;
    min-height: 2.5rem;
    border: 1px solid var(--glass-chat-line);
    border-radius: 12px;
    padding: 0.55rem 0.85rem 0.55rem 2.35rem;
    background: #f8f9fc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239aa3b5' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='M12 12l2.5 2.5'/%3E%3C/svg%3E") 0.8rem 50% no-repeat;
    font-size: 0.875rem;
    color: #344767;
    outline: none;
    transition: border-color 0.15s, background-color 0.15s;
}

.glass-chat-search:focus {
    border-color: rgba(91, 79, 232, 0.45);
    background-color: #fff;
}

.glass-chat-list {
    list-style: none;
    margin: 0;
    padding: 0.35rem 0.55rem 0.85rem;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.glass-chat-list-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.35rem;
    align-items: start;
    border-radius: 12px;
    padding: 0.15rem;
    margin-bottom: 0.2rem;
    transition: background 0.15s;
}

.glass-chat-list-item:hover {
    background: #f5f6fa;
}

.glass-chat-list-item.is-active {
    background: rgba(91, 79, 232, 0.06);
    box-shadow: inset 0 0 0 1px rgba(91, 79, 232, 0.18);
}

.glass-chat-list-btn {
    flex: 1;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    border-radius: 10px;
    padding: 0.65rem 0.65rem;
    min-width: 0;
    color: #344767;
}

.glass-chat-list-title {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
}

.glass-chat-pin {
    color: var(--glass-chat-brand);
    font-size: 0.7rem;
}

.glass-chat-list-preview {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.75rem;
    color: #6b7285;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.glass-chat-list-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
    padding: 0.55rem 0.4rem 0.55rem 0;
}

.glass-chat-list-time {
    font-size: 0.65rem;
    color: #9aa3b5;
    font-weight: 500;
    white-space: nowrap;
}

.glass-chat-list-actions {
    display: flex;
    gap: 0.1rem;
    opacity: 0;
    transition: opacity 0.15s;
}

.glass-chat-list-item:hover .glass-chat-list-actions,
.glass-chat-list-item.is-active .glass-chat-list-actions,
.glass-chat-list-item:focus-within .glass-chat-list-actions {
    opacity: 1;
}

.glass-chat-icon-action {
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #6b7285;
    display: inline-grid;
    place-items: center;
    padding: 0;
}

.glass-chat-icon-action:hover {
    background: #f3f4f8;
    color: #1e293b;
}

.glass-chat-icon-action.is-danger:hover {
    color: #e11d48;
    background: #fff1f2;
}

.glass-chat-list-empty {
    padding: 1.25rem 0.85rem;
    font-size: 0.825rem;
    color: #6b7285;
    text-align: center;
}

.glass-chat-main {
    min-width: 0;
    max-height: 100%;
}

.glass-chat-main-head {
    justify-content: flex-start;
}

.glass-chat-identity {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
    flex: 1;
}

.glass-chat-agent-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    background: linear-gradient(145deg, #5b4fe8, #7928ca);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 6px 14px rgba(91, 79, 232, 0.28);
    position: relative;
    flex-shrink: 0;
}

.glass-chat-agent-avatar::after {
    content: "";
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #fff;
}

.glass-chat-subtitle {
    font-size: 0.775rem;
    color: #6b7285;
    margin-top: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.glass-chat-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #15803d;
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    flex-shrink: 0;
    margin-left: auto;
}

.glass-chat-status-pill i {
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: #22c55e;
    display: inline-block;
}

.glass-chat-back-btn,
.glass-chat-menu-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--glass-chat-line);
    background: #fff;
    color: #344767;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
}

.glass-chat-back-btn:hover,
.glass-chat-menu-btn:hover {
    background: #f3f4f8;
}

.glass-chat-thread {
    flex: 1;
    overflow-y: auto;
    padding: 1.15rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background:
        radial-gradient(ellipse 80% 45% at 50% -15%, rgba(91, 79, 232, 0.06), transparent),
        #fff;
    -webkit-overflow-scrolling: touch;
}

.glass-chat-empty {
    margin: auto;
    text-align: center;
    max-width: 26rem;
    color: #67748e;
    padding: 1rem;
}

.glass-chat-empty-avatar {
    margin: 0 auto 0.85rem;
}

.glass-chat-empty-title {
    font-weight: 700;
    color: #1e293b;
    font-size: 1.05rem;
}

.glass-chat-msg {
    display: flex;
    gap: 0.6rem;
    max-width: min(640px, 94%);
}

.glass-chat-msg--user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.glass-chat-msg--assistant {
    align-self: flex-start;
}

.glass-chat-msg-avatar {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 8px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 0.62rem;
    font-weight: 700;
    margin-top: 1.25rem;
    color: #fff;
}

.glass-chat-msg--assistant .glass-chat-msg-avatar {
    background: linear-gradient(145deg, #5b4fe8, #7928ca);
}

.glass-chat-msg--user .glass-chat-msg-avatar {
    background: var(--glass-chat-user-grad);
    border-radius: 50%;
}

.glass-chat-msg-stack {
    min-width: 0;
}

.glass-chat-msg-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #9aa3b5;
    margin-bottom: 0.28rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.glass-chat-msg--user .glass-chat-msg-label {
    justify-content: flex-end;
}

.glass-chat-msg-time {
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: #b0b7c5;
}

.glass-chat-bubble {
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    line-height: 1.55;
    border-radius: 16px;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.glass-chat-bubble--user {
    background: var(--glass-chat-user-grad);
    color: #fff;
    border-top-right-radius: 5px;
    box-shadow: 0 6px 16px rgba(203, 12, 159, 0.2);
}

.glass-chat-bubble--assistant {
    background: #f6f7fb;
    color: #344767;
    border: 1px solid var(--glass-chat-line);
    border-top-left-radius: 5px;
}

.glass-chat-draft-card {
    align-self: flex-start;
    max-width: min(520px, 92%);
    margin-left: 2.35rem;
}

.glass-pending-card {
    width: 100%;
    padding: 1rem 1.05rem 0.95rem;
    border-radius: 16px;
    border: 1px solid rgba(203, 12, 159, 0.22);
    background:
        linear-gradient(180deg, rgba(203, 12, 159, 0.05), rgba(255, 255, 255, 0.95)),
        #fff;
    box-shadow: 0 8px 24px rgba(121, 40, 202, 0.08);
}

.glass-pending-card__head {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.glass-pending-card__avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 14px;
    background: linear-gradient(135deg, #7928ca, #cb0c9f);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    box-shadow: 0 6px 14px rgba(203, 12, 159, 0.28);
}

.glass-pending-card--policy .glass-pending-card__avatar {
    background: linear-gradient(145deg, #5b4fe8, #7928ca);
}

.glass-pending-card--issuance_email .glass-pending-card__avatar {
    background: linear-gradient(145deg, #0d9488, #0f766e);
}

.glass-pending-email {
    margin-top: 0.9rem;
    padding: 0.85rem 0.9rem;
    border-radius: 12px;
    border: 1px solid rgba(15, 118, 110, 0.2);
    background: linear-gradient(180deg, rgba(13, 148, 136, 0.06), rgba(255, 255, 255, 0.92));
}

.glass-pending-email__label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #0f766e;
    margin-bottom: 0.65rem;
}

.glass-pending-email__meta {
    margin: 0;
    display: grid;
    gap: 0.45rem;
}

.glass-pending-email__row {
    display: grid;
    grid-template-columns: 4.5rem 1fr;
    gap: 0.5rem;
    align-items: start;
}

.glass-pending-email__row dt {
    margin: 0;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #9aa3b5;
    padding-top: 0.1rem;
}

.glass-pending-email__row dd {
    margin: 0;
    font-size: 0.84rem;
    font-weight: 600;
    color: #344767;
    word-break: break-word;
}

.glass-pending-email__body {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(52, 71, 103, 0.1);
    font-size: 0.82rem;
    line-height: 1.45;
    color: #475569;
    max-height: 220px;
    overflow: auto;
}

.glass-pending-email__body p {
    margin: 0 0 0.55rem;
}

.glass-pending-email__body ul {
    margin: 0 0 0.55rem;
    padding-left: 1.1rem;
}

.glass-pending-email__body h3 {
    margin: 0 0 0.4rem;
    font-size: 0.9rem;
    color: #1e293b;
}

.glass-pending-card__titles {
    min-width: 0;
    flex: 1;
}

.glass-pending-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #cb0c9f;
    margin-bottom: 0.25rem;
}

.glass-pending-card__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #1e293b;
    line-height: 1.25;
}

.glass-pending-card__subtitle {
    margin: 0.15rem 0 0;
    font-size: 0.78rem;
    color: #6b7285;
}

.glass-pending-card__fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem 0.75rem;
    margin: 0.9rem 0 0;
    padding: 0.85rem 0 0;
    border-top: 1px solid rgba(52, 71, 103, 0.1);
}

.glass-pending-card__row {
    min-width: 0;
}

.glass-pending-card__row dt {
    margin: 0;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #9aa3b5;
}

.glass-pending-card__row dd {
    margin: 0.15rem 0 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #344767;
    word-break: break-word;
}

.glass-pending-card__hint {
    margin: 0.85rem 0 0;
    font-size: 0.78rem;
    color: #6b7285;
}

@media (max-width: 575.98px) {
    .glass-pending-card__fields {
        grid-template-columns: 1fr;
    }
}

.glass-chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-left: 2.35rem;
    max-width: min(560px, 92%);
}

.glass-chat-suggestions--center {
    margin-left: 0;
    justify-content: center;
    max-width: 100%;
}

.glass-chat-chip {
    border: 1px solid var(--glass-chat-line);
    background: #fff;
    color: #344767;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    min-height: 2.4rem;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.glass-chat-chip:hover {
    border-color: rgba(91, 79, 232, 0.4);
    color: var(--glass-chat-brand);
    background: rgba(91, 79, 232, 0.06);
}

.wg-nav-back {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--line, #e6e8ef);
    background: #fff;
    color: #344767;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    padding: 0;
    cursor: pointer;
}
.wg-nav-back:hover {
    background: #f3f4f8;
    border-color: #c9cdfb;
    color: var(--brand, #5b4fe8);
}
.wg-nav-back .material-icons {
    font-size: 1.25rem;
    line-height: 1;
}
.wg-nav-back[hidden] {
    display: none !important;
}

.glass-chat-issued-upload {
    border-top: 1px solid var(--glass-chat-line);
    background: #f3f4f8;
    flex-shrink: 0;
}

.glass-chat-issued-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    border: 0;
    background: transparent;
    color: var(--brand, #5b4fe8);
    font-size: 0.84rem;
    font-weight: 700;
    padding: 0.75rem 1.05rem;
    text-align: left;
    cursor: pointer;
}

.glass-chat-issued-toggle__lead {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.glass-chat-issued-chevron {
    transition: transform 0.2s;
    color: #9aa0b0;
    font-size: 0.75rem;
}

.glass-chat-issued-chevron.is-open,
.glass-chat-issued-toggle .fa-chevron-down.is-open {
    transform: rotate(180deg);
}

.glass-chat-issued-panel {
    padding: 0 1.05rem 1rem;
    overflow: visible;
    position: relative;
    z-index: 2;
}

/* Full-bleed of chat column; dense grid on desktop, stack on phone */
.glass-chat-issued-card {
    width: 100%;
    max-width: none;
    background: #fff;
    border: 1px solid var(--glass-chat-line);
    border-radius: 14px;
    padding: 0.85rem 0.95rem;
    box-shadow: 0 1px 2px rgba(26, 29, 38, 0.04);
}

.glass-chat-issued-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
    align-items: end;
}

.glass-chat-issued-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.glass-chat-issued-label {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 650;
    color: #6b7285;
}

.glass-chat-issued-label--spacer {
    display: none;
}

.glass-chat-issued-panel .selectize-control {
    width: 100%;
}

.glass-chat-issued-panel .selectize-input,
.glass-chat-issued-panel .form-select {
    min-height: 42px;
    border-radius: 10px !important;
}

.glass-chat-issued-panel .selectize-dropdown {
    z-index: 1100;
}

.glass-chat-issued-empty {
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--line, #e6e8ef);
    border-radius: 10px;
    background: #fafbfe;
    color: var(--muted, #6b7285);
    font-size: 0.78rem;
    line-height: 1.35;
}

.glass-chat-issued-help {
    margin: 0 0 0.7rem;
    font-size: 0.76rem;
    line-height: 1.4;
    color: #6b7285;
}

.glass-chat-issued-filechip {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 42px;
    padding: 0.35rem 0.45rem 0.35rem 0.7rem;
    border: 1px solid #c9cdfb;
    border-radius: 10px;
    background: #f8f7ff;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.glass-chat-issued-filechip:hover {
    border-color: var(--brand, #5b4fe8);
    background: #eeecfd;
}

.glass-chat-issued-file {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.glass-chat-issued-filechip__icon {
    color: var(--brand, #5b4fe8);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.glass-chat-issued-filechip__text {
    flex: 1;
    min-width: 0;
    font-size: 0.82rem;
    font-weight: 650;
    color: #1a1d26;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.glass-chat-issued-filechip__action {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--brand, #5b4fe8);
    background: #fff;
    border: 1px solid #c9cdfb;
    border-radius: 8px;
    padding: 0.28rem 0.55rem;
}

.glass-chat-issued-submit {
    width: 100%;
    min-height: 42px;
    border-radius: 10px !important;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .glass-chat-issued-grid {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
        gap: 0.75rem;
    }

    .glass-chat-issued-label--spacer {
        display: block;
    }

    .glass-chat-issued-submit {
        width: auto;
        min-width: 7.5rem;
        padding-left: 1.1rem;
        padding-right: 1.1rem;
    }
}

.glass-chat-composer {
    padding: 0.75rem 1.05rem calc(0.95rem + var(--glass-chat-safe-bottom));
    border-top: 1px solid var(--glass-chat-line);
    background: #fafbfd;
    flex-shrink: 0;
}

.glass-chat-composer-box {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: #fff;
    border: 1px solid var(--glass-chat-line);
    border-radius: 16px;
    padding: 0.7rem 0.8rem 0.6rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.glass-chat-composer-box:focus-within {
    border-color: rgba(91, 79, 232, 0.45);
    box-shadow: 0 0 0 3px rgba(91, 79, 232, 0.1);
}

.glass-chat-input {
    width: 100%;
    border: 0;
    outline: none;
    resize: none;
    min-height: 3rem;
    max-height: 7.5rem;
    line-height: 1.5;
    font-size: 0.925rem;
    background: transparent;
    color: #1e293b;
    padding: 0;
}

.glass-chat-input:disabled {
    opacity: 0.65;
}

.glass-chat-input::placeholder {
    color: #a0a8b8;
}

.glass-chat-composer-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
}

.glass-chat-composer-hint {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.55rem;
    margin: 0;
    font-size: 0.7rem;
    color: #8b95a8;
    line-height: 1;
}

.glass-chat-kbd-group {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
}

.glass-chat-kbd-sep {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #c5ccd8;
    flex-shrink: 0;
}

.glass-chat-kbd-plus {
    font-size: 0.62rem;
    font-weight: 600;
    color: #a0a8b8;
    line-height: 1;
}

.glass-chat-kbd-label {
    font-size: 0.68rem;
    font-weight: 500;
    color: #9aa3b5;
    letter-spacing: 0.01em;
}

.glass-chat-composer-hint kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.35rem;
    padding: 0.15rem 0.42rem;
    font-family: inherit;
    font-size: 0.62rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    line-height: 1;
    color: #4c3fd4 !important;
    background:
        linear-gradient(180deg, #ffffff 0%, #f4f2ff 100%) !important;
    border: 1px solid rgba(91, 79, 232, 0.22) !important;
    border-bottom-color: rgba(91, 79, 232, 0.38) !important;
    border-radius: 6px;
    box-shadow:
        0 1px 0 rgba(91, 79, 232, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.glass-chat-send {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background-image: var(--glass-chat-user-grad) !important;
    border: 0 !important;
    border-radius: 11px !important;
    min-height: 2.5rem;
    padding: 0.5rem 1.05rem;
    box-shadow: 0 4px 12px rgba(203, 12, 159, 0.28);
}

.glass-chat-fab {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right, 0px));
    bottom: max(1.25rem, calc(1rem + var(--glass-chat-safe-bottom)));
    z-index: 25;
    width: 3.5rem;
    height: 3.5rem;
    border: 0;
    border-radius: 18px;
    background: var(--glass-chat-user-grad);
    color: #fff;
    box-shadow: 0 10px 24px rgba(203, 12, 159, 0.35);
    display: inline-grid;
    place-items: center;
    font-size: 1.1rem;
}

.glass-pulse-dots {
    display: inline-flex;
    gap: 0.25rem;
    vertical-align: middle;
    margin-right: 0.35rem;
}

.glass-pulse-dots span {
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: #cb0c9f;
    animation: glass-pulse 1.2s ease-in-out infinite;
}

.glass-pulse-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.glass-pulse-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes glass-pulse {
    0%, 80%, 100% {
        opacity: 0.35;
        transform: scale(0.85);
    }
    40% {
        opacity: 1;
        transform: scale(1);
    }
}

.glass-shimmer {
    background: linear-gradient(90deg, rgba(203, 12, 159, 0.08), rgba(121, 40, 202, 0.18), rgba(203, 12, 159, 0.08));
    background-size: 200% 100%;
    animation: glass-shimmer 1.4s linear infinite;
    border-radius: 0.35rem;
    padding: 0.15rem 0.35rem;
    display: inline-block;
}

@keyframes glass-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@media (max-width: 991.98px) {
    .glass-chat-layout {
        grid-template-columns: 240px 1fr;
    }

    .glass-chat-subtitle {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .glass-chat-root {
        min-height: calc(100dvh - 6.5rem);
        margin-left: -0.5rem;
        margin-right: -0.5rem;
        width: calc(100% + 1rem);
    }

    .glass-chat-layout {
        display: block;
        position: relative;
        height: calc(100dvh - 6.5rem);
        min-height: calc(100dvh - 6.5rem);
        gap: 0;
        overflow: hidden;
    }

    .glass-chat-sidebar,
    .glass-chat-main {
        position: absolute;
        inset: 0;
        width: 100%;
        max-height: none;
        border-radius: 0;
        border: 0;
        box-shadow: none;
        transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s;
    }

    .glass-chat-sidebar {
        z-index: 2;
        transform: translateX(0);
    }

    .glass-chat-main {
        z-index: 3;
        transform: translateX(100%);
    }

    .glass-chat-root.is-mobile-chat .glass-chat-sidebar {
        transform: translateX(-28%);
        opacity: 0.4;
        pointer-events: none;
    }

    .glass-chat-root.is-mobile-chat .glass-chat-main {
        transform: translateX(0);
    }

    .glass-chat-root:not(.is-mobile-chat) .glass-chat-main {
        pointer-events: none;
    }

    /* Legacy overlay toggle when list needs temporary show over chat */
    .glass-chat-sidebar.is-open {
        transform: translateX(0) !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        z-index: 4;
        box-shadow: 8px 0 28px rgba(15, 23, 42, 0.16);
    }

    .glass-chat-list-actions {
        opacity: 1;
    }

    .glass-chat-main-head {
        padding: 0.7rem 0.85rem;
    }

    .glass-chat-agent-avatar {
        width: 2.15rem;
        height: 2.15rem;
        font-size: 0.75rem;
        border-radius: 10px;
    }

    .glass-chat-status-pill {
        width: 0.65rem;
        height: 0.65rem;
        padding: 0;
        border-radius: 50%;
        background: #22c55e;
        border: 2px solid #fff;
        box-shadow: 0 0 0 1px #bbf7d0;
    }

    .glass-chat-status-pill i,
    .glass-chat-status-pill span {
        display: none;
    }

    .glass-chat-thread {
        padding: 0.9rem 0.85rem 1rem;
        gap: 0.85rem;
    }

    .glass-chat-msg {
        max-width: 88%;
    }

    .glass-chat-msg-avatar {
        display: none;
    }

    .glass-chat-draft-card,
    .glass-chat-suggestions {
        margin-left: 0;
        max-width: 100%;
    }

    .glass-chat-suggestions {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.15rem;
        scrollbar-width: none;
    }

    .glass-chat-suggestions::-webkit-scrollbar {
        display: none;
    }

    .glass-chat-issued-upload {
        display: block;
        position: relative;
        z-index: 3;
        background: #f3f4f8;
        border-top: 1px solid var(--glass-chat-line);
    }

    .glass-chat-issued-toggle {
        padding: 0.75rem 0.85rem;
        font-size: 0.84rem;
        min-height: 44px;
    }

    .glass-chat-issued-panel {
        padding: 0 0.75rem 0.9rem;
    }

    .glass-chat-issued-card {
        max-width: none;
        width: 100%;
        padding: 0.75rem 0.8rem;
    }

    .glass-chat-issued-grid {
        grid-template-columns: 1fr;
    }

    .glass-chat-issued-submit {
        width: 100%;
        min-height: 44px;
    }

    .glass-chat-issued-label--spacer {
        display: none;
    }

    .glass-chat-composer {
        padding: 0.55rem 0.7rem calc(0.7rem + var(--glass-chat-safe-bottom));
    }

    .glass-chat-composer-hint {
        display: none;
    }

    .glass-chat-composer-box {
        flex-direction: row;
        align-items: flex-end;
        gap: 0.5rem;
        padding: 0.45rem 0.45rem 0.45rem 0.85rem;
        border-radius: 22px;
    }

    @media (orientation: landscape) and (max-height: 480px) {
        .glass-chat-thread {
            padding: 0.55rem 0.7rem;
        }
        .glass-chat-issued-toggle {
            min-height: 40px;
            padding: 0.45rem 0.75rem;
        }
        .glass-chat-composer {
            padding: 0.4rem 0.55rem calc(0.45rem + var(--glass-chat-safe-bottom));
        }
    }

    .glass-chat-input {
        min-height: 2.5rem;
        max-height: 6.25rem;
        font-size: 1rem;
        padding: 0.45rem 0;
    }

    .glass-chat-composer-bar {
        margin: 0;
    }

    .glass-chat-send {
        width: 2.625rem;
        height: 2.625rem;
        min-height: 2.625rem;
        padding: 0;
        border-radius: 50% !important;
        flex-shrink: 0;
        justify-content: center;
    }

    .glass-chat-send-label {
        display: none;
    }

    .glass-chat-new-btn span {
        display: none;
    }

    .glass-chat-root.is-mobile-chat .glass-chat-fab {
        display: none !important;
    }
}

.floating-bulk-action-bar .documents-btn .documents-count-badge {
    position: static !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    box-sizing: border-box !important;
    width: 1.15rem !important;
    min-width: 1.15rem !important;
    height: 1.15rem !important;
    padding: 0 !important;
    margin: 0 0 0 0.15rem !important;
    border-radius: 999px !important;
    border: 1.5px solid rgba(255, 255, 255, 0.35) !important;
    background: #ef4444 !important;
    background-image: none !important;
    color: #fff !important;
    font-size: 0.65rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    white-space: nowrap !important;
    overflow: visible !important;
    box-shadow: none !important;
    z-index: 1;
}

/* ---- Premium Calculator — guided wizard (mock two-panel) ---- */
.premium-calculator-wizard .pc-wizard-shell {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
    min-height: 0;
    flex: 1 1 auto;
    height: 100%;
}

.premium-calculator-wizard .pc-rail {
    background: var(--surface, #fff);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow, 0 8px 24px rgba(26, 29, 38, 0.06));
    padding: 1.15rem 0.9rem;
    min-height: 0;
}

.premium-calculator-wizard .pc-rail-label {
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted-2);
    margin-bottom: 0.85rem;
}

.premium-calculator-wizard .pc-rail-step {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0;
    border: 0;
    background: transparent;
    opacity: 0.4;
    font-family: var(--font);
    color: inherit;
}

.premium-calculator-wizard .pc-rail-step.is-current {
    opacity: 1;
}

.premium-calculator-wizard .pc-rail-step.is-done {
    opacity: 0.85;
    cursor: pointer;
}

.premium-calculator-wizard .pc-rail-step.is-done:hover {
    opacity: 1;
}

.premium-calculator-wizard .pc-rail-num {
    flex: 0 0 1.45rem;
    width: 1.45rem;
    height: 1.45rem;
    border-radius: var(--radius-sm);
    border: 0;
    display: grid;
    place-items: center;
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--line);
    color: var(--muted);
}

.premium-calculator-wizard .pc-rail-step.is-current .pc-rail-num {
    background: var(--brand, #5b4fe8);
    color: #fff;
}

.premium-calculator-wizard .pc-rail-step.is-done .pc-rail-num {
    background: var(--brand-soft, #eeecfd);
    color: #3d36a8;
}

.premium-calculator-wizard .pc-rail-step strong {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--ink);
}

.premium-calculator-wizard .pc-rail-step span span {
    display: block;
    font-size: 0.7rem;
    color: var(--muted);
    line-height: 1.35;
    font-weight: 500;
    margin-top: 0.05rem;
}

.premium-calculator-wizard .pc-stage {
    padding: 1.35rem 1.35rem 1.15rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: var(--surface, #fff);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow, 0 8px 24px rgba(26, 29, 38, 0.06));
    min-height: 0;
    overflow: hidden;
}

.premium-calculator-wizard .pc-stage-title {
    font-size: 1.15rem;
    font-weight: 720;
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
}

.premium-calculator-wizard .pc-lead {
    font-size: 0.875rem;
    color: var(--muted);
    margin-bottom: 1.25rem;
    max-width: 32rem;
    line-height: 1.45;
}

.premium-calculator-wizard .pc-step-panel.is-active {
    flex: 0 0 auto;
    display: block;
}

.premium-calculator-wizard .pc-field-label {
    font-size: 0.78rem;
    font-weight: 650;
    margin-bottom: 0.55rem;
    display: block;
}

.premium-calculator-wizard .pc-company-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 0.85rem;
    max-width: none;
}

.premium-calculator-wizard .pc-company-card,
.premium-calculator-wizard .pc-line-tile,
.premium-calculator-wizard .pc-plan-opt {
    font-family: var(--font);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.premium-calculator-wizard .pc-company-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: left;
    background: #fff;
    min-height: 96px;
    cursor: pointer;
}

.premium-calculator-wizard .pc-company-card:hover {
    border-color: var(--line-strong, #d5d8e3);
}

.premium-calculator-wizard .pc-company-card.is-selected {
    border-color: var(--brand, #5b4fe8);
    background: var(--brand-soft, #eeecfd);
    box-shadow: 0 0 0 3px rgba(91, 79, 232, 0.12);
}

.premium-calculator-wizard .pc-company-mark {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.85rem;
    background: #f1f5f9;
    color: #3d36a8;
    margin-bottom: 0.55rem;
}

.premium-calculator-wizard .pc-company-card.is-selected .pc-company-mark {
    background: rgba(91, 79, 232, 0.18);
}

.premium-calculator-wizard .pc-company-card strong {
    display: block;
    font-size: 0.92rem;
    margin-bottom: 0.15rem;
}

.premium-calculator-wizard .pc-company-card > span:not(.pc-company-mark) {
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.15rem;
}

.premium-calculator-wizard .pc-line-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.65rem;
    max-width: none;
    margin-bottom: 0;
}

.premium-calculator-wizard .pc-empty-line {
    border-radius: 10px;
    padding: 0.85rem 1rem;
}

.premium-calculator-wizard .pc-details-max .pc-rate-section + .pc-rate-section {
    margin-top: 1rem;
}

.premium-calculator-wizard .pc-line-tile {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.85rem 0.9rem;
    text-align: left;
    background: #fff;
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    cursor: pointer;
}

.premium-calculator-wizard .pc-line-tile:hover {
    border-color: var(--line-strong, #d5d8e3);
}

.premium-calculator-wizard .pc-line-tile.is-selected {
    border-color: var(--brand, #5b4fe8);
    background: var(--brand-soft, #eeecfd);
    box-shadow: 0 0 0 3px rgba(91, 79, 232, 0.12);
}

.premium-calculator-wizard .pc-line-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: #f1f5f9;
    color: var(--muted);
    flex-shrink: 0;
    margin-bottom: 0;
}

.premium-calculator-wizard .pc-line-tile.is-selected .pc-line-icon {
    background: rgba(91, 79, 232, 0.14);
    color: #3d36a8;
}

.premium-calculator-wizard .pc-line-icon svg {
    width: 16px;
    height: 16px;
}

.premium-calculator-wizard .pc-line-copy {
    min-width: 0;
}

.premium-calculator-wizard .pc-line-tile strong,
.premium-calculator-wizard .pc-line-copy strong {
    display: block;
    font-size: 0.9rem;
}

.premium-calculator-wizard .pc-line-copy span,
.premium-calculator-wizard .pc-line-tile .pc-line-copy span {
    display: block;
    font-size: 0.72rem;
    color: var(--muted);
    margin-top: 0.1rem;
}

@media (max-width: 720px) {
    .premium-calculator-wizard .pc-company-grid {
        grid-template-columns: 1fr;
    }
}

.premium-calculator-wizard .pc-plan-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-width: 480px;
}

.premium-calculator-wizard .pc-plan-opt {
    border: 2px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.9rem;
    text-align: left;
    width: 100%;
    background: var(--surface);
}

.premium-calculator-wizard .pc-plan-opt.is-selected {
    border-color: var(--brand);
    background: var(--brand-soft);
}

.premium-calculator-wizard .pc-details-max {
    max-width: 640px;
}

.premium-calculator-wizard .pc-stage .form-control,
.premium-calculator-wizard .pc-stage .form-select {
    border: 1px solid var(--line-strong) !important;
    border-radius: var(--radius-sm) !important;
    background-color: #fff !important;
    box-shadow: none !important;
    height: 42px;
    padding: 0.5rem 0.85rem !important;
}

.premium-calculator-wizard .pc-stage .form-control:focus,
.premium-calculator-wizard .pc-stage .form-select:focus {
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 3px var(--brand-soft) !important;
    outline: none;
}

.premium-calculator-wizard .pc-age-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.55rem;
}

.premium-calculator-wizard .pc-age-label {
    flex: 0 0 5.5rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
}

.premium-calculator-wizard .pc-age-input {
    flex: 0 0 7rem;
    max-width: 7rem;
}

.premium-calculator-wizard .pc-age-remove {
    flex-shrink: 0;
}

.premium-calculator-wizard .pc-stage-foot {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex-shrink: 0;
}

.premium-calculator-wizard .pc-result-hero {
    background: var(--success-soft);
    border: 1px solid #bfe5cd;
    border-radius: var(--radius);
    padding: 1.15rem 1.35rem;
    max-width: 480px;
    margin-bottom: 1rem;
}

.premium-calculator-wizard .pc-result-tag {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--success);
}

.premium-calculator-wizard .pc-result-sum {
    font-size: 2rem;
    font-weight: 720;
    letter-spacing: -0.03em;
    margin-top: 0.25rem;
}

.premium-calculator-wizard .pc-breakdown {
    max-width: 480px;
    font-size: 0.84rem;
}

.premium-calculator-wizard .pc-breakdown dl {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 0.3rem 0.75rem;
    margin: 0;
}

.premium-calculator-wizard .pc-breakdown dt {
    color: var(--muted);
    margin: 0;
}

.premium-calculator-wizard .pc-breakdown dd {
    font-weight: 550;
    margin: 0;
}

@media (max-width: 767.98px) {
    .premium-calculator-wizard .pc-wizard-shell {
        grid-template-columns: 1fr;
    }

    .premium-calculator-wizard .pc-rail {
        border-right: 0;
        border-bottom: 1px solid var(--line);
        padding-bottom: 0.75rem;
    }

    .premium-calculator-wizard .pc-rail-steps {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem 0.75rem;
    }

    .premium-calculator-wizard .pc-rail-step {
        padding: 0.25rem 0;
        width: auto;
    }

    .premium-calculator-wizard .pc-rail-step span span {
        display: none;
    }

    .premium-calculator-wizard .pc-line-tiles {
        max-width: none;
    }
}

/* ---- Premium Tariff Admin (from tmp-mocks/tariff-admin-mock.html) ---- */
.premium-tariff-admin .ta-shell-card,
.premium-tariff-admin .ta-list-card {
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius);
    overflow: hidden;
}

.premium-tariff-admin .ta-alert {
    border-radius: var(--radius-sm);
}

.premium-tariff-admin .ta-shell {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    min-height: 0;
    height: 100%;
    align-items: stretch;
}

.premium-tariff-admin .ta-rail {
    background: #fafbfe;
    border-right: 1px solid var(--line);
    padding: 1.25rem 1rem;
}

.premium-tariff-admin .ta-rail-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted-2);
    margin-bottom: 1rem;
}

.premium-tariff-admin .ta-rail-step {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.55rem 0;
    opacity: 0.45;
}

.premium-tariff-admin .ta-rail-step.is-current { opacity: 1; }
.premium-tariff-admin .ta-rail-step.is-done { opacity: 0.88; }

.premium-tariff-admin .ta-rail-num {
    flex: 0 0 1.5rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--line);
    color: var(--muted);
}

.premium-tariff-admin .ta-rail-step.is-current .ta-rail-num {
    background: var(--brand);
    color: #fff;
}

.premium-tariff-admin .ta-rail-step.is-done .ta-rail-num {
    background: var(--brand-soft);
    color: var(--brand-ink);
}

.premium-tariff-admin .ta-rail-step strong {
    display: block;
    font-size: 0.86rem;
    color: var(--ink);
}

.premium-tariff-admin .ta-rail-step span span {
    display: block;
    font-size: 0.72rem;
    color: var(--muted);
    margin-top: 0.1rem;
}

.premium-tariff-admin .ta-rail-note {
    margin: 1.25rem 0 0;
    font-size: 0.72rem;
    line-height: 1.45;
    color: var(--muted);
}

.premium-tariff-admin .ta-stage {
    padding: 1.5rem 1.5rem 1.25rem;
}

.premium-tariff-admin .ta-stage-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    color: var(--ink);
}

.premium-tariff-admin .ta-lead {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    max-width: 42rem;
}

.premium-tariff-admin .ta-field-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.35rem;
}

.premium-tariff-admin .ta-stage .form-control,
.premium-tariff-admin .ta-stage .form-select {
    border: 1px solid var(--line-strong) !important;
    border-radius: var(--radius-sm) !important;
    background-color: #fff !important;
    box-shadow: none !important;
    height: 42px;
    padding: 0.5rem 0.85rem !important;
}

.premium-tariff-admin .ta-stage .form-control:focus,
.premium-tariff-admin .ta-stage .form-select:focus {
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 3px var(--brand-soft) !important;
    outline: none;
}

.premium-tariff-admin .ta-hint {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    color: var(--muted);
    line-height: 1.4;
}

.premium-tariff-admin .ta-hint code {
    font-family: var(--mono);
    font-size: 0.72rem;
    background: var(--brand-soft);
    color: var(--brand-ink);
    padding: 0.05rem 0.3rem;
    border-radius: 4px;
}

.premium-tariff-admin .ta-line-tiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.premium-tariff-admin .ta-line-tile {
    text-align: left;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.85rem;
    font-family: var(--font);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.premium-tariff-admin .ta-line-tile:hover { border-color: var(--line-strong); }

.premium-tariff-admin .ta-line-tile.is-selected {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.premium-tariff-admin .ta-line-tile strong {
    display: block;
    font-size: 0.9rem;
    color: var(--ink);
}

.premium-tariff-admin .ta-line-tile span {
    display: block;
    font-size: 0.72rem;
    color: var(--muted);
    margin-top: 0.15rem;
}

.premium-tariff-admin .ta-upload-zone {
    position: relative;
    width: 100%;
    max-width: 100%;
    border: 1.5px dashed #c5c9d8;
    border-radius: 12px;
    background: linear-gradient(180deg, #fbfbfe 0%, #f6f7fb 100%);
    padding: 1.1rem 1.25rem;
    text-align: center;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.premium-tariff-admin .ta-upload-zone:hover {
    border-color: var(--brand);
    background: linear-gradient(180deg, #f8f7ff 0%, #f3f1ff 100%);
    box-shadow: 0 0 0 4px var(--brand-soft);
}

.premium-tariff-admin .ta-upload-zone.has-file {
    border-style: solid;
    border-color: #b7e0c5;
    background: linear-gradient(180deg, #f6fbf8 0%, #eef8f2 100%);
    box-shadow: 0 0 0 4px var(--success-soft);
    text-align: left;
}

.premium-tariff-admin .ta-upload-icon {
    width: 36px;
    height: 36px;
    margin: 0 auto 0.55rem;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--brand-soft);
    color: var(--brand);
}

.premium-tariff-admin .ta-upload-icon svg {
    width: 18px;
    height: 18px;
}

.premium-tariff-admin .ta-upload-zone.has-file .ta-upload-icon {
    margin: 0;
    background: var(--success-soft);
    color: var(--success);
    flex-shrink: 0;
}

.premium-tariff-admin .ta-upload-title {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--ink);
}

.premium-tariff-admin .ta-upload-sub {
    margin: 0.2rem 0 0.65rem;
    font-size: 0.75rem;
    color: var(--muted);
    line-height: 1.35;
}

.premium-tariff-admin .ta-upload-browse {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    margin: 0;
}

.premium-tariff-admin .ta-upload-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.premium-tariff-admin .ta-upload-meta {
    margin-top: 0.5rem;
    margin-bottom: 0;
    font-size: 0.68rem;
    color: var(--muted-2);
}

.premium-tariff-admin .ta-upload-file-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.premium-tariff-admin .ta-upload-file-info {
    flex: 1;
    min-width: 0;
}

.premium-tariff-admin .ta-upload-file-name {
    margin: 0;
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.premium-tariff-admin .ta-upload-file-meta {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
    color: var(--muted);
}

.premium-tariff-admin .ta-upload-file-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.premium-tariff-admin .ta-stage-foot {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
}

.premium-tariff-admin .ta-foot-note {
    margin: 0;
    font-size: 0.78rem;
    color: var(--muted);
    max-width: 28rem;
}

.premium-tariff-admin .ta-notes {
    margin-top: 1rem;
    padding: 0.75rem 0.9rem;
    background: var(--info-soft);
    color: var(--info);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.premium-tariff-admin .ta-draft-panel {
    margin-top: 1.25rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fafbfe;
}

.premium-tariff-admin .ta-draft-table {
    max-height: 240px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    background: var(--surface);
}

.premium-tariff-admin .ta-table thead th {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    font-weight: 700;
    border-bottom-width: 1px;
    white-space: nowrap;
}

.premium-tariff-admin .ta-table tbody td {
    vertical-align: middle;
    font-size: 0.88rem;
}

.premium-tariff-admin .ta-plan-key {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--brand-ink);
}

.premium-tariff-admin .ta-pill {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: lowercase;
}

.premium-tariff-admin .ta-pill-medical {
    background: var(--info-soft);
    color: var(--info);
}

.premium-tariff-admin .ta-pill-motor {
    background: var(--warn-soft);
    color: var(--warn);
}

.premium-tariff-admin .ta-status {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}

.premium-tariff-admin .ta-status-active {
    background: var(--success-soft);
    color: var(--success);
}

.premium-tariff-admin .ta-status-archived,
.premium-tariff-admin .ta-status-draft {
    background: #eef0f5;
    color: var(--muted);
}

@media (max-width: 991.98px) {
    .premium-tariff-admin .ta-shell {
        grid-template-columns: 1fr;
    }

    .premium-tariff-admin .ta-rail {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .premium-tariff-admin .ta-rail-steps {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem 0.75rem;
    }

    .premium-tariff-admin .ta-rail-step {
        padding: 0.25rem 0;
        width: auto;
    }

    .premium-tariff-admin .ta-rail-step span span,
    .premium-tariff-admin .ta-rail-note {
        display: none;
    }
}

.premium-tariff-admin {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    margin-bottom: 0 !important;
    padding-top: 0.25rem;
    padding-bottom: 0.75rem;
}

.premium-tariff-admin .ta-alert {
    flex-shrink: 0;
}

.premium-tariff-admin .ta-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.9fr);
    gap: 1rem;
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
}

.premium-tariff-admin .ta-workspace > .card {
    margin-bottom: 0;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.premium-tariff-admin .ta-shell-card > .card-header,
.premium-tariff-admin .ta-list-card > .card-header {
    flex-shrink: 0;
}

.premium-tariff-admin .ta-shell-card > .card-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
}

.premium-tariff-admin .ta-shell-card .ta-shell {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.premium-tariff-admin .ta-shell-card .ta-rail {
    overflow-y: auto;
    min-height: 0;
}

.premium-tariff-admin .ta-shell-card .ta-stage {
    overflow-y: auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.premium-tariff-admin .ta-library-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
    background: #fff;
}

.premium-tariff-admin .ta-library-search {
    flex: 1 1 9rem;
    min-width: 8rem;
    max-width: none;
}

.premium-tariff-admin .ta-library-filters .form-select {
    flex: 0 1 7.5rem;
    max-width: 9rem;
}

.premium-tariff-admin .ta-library-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.65rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background: #fafbff;
}

.premium-tariff-admin .ta-library-foot {
    flex-shrink: 0;
    padding: 0.55rem 0.85rem;
    border-top: 1px solid var(--line);
    background: #fff;
}

.premium-tariff-admin .ta-library-foot .pagination {
    margin-bottom: 0;
    justify-content: center;
}

.premium-tariff-admin .ta-lib-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.65rem;
    align-items: center;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.premium-tariff-admin .ta-lib-row:hover {
    border-color: rgba(91, 79, 232, 0.45);
    box-shadow: 0 0 0 3px rgba(91, 79, 232, 0.08);
}

.premium-tariff-admin .ta-lib-row__title {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.premium-tariff-admin .ta-lib-row__meta {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.premium-tariff-admin .ta-lib-row__doc {
    margin-top: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--brand-ink, #3d36a8);
    word-break: break-word;
}

.premium-tariff-admin .ta-lib-row__doc--muted {
    font-weight: 550;
    color: var(--muted);
}

.premium-tariff-admin .ta-lib-row__action {
    flex-shrink: 0;
    white-space: nowrap;
}

.premium-tariff-admin .ta-library-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.88rem;
}

.premium-tariff-admin .ta-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 650;
    background: #eef0f5;
    color: var(--muted);
}

.premium-tariff-admin .ta-chip--live {
    background: var(--success-soft);
    color: var(--success);
}

.premium-tariff-admin .ta-chip--draft {
    background: #fff4e5;
    color: #b45309;
}

.premium-tariff-admin .ta-chip--archived {
    background: #eef0f5;
    color: var(--muted);
}

.premium-tariff-admin .ta-library-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

.premium-tariff-admin .ta-library-pdf {
    font-size: 0.72rem;
    color: var(--muted);
    word-break: break-all;
}

@media (max-width: 991.98px) {
    .premium-tariff-admin {
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .premium-tariff-admin .ta-workspace {
        grid-template-columns: 1fr;
        height: auto;
        max-height: none;
        min-height: 0;
        flex: none;
    }

    .premium-tariff-admin .ta-workspace > .card {
        height: auto;
        max-height: none;
    }

    .premium-tariff-admin .ta-shell-card > .card-body {
        overflow: visible;
        display: block;
    }

    .premium-tariff-admin .ta-shell-card .ta-shell {
        height: auto;
        overflow: visible;
    }

    .premium-tariff-admin .ta-library-scroll {
        max-height: min(28rem, 55vh);
    }
}

/* Shared tariff price modal */
body:has(.ta-price-modal) {
    overflow: hidden;
}

.ta-price-modal {
    z-index: 1060;
}

.ta-price-modal + .modal-backdrop {
    z-index: 1055;
}

.ta-price-modal__dialog {
    max-width: min(960px, calc(100vw - 1.5rem));
    margin: 1rem auto;
}

.ta-price-modal__content {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
}

.ta-price-modal__header {
    align-items: flex-start;
    gap: 0.75rem;
    border-bottom: 1px solid var(--line);
}

.ta-price-modal__heading {
    flex: 1;
    min-width: 0;
}

.ta-price-modal__title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    outline: none;
}

.ta-price-modal__subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.82rem;
    color: var(--muted);
}

.ta-price-modal__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.55rem;
}

.ta-price-modal__meta .ta-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 650;
    background: #eef0f5;
    color: var(--muted);
}

.ta-price-modal__meta .ta-chip--live {
    background: var(--success-soft);
    color: var(--success);
}

.ta-price-modal__meta .ta-chip--draft {
    background: #fff4e5;
    color: #b45309;
}

.ta-price-modal__meta .ta-chip--archived {
    background: #eef0f5;
    color: var(--muted);
}

.ta-price-modal__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.ta-price-modal__pdf-name {
    font-weight: 500;
    opacity: 0.85;
}

.ta-price-modal__body {
    overflow: auto;
    padding-top: 0.85rem;
}

.ta-price-modal__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.ta-price-modal__filters .form-control,
.ta-price-modal__filters .form-select {
    max-width: 12rem;
}

.ta-price-modal__table-wrap {
    overflow: auto;
    max-height: min(55vh, 28rem);
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) - 2px);
}

.ta-price-modal__table {
    margin: 0;
    font-size: 0.82rem;
}

.ta-price-modal__table thead th {
    position: sticky;
    top: 0;
    background: #f8f9fc;
    z-index: 1;
    border-bottom-width: 1px;
    white-space: nowrap;
}

.ta-price-modal__cell-primary {
    font-weight: 600;
}

.ta-price-modal__cell-muted {
    font-size: 0.75rem;
    color: var(--muted);
}

.ta-price-modal__row--highlight {
    background: rgba(91, 79, 232, 0.08);
}

.ta-price-modal__footer {
    border-top: 1px solid var(--line);
}

.ta-price-modal__more {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

@media (max-width: 575.98px) {
    .ta-price-modal__dialog {
        margin: 0;
        max-width: 100%;
        height: 100%;
    }

    .ta-price-modal__content {
        max-height: 100vh;
        height: 100%;
        border-radius: 0;
    }

    .ta-price-modal__filters .form-control,
    .ta-price-modal__filters .form-select {
        max-width: none;
        flex: 1 1 100%;
    }
}

/* Calculator — mock-aligned rating UX */
.premium-calculator-wizard {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    padding-top: 0.25rem;
    padding-bottom: 0.75rem;
}

.premium-calculator-wizard .pc-wizard-shell {
    overflow: hidden;
}

.premium-calculator-wizard .pc-stage {
    overflow-y: auto;
}

.premium-calculator-wizard .pc-step-panel {
    flex: 1 1 auto;
}

.premium-calculator-wizard .pc-stage-foot {
    margin-top: auto;
    justify-content: space-between;
    align-items: center;
}

.premium-calculator-wizard .pc-stage-foot .btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.premium-calculator-wizard .pc-plan-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    margin-bottom: 0.55rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.premium-calculator-wizard .pc-plan-row.is-selected {
    border-color: var(--brand, #5b4fe8);
    box-shadow: 0 0 0 3px rgba(91, 79, 232, 0.1);
}

.premium-calculator-wizard .pc-plan-row__select {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.premium-calculator-wizard .pc-plan-row__mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-weight: 700;
    background: #f1f5f9;
    color: #3d36a8;
    flex-shrink: 0;
}

.premium-calculator-wizard .pc-plan-row__meta {
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
}

.premium-calculator-wizard .pc-plan-row__prices {
    margin-left: auto;
    flex-shrink: 0;
    text-decoration: none;
}

.premium-calculator-wizard .pc-rate-section {
    margin-bottom: 1.15rem;
}

.premium-calculator-wizard .pc-rate-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--ink, #1a1d26);
    margin-bottom: 0.45rem;
}

.premium-calculator-wizard .pc-choice-row,
.premium-calculator-wizard .pc-choice-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.premium-calculator-wizard .pc-choice-chip {
    padding: 0.55rem 0.9rem;
    border-radius: 8px;
    border: 1px solid var(--line-strong, #d5d8e3);
    background: #fff;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.premium-calculator-wizard .pc-choice-chip:hover {
    color: var(--ink, #1a1d26);
    background: #f8f8fc;
}

.premium-calculator-wizard .pc-choice-chip.is-selected {
    border-color: var(--brand, #5b4fe8);
    background: #eeecfd;
    color: #3d36a8;
    box-shadow: 0 0 0 3px rgba(91, 79, 232, 0.12);
}

.premium-calculator-wizard .pc-members-section {
    padding-top: 0.35rem;
    border-top: 1px solid var(--line);
    margin-top: 0.35rem;
}

.premium-calculator-wizard .pc-members-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}

.premium-calculator-wizard .pc-hint {
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.4;
}

.premium-calculator-wizard .pc-warn-hint {
    color: #c2410c !important;
    margin-top: 0.55rem !important;
}

.premium-calculator-wizard .pc-family-pill,
.premium-calculator-wizard .pc-band-pill {
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: #eeecfd;
    color: #3d36a8;
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
}

.premium-calculator-wizard .pc-member-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.premium-calculator-wizard .pc-member-card {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fafafc;
}

.premium-calculator-wizard .pc-member-card.is-primary {
    background: #fff;
    border-color: var(--line-strong, #d5d8e3);
}

.premium-calculator-wizard .pc-member-role {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 5.5rem;
}

.premium-calculator-wizard .pc-role-chip {
    width: fit-content;
    display: inline-flex;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: #eef0f5;
    font-size: 0.7rem;
    font-weight: 700;
}

.premium-calculator-wizard .pc-role-chip--ok {
    background: var(--success-soft, #e8f7ee);
    color: var(--success, #15803d);
}

.premium-calculator-wizard .pc-role-chip--line {
    background: #e8f4fb;
    color: #0369a1;
}

.premium-calculator-wizard .pc-role-chip--warn {
    background: #fff1e7;
    color: #c2410c;
}

.premium-calculator-wizard .pc-role-sub {
    font-size: 0.68rem;
    color: #9aa0b0;
    font-weight: 600;
}

.premium-calculator-wizard .pc-member-name {
    min-width: 0;
}

.premium-calculator-wizard .pc-member-name .form-control {
    height: 38px;
    font-size: 0.86rem;
}

.premium-calculator-wizard .pc-age-stepper {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--line-strong, #d5d8e3);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.premium-calculator-wizard .pc-age-stepper button {
    width: 36px;
    height: 38px;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: #3d36a8;
    background: #f3f4f8;
    border: 0;
    padding: 0;
}

.premium-calculator-wizard .pc-age-stepper button:hover:not(:disabled) {
    background: #eeecfd;
}

.premium-calculator-wizard .pc-age-stepper button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.premium-calculator-wizard .pc-age-stepper input {
    width: 52px;
    height: 38px;
    border: 0;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    text-align: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    border-radius: 0;
    box-shadow: none;
}

.premium-calculator-wizard .pc-age-stepper input:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px #eeecfd;
}

.premium-calculator-wizard .pc-member-remove {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: var(--muted);
    border: 1px solid transparent;
    background: transparent;
    font-size: 1.25rem;
    line-height: 1;
}

.premium-calculator-wizard .pc-member-remove:hover:not(:disabled) {
    color: #b91c1c;
    background: #fdecec;
}

.premium-calculator-wizard .pc-member-remove:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.premium-calculator-wizard .pc-add-member-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
    border: 1px dashed var(--line-strong, #d5d8e3);
    border-radius: var(--radius);
    background: #fbfbfe;
}

.premium-calculator-wizard .pc-add-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
    margin-right: 0.15rem;
}

.premium-calculator-wizard .pc-premium-hero {
    font-size: 2.6rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    margin: 0.35rem 0 0.75rem;
    line-height: 1.1;
}

.premium-calculator-wizard .pc-quote-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.5rem;
}

.premium-calculator-wizard .pc-chip {
    display: inline-flex;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: #eef0f5;
    color: var(--muted);
}

.premium-calculator-wizard .pc-chip--ok {
    background: var(--success-soft, #e8f7ee);
    color: var(--success, #15803d);
}

.premium-calculator-wizard .pc-matched-rows {
    margin-top: 1.1rem;
    border-top: 1px solid var(--line);
    padding-top: 1rem;
    max-width: 560px;
}

.premium-calculator-wizard .pc-matched-rows h4 {
    margin: 0 0 0.65rem;
    font-size: 0.9rem;
    font-weight: 700;
}

.premium-calculator-wizard .pc-matched-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.premium-calculator-wizard .pc-matched-list li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem 0.85rem;
    background: #f8fafc;
    border-radius: 12px;
    font-size: 0.86rem;
}

.premium-calculator-wizard .pc-matched-meta {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 0.15rem;
}

@media (max-width: 720px) {
    .premium-calculator-wizard .pc-member-card {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "role remove"
            "name name"
            "age age";
    }

    .premium-calculator-wizard .pc-member-role { grid-area: role; }
    .premium-calculator-wizard .pc-member-name { grid-area: name; }
    .premium-calculator-wizard .pc-age-stepper { grid-area: age; }
    .premium-calculator-wizard .pc-member-remove {
        grid-area: remove;
        justify-self: end;
    }
}

@media (max-width: 767.98px) {
    .premium-calculator-wizard {
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .premium-calculator-wizard .pc-wizard-shell {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
    }

    .premium-calculator-wizard .pc-rail,
    .premium-calculator-wizard .pc-stage {
        overflow: visible;
        height: auto;
        max-height: none;
    }
}

/* AI agent tariff quote chip (mock tariff-chip-btn) */
.glass-chat-tariff-chip,
.glass-chat-quote-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.7rem;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    background: #eeecfd;
    color: #3d36a8;
    font-size: 0.76rem;
    font-weight: 700;
    border: 1px solid rgba(91, 79, 232, 0.22);
    cursor: pointer;
    transition: transform 0.12s ease, background 0.15s ease;
}

.glass-chat-tariff-chip:hover,
.glass-chat-quote-chip:hover {
    background: #e4e0fc;
    transform: translateY(-1px);
}

.glass-chat-msg--assistant .glass-chat-tariff-chip {
    margin-left: 0;
}

/* —— Notification center —— */
.wg-notif {
    position: relative;
}

.wg-notif__bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    padding: 0;
    border: 1px solid rgba(52, 71, 103, 0.12);
    border-radius: 12px;
    background: #fff;
    color: #344054;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, color 0.15s;
}

.wg-notif__bell:hover {
    border-color: rgba(91, 79, 232, 0.35);
    color: #5b4fe8;
    box-shadow: 0 0 0 3px rgba(91, 79, 232, 0.1);
}

.wg-notif__bell i {
    font-size: 0.95rem;
}

.wg-notif__badge {
    position: absolute;
    top: -0.35rem;
    right: -0.35rem;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.28rem;
    border-radius: 999px;
    background: #e11d48;
    color: #fff !important;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.15rem;
    text-align: center;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(225, 29, 72, 0.35);
    pointer-events: none;
}

.wg-notif__panel {
    position: absolute;
    top: calc(100% + 0.55rem);
    right: 0;
    z-index: 1080;
    width: min(24rem, calc(100vw - 1.5rem));
    background: #fff;
    border: 1px solid rgba(52, 71, 103, 0.1);
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
    overflow: hidden;
}

.wg-notif__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1rem 0.75rem;
    border-bottom: 1px solid rgba(52, 71, 103, 0.08);
    background: linear-gradient(180deg, #fafbff 0%, #fff 100%);
}

.wg-notif__title {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
    color: #1a1d26;
}

.wg-notif__sub {
    margin: 0.15rem 0 0;
    font-size: 0.72rem;
    color: #8b95a8;
}

.wg-notif__head-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.wg-notif__mark {
    border: 0;
    background: transparent;
    color: #5b4fe8;
    font-size: 0.72rem;
    font-weight: 650;
    padding: 0.15rem 0;
    white-space: nowrap;
    cursor: pointer;
}

.wg-notif__mark:hover {
    text-decoration: underline;
}

.wg-notif__close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    padding: 0;
    border: 1px solid rgba(52, 71, 103, 0.12);
    border-radius: 10px;
    background: #fff;
    color: #475467;
    cursor: pointer;
}

.wg-notif__close:hover,
.wg-notif__close:active {
    color: #1a1d26;
    border-color: rgba(52, 71, 103, 0.22);
    background: #f7f8fc;
}

.wg-notif__list {
    max-height: 22rem;
    overflow-y: auto;
}

.wg-notif__item {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    padding: 0.8rem 1rem;
    text-decoration: none !important;
    border-bottom: 1px solid rgba(52, 71, 103, 0.06);
    transition: background 0.12s;
}

.wg-notif__item:last-child {
    border-bottom: 0;
}

.wg-notif__item:hover {
    background: #f7f8fc;
}

.wg-notif__item.is-unread {
    background: #f5f3ff;
}

.wg-notif__item.is-unread:hover {
    background: #efeaff;
}

.wg-notif__dot {
    width: 0.5rem;
    height: 0.5rem;
    margin-top: 0.4rem;
    border-radius: 50%;
    background: transparent;
    flex-shrink: 0;
}

.wg-notif__item.is-unread .wg-notif__dot {
    background: #5b4fe8;
    box-shadow: 0 0 0 3px rgba(91, 79, 232, 0.15);
}

.wg-notif__body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.wg-notif__item-title {
    font-size: 0.84rem;
    font-weight: 650;
    color: #1e293b;
    line-height: 1.3;
}

.wg-notif__item.is-read .wg-notif__item-title {
    font-weight: 500;
    color: #475467;
}

.wg-notif__item-text {
    font-size: 0.75rem;
    color: #667085;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wg-notif__item-time {
    font-size: 0.68rem;
    color: #98a2b3;
    margin-top: 0.1rem;
}

.wg-notif__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    padding: 2rem 1rem;
    color: #98a2b3;
    text-align: center;
}

.wg-notif__empty i {
    font-size: 1.25rem;
    opacity: 0.7;
}

.wg-notif__empty p {
    margin: 0;
    font-size: 0.8rem;
}

.wg-notif-enter {
    transition: opacity 0.14s ease, transform 0.14s ease;
}

.wg-notif-enter-start,
.wg-notif-leave-end {
    opacity: 0;
    transform: translateY(-4px);
}

.wg-notif-enter-end,
.wg-notif-leave-start {
    opacity: 1;
    transform: translateY(0);
}

.wg-notif-leave {
    transition: opacity 0.1s ease, transform 0.1s ease;
}

.wg-notif__toast {
    position: fixed;
    top: 1.1rem;
    right: 1.1rem;
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    width: min(22rem, calc(100vw - 1.5rem));
    padding: 0.85rem 0.95rem;
    border-radius: 14px;
    border: 1px solid rgba(91, 79, 232, 0.2);
    background: #fff;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
    cursor: pointer;
}

@media (max-width: 767.98px) {
    .wg-notif__bell {
        width: 2.6rem;
        height: 2.6rem;
    }

    .wg-notif__panel {
        position: fixed;
        top: max(0.65rem, env(safe-area-inset-top, 0px));
        right: 0.65rem;
        left: 0.65rem;
        width: auto;
        max-height: calc(100dvh - 1.3rem - env(safe-area-inset-bottom, 0px));
        display: flex;
        flex-direction: column;
        border-radius: 18px;
        box-shadow: 0 22px 50px rgba(15, 23, 42, 0.22);
    }

    .wg-notif__head {
        padding: 1rem 1rem 0.85rem;
        flex-shrink: 0;
    }

    .wg-notif__close {
        display: inline-flex;
    }

    .wg-notif__mark {
        min-height: 2.1rem;
        padding: 0.35rem 0.5rem;
        font-size: 0.78rem;
    }

    .wg-notif__list {
        max-height: none;
        flex: 1 1 auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .wg-notif__item {
        padding: 0.95rem 1rem;
        min-height: 3.25rem;
    }

    .wg-notif__item-title {
        font-size: 0.9rem;
    }

    .wg-notif__item-text {
        font-size: 0.8rem;
    }

    .wg-notif__toast {
        top: auto;
        bottom: max(1rem, env(safe-area-inset-bottom, 0px));
        left: 0.75rem;
        right: 0.75rem;
        width: auto;
    }

    .wg-notif-enter-start,
    .wg-notif-leave-end {
        transform: translateY(8px);
    }
}

.wg-notif__toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    background: linear-gradient(135deg, #7928ca 0%, #cb0c9f 100%);
    color: #fff;
    flex-shrink: 0;
}

.wg-notif__toast-copy {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.wg-notif__toast-copy strong {
    font-size: 0.86rem;
    color: #1a1d26;
    line-height: 1.3;
}

.wg-notif__toast-copy small {
    font-size: 0.75rem;
    color: #667085;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- Policy details design fixes (from Playwright design-audit) ---- */
/* Stop Bootstrap row stretch: left stack was forcing ~989px empty payments column */
.policy-view-details > .container-fluid {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

.policy-view-details > .container-fluid > .row {
    align-items: flex-start;
}

.policy-view-details > .container-fluid > .soft-card.mb-4 {
    margin-bottom: 0.75rem !important;
}

.policy-view-details .col-12.col-lg-5 .soft-card.mb-3,
.policy-view-details .col-12.col-xl-4 .soft-card.mb-3 {
    margin-bottom: 0.65rem !important;
}

.policy-view-details .dense-dl.row > dt {
    margin-bottom: 0 !important;
    padding-top: 0.12rem;
    padding-bottom: 0.12rem;
    font-size: 0.78rem;
    font-weight: 650;
}

.policy-view-details .dense-dl.row > dd {
    margin-bottom: 0 !important;
    padding-top: 0.12rem;
    padding-bottom: 0.12rem;
    font-size: 0.86rem;
}

.policy-view-details .soft-card .card-header {
    padding: 0.55rem 0.95rem 0.1rem !important;
}

.policy-view-details .soft-card .card-header .card-title {
    margin-bottom: 0.1rem !important;
}

.policy-view-details .soft-card .card-header .text-muted {
    margin-bottom: 0 !important;
}

.policy-view-details .soft-card .card-body {
    padding: 0.35rem 0.95rem 0.55rem !important;
}

.policy-view-details .policy-payments-card {
    min-height: 0 !important;
    height: auto !important;
    align-self: flex-start;
}

.policy-view-details .policy-payments-card .card-header {
    padding: 0.65rem 0.95rem !important;
}

.policy-view-details .policy-payments-card .table-responsive {
    margin-bottom: 0.35rem;
}

.policy-view-details .empty-state,
.policy-view-details .text-center.py-5,
.policy-view-details .policy-payments-card .text-center {
    padding-top: 0.65rem !important;
    padding-bottom: 0.65rem !important;
}

.policy-view-details .empty-state .material-icons,
.policy-view-details .text-center.py-5 .material-icons {
    font-size: 1.5rem !important;
    margin-bottom: 0.25rem !important;
}

/* Receipts / history blocks should not invent tall empty planes */
.policy-view-details .soft-card .card-body.py-5 {
    padding-top: 0.65rem !important;
    padding-bottom: 0.65rem !important;
}

.policy-view-details .policy-receipts-empty {
    margin-top: 0.5rem;
    padding: 0.55rem 0.75rem;
    border: 1px dashed var(--line, #e6e8ef);
    border-radius: 10px;
    font-size: 0.82rem;
}

.policy-view-details .policy-receipts-empty .material-icons {
    font-size: 1.35rem !important;
    margin-bottom: 0.2rem;
    opacity: 0.7;
}

.policy-view-details .policy-audit-card {
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
}

/* Status filter — readable width, one caret, no ×/caret collision */
.policy-view-details .policy-status-filter {
    gap: 0.55rem !important;
}

.policy-view-details .policy-status-filter .toolbar-label {
    font-size: 0.8rem;
    font-weight: 650;
    color: var(--muted, #6b7285);
    white-space: nowrap;
}

.policy-view-details .policy-status-filter .soft-header {
    min-width: 200px;
    width: min(240px, 100%);
}

.policy-view-details .policy-status-filter .selectize-control,
.policy-view-details .policy-status-filter .selectize-input {
    width: 100% !important;
}

.policy-view-details .policy-status-filter .selectize-input {
    min-height: 40px !important;
    padding: 0.4rem 2rem 0.4rem 0.85rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.25rem;
}

.policy-view-details .policy-status-filter .selectize-input .item {
    display: inline-flex !important;
    align-items: center;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.86rem !important;
    font-weight: 600;
    line-height: 1.25 !important;
    background: transparent !important;
    border: 0 !important;
    color: var(--ink, #1a1d26) !important;
}

.policy-view-details .policy-status-filter .selectize-input input {
    width: 0 !important;
    min-width: 0 !important;
    opacity: 0;
}

.policy-view-details .policy-status-filter .selectize-control.single .selectize-input:after {
    top: 50% !important;
    right: 12px !important;
    margin-top: 0 !important;
    transform: translateY(-35%) !important;
    border-width: 5px 5px 0 5px !important;
    border-color: #8b93a7 transparent transparent transparent !important;
}

.policy-view-details .policy-status-filter .selectize-control .clear {
    display: none !important;
}

/* Roles permissions — phone: stack name + description, keep groups tappable */
@media (max-width: 767.98px) {
    .role-form-head {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .role-perm-toolbar {
        position: sticky;
        top: 0;
        z-index: 2;
    }

    .role-group-bar {
        flex-wrap: wrap;
        padding: 0.45rem 0.55rem;
    }

    .role-group-head {
        min-height: 44px;
        width: 100%;
    }

    .role-group-select {
        margin-left: auto;
    }

    .role-perm-table thead {
        display: none;
    }

    .role-perm-table,
    .role-perm-table tbody,
    .role-perm-table tr,
    .role-perm-table td {
        display: block;
        width: 100% !important;
    }

    .role-perm-table tbody tr {
        padding: 0.55rem 0.65rem;
        border-bottom: 1px solid var(--line, #e6e8ef);
    }

    .role-perm-table td.perm-col,
    .role-perm-table td.desc-col {
        padding: 0.15rem 0 !important;
        border: 0 !important;
    }

    .role-perm-table td.desc-col .role-perm-desc {
        margin: 0.15rem 0 0 1.65rem;
        font-size: 0.75rem;
        color: var(--muted, #6b7285);
    }
}

/* Phone: payment schedule as stacked cards — keep all columns, no sideways scroll */
@media (max-width: 767.98px) {
    .policy-view-details .modern-table thead {
        display: none;
    }

    .policy-view-details .modern-table,
    .policy-view-details .modern-table tbody {
        display: block;
        width: 100%;
    }

    .policy-view-details .modern-table tbody tr {
        display: block;
        width: 100%;
        margin: 0 0 0.65rem;
        padding: 0.55rem 0.7rem;
        border: 1px solid var(--line, #e6e8ef);
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 1px 2px rgba(26, 29, 38, 0.04);
    }

    .policy-view-details .modern-table tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        width: 100% !important;
        border: 0 !important;
        padding: 0.28rem 0 !important;
        text-align: right !important;
        white-space: normal !important;
    }

    .policy-view-details .modern-table tbody td::before {
        content: attr(data-label);
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.03em;
        text-transform: uppercase;
        color: var(--muted, #6b7285);
        text-align: left;
        flex: 0 0 42%;
    }

    .policy-view-details .table-responsive {
        overflow-x: visible !important;
    }

    /* Keep closed off-canvas out of hit-testing, but NEVER disable a pinned/open menu.
       Earlier :not(.show) broke interactivity — Glass uses g-sidenav-pinned, not .show. */
    body:not(.g-sidenav-pinned):not(.g-sidenav-show) .wg-sidebar.sidebar,
    body:not(.g-sidenav-pinned):not(.g-sidenav-show) aside.wg-sidebar#sidenav-main {
        pointer-events: none;
    }

    body.g-sidenav-pinned .wg-sidebar.sidebar,
    body.g-sidenav-pinned aside.wg-sidebar#sidenav-main,
    body.g-sidenav-show.g-sidenav-pinned .wg-sidebar.sidebar {
        visibility: visible !important;
        pointer-events: auto !important;
    }
}
