:root {
    --bs-primary: #1769aa;
    --bs-primary-rgb: 23, 105, 170;
    --bs-success: #198a62;
    --bs-success-rgb: 25, 138, 98;
    --bs-danger: #c83d4d;
    --bs-danger-rgb: 200, 61, 77;
    --bs-warning: #e49a22;
    --bs-warning-rgb: 228, 154, 34;
    --crm-navy: #123256;
    --crm-deep: #0b223d;
    --crm-blue: #1769aa;
    --crm-sky: #e7f3fb;
    --crm-paper: #fff;
    --crm-gray: #f3f6fa;
    --crm-ink: #152230;
    --crm-muted: #5b7185;
    --crm-green: #198a62;
    --crm-orange: #e49a22;
    --crm-red: #c83d4d;
    --crm-cyan: #35a6a8;
    --crm-border: #d6e0ea;
    --crm-shadow: 0 1rem 2.5rem rgba(11, 34, 61, .08);
    --crm-soft-shadow: 0 .4rem 1.2rem rgba(11, 34, 61, .08);
}

* {
    letter-spacing: 0;
}

body {
    background: var(--crm-gray);
    color: var(--crm-ink);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

a {
    color: var(--crm-blue);
    text-underline-offset: .18rem;
}

.auth-shell {
    background:
        linear-gradient(135deg, rgba(18, 50, 86, .97), rgba(23, 105, 170, .84)),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, .08) 0 1px, transparent 1px 5.5rem);
}

