:root {
    --bcms-primary: #0b3d91;
    --bcms-primary-dark: #072a65;
    --bcms-primary-soft: #eaf0fb;
    --bcms-accent: #c89b2c;
    --bcms-accent-dark: #9c761c;
    --bcms-bg: #f4f7fb;
    --bcms-surface: #ffffff;
    --bcms-text: #172033;
    --bcms-muted: #667085;
    --bcms-border: #dfe5ee;
    --bcms-success: #16794b;
    --bcms-danger: #b42318;
    --bcms-warning: #a15c07;
    --bcms-info: #1769aa;
    --bcms-radius: 0.75rem;
    --bcms-shadow: 0 0.35rem 1.25rem rgba(25, 46, 89, 0.08);
    --bcms-sidebar-width: 17rem;
    --bcms-topbar-height: 4.25rem;
    --bs-primary: var(--bcms-primary);
    --bs-secondary: #667085;
    --bs-success: var(--bcms-success);
    --bs-danger: var(--bcms-danger);
    --bs-warning: var(--bcms-warning);
    --bs-info: var(--bcms-info);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--bcms-text);
    background: var(--bcms-bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.9375rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

body.is-locked {
    overflow: hidden;
}

a {
    color: var(--bcms-primary);
    text-decoration: none;
}

a:hover {
    color: var(--bcms-primary-dark);
    text-decoration: underline;
}

img,
svg {
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.skip-link {
    position: fixed;
    z-index: 1200;
    top: -5rem;
    left: 1rem;
    padding: 0.65rem 1rem;
    color: #fff;
    background: var(--bcms-primary);
    border-radius: 0.5rem;
}

.skip-link:focus {
    top: 0.75rem;
}

.icon {
    width: 1.15rem;
    height: 1.15rem;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: -0.18em;
}

.container,
.container-fluid {
    width: 100%;
    margin-right: auto;
    margin-left: auto;
    padding-right: 1rem;
    padding-left: 1rem;
}

.container {
    max-width: 78rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: -0.5rem;
}

.row > * {
    min-width: 0;
    padding: 0.5rem;
}

.col,
.col-12 {
    flex: 0 0 auto;
    width: 100%;
}

.col-auto {
    flex: 0 0 auto;
    width: auto;
}

.g-0 {
    margin: 0;
}

.g-0 > * {
    padding: 0;
}

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-column { flex-direction: column !important; }
.align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-end { justify-content: flex-end !important; }
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }
.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }
.m-0 { margin: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.ms-auto { margin-left: auto !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.p-0 { padding: 0 !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.px-3 { padding-right: 1rem !important; padding-left: 1rem !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.text-start { text-align: left !important; }
.text-center { text-align: center !important; }
.text-end { text-align: right !important; }
.text-muted { color: var(--bcms-muted) !important; }
.text-primary { color: var(--bcms-primary) !important; }
.text-success { color: var(--bcms-success) !important; }
.text-danger { color: var(--bcms-danger) !important; }
.text-warning { color: var(--bcms-warning) !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-bold { font-weight: 700 !important; }
.small, small { font-size: 0.82rem; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.app-shell {
    min-height: 100vh;
}

.app-sidebar {
    position: fixed;
    z-index: 1040;
    inset: 0 auto 0 0;
    display: flex;
    width: var(--bcms-sidebar-width);
    flex-direction: column;
    color: #fff;
    background: linear-gradient(180deg, var(--bcms-primary-dark), var(--bcms-primary) 55%, #0d3475);
    box-shadow: 0.35rem 0 1.75rem rgba(7, 42, 101, 0.15);
}

.brand {
    display: flex;
    min-height: var(--bcms-topbar-height);
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.15rem;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand:hover {
    color: #fff;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 2.55rem;
    height: 2.55rem;
    flex: 0 0 auto;
    place-items: center;
    color: var(--bcms-primary-dark);
    background: var(--bcms-accent);
    border-radius: 0.7rem;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: inherit;
}

.brand-name {
    display: block;
    overflow: hidden;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-company {
    display: block;
    max-width: 11rem;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-nav {
    min-height: 0;
    flex: 1 1 auto;
    padding: 1rem 0.75rem;
    overflow-y: auto;
    scrollbar-width: thin;
}

.sidebar-label {
    margin: 0.75rem 0.65rem 0.4rem;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 2.75rem;
    margin-bottom: 0.2rem;
    padding: 0.63rem 0.75rem;
    color: rgba(255, 255, 255, 0.82);
    border-radius: 0.6rem;
    font-weight: 550;
    transition: color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.sidebar-link:hover,
.sidebar-link:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
    transform: translateX(0.1rem);
    outline: none;
}

.sidebar-link.active,
.sidebar-link[aria-current="page"] {
    color: #fff;
    background: rgba(200, 155, 44, 0.22);
    box-shadow: inset 0.18rem 0 0 var(--bcms-accent);
}

.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.app-main {
    min-width: 0;
    min-height: 100vh;
    margin-left: var(--bcms-sidebar-width);
}

.topbar {
    position: sticky;
    z-index: 1020;
    top: 0;
    display: flex;
    min-height: var(--bcms-topbar-height);
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 1.5rem;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--bcms-border);
    backdrop-filter: blur(10px);
}

.topbar-title {
    min-width: 0;
    margin-right: auto;
}

.topbar-title h1 {
    margin: 0;
    overflow: hidden;
    font-size: 1.06rem;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-title p {
    margin: 0.08rem 0 0;
    color: var(--bcms-muted);
    font-size: 0.74rem;
}

.topbar-action,
.icon-button {
    position: relative;
    display: inline-grid;
    width: 2.6rem;
    height: 2.6rem;
    flex: 0 0 auto;
    padding: 0;
    place-items: center;
    color: #344054;
    background: #fff;
    border: 1px solid var(--bcms-border);
    border-radius: 50%;
}

.topbar-action:hover,
.icon-button:hover {
    color: var(--bcms-primary);
    background: var(--bcms-primary-soft);
    border-color: #b7c8e8;
}

.notification-count {
    position: absolute;
    top: -0.2rem;
    right: -0.18rem;
    display: grid;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.25rem;
    place-items: center;
    color: #fff;
    background: var(--bcms-danger);
    border: 2px solid #fff;
    border-radius: 1rem;
    font-size: 0.63rem;
    font-weight: 700;
    line-height: 1;
}

.profile-button {
    display: flex;
    max-width: 14rem;
    align-items: center;
    gap: 0.55rem;
    padding: 0.3rem 0.55rem 0.3rem 0.35rem;
    color: var(--bcms-text);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 2rem;
}

.profile-button:hover {
    background: var(--bcms-bg);
    border-color: var(--bcms-border);
}

.avatar {
    display: inline-grid;
    width: 2.15rem;
    height: 2.15rem;
    flex: 0 0 auto;
    place-items: center;
    overflow: hidden;
    color: #fff;
    background: var(--bcms-primary);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.avatar-sm {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.66rem;
}

.avatar-lg {
    width: 4.5rem;
    height: 4.5rem;
    font-size: 1.25rem;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-meta {
    min-width: 0;
    text-align: left;
}

.profile-name,
.profile-role {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-name {
    max-width: 9rem;
    font-size: 0.83rem;
    font-weight: 650;
}

.profile-role {
    color: var(--bcms-muted);
    font-size: 0.69rem;
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    z-index: 1050;
    top: calc(100% + 0.55rem);
    right: 0;
    display: none;
    min-width: 13rem;
    max-width: min(22rem, calc(100vw - 2rem));
    padding: 0.45rem;
    background: #fff;
    border: 1px solid var(--bcms-border);
    border-radius: 0.75rem;
    box-shadow: 0 1rem 2.5rem rgba(16, 24, 40, 0.17);
}

.dropdown-menu.show {
    display: block;
    animation: dropdown-in 0.14s ease-out;
}

.dropdown-header {
    padding: 0.65rem 0.7rem;
    color: var(--bcms-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dropdown-item {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.55rem;
    padding: 0.58rem 0.7rem;
    color: #344054;
    background: transparent;
    border: 0;
    border-radius: 0.5rem;
    text-align: left;
}

.dropdown-item:hover,
.dropdown-item:focus-visible {
    color: var(--bcms-primary);
    background: var(--bcms-primary-soft);
    text-decoration: none;
    outline: none;
}

.dropdown-divider {
    height: 1px;
    margin: 0.4rem 0;
    background: var(--bcms-border);
}

.notification-menu {
    width: 22rem;
    padding: 0;
    overflow: hidden;
}

.notification-menu-head,
.notification-menu-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
}

.notification-menu-head {
    border-bottom: 1px solid var(--bcms-border);
}

.notification-menu-foot {
    justify-content: center;
    border-top: 1px solid var(--bcms-border);
}

.notification-preview {
    display: flex;
    gap: 0.65rem;
    padding: 0.8rem 1rem;
    color: var(--bcms-text);
    border-bottom: 1px solid #edf0f5;
}

.notification-preview:hover {
    background: #f8faff;
    text-decoration: none;
}

.notification-preview.unread {
    background: #eff5ff;
}

.notification-dot {
    width: 0.6rem;
    height: 0.6rem;
    flex: 0 0 auto;
    margin-top: 0.35rem;
    background: var(--bcms-primary);
    border-radius: 50%;
}

.sidebar-toggle {
    display: none;
}

.drawer-backdrop {
    position: fixed;
    z-index: 1030;
    inset: 0;
    display: none;
    background: rgba(16, 24, 40, 0.56);
    backdrop-filter: blur(1px);
}

.drawer-backdrop.show {
    display: block;
}

.page-content {
    width: 100%;
    max-width: 100rem;
    margin: 0 auto;
    padding: 1.25rem 1.5rem 2.5rem;
}

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

.page-header h2 {
    margin: 0;
    font-size: 1.45rem;
    line-height: 1.25;
}

.page-header p {
    max-width: 48rem;
    margin: 0.28rem 0 0;
    color: var(--bcms-muted);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 0 0 0.85rem;
    padding: 0;
    color: var(--bcms-muted);
    list-style: none;
    font-size: 0.78rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    padding: 0 0.5rem;
    color: #98a2b3;
}

.breadcrumb-item.active {
    color: #475467;
}

.card {
    min-width: 0;
    background: var(--bcms-surface);
    border: 1px solid var(--bcms-border);
    border-radius: var(--bcms-radius);
    box-shadow: var(--bcms-shadow);
}

.card-header,
.card-footer {
    padding: 1rem 1.2rem;
    background: #fff;
}

.card-header {
    border-bottom: 1px solid var(--bcms-border);
    border-radius: var(--bcms-radius) var(--bcms-radius) 0 0;
}

.card-footer {
    border-top: 1px solid var(--bcms-border);
    border-radius: 0 0 var(--bcms-radius) var(--bcms-radius);
}

.card-body {
    padding: 1.2rem;
}

.card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.card-subtitle {
    margin: 0.2rem 0 0;
    color: var(--bcms-muted);
    font-size: 0.8rem;
}

.stat-card {
    position: relative;
    height: 100%;
    overflow: hidden;
}

.stat-card::after {
    position: absolute;
    right: -2rem;
    bottom: -2.7rem;
    width: 7rem;
    height: 7rem;
    content: "";
    background: var(--bcms-primary-soft);
    border-radius: 50%;
}

.stat-card .card-body {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.stat-value {
    display: block;
    margin-top: 0.3rem;
    font-size: 1.85rem;
    font-weight: 750;
    line-height: 1.1;
}

.stat-icon {
    display: grid;
    width: 2.75rem;
    height: 2.75rem;
    flex: 0 0 auto;
    place-items: center;
    color: var(--bcms-primary);
    background: var(--bcms-primary-soft);
    border-radius: 0.72rem;
}

.btn {
    display: inline-flex;
    min-height: 2.4rem;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.5rem 0.85rem;
    color: #344054;
    background: #fff;
    border: 1px solid #cfd6e0;
    border-radius: 0.5rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.btn:hover {
    color: #1d2939;
    background: #f7f8fa;
    text-decoration: none;
    transform: translateY(-1px);
}

.btn:focus-visible,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(11, 61, 145, 0.18);
}

.btn:disabled,
.btn.disabled {
    cursor: not-allowed;
    opacity: 0.58;
    transform: none;
}

.btn-primary {
    color: #fff;
    background: var(--bcms-primary);
    border-color: var(--bcms-primary);
}

.btn-primary:hover {
    color: #fff;
    background: var(--bcms-primary-dark);
    border-color: var(--bcms-primary-dark);
}

.btn-accent {
    color: #1b2740;
    background: var(--bcms-accent);
    border-color: var(--bcms-accent);
}

.btn-accent:hover {
    color: #101828;
    background: #d8ad40;
}

.btn-success {
    color: #fff;
    background: var(--bcms-success);
    border-color: var(--bcms-success);
}

.btn-danger {
    color: #fff;
    background: var(--bcms-danger);
    border-color: var(--bcms-danger);
}

.btn-outline-primary {
    color: var(--bcms-primary);
    border-color: var(--bcms-primary);
}

.btn-outline-primary:hover {
    color: #fff;
    background: var(--bcms-primary);
}

.btn-outline-danger {
    color: var(--bcms-danger);
    border-color: #e1a9a5;
}

.btn-outline-danger:hover {
    color: #fff;
    background: var(--bcms-danger);
    border-color: var(--bcms-danger);
}

.btn-link {
    min-height: auto;
    padding: 0.25rem;
    color: var(--bcms-primary);
    background: transparent;
    border-color: transparent;
}

.btn-link:hover {
    color: var(--bcms-primary-dark);
    background: transparent;
    text-decoration: underline;
    transform: none;
}

.btn-sm {
    min-height: 2rem;
    padding: 0.36rem 0.62rem;
    font-size: 0.8rem;
}

.btn-lg {
    min-height: 2.9rem;
    padding: 0.7rem 1.15rem;
}

.btn-icon {
    width: 2.25rem;
    padding: 0;
}

.btn-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.form-label {
    display: inline-block;
    margin-bottom: 0.38rem;
    color: #344054;
    font-size: 0.84rem;
    font-weight: 650;
}

.required::after {
    margin-left: 0.15rem;
    color: var(--bcms-danger);
    content: "*";
}

.form-control,
.form-select {
    display: block;
    width: 100%;
    min-height: 2.65rem;
    padding: 0.57rem 0.72rem;
    color: var(--bcms-text);
    background-color: #fff;
    border: 1px solid #cbd3df;
    border-radius: 0.5rem;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.form-select {
    padding-right: 2.25rem;
    background-image: linear-gradient(45deg, transparent 50%, #667085 50%), linear-gradient(135deg, #667085 50%, transparent 50%);
    background-position: calc(100% - 1rem) 1.12rem, calc(100% - 0.72rem) 1.12rem;
    background-repeat: no-repeat;
    background-size: 0.3rem 0.3rem, 0.3rem 0.3rem;
    appearance: none;
}

textarea.form-control {
    min-height: 6rem;
    resize: vertical;
}

.form-control:hover,
.form-select:hover {
    border-color: #98a2b3;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--bcms-primary);
}

.form-control[disabled],
.form-control[readonly],
.form-select[disabled] {
    color: #667085;
    background: #f2f4f7;
    cursor: not-allowed;
}

.form-text {
    margin-top: 0.3rem;
    color: var(--bcms-muted);
    font-size: 0.76rem;
}

.invalid-feedback,
.field-error {
    display: block;
    margin-top: 0.3rem;
    color: var(--bcms-danger);
    font-size: 0.76rem;
}

.is-invalid,
.was-validated :invalid {
    border-color: var(--bcms-danger) !important;
}

.form-check {
    display: flex;
    min-height: 1.5rem;
    align-items: flex-start;
    gap: 0.5rem;
}

.form-check-input {
    width: 1.05rem;
    height: 1.05rem;
    flex: 0 0 auto;
    margin-top: 0.2rem;
    accent-color: var(--bcms-primary);
}

.input-group {
    display: flex;
    width: 100%;
}

.input-group > .form-control,
.input-group > .form-select {
    min-width: 0;
    flex: 1 1 auto;
    border-radius: 0.5rem 0 0 0.5rem;
}

.input-group > .btn,
.input-group-text {
    flex: 0 0 auto;
    border-radius: 0 0.5rem 0.5rem 0;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.55rem 0.7rem;
    color: var(--bcms-muted);
    background: #f8fafc;
    border: 1px solid #cbd3df;
    border-left: 0;
}

.search-control {
    position: relative;
    min-width: min(19rem, 100%);
}

.search-control .form-control {
    padding-left: 2.4rem;
}

.search-control .icon {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 0.75rem;
    color: #98a2b3;
    transform: translateY(-50%);
    pointer-events: none;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 0.75rem;
    padding: 1rem 1.2rem;
    background: #fff;
    border-bottom: 1px solid var(--bcms-border);
}

.filter-field {
    min-width: 10rem;
    flex: 1 1 10rem;
}

.filter-field.search-control {
    flex-basis: 16rem;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    margin: 0;
    color: var(--bcms-text);
    border-collapse: collapse;
    vertical-align: middle;
}

.table th,
.table td {
    padding: 0.82rem 1rem;
    border-bottom: 1px solid #e9edf3;
    text-align: left;
}

.table th {
    color: #475467;
    background: #f8fafc;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    white-space: nowrap;
}

.table tbody tr:hover {
    background: #fafcff;
}

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

.table td.actions,
.table th.actions {
    width: 1%;
    text-align: right;
    white-space: nowrap;
}

.table-sm th,
.table-sm td {
    padding: 0.58rem 0.7rem;
}

.table-card .card-body {
    padding: 0;
}

.table-card .table-pagination {
    border-top: 1px solid var(--bcms-border);
}

.table-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1.1rem;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.page-link {
    display: grid;
    min-width: 2.15rem;
    height: 2.15rem;
    padding: 0 0.5rem;
    place-items: center;
    color: #344054;
    background: #fff;
    border: 1px solid var(--bcms-border);
    border-radius: 0.42rem;
}

.page-link:hover {
    color: var(--bcms-primary);
    background: var(--bcms-primary-soft);
    text-decoration: none;
}

.page-item.active .page-link,
.page-link.active {
    color: #fff;
    background: var(--bcms-primary);
    border-color: var(--bcms-primary);
}

.page-item.disabled .page-link {
    color: #98a2b3;
    background: #f8fafc;
    pointer-events: none;
}

.badge {
    display: inline-flex;
    min-height: 1.45rem;
    align-items: center;
    padding: 0.18rem 0.55rem;
    color: #344054;
    background: #edf0f5;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.badge-primary,
.bg-primary { color: #fff; background: var(--bcms-primary); }
.badge-success,
.bg-success { color: #fff; background: var(--bcms-success); }
.badge-danger,
.bg-danger { color: #fff; background: var(--bcms-danger); }
.badge-warning,
.bg-warning { color: #382b06; background: #f5cc68; }
.badge-info,
.bg-info { color: #fff; background: var(--bcms-info); }
.badge-muted { color: #475467; background: #eaecf0; }
.badge-soft-primary { color: var(--bcms-primary-dark); background: var(--bcms-primary-soft); }
.badge-soft-success { color: #08603a; background: #dcfae6; }
.badge-soft-danger { color: #912018; background: #fee4e2; }
.badge-soft-warning { color: #854a0e; background: #fef0c7; }

.alert {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    margin-bottom: 1rem;
    padding: 0.85rem 2.7rem 0.85rem 1rem;
    color: #344054;
    background: #f8fafc;
    border: 1px solid var(--bcms-border);
    border-left-width: 0.28rem;
    border-radius: 0.6rem;
}

.alert-success { color: #075f39; background: #ecfdf3; border-color: #75e0a7; }
.alert-danger { color: #912018; background: #fef3f2; border-color: #fda29b; }
.alert-warning { color: #854a0e; background: #fffaeb; border-color: #fec84b; }
.alert-info { color: #175c8f; background: #eff8ff; border-color: #84caff; }

.alert-close {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    display: grid;
    width: 1.8rem;
    height: 1.8rem;
    padding: 0;
    place-items: center;
    color: currentColor;
    background: transparent;
    border: 0;
    border-radius: 50%;
    opacity: 0.7;
}

.alert-close:hover {
    background: rgba(16, 24, 40, 0.08);
    opacity: 1;
}

.empty-state {
    display: grid;
    min-height: 16rem;
    padding: 2.5rem 1.2rem;
    place-items: center;
    color: var(--bcms-muted);
    text-align: center;
}

.empty-state-icon {
    display: grid;
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    place-items: center;
    color: var(--bcms-primary);
    background: var(--bcms-primary-soft);
    border-radius: 50%;
}

.empty-state h3 {
    margin: 0 0 0.35rem;
    color: var(--bcms-text);
    font-size: 1.05rem;
}

.empty-state p {
    max-width: 28rem;
    margin: 0 auto 1rem;
}

.modal-backdrop {
    position: fixed;
    z-index: 1080;
    inset: 0;
    display: none;
    padding: 1rem;
    align-items: center;
    justify-content: center;
    background: rgba(16, 24, 40, 0.65);
    backdrop-filter: blur(2px);
}

.modal-backdrop.show {
    display: flex;
}

.modal-dialog {
    width: min(31rem, 100%);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    background: #fff;
    border-radius: 0.85rem;
    box-shadow: 0 1.5rem 4rem rgba(16, 24, 40, 0.28);
    animation: modal-in 0.18s ease-out;
}

.modal-dialog.modal-lg {
    width: min(52rem, 100%);
}

.modal-header,
.modal-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.2rem;
}

.modal-header {
    justify-content: space-between;
    border-bottom: 1px solid var(--bcms-border);
}

.modal-footer {
    justify-content: flex-end;
    border-top: 1px solid var(--bcms-border);
}

.modal-title {
    margin: 0;
    font-size: 1.05rem;
}

.modal-body {
    padding: 1.2rem;
}

.loading-overlay {
    position: fixed;
    z-index: 1100;
    inset: 0;
    display: none;
    place-items: center;
    background: rgba(255, 255, 255, 0.83);
    backdrop-filter: blur(1px);
}

.loading-overlay.show {
    display: grid;
}

.loading-box {
    min-width: 10rem;
    padding: 1.2rem;
    background: #fff;
    border: 1px solid var(--bcms-border);
    border-radius: 0.75rem;
    box-shadow: var(--bcms-shadow);
    text-align: center;
}

.spinner,
.spinner-border {
    display: inline-block;
    width: 1.75rem;
    height: 1.75rem;
    border: 0.2rem solid #d8e2f3;
    border-top-color: var(--bcms-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.spinner-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.14rem;
}

.tabs,
.nav-tabs {
    display: flex;
    max-width: 100%;
    gap: 0.25rem;
    margin: 0 0 1.1rem;
    padding: 0.3rem;
    overflow-x: auto;
    background: #e9eef6;
    border-radius: 0.65rem;
    list-style: none;
}

.tab-button,
.nav-link {
    display: inline-flex;
    min-height: 2.35rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.48rem 0.8rem;
    color: #475467;
    background: transparent;
    border: 0;
    border-radius: 0.48rem;
    font-weight: 600;
    white-space: nowrap;
}

.tab-button:hover,
.nav-link:hover {
    color: var(--bcms-primary);
    text-decoration: none;
}

.tab-button.active,
.nav-link.active {
    color: var(--bcms-primary-dark);
    background: #fff;
    box-shadow: 0 0.15rem 0.5rem rgba(16, 24, 40, 0.1);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.detail-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    gap: 0;
}

.detail-item {
    padding: 0.85rem 0;
    border-bottom: 1px solid #edf0f5;
}

.detail-item:nth-child(odd) {
    padding-right: 1rem;
}

.detail-item dt {
    margin-bottom: 0.15rem;
    color: var(--bcms-muted);
    font-size: 0.74rem;
    font-weight: 600;
}

.detail-item dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-weight: 550;
}

.hero-panel {
    position: relative;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(125deg, var(--bcms-primary-dark), var(--bcms-primary) 70%, #175bc2);
}

.hero-panel::after {
    position: absolute;
    right: -5rem;
    bottom: -7rem;
    width: 18rem;
    height: 18rem;
    content: "";
    border: 3rem solid rgba(200, 155, 44, 0.17);
    border-radius: 50%;
}

.hero-panel .card-body {
    position: relative;
    z-index: 1;
}

.timeline {
    margin: 0;
    padding: 0;
    list-style: none;
}

.timeline-item {
    position: relative;
    padding: 0 0 1.1rem 1.65rem;
}

.timeline-item::before {
    position: absolute;
    top: 0.4rem;
    bottom: -0.4rem;
    left: 0.38rem;
    width: 1px;
    content: "";
    background: #d9e0ea;
}

.timeline-item::after {
    position: absolute;
    top: 0.35rem;
    left: 0;
    width: 0.8rem;
    height: 0.8rem;
    content: "";
    background: var(--bcms-accent);
    border: 0.17rem solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px #d9e0ea;
}

.timeline-item:last-child::before {
    display: none;
}

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

.permission-group {
    padding: 1rem;
    background: #fafbfc;
    border: 1px solid var(--bcms-border);
    border-radius: 0.65rem;
}

.permission-group h4 {
    margin: 0 0 0.65rem;
    font-size: 0.9rem;
}

.permission-list {
    display: grid;
    gap: 0.45rem;
}

.permission-option {
    padding: 0.45rem 0.55rem;
    background: #fff;
    border: 1px solid #e5e9f0;
    border-radius: 0.45rem;
}

.notification-row {
    display: flex;
    gap: 0.8rem;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--bcms-border);
}

.notification-row:last-child {
    border-bottom: 0;
}

.notification-row.unread {
    background: #f1f6ff;
}

.notification-icon {
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 auto;
    place-items: center;
    color: var(--bcms-primary);
    background: var(--bcms-primary-soft);
    border-radius: 50%;
}

.auth-page {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(18rem, 0.9fr) minmax(24rem, 1.1fr);
    background: #fff;
}

.auth-brand-panel {
    position: relative;
    display: flex;
    min-height: 100%;
    padding: clamp(2rem, 5vw, 5rem);
    align-items: flex-end;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(145deg, #061f4b, var(--bcms-primary) 70%, #154fa8);
}

.auth-brand-panel::before,
.auth-brand-panel::after {
    position: absolute;
    content: "";
    border: 4rem solid rgba(200, 155, 44, 0.15);
    border-radius: 50%;
}

.auth-brand-panel::before {
    top: -9rem;
    right: -8rem;
    width: 22rem;
    height: 22rem;
}

.auth-brand-panel::after {
    bottom: -12rem;
    left: -10rem;
    width: 27rem;
    height: 27rem;
}

.auth-brand-content {
    position: relative;
    z-index: 1;
    max-width: 34rem;
}

.auth-brand-content .brand-mark {
    width: 3.4rem;
    height: 3.4rem;
    margin-bottom: 1.25rem;
}

.auth-brand-content h1 {
    margin: 0 0 0.75rem;
    font-size: clamp(1.8rem, 3vw, 2.65rem);
    line-height: 1.12;
}

.auth-brand-content p {
    margin: 0;
    color: rgba(255, 255, 255, 0.76);
    font-size: 1rem;
}

.auth-form-panel {
    display: grid;
    padding: 2rem;
    place-items: center;
    background: #fff;
}

.auth-card {
    width: min(27rem, 100%);
}

.auth-card h2 {
    margin: 0;
    font-size: 1.6rem;
}

.auth-footer {
    margin-top: 1.5rem;
    color: var(--bcms-muted);
    font-size: 0.75rem;
    text-align: center;
}

.error-page {
    display: grid;
    min-height: 100vh;
    padding: 2rem;
    place-items: center;
    background: radial-gradient(circle at top, #edf3fd, var(--bcms-bg) 50%);
    text-align: center;
}

.error-code {
    margin: 0;
    color: var(--bcms-primary);
    font-size: clamp(4rem, 13vw, 8rem);
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1;
}

.error-page h1 {
    margin: 0.5rem 0;
    font-size: clamp(1.5rem, 4vw, 2.2rem);
}

.logo-preview {
    display: grid;
    width: 8rem;
    height: 8rem;
    place-items: center;
    overflow: hidden;
    color: var(--bcms-muted);
    background: #f8fafc;
    border: 1px dashed #98a2b3;
    border-radius: 0.75rem;
}

.logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

[data-local-row][hidden],
[data-filter-row][hidden] {
    display: none !important;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes dropdown-in {
    from { opacity: 0; transform: translateY(-0.25rem); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes modal-in {
    from { opacity: 0; transform: translateY(0.7rem) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (min-width: 576px) {
    .col-sm-6 { flex: 0 0 auto; width: 50%; }
    .d-sm-flex { display: flex !important; }
}

@media (min-width: 768px) {
    .col-md-4 { flex: 0 0 auto; width: 33.333333%; }
    .col-md-5 { flex: 0 0 auto; width: 41.666667%; }
    .col-md-6 { flex: 0 0 auto; width: 50%; }
    .col-md-7 { flex: 0 0 auto; width: 58.333333%; }
    .col-md-8 { flex: 0 0 auto; width: 66.666667%; }
    .d-md-block { display: block !important; }
    .d-md-flex { display: flex !important; }
}

@media (min-width: 992px) {
    .col-lg-3 { flex: 0 0 auto; width: 25%; }
    .col-lg-4 { flex: 0 0 auto; width: 33.333333%; }
    .col-lg-5 { flex: 0 0 auto; width: 41.666667%; }
    .col-lg-6 { flex: 0 0 auto; width: 50%; }
    .col-lg-7 { flex: 0 0 auto; width: 58.333333%; }
    .col-lg-8 { flex: 0 0 auto; width: 66.666667%; }
    .col-lg-9 { flex: 0 0 auto; width: 75%; }
    .d-lg-block { display: block !important; }
    .d-lg-none { display: none !important; }
}

@media (min-width: 1200px) {
    .col-xl-3 { flex: 0 0 auto; width: 25%; }
    .col-xl-4 { flex: 0 0 auto; width: 33.333333%; }
    .col-xl-5 { flex: 0 0 auto; width: 41.666667%; }
    .col-xl-7 { flex: 0 0 auto; width: 58.333333%; }
    .col-xl-8 { flex: 0 0 auto; width: 66.666667%; }
}

@media (max-width: 991.98px) {
    .app-sidebar {
        width: min(var(--bcms-sidebar-width), calc(100vw - 3rem));
        transform: translateX(-102%);
        transition: transform 0.22s ease;
    }

    .app-sidebar.show {
        transform: translateX(0);
    }

    .app-main {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: inline-grid;
    }

    .page-content,
    .topbar {
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .profile-meta {
        display: none;
    }

    .profile-button {
        padding-right: 0.32rem;
    }
}

@media (max-width: 767.98px) {
    .auth-page {
        display: block;
        background: var(--bcms-bg);
    }

    .auth-brand-panel {
        min-height: 13rem;
        padding: 2rem 1.25rem;
        align-items: center;
    }

    .auth-brand-content p {
        font-size: 0.88rem;
    }

    .auth-form-panel {
        padding: 1.25rem;
        background: var(--bcms-bg);
    }

    .auth-card {
        margin-top: -2.8rem;
        padding: 1.2rem;
        background: #fff;
        border: 1px solid var(--bcms-border);
        border-radius: var(--bcms-radius);
        box-shadow: var(--bcms-shadow);
    }

    .page-header {
        flex-direction: column;
    }

    .page-header-actions,
    .page-header-actions .btn {
        width: 100%;
    }

    .filter-bar {
        align-items: stretch;
    }

    .filter-field,
    .filter-field.search-control {
        min-width: 100%;
        flex-basis: 100%;
    }

    .permission-grid,
    .detail-list {
        grid-template-columns: 1fr;
    }

    .detail-item:nth-child(odd) {
        padding-right: 0;
    }

    .table-responsive[data-card-table] {
        overflow: visible;
    }

    .table-responsive[data-card-table] .table,
    .table-responsive[data-card-table] tbody,
    .table-responsive[data-card-table] tr,
    .table-responsive[data-card-table] td {
        display: block;
        width: 100%;
    }

    .table-responsive[data-card-table] thead {
        display: none;
    }

    .table-responsive[data-card-table] tbody {
        padding: 0.65rem;
    }

    .table-responsive[data-card-table] tbody tr {
        margin-bottom: 0.7rem;
        padding: 0.45rem 0.65rem;
        background: #fff;
        border: 1px solid var(--bcms-border);
        border-radius: 0.65rem;
        box-shadow: 0 0.2rem 0.65rem rgba(16, 24, 40, 0.04);
    }

    .table-responsive[data-card-table] tbody tr:last-child {
        margin-bottom: 0;
    }

    .table-responsive[data-card-table] td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.48rem 0.2rem;
        text-align: right;
        border-bottom: 1px dashed #e5e9f0;
    }

    .table-responsive[data-card-table] td::before {
        flex: 0 0 42%;
        color: var(--bcms-muted);
        content: attr(data-label);
        font-size: 0.72rem;
        font-weight: 700;
        text-align: left;
        text-transform: uppercase;
    }

    .table-responsive[data-card-table] td:last-child {
        border-bottom: 0;
    }

    .table-responsive[data-card-table] td.actions {
        display: block;
        padding-top: 0.7rem;
        text-align: left;
    }

    .table-responsive[data-card-table] td.actions::before {
        display: none;
    }

    .table-responsive[data-card-table] td.actions .btn-group {
        width: 100%;
    }

    .table-responsive[data-card-table] td.actions .btn {
        flex: 1 1 auto;
    }

    .table-pagination {
        justify-content: center;
        text-align: center;
    }

    .notification-menu {
        position: fixed;
        top: var(--bcms-topbar-height);
        right: 0.7rem;
        left: 0.7rem;
        width: auto;
        max-width: none;
    }
}

@media (max-width: 479.98px) {
    .topbar-title p {
        display: none;
    }

    .topbar {
        gap: 0.4rem;
    }

    .page-content {
        padding: 1rem 0.75rem 2rem;
    }

    .card-body,
    .card-header,
    .card-footer {
        padding-right: 0.9rem;
        padding-left: 0.9rem;
    }

    .btn-group.stack-mobile {
        display: grid;
        width: 100%;
    }

    .modal-footer {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

@media print {
    .app-sidebar,
    .topbar,
    .breadcrumb,
    .page-header-actions,
    .filter-bar,
    .btn,
    .table-pagination,
    .drawer-backdrop,
    .loading-overlay {
        display: none !important;
    }

    body,
    .app-main {
        margin: 0;
        background: #fff;
    }

    .page-content {
        max-width: none;
        padding: 0;
    }

    .card {
        box-shadow: none;
    }
}

/* Phase 4 customer portal redesign */
:root {
    --bcms-sidebar-width: 17.5rem;
    --bcms-sidebar-collapsed: 5.25rem;
    --bcms-topbar-height: 4.75rem;
}
body { background: #f4f7fb; }
.app-sidebar { background: linear-gradient(180deg, #082f70 0%, #0b3d91 52%, #073273 100%); box-shadow: 10px 0 30px rgba(3, 28, 67, .08); }
.sidebar-brand-row { display: flex; align-items: center; min-height: var(--bcms-topbar-height); padding-right: .75rem; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-brand-row .brand { flex: 1; min-width: 0; border-bottom: 0; }
.sidebar-collapse { width: 2rem; height: 2rem; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.18); border-radius: .6rem; color: #fff; background: rgba(255,255,255,.08); font-size: 1.4rem; line-height: 1; cursor: pointer; transition: .2s ease; }
.sidebar-collapse:hover { background: rgba(255,255,255,.16); }
.sidebar-group { margin-bottom: .65rem; }
.sidebar-label { margin: .85rem 1rem .35rem; color: rgba(219,232,255,.62); font-size: .65rem; letter-spacing: .1em; }
.sidebar-link { margin: .13rem .7rem; min-height: 2.65rem; gap: .75rem; border-radius: .7rem; color: #dce8ff; font-weight: 560; }
.sidebar-link:hover { color: #fff; background: rgba(255,255,255,.09); transform: translateX(2px); }
.sidebar-link.active { color: #fff; background: rgba(255,255,255,.14); box-shadow: inset 3px 0 0 #e2ad22; }
.nav-icon { display: inline-grid; place-items: center; width: 1.85rem; height: 1.85rem; flex: 0 0 1.85rem; border-radius: .55rem; background: rgba(255,255,255,.1); color: #fff; font-size: .68rem; font-weight: 800; }
.sidebar-footer { background: rgba(3, 25, 63, .22); }
.app-shell.sidebar-collapsed { --bcms-sidebar-width: var(--bcms-sidebar-collapsed); }
.app-shell.sidebar-collapsed .brand-copy, .app-shell.sidebar-collapsed .sidebar-link-label, .app-shell.sidebar-collapsed .sidebar-label { display: none; }
.app-shell.sidebar-collapsed .brand { justify-content: center; padding-inline: .5rem; }
.app-shell.sidebar-collapsed .sidebar-brand-row { padding: 0; justify-content: center; }
.app-shell.sidebar-collapsed .sidebar-collapse { position: absolute; left: calc(var(--bcms-sidebar-collapsed) - .7rem); top: 1.4rem; background: #fff; color: #0b3d91; box-shadow: 0 4px 14px rgba(0,0,0,.15); }
.app-shell.sidebar-collapsed .sidebar-link { justify-content: center; margin-inline: .65rem; padding-inline: .35rem; }
.topbar { padding-inline: 1.5rem; background: rgba(255,255,255,.94); backdrop-filter: blur(12px); border-bottom: 1px solid #e5ebf4; box-shadow: 0 4px 18px rgba(17, 48, 89, .04); }
.topbar-leading, .topbar-tools { display: flex; align-items: center; gap: .75rem; }
.topbar-leading { min-width: 0; flex: 1; }
.topbar-tools { justify-content: flex-end; }
.topbar-title h1 { font-size: 1.05rem; }
.topbar-title p { display: flex; align-items: center; gap: .45rem; }
.topbar-title p strong { color: #30415f; font-weight: 650; }
.tenant-divider { color: #c2cad8; }
.language-switcher .form-select { min-width: 4.4rem; border-radius: .7rem; font-weight: 700; }
.notification-button { position: relative; }
.profile-button { border-radius: .8rem; padding: .35rem .55rem; }
.profile-caret { color: #7d8ba3; }
.page-content { max-width: 1680px; width: 100%; margin-inline: auto; padding: 1.5rem 1.7rem 2.5rem; }
.dashboard-hero { position: relative; display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; overflow: hidden; padding: 1.45rem 1.6rem; margin-bottom: 1rem; border-radius: 1rem; color: #fff; background: linear-gradient(120deg, #0b3d91 0%, #124da7 72%, #1a65c7 100%); box-shadow: 0 14px 34px rgba(11,61,145,.18); }
.dashboard-hero::after { content: ""; position: absolute; width: 13rem; height: 13rem; right: -3rem; top: -7rem; border: 2.2rem solid rgba(255,255,255,.08); border-radius: 50%; }
.dashboard-hero > * { position: relative; z-index: 1; }
.dashboard-hero h2 { margin: .2rem 0 .3rem; color: #fff; font-size: clamp(1.35rem,2vw,1.85rem); }
.dashboard-hero p { margin: 0; color: #dce9ff; }
.eyebrow, .panel-kicker { display: block; color: #e5b52f; font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.dashboard-filter { display: flex; align-items: center; justify-content: flex-end; gap: .7rem; margin-bottom: 1rem; color: #62718a; font-size: .8rem; font-weight: 700; }
.dashboard-filter .form-select { max-width: 18rem; }
.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: .8rem; margin-bottom: 1rem; }
.metric-card { min-width: 0; display: flex; align-items: center; gap: .75rem; padding: 1rem; border: 1px solid #e4eaf3; border-radius: .95rem; background: #fff; box-shadow: 0 6px 20px rgba(23, 54, 93, .055); transition: transform .2s ease, box-shadow .2s ease; }
.metric-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(23,54,93,.1); }
.metric-card > div:last-child { min-width: 0; }
.metric-card span { display: block; color: #6e7e96; font-size: .72rem; line-height: 1.2; }
.metric-card strong { display: block; margin-top: .3rem; color: #102a52; font-size: clamp(1.15rem,1.6vw,1.55rem); line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-card small { display: block; margin-top: .25rem; color: #9aa6b8; font-size: .62rem; }
.metric-icon { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; flex: 0 0 2.6rem; border-radius: .8rem; font-weight: 800; }
.metric-blue .metric-icon { background:#e7f0ff;color:#0b55b9 }.metric-teal .metric-icon{background:#e2f8f5;color:#087f74}.metric-amber .metric-icon{background:#fff5d8;color:#9a6800}.metric-green .metric-icon{background:#e7f8ec;color:#137a35}.metric-violet .metric-icon{background:#f1ebff;color:#6842bb}.metric-slate .metric-icon{background:#edf1f6;color:#53647e}
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(20rem,.85fr); gap: 1rem; align-items: start; }
.dashboard-panel { overflow: hidden; border-radius: 1rem; border-color: #e3e9f2; box-shadow: 0 6px 22px rgba(23,54,93,.05); }
.dashboard-panel .card-header { min-height: 4.5rem; padding: 1rem 1.15rem; }
.panel-kicker { margin-bottom: .2rem; color: #7d8ca2; }
.panel-link { white-space: nowrap; font-size: .78rem; font-weight: 700; }
.dashboard-table td, .dashboard-table th { padding: .85rem 1rem; }
.dashboard-table td small { display: block; margin-top: .18rem; color: #8491a5; }
.table-primary-link { color: #103f8f; font-weight: 700; }
.outstanding-list { padding: .35rem .8rem .8rem; }
.outstanding-item { display: grid; grid-template-columns: 2.3rem minmax(0,1fr) auto; align-items: center; gap: .7rem; padding: .7rem .35rem; color: inherit; border-bottom: 1px solid #edf1f6; text-decoration: none; }
.outstanding-item:hover { background: #f8faff; }
.outstanding-item small, .timeline small { display: block; color: #8290a5; font-size: .72rem; margin-top: .18rem; }
.mini-avatar { display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: .7rem; background: #e8f0ff; color: #0b4da8; font-weight: 800; }
.outstanding-amount { color: #a06400; font-weight: 800; white-space: nowrap; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; display: grid; grid-template-columns: 1rem 1fr; gap: .7rem; padding: 0 0 1rem; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: .31rem; top: .8rem; bottom: 0; width: 1px; background: #dfe6f0; }
.timeline-dot { position: relative; z-index: 1; width: .7rem; height: .7rem; margin-top: .3rem; border: 2px solid #fff; border-radius: 50%; background: #1b63be; box-shadow: 0 0 0 2px #cfe0f7; }
@media (max-width: 1399.98px) { .metric-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width: 991.98px) {
 .sidebar-collapse { display:none; }
 .dashboard-grid { grid-template-columns: 1fr; }
 .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .topbar-title p .tenant-divider, .topbar-title p strong { display:none; }
}
@media (max-width: 767.98px) {
 .topbar { padding-inline: .8rem; }
 .topbar-tools { gap: .35rem; }
 .profile-meta { display:none; }
 .page-content { padding: 1rem .85rem 2rem; }
 .dashboard-hero { align-items:flex-start; flex-direction:column; padding:1.2rem; }
 .dashboard-filter { align-items:stretch; flex-direction:column; }
 .dashboard-filter .form-select { max-width:none; }
}
@media (max-width: 479.98px) {
 .metric-grid { grid-template-columns: 1fr; }
 .metric-card { padding:.85rem; }
 .language-switcher .form-select { min-width:3.7rem; padding-inline:.55rem 1.6rem; }
 .topbar-title p { display:none; }
}
@media (prefers-color-scheme: dark) {
 body { background:#eef2f8; }
}

/* Phase 4 notification center */
.notification-menu { width: min(27rem, calc(100vw - 1.5rem)); max-height: min(40rem, calc(100vh - 6rem)); overflow: hidden; border: 1px solid #dfe6f0; border-radius: 1rem; box-shadow: 0 22px 55px rgba(18,45,82,.2); }
.notification-menu-head { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:1rem 1.1rem; }
.notification-menu-head > div { min-width:0; }
.notification-menu-head strong, .notification-menu-head small { display:block; }
.notification-menu-head small { margin-top:.15rem; color:#7b899e; font-size:.72rem; }
.notification-read-all { border:0; background:transparent; color:#0b4ea5; font-size:.72rem; font-weight:700; cursor:pointer; white-space:nowrap; }
.notification-menu-list { max-height:29rem; overflow-y:auto; }
.notification-preview-form { margin:0; }
.notification-preview { width:100%; display:grid; grid-template-columns:2.25rem minmax(0,1fr); gap:.75rem; padding:.85rem 1rem; text-align:left; color:inherit; background:#fff; border:0; border-bottom:1px solid #edf1f6; cursor:pointer; }
.notification-preview:hover { background:#f7f9fd; }
.notification-preview.unread { background:#f2f7ff; box-shadow:inset 3px 0 0 #1765c1; }
.notification-preview-copy { min-width:0; }
.notification-preview-copy strong, .notification-preview-copy span, .notification-preview-copy small { display:block; }
.notification-preview-copy strong { overflow:hidden; color:#172b4d; font-size:.82rem; text-overflow:ellipsis; white-space:nowrap; }
.notification-preview-copy span { margin-top:.2rem; overflow:hidden; color:#5f6f87; font-size:.75rem; line-height:1.35; text-overflow:ellipsis; white-space:nowrap; }
.notification-preview-copy small { margin-top:.3rem; color:#8b98aa; font-size:.66rem; }
.notification-type-icon { display:grid; place-items:center; width:2.25rem; height:2.25rem; border-radius:.7rem; background:#e8f1ff; color:#145ab2; font-size:.86rem; font-weight:900; }
.type-success .notification-type-icon { background:#e5f7eb;color:#16763a }.type-warning .notification-type-icon{background:#fff4d6;color:#936000}.type-error .notification-type-icon{background:#fee9e9;color:#b72b2b}
.notification-empty { display:grid; justify-items:center; gap:.25rem; padding:2rem 1rem; color:#758399; text-align:center; }
.notification-empty > span { display:grid; place-items:center; width:3rem; height:3rem; margin-bottom:.3rem; border-radius:50%; background:#edf3fb; color:#315f9d; font-size:1.2rem; }
.notification-empty strong { color:#2a3b56; }
.notification-empty small { font-size:.75rem; }
.notification-center-list { display:grid; gap:.75rem; }
.notification-card { display:grid; grid-template-columns:2.6rem minmax(0,1fr) auto; gap:1rem; align-items:start; padding:1.1rem 1.2rem; border:1px solid #e1e7f0; border-radius:1rem; background:#fff; box-shadow:0 5px 18px rgba(20,49,88,.045); }
.notification-card.unread { border-color:#bfd5f2; box-shadow:inset 3px 0 0 #1765c1,0 6px 20px rgba(20,49,88,.06); }
.notification-card .notification-type-icon { width:2.6rem;height:2.6rem; }
.notification-card-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:.75rem; }
.notification-card-heading h3 { margin:0; color:#172b4d; font-size:.96rem; }
.notification-card-copy p { margin:.4rem 0 .55rem; color:#53637a; font-size:.84rem; line-height:1.5; }
.notification-card-meta { display:flex; flex-wrap:wrap; gap:.4rem 1rem; color:#8491a4; font-size:.7rem; }
.notification-card-actions { display:flex; align-items:center; justify-content:flex-end; gap:.45rem; }
.notification-card-actions form { margin:0; }
@media (max-width:767.98px) {
 .notification-menu { position:fixed; top:var(--bcms-topbar-height); right:.5rem; left:.5rem; width:auto; }
 .notification-card { grid-template-columns:2.4rem minmax(0,1fr); padding:1rem; }
 .notification-card-actions { grid-column:1/-1; justify-content:flex-end; }
}
@media (max-width:479.98px) {
 .notification-menu-head { align-items:flex-start; }
 .notification-card-heading { align-items:flex-start; flex-direction:column; gap:.35rem; }
 .notification-card-actions { flex-wrap:wrap; }
}

/* Phase 4.4 personal account */
.profile-shell{display:grid;grid-template-columns:minmax(230px,300px) 1fr;gap:1.25rem;align-items:start}
.profile-identity{text-align:center;position:sticky;top:1rem}
.profile-avatar-xl{width:112px;height:112px;margin:0 auto 1rem;border-radius:32px;overflow:hidden;display:grid;place-items:center;background:linear-gradient(145deg,var(--primary,#0b3d91),#195dc2);color:#fff;font-size:2.25rem;font-weight:800;box-shadow:0 12px 30px rgba(11,61,145,.22)}
.profile-avatar-xl img{width:100%;height:100%;object-fit:cover}
.profile-identity h3{margin:0 0 .25rem}.profile-tenant{margin:1rem 0 0;color:var(--muted,#64748b)}
.profile-detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1.25rem}
.profile-detail-grid div{padding:1rem;border:1px solid var(--border,#e2e8f0);border-radius:14px;background:var(--surface-subtle,#f8fafc)}
.profile-detail-grid small{display:block;color:var(--muted,#64748b);margin-bottom:.35rem}.profile-detail-grid strong{display:block;overflow-wrap:anywhere}
.profile-form fieldset{border:0;padding:0;margin:0}.profile-form legend{font-size:1.05rem;font-weight:750;margin-bottom:1rem}
.profile-locked-note{padding:1rem;border-radius:12px;background:#f8fafc;color:#64748b;border:1px dashed #cbd5e1}
.profile-password-card{max-width:660px}.form-text{display:block;color:#64748b;margin-top:.35rem}
@media(max-width:767.98px){.profile-shell{grid-template-columns:1fr}.profile-identity{position:static}.profile-detail-grid{grid-template-columns:1fr}.page-header>.btn-group{width:100%;display:grid;grid-template-columns:1fr 1fr}}
/* Task 4.5 commercial SaaS polish */
:root{--sidebar-width:280px;--sidebar-collapsed:80px;--topbar-height:76px;--bcms-blue:#0b3d91;--bcms-blue-dark:#072f70;--bcms-gold:#c89b2c;--surface:#fff;--surface-soft:#f7f9fc;--line:#e5eaf2;--ink:#12213a;--muted:#66758d;--shadow-sm:0 3px 12px rgba(16,45,86,.06);--shadow-md:0 14px 34px rgba(16,45,86,.12)}
html{scroll-behavior:smooth}
body{color:var(--ink);background:#f4f7fb;letter-spacing:-.005em}
:focus-visible{outline:3px solid rgba(200,155,44,.5)!important;outline-offset:3px}
.app-sidebar{width:var(--sidebar-width);transition:width .24s ease,transform .24s ease;z-index:1050}
.app-main{margin-left:var(--sidebar-width);width:calc(100% - var(--sidebar-width));transition:margin-left .24s ease,width .24s ease}
.app-shell.sidebar-collapsed .app-sidebar{width:var(--sidebar-collapsed)}
.app-shell.sidebar-collapsed .app-main{margin-left:var(--sidebar-collapsed);width:calc(100% - var(--sidebar-collapsed))}
.sidebar-brand-row{height:var(--topbar-height);padding:0 1rem;border-bottom:1px solid rgba(255,255,255,.1)}
.brand-mark{width:42px;height:42px;border-radius:13px;box-shadow:0 7px 16px rgba(0,0,0,.15)}
.sidebar-collapse{display:grid;place-items:center;min-width:32px;width:32px;height:32px;border-radius:9px;transition:background .2s ease,transform .24s ease}
.sidebar-collapse:hover{background:rgba(255,255,255,.12)}
.sidebar-collapse.is-collapsed svg,.app-shell.sidebar-collapsed .sidebar-collapse svg{transform:rotate(180deg)}
.sidebar-collapse svg{transition:transform .24s ease}
.sidebar-nav{padding:.7rem 0 1rem}
.sidebar-group{margin:0 0 .45rem}
.sidebar-group-toggle{display:flex;width:100%;align-items:center;justify-content:space-between;padding:.55rem 1.2rem .4rem;border:0;background:none;color:#9fb6dd;cursor:pointer;font:inherit}
.sidebar-label{margin:0;font-size:.69rem;font-weight:800;letter-spacing:.09em;text-transform:uppercase}
.group-chevron{transition:transform .2s ease}
.sidebar-group.is-collapsed .group-chevron{transform:rotate(-90deg)}
.sidebar-group-items{display:grid;grid-template-rows:1fr;opacity:1;transition:grid-template-rows .2s ease,opacity .18s ease}
.sidebar-group-items>*{overflow:hidden}
.sidebar-group.is-collapsed .sidebar-group-items{grid-template-rows:0fr;opacity:.3}
.sidebar-link{min-height:44px;margin:.12rem .72rem;padding:.62rem .8rem;border-radius:11px;gap:.78rem}
.nav-icon{display:grid;place-items:center;flex:0 0 23px;width:23px;height:23px}
.nav-icon svg{width:20px;height:20px}
.sidebar-link.active{background:linear-gradient(90deg,rgba(255,255,255,.17),rgba(255,255,255,.1));box-shadow:inset 3px 0 0 var(--bcms-gold),0 7px 18px rgba(0,0,0,.08)}
.sidebar-link.active .nav-icon{color:#ffd66e}
.sidebar-footer{padding:.75rem 1rem 1.1rem;border-top:1px solid rgba(255,255,255,.09)}
.sidebar-future{display:flex;align-items:center;gap:.65rem;padding:.7rem;color:#bad0ef;font-size:.76rem}
.status-dot{width:8px;height:8px;border-radius:50%;background:#5ed59b;box-shadow:0 0 0 4px rgba(94,213,155,.12)}
.app-shell.sidebar-collapsed .sidebar-group-toggle{display:none}
.app-shell.sidebar-collapsed .sidebar-link{margin-inline:.7rem;padding-inline:.55rem}
.app-shell.sidebar-collapsed .sidebar-footer{padding-inline:.6rem}.app-shell.sidebar-collapsed .sidebar-future{justify-content:center}

.topbar{position:sticky;top:0;z-index:1020;min-height:var(--topbar-height);padding:0 1.35rem;display:grid;grid-template-columns:minmax(240px,1fr) minmax(260px,520px) minmax(290px,1fr);align-items:center;gap:1.2rem;background:rgba(255,255,255,.96);border-bottom:1px solid var(--line);box-shadow:0 4px 18px rgba(17,48,89,.045)}
.topbar-leading{min-width:0}.topbar-heading{min-width:0}.topbar-heading h1{margin:0;font-size:1.08rem;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.topbar-breadcrumb{display:flex;align-items:center;gap:.38rem;margin-top:.18rem;color:#7b8799;font-size:.72rem;white-space:nowrap;overflow:hidden}
.topbar-breadcrumb a{color:#526887;text-decoration:none}.topbar-breadcrumb a:hover{color:var(--bcms-blue)}
.topbar-search{height:42px;display:flex;align-items:center;gap:.65rem;padding:0 .8rem;border:1px solid #dce3ed;border-radius:12px;background:#f7f9fc;color:#78879d;transition:border-color .18s ease,box-shadow .18s ease,background .18s ease}
.topbar-search:focus-within{background:#fff;border-color:#7da4dc;box-shadow:0 0 0 3px rgba(11,61,145,.1)}
.topbar-search input{width:100%;border:0;outline:0;background:transparent;color:var(--ink);font:inherit;font-size:.86rem}
.topbar-search input::placeholder{color:#8b98aa}.topbar-search kbd{padding:.17rem .38rem;border:1px solid #d9e0ea;border-bottom-width:2px;border-radius:6px;background:#fff;color:#718096;font-size:.66rem;white-space:nowrap}
.topbar-tools{min-width:0;gap:.55rem}.topbar-action{width:42px;height:42px;border-radius:12px}
.language-switcher .form-select{height:42px;min-width:68px;border-radius:12px;background-color:#fff}
.profile-button{min-height:48px;padding:.25rem .35rem .25rem .3rem;border-radius:13px;gap:.55rem}
.profile-button:hover{background:#f3f6fa}.profile-button>svg{width:16px;height:16px;color:#7d8aa0}
.avatar{width:38px;height:38px}.avatar-lg{width:52px;height:52px;font-size:1rem}
.dropdown-menu{border:1px solid #e2e7ef;border-radius:15px;box-shadow:var(--shadow-md);padding:.45rem;animation:menuIn .15s ease-out}
@keyframes menuIn{from{opacity:0;transform:translateY(-5px) scale(.985)}to{opacity:1;transform:none}}
.profile-menu{width:285px}.profile-menu-head{display:flex;align-items:center;gap:.8rem;padding:.75rem}
.profile-menu-head>div{min-width:0;display:flex;flex-direction:column}.profile-menu-head strong,.profile-menu-head span,.profile-menu-head small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.profile-menu-head span{font-size:.78rem;color:var(--bcms-blue);font-weight:650}.profile-menu-head small{color:var(--muted);font-size:.72rem;margin-top:.12rem}
.dropdown-item{display:flex;align-items:center;gap:.7rem;border-radius:9px;min-height:40px}.dropdown-item svg{flex:0 0 18px;width:18px;height:18px}
.notification-menu{width:min(390px,calc(100vw - 1rem));padding:0;overflow:hidden}.notification-menu-head{padding:1rem}
.notification-menu-list{max-height:390px;overflow:auto}.notification-preview{position:relative;padding:.8rem 1rem;gap:.75rem}
.notification-preview.unread{background:#f5f8fd}.notification-preview.unread:hover{background:#edf3fb}
.notification-state-dot{position:absolute;right:.8rem;top:1rem;width:7px;height:7px;border-radius:50%;background:transparent}.notification-preview.unread .notification-state-dot{background:var(--bcms-blue)}
.notification-preview.type-success .notification-type-icon{background:#eaf8f1;color:#16875c}.notification-preview.type-warning .notification-type-icon{background:#fff7e7;color:#a86f08}.notification-preview.type-error .notification-type-icon{background:#fff0ef;color:#c53b34}.notification-preview.type-info .notification-type-icon{background:#eaf2ff;color:#245fae}
.notification-empty{padding:2.1rem 1rem}.empty-illustration{display:grid;place-items:center;width:52px;height:52px;border-radius:16px;background:#edf3fc;color:var(--bcms-blue);margin-bottom:.7rem}
.notification-menu-foot{padding:.78rem 1rem;background:#fafbfd}

.page-content{padding:1.5rem clamp(1rem,2vw,2rem) 2.5rem;max-width:1720px;width:100%;margin:0 auto}
.page-header{margin-bottom:1.35rem;align-items:flex-end}.page-header h2{font-size:clamp(1.35rem,1.6vw,1.75rem);letter-spacing:-.025em}.page-header p{margin-top:.3rem}
.card{border:1px solid #e4e9f1;border-radius:16px;box-shadow:var(--shadow-sm);transition:box-shadow .2s ease,border-color .2s ease}
.card:hover{border-color:#dbe2ec}.card-header{padding:1rem 1.15rem;border-bottom-color:#e8edf4}.card-body{padding:1.15rem}.card-title{font-size:.98rem;letter-spacing:-.01em}
.metric-grid>*{display:flex}.metric-card,.stat-card{width:100%;height:100%;min-height:126px}.metric-card .card-body,.stat-card .card-body{height:100%;display:flex;flex-direction:column;justify-content:space-between}
.metric-icon{width:43px;height:43px;border-radius:13px}.metric-value,.stat-value{font-variant-numeric:tabular-nums;letter-spacing:-.035em}
.dashboard-grid>*,.row>[class*="col-"]{min-width:0}.table-card{overflow:hidden}.table-responsive{border-radius:0 0 16px 16px}
.table{margin:0}.table thead th{height:44px;padding:.72rem 1rem;background:#f6f8fb;color:#53647d;font-size:.69rem;font-weight:800;letter-spacing:.055em;text-transform:uppercase;white-space:nowrap}.table tbody td{padding:.82rem 1rem;vertical-align:middle}.table tbody tr:hover{background:#fafcff}
.btn{min-height:40px;border-radius:10px;font-weight:680;letter-spacing:0}.btn-sm{min-height:34px;border-radius:8px}.btn-lg{min-height:48px}
.alert{position:relative;border-radius:13px;padding: .9rem 3rem .9rem 1rem;box-shadow:0 4px 14px rgba(20,43,76,.04)}.alert::before{content:"";position:absolute;left:0;top:10px;bottom:10px;width:3px;border-radius:0 3px 3px 0;background:currentColor}.alert-close{right:.65rem;top:.55rem}
.empty-state{min-height:260px;padding:2.5rem 1rem}.empty-state-icon{width:84px;height:84px;border-radius:24px;background:linear-gradient(145deg,#eff4fb,#fff8e7);color:#6b82a5;display:grid;place-items:center;margin:0 auto 1rem}.empty-state h3{font-size:1.08rem}.empty-state p{max-width:440px;margin-inline:auto}
.loading-overlay{background:rgba(244,247,251,.88);backdrop-filter:blur(3px)}.loading-panel{width:min(580px,calc(100vw - 2rem));padding:1.3rem;border:1px solid #e1e7f0;border-radius:18px;background:#fff;box-shadow:var(--shadow-md)}
.skeleton{display:block;border-radius:10px;background:linear-gradient(90deg,#edf1f6 25%,#f8fafc 42%,#edf1f6 60%);background-size:300% 100%;animation:skeletonWave 1.35s ease-in-out infinite}
.skeleton-title{width:42%;height:18px;margin-bottom:1rem}.skeleton-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:.75rem}.skeleton-grid .skeleton{height:92px}.loading-caption{display:flex;justify-content:center;align-items:center;gap:.65rem;margin-top:1rem;color:#50627c}.loading-caption .spinner{width:20px;height:20px}
@keyframes skeletonWave{0%{background-position:100% 0}100%{background-position:0 0}}
button.is-loading,.btn.is-loading{position:relative;pointer-events:none;opacity:.78}
.drawer-backdrop{backdrop-filter:blur(2px)}

@media(max-width:1199.98px){
 .topbar{grid-template-columns:minmax(220px,1fr) minmax(220px,360px) auto;gap:.8rem}
 .profile-meta{display:none}
}
@media(max-width:991.98px){
 .app-sidebar{width:280px;transform:translateX(-105%)}
 .app-sidebar.show{transform:translateX(0)}
 .app-main,.app-shell.sidebar-collapsed .app-main{margin-left:0;width:100%}
 .topbar{grid-template-columns:minmax(0,1fr) minmax(200px,320px) auto}
 .sidebar-collapse{display:none}
}
@media(max-width:767.98px){
 :root{--topbar-height:68px}
 .topbar{grid-template-columns:minmax(0,1fr) auto;padding:0 .75rem;gap:.45rem}
 .topbar-search{display:none}.topbar-breadcrumb{display:none}.topbar-heading h1{font-size:.98rem}
 .language-switcher .form-select{min-width:60px;padding-left:.55rem}
 .topbar-tools{gap:.25rem}.profile-button{padding:.2rem}.profile-button>svg{display:none}
 .page-content{padding:1rem .8rem 2rem}.page-header{align-items:flex-start}
 .metric-grid{grid-template-columns:1fr}.metric-card,.stat-card{min-height:112px}
 .skeleton-grid{grid-template-columns:1fr}.skeleton-grid .skeleton{height:60px}
 .table-responsive{overflow-x:auto;-webkit-overflow-scrolling:touch}.table{min-width:680px}
}
@media(max-width:479.98px){
 .topbar-heading{max-width:125px}.topbar-action{width:39px;height:39px}.language-switcher{display:none}
 .notification-menu{position:fixed;left:.5rem!important;right:.5rem!important;top:64px!important;width:auto}
}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}.app-sidebar,.app-main,.sidebar-group-items,.dropdown-menu,.skeleton{transition:none!important;animation:none!important}}
@media(prefers-color-scheme:dark){
 body{background:#eef2f7;color:#12213a}.topbar{background:rgba(255,255,255,.97)}.card,.dropdown-menu,.loading-panel{background:#fff;color:#12213a}
}
/* Desktop regression hotfix 4.5.1 — min-width rules preserve the existing mobile UI */
@media (min-width: 992px) {
  .app-shell { display:block; min-height:100vh; }
  .app-sidebar { position:fixed; inset:0 auto 0 0; width:260px; transform:none; }
  .app-main { display:block; min-width:0; width:calc(100% - 260px); margin-left:260px; }
  .app-shell.sidebar-collapsed .app-sidebar { width:76px; }
  .app-shell.sidebar-collapsed .app-main { width:calc(100% - 76px); margin-left:76px; }
  .topbar { display:grid; grid-template-columns:minmax(180px,.9fr) minmax(150px,1.25fr) max-content; align-items:center; min-width:0; width:100%; gap:.75rem; flex-wrap:nowrap; overflow:visible; }
  .topbar-leading,.topbar-tools { display:flex; align-items:center; min-width:0; flex-wrap:nowrap; }
  .topbar-leading { overflow:hidden; }
  .topbar-tools { width:auto; justify-self:end; justify-content:flex-end; white-space:nowrap; }
  .topbar-search { min-width:0; width:100%; max-width:520px; justify-self:center; }
  .topbar-heading { min-width:0; overflow:hidden; }
  .language-switcher,.notification-button,.profile-button { flex:0 0 auto; }
  .page-content { box-sizing:border-box; min-width:0; width:100%; }
  .metric-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); align-items:stretch; }
  .metric-grid>* { display:flex; min-width:0; }
  .metric-card,.stat-card { display:flex; width:100%; min-width:0; height:100%; }
  .dashboard-grid { display:grid; grid-template-columns:1fr; align-items:stretch; }
  .dashboard-panel { min-width:0; height:100%; }
  .row { min-width:0; }
}
@media (min-width:1100px) {
  .topbar { grid-template-columns:minmax(190px,.9fr) minmax(180px,1.2fr) max-content; gap:1rem; }
}
@media (min-width:1200px) {
  .app-sidebar { width:270px; }
  .app-main { width:calc(100% - 270px); margin-left:270px; }
  .app-shell.sidebar-collapsed .app-sidebar { width:78px; }
  .app-shell.sidebar-collapsed .app-main { width:calc(100% - 78px); margin-left:78px; }
  .dashboard-grid { grid-template-columns:minmax(0,1.2fr) minmax(310px,.8fr); gap:1rem; }
}
@media (min-width:1400px) {
  .app-sidebar { width:280px; }
  .app-main { width:calc(100% - 280px); margin-left:280px; }
  .app-shell.sidebar-collapsed .app-sidebar { width:80px; }
  .app-shell.sidebar-collapsed .app-main { width:calc(100% - 80px); margin-left:80px; }
  .topbar { grid-template-columns:minmax(240px,1fr) minmax(300px,520px) minmax(300px,1fr); gap:1.2rem; }
  .metric-grid { grid-template-columns:repeat(6,minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns:minmax(0,1.25fr) minmax(340px,.75fr); }
}
@media (min-width:1800px) {
  .page-content { max-width:1720px; }
  .dashboard-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
/* Phase 5.4: member pledge list and detail */
.member-pledge-filters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1rem;align-items:end}
.member-pledge-filters .filter-actions{display:flex;gap:.75rem;grid-column:1/-1;justify-content:flex-end}
.pledge-progress{display:flex;align-items:center;gap:.55rem;min-width:130px}.pledge-progress progress{width:100%;height:.65rem;accent-color:var(--primary,#0b3d91)}.pledge-progress-wide{max-width:520px}
@media(max-width:1199.98px){.member-pledge-filters{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:767.98px){.member-pledge-filters{grid-template-columns:1fr}.member-pledge-filters .filter-actions{display:grid;grid-template-columns:1fr 1fr}.pledge-progress-wide{max-width:none}}
/* Phase 5.5: member payment list and detail */
.member-payment-summary{grid-template-columns:repeat(4,minmax(0,1fr))}
.member-payment-filters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem;align-items:end}
.member-payment-filters .filter-actions{display:flex;gap:.75rem;grid-column:1/-1;justify-content:flex-end}
@media(max-width:991.98px){.member-payment-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.member-payment-filters{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:767.98px){.member-payment-summary,.member-payment-filters{grid-template-columns:1fr}.member-payment-filters .filter-actions{display:grid;grid-template-columns:1fr 1fr}}
/* Phase 5.6: member receipts */
.member-receipt-summary{grid-template-columns:repeat(4,minmax(0,1fr))}
.member-receipt-filters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem;align-items:end}.member-receipt-filters .filter-actions{display:flex;gap:.75rem;grid-column:1/-1;justify-content:flex-end}
@media(max-width:991.98px){.member-receipt-summary,.member-receipt-filters{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:767.98px){.member-receipt-summary,.member-receipt-filters{grid-template-columns:1fr}.member-receipt-filters .filter-actions{display:grid;grid-template-columns:1fr 1fr}}
/* Phase 5.7 member notifications */
.member-notification-filters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem;align-items:end}.member-notification-filters .filter-actions{display:flex;gap:.75rem;grid-column:1/-1}.notification-list{display:grid;gap:1rem}.member-notification-card{display:grid;grid-template-columns:auto 1fr auto;gap:1rem;align-items:center;padding:1rem}.member-notification-card.unread{border-left:4px solid var(--primary,#0b3d91);background:#f8fbff}.notification-card-head{display:flex;justify-content:space-between;gap:1rem}.notification-card-head h3{margin:0}.member-notification-bell{position:relative}.member-notification-bell .notification-menu{width:min(390px,90vw)}.notification-item{display:grid;grid-template-columns:auto 1fr;gap:.75rem;padding:.8rem;text-decoration:none}.notification-item.unread{background:#f2f7ff}.notification-item small,.notification-item time{display:block}.notification-badge{position:absolute;top:-4px;right:-4px;background:#d92d20;color:#fff;border-radius:999px;padding:1px 5px;font-size:.7rem}
@media(max-width:991.98px){.member-notification-filters{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:767.98px){.member-notification-filters{grid-template-columns:1fr}.member-notification-card{grid-template-columns:auto 1fr}.member-notification-card>.btn{grid-column:1/-1}.notification-card-head{display:block}}
/* Phase 5 Task 5.8: Member profile and preferences */
.member-profile-hero .card-body{display:flex;align-items:center;gap:1.25rem}.profile-avatar{display:grid;place-items:center;overflow:hidden;border-radius:50%;background:#eaf1fb;color:#0b3d91;font-weight:800}.profile-avatar-lg{width:88px;height:88px;font-size:1.55rem;flex:0 0 88px}.profile-avatar img,.avatar img{width:100%;height:100%;object-fit:cover}.profile-detail-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem}.profile-detail-grid>div{display:flex;flex-direction:column;gap:.35rem;padding:1rem;border:1px solid #e3e8f1;border-radius:12px}.profile-detail-grid small{color:#637083}.profile-form{max-width:920px}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}.form-grid label,.form-stack label{display:flex;flex-direction:column;gap:.45rem;font-weight:650}.form-span-2{grid-column:1/-1}.form-stack{display:grid;gap:1rem;max-width:620px}.preference-grid{border:0;padding:0;margin:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem}.preference-grid legend{font-weight:800;margin-bottom:.75rem}.preference-option{display:flex!important;flex-direction:row!important;align-items:flex-start;gap:.75rem!important;padding:1rem;border:1px solid #e3e8f1;border-radius:12px}.preference-option input{margin-top:.25rem}.preference-option span{display:flex;flex-direction:column;gap:.2rem}.preference-option small{color:#637083;font-weight:400}.card-footer{display:flex;justify-content:flex-end;padding:1rem 1.25rem;border-top:1px solid #e3e8f1}@media(max-width:767px){.profile-detail-grid,.form-grid,.preference-grid{grid-template-columns:1fr}.form-span-2{grid-column:auto}.member-profile-hero .card-body{align-items:flex-start}.page-header .btn-group{width:100%;flex-wrap:wrap}}
.workspace-overview{margin-bottom:1.25rem}.workspace-overview .card-body{display:flex;justify-content:space-between;align-items:center;gap:1.5rem}.package-widget{min-width:230px;padding:1rem 1.25rem;border-radius:14px;background:#eef4ff;display:grid;gap:.25rem}.package-widget strong{font-size:1.35rem;color:#0b3d91}.workspace-package-badge{white-space:nowrap}.workspace-search-form{display:grid;gap:.5rem}.search-row{display:flex;gap:.75rem}.workspace-results{display:grid;gap:.65rem}.workspace-result{display:grid;grid-template-columns:110px 1fr auto;gap:1rem;align-items:center;padding:.9rem;border:1px solid #e2e8f0;border-radius:12px;text-decoration:none}.workspace-result:hover{border-color:#d7a928;background:#fffbeb}@media(max-width:768px){.workspace-overview .card-body{align-items:stretch;flex-direction:column}.package-widget{min-width:0}.search-row{flex-direction:column}.workspace-result{grid-template-columns:1fr;gap:.35rem}.dashboard-hero-actions{overflow-x:auto;padding-bottom:.25rem}}

.organization-grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(17rem,1fr);gap:1.25rem;align-items:start}.organization-main{display:grid;gap:1rem}.form-section,.branding-preview{padding:1.25rem}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}.form-grid label{display:grid;gap:.4rem;font-weight:600}.form-grid .span-2{grid-column:1/-1}.form-grid input,.form-grid select,.form-grid textarea{width:100%;padding:.7rem;border:1px solid var(--bcms-border);border-radius:.55rem;background:#fff}.branding-preview{position:sticky;top:5.5rem}.preview-brand{display:grid;gap:1rem;padding:1rem;border:1px solid var(--bcms-border);border-radius:.75rem}.preview-brand img{max-height:72px;max-width:180px}.preview-brand button{border:0;border-radius:.5rem;padding:.65rem;color:#fff;background:var(--preview-primary)}.preview-sidebar{padding:.75rem;color:#fff;background:var(--preview-secondary);border-left:4px solid var(--preview-accent)}.preview-receipt{padding:.75rem;border-top:4px solid var(--preview-primary)}@media(max-width:900px){.organization-grid{grid-template-columns:1fr}.branding-preview{position:static}}@media(max-width:620px){.form-grid{grid-template-columns:1fr}.form-grid .span-2{grid-column:auto}}
.subscription-summary{display:flex;flex-wrap:wrap;gap:1.5rem;justify-content:space-between}.usage-card{display:grid;gap:.65rem}.usage-meter{height:.45rem;background:var(--bcms-border);border-radius:1rem;overflow:hidden}.usage-meter span{display:block;height:100%;background:var(--bcms-primary)}.usage-warning .usage-meter span{background:var(--bcms-warning)}.usage-critical .usage-meter span{background:var(--bcms-danger)}.module-list{display:flex;flex-wrap:wrap;gap:.5rem}@media(max-width:620px){.subscription-summary{display:grid}.usage-card{min-width:100%}}
.account-links{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:1rem}.account-usage{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:1rem}.account-usage>div{display:grid;padding:.75rem;border:1px solid var(--bcms-border);border-radius:.6rem}.support-thread{display:grid;gap:1rem}.support-thread article{padding:1rem;border-radius:.75rem;background:var(--bcms-bg)}.support-thread .admin-reply{border-left:4px solid var(--bcms-primary)}.action-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;margin-top:1rem}@media(max-width:700px){.action-grid{grid-template-columns:1fr}}

.invoice-item-row{display:grid;grid-template-columns:2fr .6fr 1fr .7fr;gap:.75rem;margin-bottom:.75rem}.billing-totals{margin-top:1rem;display:grid;gap:.5rem}.billing-totals>div{display:flex;justify-content:space-between;border-bottom:1px solid var(--bcms-border);padding:.45rem 0}@media(max-width:700px){.invoice-item-row{grid-template-columns:1fr 1fr}.billing-totals>div{gap:1rem}}