.crm-shell {
    background: linear-gradient(180deg, #f7fafe 0, var(--crm-gray) 18rem);
}

.auth-main {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.auth-stage {
    display: flex;
    justify-content: center;
    max-width: 32rem;
    width: 100%;
}

.auth-panel {
    background: rgba(255, 255, 255, .98);
    border: 1px solid rgba(255, 255, 255, .68);
    border-radius: 8px;
    box-shadow: 0 1.5rem 4rem rgba(5, 23, 43, .24);
    max-width: 30rem;
    padding: clamp(1.4rem, 4vw, 2.4rem);
    width: 100%;
}

.auth-panel h1 {
    color: var(--crm-deep);
    font-weight: 750;
}

.auth-eyebrow {
    color: var(--crm-blue);
    font-size: .8rem;
    font-weight: 800;
    text-transform: uppercase;
}

.auth-logo-frame {
    align-items: center;
    background: #fff;
    border: 1px solid var(--crm-border);
    border-radius: 8px;
    display: flex;
    height: 8rem;
    justify-content: center;
    margin-bottom: 1.35rem;
    max-width: 18rem;
    overflow: hidden;
    padding: .75rem;
}

.auth-logo {
    display: block;
    height: 100%;
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    width: 100%;
}

.auth-link {
    color: var(--crm-muted);
    font-weight: 650;
    text-align: center;
}

.captcha-box {
    align-items: center;
    background: #f8fbfe;
    border: 1px solid var(--crm-border);
    border-radius: 8px;
    display: grid;
    gap: .85rem;
    grid-template-columns: 1fr minmax(7rem, 9rem);
    padding: .85rem;
}

.captcha-box strong {
    color: var(--crm-deep);
    display: block;
    font-size: 1.15rem;
    font-weight: 850;
    line-height: 1.2;
}

.captcha-label {
    color: var(--crm-muted);
    display: block;
    font-size: .72rem;
    font-weight: 850;
    margin-bottom: .2rem;
    text-transform: uppercase;
}

.captcha-answer .form-control {
    min-height: 3.25rem;
}

.crm-sidebar {
    background: var(--crm-deep);
    border-right: 1px solid rgba(255, 255, 255, .1);
    bottom: 0;
    color: #fff;
    display: flex;
    flex-direction: column;
    left: 0;
    overflow-y: auto;
    padding: 1.15rem;
    position: fixed;
    top: 0;
    width: 17.5rem;
    z-index: 20;
}

.crm-sidebar .brand {
    align-items: flex-start;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .11);
    border-radius: 8px;
    color: #fff;
    display: flex;
    flex-direction: column;
    font-size: 1rem;
    font-weight: 750;
    gap: .7rem;
    margin-bottom: 1rem;
    max-width: 100%;
    padding: .85rem;
    text-decoration: none;
}

.brand-mark {
    align-items: center;
    background: var(--crm-orange);
    border-radius: 8px;
    color: var(--crm-deep);
    display: inline-flex;
    font-weight: 900;
    height: 2.7rem;
    justify-content: center;
    width: 2.7rem;
}

.brand-logo-frame {
    align-items: center;
    background: #fff;
    border-radius: 8px;
    display: flex;
    height: 6rem;
    justify-content: center;
    max-width: 100%;
    overflow: hidden;
    padding: .55rem;
    width: 100%;
}

.brand-logo {
    display: block;
    height: 100%;
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    width: 100%;
}

.brand-name {
    display: block;
    line-height: 1.25;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.crm-sidebar nav {
    display: grid;
    gap: .28rem;
}

.crm-sidebar nav a {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #d9e6f2;
    display: flex;
    font-weight: 650;
    gap: .65rem;
    min-height: 2.7rem;
    padding: .68rem .78rem;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.crm-sidebar nav a:hover,
.crm-sidebar nav a:focus-visible,
.crm-sidebar nav a.is-active {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .12);
    color: #fff;
}

.crm-sidebar nav a.is-active {
    box-shadow: inset 3px 0 0 var(--crm-orange);
}

.nav-icon {
    align-items: center;
    color: var(--crm-cyan);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 1.08rem;
    justify-content: center;
    line-height: 1;
    width: 1.3rem;
}

.crm-sidebar nav a:nth-child(2n) .nav-icon,
.crm-mobile-nav nav a:nth-child(2n) .nav-icon {
    color: var(--crm-orange);
}

.crm-sidebar nav a:hover .nav-icon,
.crm-sidebar nav a:focus-visible .nav-icon,
.crm-mobile-nav nav a:hover .nav-icon,
.crm-mobile-nav nav a:focus-visible .nav-icon {
    color: #fff;
}

.crm-mobile-nav {
    --bs-offcanvas-width: min(20rem, calc(100vw - 2rem));
    background: var(--crm-deep);
    color: #fff;
}

.crm-mobile-nav .offcanvas-header {
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    padding: 1rem 1.15rem;
}

.crm-mobile-nav .offcanvas-body {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 1rem 1.15rem 1.25rem;
}

.crm-mobile-nav .brand,
.crm-mobile-nav nav a {
    color: #fff;
}

.crm-mobile-nav nav {
    display: grid;
    gap: .34rem;
}

.crm-mobile-nav nav a {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 8px;
    display: flex;
    font-weight: 700;
    gap: .65rem;
    min-height: 2.9rem;
    padding: .72rem .78rem;
    text-decoration: none;
}

.crm-mobile-nav nav a:hover,
.crm-mobile-nav nav a:focus-visible {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .12);
}

.crm-topbar {
    align-items: center;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, .92);
    border-bottom: 1px solid var(--crm-border);
    display: flex;
    justify-content: flex-end;
    left: 17.5rem;
    min-height: 4.75rem;
    padding: .8rem 1.6rem;
    position: fixed;
    right: 0;
    top: 0;
    transition: transform .22s ease, box-shadow .18s ease;
    z-index: 10;
}

.crm-topbar.is-hidden {
    pointer-events: none;
    transform: translate3d(0, -120%, 0);
}

.crm-topbar.is-scrolled {
    box-shadow: 0 .65rem 1.6rem rgba(11, 34, 61, .12);
}

.topbar-start {
    align-items: center;
    display: flex;
    gap: .85rem;
    margin-left: auto;
    min-width: 0;
}

.topbar-user,
.topbar-actions {
    align-items: center;
    display: flex;
    gap: .65rem;
}

.topbar-user {
    flex: 0 0 auto;
    gap: .7rem;
    justify-content: flex-start;
    min-width: 0;
}

.topbar-user > div {
    min-width: 0;
}

.topbar-user strong {
    display: block;
    line-height: 1.15;
    max-width: 9.5rem;
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-topbar small {
    color: var(--crm-muted);
    display: block;
    max-width: 9.5rem;
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-chip {
    align-items: center;
    background: var(--crm-sky);
    border: 1px solid rgba(23, 105, 170, .18);
    border-radius: 8px;
    color: var(--crm-blue);
    display: inline-flex;
    font-size: 1rem;
    font-weight: 850;
    height: 2.65rem;
    justify-content: center;
    width: 2.65rem;
}

.topbar-brand {
    align-items: center;
    color: var(--crm-deep);
    display: flex;
    flex: 1 1 auto;
    font-weight: 820;
    gap: .62rem;
    line-height: 1.15;
    min-width: 0;
    text-decoration: none;
}

.topbar-brand > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-logo-frame {
    align-items: center;
    background: #fff;
    border: 1px solid var(--crm-border);
    border-radius: 8px;
    display: inline-flex;
    flex: 0 0 auto;
    height: 2.7rem;
    justify-content: center;
    overflow: hidden;
    padding: .28rem;
    width: 2.7rem;
}

.topbar-logo {
    display: block;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    width: 100%;
}

.mobile-nav-toggle {
    align-items: center;
    display: inline-grid;
    flex: 0 0 auto;
    gap: .22rem;
    justify-content: center;
    padding-left: .62rem;
    padding-right: .62rem;
    width: 2.65rem;
}

.mobile-nav-toggle span {
    background: currentColor;
    border-radius: 999px;
    display: block;
    height: 2px;
    width: 1.05rem;
}

.topbar-icon-link {
    align-items: center;
    background: transparent;
    border: 0;
    color: #6c7f90;
    display: inline-flex;
    flex: 0 0 2.15rem;
    font-size: 1.12rem;
    height: 2.15rem;
    justify-content: center;
    min-height: 2.15rem;
    padding: 0;
    text-decoration: none;
    width: 2.15rem;
}

.topbar-icon-link:hover,
.topbar-icon-link:focus-visible {
    color: var(--crm-blue);
}

.topbar-icon-link i {
    line-height: 1;
}

.topbar-icon-button {
    cursor: pointer;
}

.topbar-logout-form {
    flex: 0 0 auto;
    margin: 0;
}

.topbar-divider {
    background: var(--crm-border);
    display: block;
    height: 2rem;
    margin: 0 .45rem;
    width: 1px;
}

.crm-main {
    margin-left: 17.5rem;
    min-height: 100vh;
    padding: 6.25rem 1.6rem 2.2rem;
}

.flash-alert-stack {
    bottom: 1.25rem;
    display: grid;
    gap: .75rem;
    max-width: min(24rem, calc(100vw - 2rem));
    position: fixed;
    right: 1.25rem;
    width: 100%;
    z-index: 1090;
}

.flash-alert {
    border-radius: 8px;
    box-shadow: 0 .9rem 2.3rem rgba(11, 34, 61, .2);
    gap: .72rem;
    margin-bottom: 0;
    padding-bottom: .85rem;
    padding-top: .85rem;
}

.flash-alert-icon {
    fill: currentColor;
    height: 1.35rem;
    margin-top: .05rem;
    width: 1.35rem;
}

.flash-alert-copy {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

.page-head {
    align-items: flex-start;
    border-bottom: 1px solid rgba(214, 224, 234, .92);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1.35rem;
    padding-bottom: 1rem;
}

.page-head h1 {
    color: var(--crm-deep);
    font-weight: 780;
}

.page-head p,
.text-secondary {
    color: var(--crm-muted) !important;
}

.panel,
.metric,
.empty-state {
    background: var(--crm-paper);
    border: 1px solid var(--crm-border);
    border-radius: 8px;
    box-shadow: var(--crm-soft-shadow);
}

.panel {
    padding: 1.25rem;
}

.panel > h2,
.panel h2.h5 {
    color: var(--crm-deep);
    font-weight: 760;
}

.metric {
    border-top: 4px solid var(--crm-blue);
    height: 100%;
    min-height: 7rem;
    overflow: hidden;
    padding: 1rem;
    position: relative;
}

.metric::after {
    background: rgba(53, 166, 168, .16);
    border-radius: 8px;
    content: "";
    height: 2.6rem;
    position: absolute;
    right: -1rem;
    top: -1rem;
    transform: rotate(20deg);
    width: 4.5rem;
}

.dashboard-metrics > div:nth-child(3n) .metric {
    border-top-color: var(--crm-green);
}

.dashboard-metrics > div:nth-child(4n) .metric {
    border-top-color: var(--crm-orange);
}

.metric small {
    display: block;
    font-size: .82rem;
    font-weight: 750;
    line-height: 1.25;
    min-height: 2rem;
    text-transform: uppercase;
}

.metric strong {
    color: var(--crm-deep);
    display: block;
    font-size: clamp(1.65rem, 2vw, 2.15rem);
    line-height: 1.1;
    margin-top: .55rem;
}

.dashboard-chart {
    border-top: 4px solid var(--crm-blue);
    display: grid;
    gap: 1rem;
    min-height: 20rem;
}

.dashboard-chart-head {
    align-items: flex-start;
    display: flex;
    gap: .75rem;
    justify-content: space-between;
}

.dashboard-chart-head small {
    display: block;
    font-size: .78rem;
    font-weight: 820;
    line-height: 1.25;
    margin-bottom: .26rem;
    text-transform: uppercase;
}

.dashboard-chart-head strong {
    align-items: center;
    background: var(--crm-sky);
    border: 1px solid rgba(23, 105, 170, .2);
    border-radius: 8px;
    color: var(--crm-blue);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 1.45rem;
    font-weight: 850;
    justify-content: center;
    line-height: 1;
    min-height: 3.15rem;
    min-width: 3.15rem;
    padding: .55rem;
}

.dashboard-chart-bars {
    align-items: end;
    background:
        linear-gradient(to top, rgba(214, 224, 234, .92) 1px, transparent 1px);
    background-size: 100% 25%;
    border-bottom: 1px solid var(--crm-border);
    display: grid;
    gap: .55rem;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    height: 11rem;
    padding: .25rem .15rem 0;
}

.dashboard-chart-column {
    align-items: center;
    display: grid;
    gap: .36rem;
    grid-template-rows: auto 1fr auto;
    height: 100%;
    min-width: 0;
}

.dashboard-chart-value {
    color: #42596d;
    font-size: .78rem;
    font-weight: 850;
    line-height: 1;
}

.dashboard-chart-bar {
    align-self: end;
    background: linear-gradient(180deg, var(--crm-cyan), var(--crm-blue));
    border-radius: 8px 8px 3px 3px;
    box-shadow: inset 0 -1px 0 rgba(11, 34, 61, .12);
    display: block;
    height: var(--chart-height);
    min-height: .72rem;
    width: min(100%, 2.65rem);
}

.dashboard-chart-month {
    color: #42596d;
    font-size: .74rem;
    font-weight: 820;
    line-height: 1;
    text-transform: uppercase;
}

.dashboard-chart-projects {
    border-top-color: var(--crm-green);
}

.dashboard-chart-projects .dashboard-chart-head strong {
    background: #dcf5eb;
    border-color: #b9e6d1;
    color: #126345;
}

.dashboard-chart-projects .dashboard-chart-bar {
    background: linear-gradient(180deg, var(--crm-green), var(--crm-cyan));
}

.dashboard-chart-loans {
    border-top-color: var(--crm-orange);
}

.dashboard-chart-loans .dashboard-chart-head strong {
    background: #fff1dc;
    border-color: #f3d29d;
    color: #925407;
}

.dashboard-chart-loans .dashboard-chart-bar {
    background: linear-gradient(180deg, var(--crm-orange), var(--crm-blue));
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
}

.btn {
    border-radius: 8px;
    font-weight: 720;
    min-height: 2.55rem;
    padding: .56rem .9rem;
}

.btn-sm {
    min-height: 2.05rem;
    padding: .33rem .65rem;
}

.btn-primary {
    background: var(--crm-blue);
    border-color: var(--crm-blue);
    box-shadow: 0 .45rem 1rem rgba(23, 105, 170, .18);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background: #105b95;
    border-color: #105b95;
}

.btn-outline-primary {
    border-color: rgba(23, 105, 170, .42);
    color: var(--crm-blue);
}

.btn-outline-primary:hover,
.btn-outline-dark:hover,
.btn-outline-secondary:hover {
    box-shadow: var(--crm-soft-shadow);
}

.btn-success {
    background: var(--crm-green);
    border-color: var(--crm-green);
}

.form-label {
    color: #31475a;
    font-size: .86rem;
    font-weight: 760;
    margin-bottom: .42rem;
}

.form-control,
.form-select {
    background-color: #fcfdff;
    border-color: #cbd9e6;
    border-radius: 8px;
    color: var(--crm-ink);
    min-height: 2.7rem;
    padding: .62rem .78rem;
}

textarea.form-control {
    min-height: auto;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: rgba(23, 105, 170, .72);
    box-shadow: 0 0 0 .22rem rgba(23, 105, 170, .12);
}

.form-control[type="file"] {
    padding: .42rem;
}

.form-floating > label {
    color: #466075;
    font-weight: 720;
}

.form-floating > textarea.form-control.floating-textarea-sm {
    height: 6.5rem;
}

.form-floating > textarea.form-control.floating-textarea-md {
    height: 8.25rem;
}

.form-floating-compact > .form-control,
.form-floating-compact > .form-select {
    height: calc(3.25rem + calc(var(--bs-border-width) * 2));
    min-height: calc(3.25rem + calc(var(--bs-border-width) * 2));
}

.form-floating-compact > label {
    padding-bottom: .72rem;
    padding-top: .72rem;
}

.list-filter-form {
    align-items: stretch;
}

.list-filter-form .form-floating > label {
    max-width: calc(100% - 1rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-inline-form {
    align-items: start;
    display: grid;
    gap: .5rem;
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
}

.form-check-input {
    border-color: #a9c1d7;
}

.form-check-input:checked {
    background-color: var(--crm-green);
    border-color: var(--crm-green);
}

.form-section {
    border-top: 1px solid var(--crm-border);
    margin-top: 1.15rem;
    padding-top: 1.15rem;
}

.form-text,
small.text-secondary {
    color: var(--crm-muted) !important;
}

.table-responsive {
    border-radius: 8px;
}

.table {
    border-color: var(--crm-border);
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    border-bottom-color: #dde7f0;
    padding: .82rem .72rem;
}

.table thead th {
    background: #edf4fa;
    border-bottom: 1px solid #d5e1eb;
    color: #42596d;
    font-size: .76rem;
    font-weight: 850;
    text-transform: uppercase;
    white-space: nowrap;
}

.table tbody tr {
    transition: background .12s ease;
}

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

.table tbody td {
    color: #223548;
    vertical-align: middle;
}

.table a:not(.btn) {
    font-weight: 720;
}

.status-badge {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 999px;
    display: inline-flex;
    font-size: .75rem;
    font-weight: 850;
    gap: .28rem;
    line-height: 1;
    min-height: 1.65rem;
    padding: .32rem .62rem;
    text-transform: capitalize;
}

.status-badge::before {
    background: currentColor;
    border-radius: 50%;
    content: "";
    height: .42rem;
    opacity: .72;
    width: .42rem;
}

.status-ok {
    background: #dcf5eb;
    border-color: #b9e6d1;
    color: #126345;
}

.status-warn {
    background: #fff1dc;
    border-color: #f3d29d;
    color: #925407;
}

.status-muted {
    background: #e8f0f7;
    border-color: #cbdbe9;
    color: #49647a;
}

.low-stock {
    box-shadow: inset 4px 0 0 var(--crm-orange);
}

.profile-panel {
    overflow: hidden;
    position: relative;
}

.profile-panel::before {
    background: linear-gradient(90deg, var(--crm-blue), var(--crm-cyan), var(--crm-orange));
    content: "";
    height: .25rem;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.profile-message {
    border-left: 4px solid var(--crm-green);
}

.profile-facts dt {
    color: #42596d;
    font-size: .78rem;
    font-weight: 850;
    padding-top: .45rem;
    text-transform: uppercase;
}

.profile-facts dd {
    border-bottom: 1px solid #e3ebf2;
    margin-bottom: 0;
    min-height: 2.25rem;
    overflow-wrap: anywhere;
    padding-bottom: .55rem;
    padding-top: .38rem;
}

.progress {
    background: #dce9f4;
    border-radius: 999px;
    min-height: 1.2rem;
}

.progress-bar {
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 800;
}

.mini-bars {
    align-items: end;
    display: grid;
    gap: .6rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    height: 5.5rem;
}

.mini-bars span {
    align-items: end;
    background: linear-gradient(180deg, var(--crm-orange), var(--crm-blue));
    border-radius: 8px 8px 4px 4px;
    color: #fff;
    display: flex;
    font-size: .78rem;
    font-weight: 760;
    justify-content: center;
    min-height: 1.7rem;
    padding: .35rem;
}

details {
    background: #f7fbfe;
    border: 1px solid #dce7f0;
    border-radius: 8px;
    padding: .75rem;
}

summary {
    color: var(--crm-blue);
    cursor: pointer;
    font-weight: 760;
}

.company-logo-preview {
    background: #fff;
    border: 1px solid var(--crm-border);
    border-radius: 8px;
    display: block;
    max-height: 6rem;
    max-width: min(100%, 16rem);
    object-fit: contain;
    padding: .5rem;
}

.empty-state {
    border-style: dashed;
    padding: 2rem;
    text-align: center;
}

dl {
    color: #23394c;
}

.role-permission-list {
    display: flex;
    flex-wrap: wrap;
    gap: .42rem;
}

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

.role-permission-accordion {
    --bs-accordion-border-color: var(--crm-border);
    --bs-accordion-border-radius: 8px;
    --bs-accordion-inner-border-radius: 8px;
    --bs-accordion-btn-bg: #f8fbfe;
    --bs-accordion-active-bg: var(--crm-sky);
    --bs-accordion-active-color: var(--crm-deep);
    --bs-accordion-btn-focus-box-shadow: 0 0 0 .22rem rgba(23, 105, 170, .12);
    min-width: 0;
}

.role-permission-accordion .accordion-button {
    color: var(--crm-deep);
    font-weight: 780;
    gap: .65rem;
}

.role-permission-accordion .accordion-button::after {
    flex: 0 0 auto;
}

.role-permission-accordion .accordion-button > span:first-child {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.role-permission-count {
    background: #e8f0f7;
    border: 1px solid #cbdbe9;
    border-radius: 999px;
    color: #49647a;
    flex: 0 0 auto;
    font-size: .74rem;
    font-weight: 850;
    line-height: 1;
    padding: .32rem .6rem;
}

@media (min-width: 1200px) {
    .dashboard-metrics .col-xl {
        flex: 0 0 auto;
        width: 20%;
    }
}

@media (max-width: 991px) {
    .crm-topbar {
        justify-content: space-between;
        left: 0;
        min-height: 4.35rem;
        padding: .72rem 1rem;
        position: sticky;
        top: 0;
        will-change: transform;
    }

    .crm-main {
        margin-left: 0;
        padding: 1rem 1rem 2rem;
    }

    .page-head {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-metrics .col-6 {
        width: 50%;
    }

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

    .role-permission-columns {
        grid-template-columns: 1fr;
    }

    .table {
        min-width: 38rem;
    }

    .table-responsive .table td,
    .table-responsive .table th {
        padding-left: .62rem;
        padding-right: .62rem;
    }

    .page-head .quick-actions,
    .form-section.d-flex {
        flex-wrap: wrap;
    }

    .list-filter-form > [class*="col"] {
        flex: 0 0 100%;
        max-width: 100%;
        width: 100%;
    }

    .list-filter-form .btn {
        width: 100%;
    }
}

@media (max-width: 575px) {
    .auth-main {
        padding: 1rem;
    }

    .captcha-box {
        grid-template-columns: 1fr;
    }

    .crm-main {
        padding: .9rem .72rem 1.6rem;
    }

    .crm-topbar {
        align-items: center;
        flex-wrap: nowrap;
        gap: .62rem;
        padding: .68rem .72rem;
    }

    .topbar-start {
        flex: 1 1 auto;
        margin-left: 0;
        justify-content: space-between;
        width: auto;
    }

    .topbar-user {
        display: none;
    }

    .topbar-divider {
        display: none;
    }

    .topbar-actions {
        display: flex;
        gap: .45rem;
        width: auto;
    }

    .topbar-actions form,
    .topbar-actions .topbar-icon-link,
    .topbar-actions button {
        width: 2.2rem;
    }

    .list-filter-form .form-floating-compact > .form-control,
    .list-filter-form .form-floating-compact > .form-select {
        height: calc(3.45rem + calc(var(--bs-border-width) * 2));
        min-height: calc(3.45rem + calc(var(--bs-border-width) * 2));
    }

    .list-filter-form .form-floating > label {
        font-size: .82rem;
        padding-left: .72rem;
        padding-right: .72rem;
    }

    .page-head {
        gap: .72rem;
        margin-bottom: .9rem;
        padding-bottom: .8rem;
    }

    .page-head h1 {
        font-size: 1.45rem;
    }

    .panel {
        padding: .95rem;
    }

    .metric {
        min-height: 6.2rem;
        padding: .82rem;
    }

    .metric small {
        font-size: .72rem;
        min-height: 1.8rem;
    }

    .dashboard-chart {
        gap: .82rem;
        min-height: auto;
    }

    .dashboard-chart-head {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-chart-head strong {
        align-self: flex-start;
    }

    .dashboard-chart-bars {
        gap: .35rem;
        height: 9rem;
    }

    .dashboard-chart-value,
    .dashboard-chart-month {
        font-size: .68rem;
    }

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

    .quick-actions {
        display: grid;
    }

    .btn {
        white-space: normal;
    }

    .row.g-2,
    .row.g-3 {
        --bs-gutter-y: .72rem;
    }

    .form-section.d-flex,
    .form-section.d-flex .btn {
        width: 100%;
    }

    details {
        padding: .62rem;
    }

    .profile-facts dt {
        padding-bottom: .08rem;
    }

    .profile-facts dd {
        min-height: auto;
        padding-top: .05rem;
    }

    .table {
        font-size: .9rem;
        min-width: 34rem;
    }

    .role-permission-accordion .accordion-button {
        align-items: center;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .role-permission-columns {
        grid-template-columns: 1fr;
    }

    .task-inline-form {
        grid-template-columns: 1fr;
    }

    .task-inline-form .btn {
        width: 100%;
    }

    .flash-alert-stack {
        bottom: .75rem;
        max-width: calc(100vw - 1.5rem);
        right: .75rem;
    }
}
