:root {
    --saas-bg: #f4f7fc;
    --saas-surface: #ffffff;
    --saas-surface-alt: #f8fafc;
    --saas-border: #e5eaf2;
    --saas-text: #0f172a;
    --saas-muted: #64748b;
    --saas-primary: #2563eb;
    --saas-primary-soft: #dbeafe;
    --saas-success: #16a34a;
    --saas-warning: #f59e0b;
    --saas-danger: #ef4444;
    --saas-info: #0891b2;
    --saas-radius: 14px;
    --saas-shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.06);
    --saas-shadow-md: 0 16px 34px rgba(15, 23, 42, 0.1);
}

body.saas-ui {
    background: var(--saas-bg);
    color: var(--saas-text);
}

.content-wrapper {
    background: transparent;
}

.content-header {
    padding: 1.1rem 0.8rem 0.45rem;
}

.content {
    padding: 0.45rem 0.8rem 1.4rem;
}

@media (min-width: 992px) {
    .content-header {
        padding: 1.25rem 1.15rem 0.45rem;
    }

    .content {
        padding: 0.6rem 1.15rem 1.6rem;
    }
}

.content-header h1 {
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 0;
    letter-spacing: -0.02em;
}

.content-header h1:not(.no-header-icon)::before {
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    content: "\f105";
    margin-right: 0.5rem;
    color: #94a3b8;
}

.content-header small {
    display: inline-block;
    margin-top: 4px;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 0.5rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: #94a3b8;
}

.main-header.navbar {
    border-bottom: 1px solid var(--saas-border);
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.88);
}

.main-header .nav-link {
    border-radius: 10px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.main-header .nav-link:hover {
    background: #eef2ff;
    color: #1d4ed8;
}

.topbar-notification-item .topbar-notification-link {
    position: relative;
    width: 36px;
    height: 36px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
}

.topbar-notification-item .topbar-notification-icon {
    font-size: 1.02rem;
    line-height: 1;
    color: #64748b;
}

.main-header .topbar-notification-item .topbar-notification-link:hover .topbar-notification-icon {
    color: #1d4ed8;
}

.topbar-notification-item .topbar-notification-badge {
    position: absolute;
    top: 1px;
    right: 1px;
    transform: translate(42%, -42%);
    min-width: 18px;
    height: 18px;
    padding: 0 5px !important;
    border-radius: 999px;
    font-size: 0.62rem !important;
    line-height: 18px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px #ffffff;
    pointer-events: none;
}

.topbar-notification-dropdown {
    width: 360px;
    max-width: calc(100vw - 16px);
}

.topbar-notification-dropdown .notification-dropdown-header {
    background: transparent;
    border: 0;
}

.topbar-notification-row {
    white-space: normal;
}

.property-switcher-dropdown {
    margin-left: 0.5rem;
}

.property-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 12px;
    padding: 6px 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: #0f172a;
    min-height: 40px;
    max-width: 280px;
}

.property-trigger:hover,
.property-trigger:focus {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #0f172a;
}

.property-avatar {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    object-fit: cover;
    flex: 0 0 28px;
}

.property-name {
    display: inline-block;
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.property-dropdown {
    border-radius: 14px;
    padding: 8px;
    min-width: 250px;
    max-width: 320px;
}

.property-item {
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 10px;
    padding: 8px 10px;
    border: 0;
    background: transparent;
    width: 100%;
}

.property-avatar-sm {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    object-fit: cover;
    flex: 0 0 24px;
}

.property-item:hover {
    background-color: #eef2ff;
}

.property-item.active {
    background-color: #2563eb;
    color: #fff !important;
}

@media (max-width: 767.98px) {
    .property-switcher-dropdown {
        margin-left: 0.2rem;
    }

    .property-trigger {
        max-width: 180px;
        padding: 5px 10px;
    }

    .property-name {
        max-width: 92px;
    }

    .property-dropdown {
        min-width: 220px;
    }
}

.main-sidebar {
    background: #111827;
    border-right: 1px solid rgba(148, 163, 184, 0.18);
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    padding-top: 0.82rem;
    padding-bottom: 0.82rem;
    min-height: 68px;
}

.brand-link .brand-image {
    opacity: 1;
    box-shadow: none;
}

.brand-link .brand-image-enhanced {
    float: none !important;
    margin: 0 !important;
    width: auto !important;
    max-width: 214px !important;
    max-height: 56px !important;
    height: 56px !important;
    min-height: 56px;
    flex: 0 0 auto;
    object-fit: contain;
    object-position: left center;
    border-radius: 12px;
    padding: 3px 4px;
    background: rgba(255, 255, 255, 0.07);
}

.brand-link .brand-image-fallback {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    font-size: 1.1rem;
}

.brand-link .brand-text {
    font-weight: 700;
    letter-spacing: 0.01em;
    font-size: 1.03rem;
    line-height: 1.1;
    margin-left: 0;
}

.brand-link .brand-text small {
    font-size: 0.72rem;
    margin-top: 0.2rem;
}

body.sidebar-mini.sidebar-collapse .brand-link {
    justify-content: center;
    gap: 0;
}

body.sidebar-mini.sidebar-collapse .brand-link .brand-image.brand-image-enhanced {
    max-width: 48px !important;
    width: 48px !important;
    max-height: 48px !important;
    height: 48px !important;
    min-height: 48px;
    padding: 2px;
}

body.sidebar-mini.sidebar-collapse .brand-link .brand-text {
    display: none;
}

.sidebar {
    padding: 0.35rem 0.55rem 0.85rem;
}

.nav-sidebar .nav-header {
    margin-top: 0.85rem;
    margin-bottom: 0.35rem;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(203, 213, 225, 0.72);
    padding-left: 0.65rem;
}

.nav-sidebar > .nav-item {
    margin-bottom: 0.2rem;
}

.nav-sidebar .nav-link {
    border-radius: 10px;
    color: rgba(241, 245, 249, 0.86);
    font-weight: 500;
    padding: 0.55rem 0.65rem;
    position: relative;
    transition: all 0.22s ease;
}

.nav-sidebar .nav-link .nav-icon {
    width: 1.35rem;
    text-align: center;
    margin-right: 0.35rem;
}

.nav-sidebar .nav-link:hover {
    background: rgba(37, 99, 235, 0.14);
    color: #ffffff;
}

.nav-sidebar > .nav-item > .nav-link.active,
.nav-sidebar .nav-treeview > .nav-item > .nav-link.active {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.22), rgba(59, 130, 246, 0.1));
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.35);
}

.nav-sidebar > .nav-item > .nav-link.active::before,
.nav-sidebar .nav-treeview > .nav-item > .nav-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    bottom: 7px;
    width: 3px;
    border-radius: 99px;
    background: #60a5fa;
}

.nav-sidebar .menu-open > .nav-link {
    background: rgba(148, 163, 184, 0.13);
    color: #fff;
}

.nav-sidebar .nav-treeview {
    padding-left: 0.75rem;
}

.nav-sidebar .nav-treeview .nav-link {
    font-size: 0.92rem;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
}

.card,
.small-box,
.info-box,
.modal-content,
.alert,
.dropdown-menu {
    border-radius: var(--saas-radius);
}

.card {
    border: 1px solid var(--saas-border);
    box-shadow: var(--saas-shadow-sm);
    margin-bottom: 1rem;
}

.card-header {
    border-bottom: 1px solid var(--saas-border);
    background: transparent;
    padding: 0.9rem 1rem;
}

.card-title {
    font-weight: 700;
    color: #0f172a;
}

.card-body {
    padding: 1rem;
}

@media (min-width: 992px) {
    .card {
        margin-bottom: 1.1rem;
    }

    .card-body {
        padding: 1.05rem 1.1rem;
    }
}

.btn {
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: none;
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:focus,
.btn.focus {
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.18);
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-color: #1d4ed8;
}

.btn-primary:hover,
.btn-primary:focus {
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25);
}

.badge {
    font-weight: 600;
    border-radius: 999px;
    padding: 0.35rem 0.58rem;
}

.badge-success,
.badge-published {
    background: #dcfce7;
    color: #166534;
}

.badge-secondary,
.badge-draft {
    background: #eef2f7;
    color: #334155;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #cffafe;
    color: #155e75;
}

.form-group {
    margin-bottom: 0.95rem;
}

.form-group > label,
label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #334155;
    margin-bottom: 0.38rem;
}

.form-control,
.custom-select,
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple,
.input-group-text {
    border-radius: 10px;
    border-color: #d3ddea;
    min-height: calc(2.25rem + 2px);
}

.form-control:focus,
.custom-select:focus,
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: #60a5fa;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.16);
}

.input-group > .input-group-prepend > .input-group-text,
.input-group > .input-group-append > .input-group-text {
    background: #f8fafc;
    color: #64748b;
}

.invalid-feedback {
    font-size: 0.82rem;
    margin-top: 0.25rem;
}

.custom-control-input:checked ~ .custom-control-label::before {
    border-color: #2563eb;
    background-color: #2563eb;
}

.table-responsive {
    margin-bottom: 0.7rem;
    border-radius: 12px;
}

.table {
    margin-bottom: 0;
    color: #1e293b;
}

.table thead th {
    border-top: 0;
    border-bottom: 1px solid #dbe4f0;
    color: #475569;
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    background: #f8fafc;
}

.table td,
.table th {
    vertical-align: middle;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table-hover tbody tr:hover {
    background: #eff6ff;
}

.table-bordered,
.table-bordered td,
.table-bordered th {
    border-color: #e2e8f0;
}

.pagination {
    gap: 0.28rem;
}

.page-item .page-link {
    border-radius: 9px;
    border-color: #d6dfec;
    color: #1e3a8a;
    font-weight: 600;
}

.page-item.active .page-link {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.page-item.disabled .page-link {
    color: #94a3b8;
}

.modal-content {
    border: 1px solid var(--saas-border);
    box-shadow: var(--saas-shadow-md);
}

.modal-header,
.modal-footer {
    border-color: var(--saas-border);
}

.modal-header .modal-title {
    font-weight: 700;
}

.modal.fade .modal-dialog {
    transform: translateY(-10px);
    transition: transform 0.2s ease-out;
}

.modal.show .modal-dialog {
    transform: translateY(0);
}

.alert {
    border: 1px solid transparent;
    box-shadow: none;
}

.alert-success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.alert-danger {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.alert-warning {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
}

.alert-info {
    border-color: #bae6fd;
    background: #f0f9ff;
    color: #0c4a6e;
}

.empty-state {
    padding: 2rem 1rem;
    color: #64748b;
    text-align: center;
}

.empty-state i {
    font-size: 1.8rem;
    display: block;
    margin-bottom: 0.5rem;
}

.img-circle,
.img-circle img,
img.img-circle,
.avatar-sm,
.avatar-md,
.avatar-lg {
    object-fit: cover;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.avatar-md {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.avatar-lg {
    width: 64px;
    height: 64px;
    border-radius: 50%;
}

.dashboard-saas .small-box {
    background: var(--saas-surface) !important;
    color: #0f172a !important;
    border: 1px solid var(--saas-border);
    box-shadow: var(--saas-shadow-sm);
    border-radius: var(--saas-radius);
    min-height: 126px;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.dashboard-saas .small-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--saas-shadow-md);
}

.dashboard-saas .small-box .inner h3 {
    font-size: 1.65rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.25rem;
}

.dashboard-saas .small-box .inner p {
    color: #64748b;
    font-weight: 600;
    font-size: 0.88rem;
}

.dashboard-saas .small-box .icon {
    right: 14px;
    top: 14px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #1d4ed8 !important;
    background: #e0e7ff;
    opacity: 1;
}

.dashboard-saas .small-box .small-box-footer {
    display: none;
}

.dashboard-saas .info-box {
    border: 1px solid var(--saas-border);
    border-radius: var(--saas-radius);
    box-shadow: var(--saas-shadow-sm);
    background: var(--saas-surface);
}

.dashboard-saas .info-box .info-box-icon {
    border-radius: 10px;
    margin: 8px;
    height: calc(100% - 16px);
}

.dashboard-saas .card canvas {
    min-height: 220px;
}

.module-polish .dense-card {
    border-radius: 16px;
}

.module-polish .dense-filter-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    row-gap: 8px;
}

.module-polish .dense-filter-form .form-group,
.module-polish .dense-filter-form .input-group {
    margin-bottom: 0 !important;
}

.module-polish .dense-table-wrap {
    border-top: 1px solid var(--saas-border);
}

.module-polish .dense-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.module-polish .dense-table td {
    padding-top: 0.68rem;
    padding-bottom: 0.68rem;
}

.module-polish .dense-card-footer {
    border-top: 1px solid var(--saas-border);
    background: #fcfdff;
}

/* ===== Module Stat Card Unification (Reports + Similar Screens) ===== */
.module-polish .row > [class*="col-"] {
    margin-bottom: 0.9rem;
}

.module-polish .small-box,
.module-polish .info-box {
    background: var(--saas-surface) !important;
    color: var(--saas-text) !important;
    border: 1px solid var(--saas-border) !important;
    box-shadow: var(--saas-shadow-sm);
    border-radius: 16px;
    min-height: 108px;
    margin-bottom: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.module-polish .small-box:hover,
.module-polish .info-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--saas-shadow-md);
}

.module-polish .small-box {
    position: relative;
    overflow: hidden;
}

.module-polish .small-box .inner {
    padding: 1rem 1.05rem;
}

.module-polish .small-box .inner h3,
.module-polish .info-box .info-box-number {
    font-size: 1.55rem;
    line-height: 1.2;
    margin-bottom: 0.2rem;
    font-weight: 700;
    color: #1f2937 !important;
}

.module-polish .small-box .inner p,
.module-polish .info-box .info-box-text {
    margin-bottom: 0;
    font-size: 0.84rem;
    font-weight: 600;
    color: #64748b !important;
}

.module-polish .small-box .icon {
    right: 14px;
    top: 14px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    opacity: 1;
}

.module-polish .small-box .small-box-footer {
    display: none;
}

.module-polish .small-box.bg-primary .icon,
.module-polish .small-box.bg-info .icon {
    background: #dbeafe;
    color: #1d4ed8 !important;
}

.module-polish .small-box.bg-success .icon {
    background: #dcfce7;
    color: #15803d !important;
}

.module-polish .small-box.bg-warning .icon {
    background: #fef3c7;
    color: #b45309 !important;
}

.module-polish .small-box.bg-danger .icon {
    background: #fee2e2;
    color: #b91c1c !important;
}

.module-polish .small-box.bg-secondary .icon {
    background: #e2e8f0;
    color: #334155 !important;
}

.module-polish .info-box {
    display: flex;
    align-items: center;
    padding: 1rem 1.05rem;
}

.module-polish .info-box .info-box-content {
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
}

.module-polish .info-box .info-box-icon {
    order: 2;
    margin: 0;
    margin-left: auto;
    width: 44px;
    min-width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.05rem;
}

.module-polish .info-box .info-box-icon.bg-primary,
.module-polish .info-box .info-box-icon.bg-info {
    background: #dbeafe !important;
    color: #1d4ed8 !important;
}

.module-polish .info-box .info-box-icon.bg-success {
    background: #dcfce7 !important;
    color: #15803d !important;
}

.module-polish .info-box .info-box-icon.bg-warning {
    background: #fef3c7 !important;
    color: #b45309 !important;
}

.module-polish .info-box .info-box-icon.bg-danger {
    background: #fee2e2 !important;
    color: #b91c1c !important;
}

.module-polish .info-box .info-box-icon.bg-secondary {
    background: #e2e8f0 !important;
    color: #334155 !important;
}

@media (max-width: 767.98px) {
    .module-polish .small-box .inner,
    .module-polish .info-box {
        padding: 0.85rem 0.9rem;
    }

    .module-polish .small-box .inner h3,
    .module-polish .info-box .info-box-number {
        font-size: 1.35rem;
    }
}

.module-polish.module-fees .small-box .icon,
.module-polish.module-expenses .small-box .icon,
.module-polish.module-reports .small-box .icon {
    background: #e0e7ff;
    color: #1d4ed8 !important;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    right: 12px;
    top: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.module-polish.module-tenants .img-circle {
    border: 2px solid #e2e8f0;
}

.module-polish.module-tenants-show .card-body .row > [class*="col-"] {
    margin-bottom: 0.15rem;
}

.module-polish.module-reports .report-tabs {
    background: #fff;
    border: 1px solid var(--saas-border);
    border-radius: 12px;
    padding: 0.35rem;
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
}

.module-polish.module-reports .report-tabs .nav-link {
    border: 0;
    border-radius: 9px;
    color: #475569;
    font-weight: 600;
    padding: 0.45rem 0.72rem;
}

.module-polish.module-reports .report-tabs .nav-link.active {
    background: #2563eb;
    color: #fff;
}

.module-polish.module-expenses .dense-export-row,
.module-polish.module-reports .text-right {
    margin-top: 0.75rem;
}

@media (max-width: 991.98px) {
    .module-polish .dense-filter-form {
        align-items: stretch;
    }

    .module-polish .dense-filter-form .form-group,
    .module-polish .dense-filter-form .input-group {
        width: 100%;
    }
}

.quick-actions-sticky {
    position: fixed !important;
    right: 16px !important;
    bottom: 90px !important;
    z-index: 1035;
    width: auto !important;
    background: transparent !important;
    padding: 0 !important;
}

.quick-actions-sticky .btn,
.quick-actions-sticky .btn-group > .btn {
    width: 42px !important;
    height: 42px !important;
    border-radius: 12px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.25);
}

.quick-actions-bottom {
    border-top: 1px solid var(--saas-border) !important;
    box-shadow: 0 -6px 18px rgba(15, 23, 42, 0.08);
}

.property-switcher {
    min-width: 240px;
    max-width: 280px;
}

.theme-toggle-btn {
    border: 1px solid #d8e2f0;
    border-radius: 10px;
    background: #fff;
    color: #334155;
    height: 34px;
    min-width: 38px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

.theme-toggle-btn:hover {
    background: #eef2ff;
    color: #1d4ed8;
}

body.theme-dark {
    --saas-bg: #0b1220;
    --saas-surface: #111827;
    --saas-surface-alt: #0f172a;
    --saas-border: #243041;
    --saas-text: #e2e8f0;
    --saas-muted: #94a3b8;
}

body.theme-dark,
body.theme-dark .content-wrapper {
    background: #0b1220;
    color: var(--saas-text);
}

body.theme-dark .main-header.navbar {
    background: rgba(17, 24, 39, 0.88);
    border-bottom-color: #243041;
}

body.theme-dark .main-header .nav-link {
    color: #cbd5e1;
}

body.theme-dark .main-header .nav-link:hover {
    background: #1e293b;
    color: #fff;
}

body.theme-dark .topbar-notification-item .topbar-notification-icon,
body.dark-mode .topbar-notification-item .topbar-notification-icon {
    color: #cbd5e1;
}

body.theme-dark .main-header .topbar-notification-item .topbar-notification-link:hover .topbar-notification-icon,
body.dark-mode .main-header .topbar-notification-item .topbar-notification-link:hover .topbar-notification-icon {
    color: #ffffff;
}

body.theme-dark .topbar-notification-item .topbar-notification-badge,
body.dark-mode .topbar-notification-item .topbar-notification-badge {
    box-shadow: 0 0 0 2px #111827;
}

body.theme-dark .property-trigger,
body.dark-mode .property-trigger {
    background: #1f2937;
    border: 1px solid #374151;
    color: #e5e7eb;
}

body.theme-dark .property-trigger:hover,
body.theme-dark .property-trigger:focus,
body.dark-mode .property-trigger:hover,
body.dark-mode .property-trigger:focus {
    background: #243244;
    color: #ffffff;
}

body.theme-dark .property-dropdown,
body.dark-mode .property-dropdown {
    background: #111827;
    border-color: #334155;
}

body.theme-dark .property-item,
body.dark-mode .property-item {
    color: #e5e7eb;
}

body.theme-dark .property-item:hover,
body.dark-mode .property-item:hover {
    background: #1f2937;
    color: #ffffff !important;
}

body.theme-dark .property-item.active,
body.dark-mode .property-item.active {
    background: #2563eb;
    color: #ffffff !important;
}

body.theme-dark .main-sidebar {
    background: #020617;
    border-right-color: #243041;
}

body.theme-dark .brand-link {
    border-bottom-color: #243041;
}

body.theme-dark .brand-link .brand-image-enhanced,
body.dark-mode .brand-link .brand-image-enhanced {
    background: rgba(148, 163, 184, 0.14);
}

body.theme-dark .card,
body.theme-dark .info-box,
body.theme-dark .small-box,
body.theme-dark .modal-content,
body.theme-dark .dropdown-menu {
    background: var(--saas-surface);
    border-color: var(--saas-border);
    color: var(--saas-text);
}

body.theme-dark .card-header,
body.theme-dark .modal-header,
body.theme-dark .modal-footer,
body.theme-dark .main-footer {
    border-color: var(--saas-border);
}

body.theme-dark .card-title,
body.theme-dark .content-header h1,
body.theme-dark .form-group > label,
body.theme-dark label,
body.theme-dark .brand-text {
    color: #f8fafc;
}

body.theme-dark .text-muted,
body.theme-dark .content-header small,
body.theme-dark .small-box .inner p,
body.theme-dark .info-box-text {
    color: #94a3b8 !important;
}

body.theme-dark .form-control,
body.theme-dark .custom-select,
body.theme-dark .select2-container--default .select2-selection--single,
body.theme-dark .select2-container--default .select2-selection--multiple,
body.theme-dark .input-group-text,
body.theme-dark .property-switcher,
body.theme-dark .form-control-navbar {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

body.theme-dark .form-control::placeholder {
    color: #64748b;
}

body.theme-dark select.form-control,
body.theme-dark select.custom-select,
body.dark-mode select.form-control,
body.dark-mode select.custom-select {
    color-scheme: dark;
}

body.theme-dark select.form-control option,
body.theme-dark select.custom-select option,
body.dark-mode select.form-control option,
body.dark-mode select.custom-select option {
    background-color: #111827;
    color: #e5e7eb;
}

body.theme-dark .dropdown-item,
body.dark-mode .dropdown-item {
    color: #e5e7eb;
}

body.theme-dark .dropdown-item:hover,
body.theme-dark .dropdown-item:focus,
body.dark-mode .dropdown-item:hover,
body.dark-mode .dropdown-item:focus {
    background-color: #1e293b;
    color: #ffffff;
}

body.theme-dark .select2-container--default .select2-dropdown,
body.dark-mode .select2-container--default .select2-dropdown {
    background: #111827;
    border-color: #334155;
}

body.theme-dark .select2-container--default .select2-results__option,
body.dark-mode .select2-container--default .select2-results__option {
    color: #e5e7eb;
}

body.theme-dark .select2-container--default .select2-results__option--highlighted[aria-selected],
body.dark-mode .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #1d4ed8;
    color: #ffffff;
}

body.theme-dark .select2-container--default .select2-results__option[aria-selected=true],
body.dark-mode .select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #1e293b;
    color: #ffffff;
}

body.theme-dark .select2-container--default .select2-selection__placeholder,
body.dark-mode .select2-container--default .select2-selection__placeholder {
    color: #94a3b8;
}

body.theme-dark .select2-container--default .select2-search--dropdown .select2-search__field,
body.dark-mode .select2-container--default .select2-search--dropdown .select2-search__field {
    background: #0f172a;
    border: 1px solid #334155;
    color: #e5e7eb;
}

body.theme-dark .table {
    color: #cbd5e1;
}

body.theme-dark .table thead th {
    background: #0f172a;
    color: #94a3b8;
    border-bottom-color: #334155;
}

body.theme-dark .table-bordered,
body.theme-dark .table-bordered td,
body.theme-dark .table-bordered th {
    border-color: #334155;
}

body.theme-dark .table-hover tbody tr:hover {
    background: #1e293b;
}

body.theme-dark .pagination .page-link {
    background: #111827;
    border-color: #334155;
    color: #93c5fd;
}

body.theme-dark .page-item.active .page-link {
    background: #2563eb;
    border-color: #2563eb;
}

body.theme-dark .theme-toggle-btn {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

body.theme-dark .theme-toggle-btn:hover {
    background: #1e293b;
    color: #fff;
}

body.theme-dark .quick-actions-bottom {
    background: #111827 !important;
    border-top-color: #243041 !important;
}

body.theme-dark .quick-actions-bottom a {
    color: #e2e8f0 !important;
}

body.theme-dark .module-polish .dense-card-footer {
    background: #0f172a;
}

body.theme-dark .module-polish .small-box,
body.theme-dark .module-polish .info-box,
body.dark-mode .module-polish .small-box,
body.dark-mode .module-polish .info-box {
    background: #111827 !important;
    border-color: #1f2937 !important;
}

body.theme-dark .module-polish .small-box .inner h3,
body.theme-dark .module-polish .info-box .info-box-number,
body.dark-mode .module-polish .small-box .inner h3,
body.dark-mode .module-polish .info-box .info-box-number {
    color: #ffffff !important;
}

body.theme-dark .module-polish .small-box .inner p,
body.theme-dark .module-polish .info-box .info-box-text,
body.dark-mode .module-polish .small-box .inner p,
body.dark-mode .module-polish .info-box .info-box-text {
    color: #94a3b8 !important;
}

body.theme-dark .module-polish .small-box.bg-primary .icon,
body.theme-dark .module-polish .small-box.bg-info .icon,
body.dark-mode .module-polish .small-box.bg-primary .icon,
body.dark-mode .module-polish .small-box.bg-info .icon,
body.theme-dark .module-polish .info-box .info-box-icon.bg-primary,
body.theme-dark .module-polish .info-box .info-box-icon.bg-info,
body.dark-mode .module-polish .info-box .info-box-icon.bg-primary,
body.dark-mode .module-polish .info-box .info-box-icon.bg-info {
    background: rgba(37, 99, 235, 0.22) !important;
    color: #93c5fd !important;
}

body.theme-dark .module-polish .small-box.bg-success .icon,
body.dark-mode .module-polish .small-box.bg-success .icon,
body.theme-dark .module-polish .info-box .info-box-icon.bg-success,
body.dark-mode .module-polish .info-box .info-box-icon.bg-success {
    background: rgba(22, 163, 74, 0.22) !important;
    color: #86efac !important;
}

body.theme-dark .module-polish .small-box.bg-warning .icon,
body.dark-mode .module-polish .small-box.bg-warning .icon,
body.theme-dark .module-polish .info-box .info-box-icon.bg-warning,
body.dark-mode .module-polish .info-box .info-box-icon.bg-warning {
    background: rgba(245, 158, 11, 0.24) !important;
    color: #fcd34d !important;
}

body.theme-dark .module-polish .small-box.bg-danger .icon,
body.dark-mode .module-polish .small-box.bg-danger .icon,
body.theme-dark .module-polish .info-box .info-box-icon.bg-danger,
body.dark-mode .module-polish .info-box .info-box-icon.bg-danger {
    background: rgba(239, 68, 68, 0.24) !important;
    color: #fca5a5 !important;
}

body.theme-dark .module-polish .small-box.bg-secondary .icon,
body.dark-mode .module-polish .small-box.bg-secondary .icon,
body.theme-dark .module-polish .info-box .info-box-icon.bg-secondary,
body.dark-mode .module-polish .info-box .info-box-icon.bg-secondary {
    background: rgba(148, 163, 184, 0.2) !important;
    color: #cbd5e1 !important;
}

body.theme-dark .module-polish.module-reports .report-tabs {
    background: #111827;
    border-color: #334155;
}

body.theme-dark .module-polish.module-reports .report-tabs .nav-link {
    color: #94a3b8;
}

body.theme-dark .module-polish.module-reports .report-tabs .nav-link.active {
    background: #2563eb;
    color: #fff;
}

.main-footer {
    border-top: 1px solid var(--saas-border);
    background: rgba(255, 255, 255, 0.7);
}

body.theme-dark .main-footer {
    background: rgba(15, 23, 42, 0.7);
}


/* ===== Dashboard SaaS Card Cleanup ===== */
body.saas-ui {
    background: #f8fafc;
    font-family: Inter, "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.saas-ui .content-wrapper {
    background: #f8fafc;
}

body.saas-ui .main-sidebar {
    background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
}

body.saas-ui .sidebar {
    padding-left: 0.45rem;
    padding-right: 0.45rem;
}

body.saas-ui .nav-sidebar .nav-link {
    padding: 0.5rem 0.62rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

body.saas-ui .nav-sidebar .nav-link .nav-icon {
    width: 1.2rem;
    font-size: 0.95rem;
}

body.saas-ui .nav-sidebar .nav-link:hover {
    background: rgba(37, 99, 235, 0.14);
}

body.saas-ui .nav-sidebar > .nav-item > .nav-link.active,
body.saas-ui .nav-sidebar .nav-treeview > .nav-item > .nav-link.active {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.22), rgba(59, 130, 246, 0.1));
}

body.saas-ui .nav-sidebar > .nav-item > .nav-link.active::before,
body.saas-ui .nav-sidebar .nav-treeview > .nav-item > .nav-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    bottom: 7px;
    width: 3px;
    border-radius: 99px;
    background: #60a5fa;
}

.dashboard-modern-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.dashboard-modern-subtitle {
    font-size: 0.9rem;
}

.dashboard-modern .chart-card,
.dashboard-modern .stat-card {
    background: #fff;
    border: 1px solid #eef1f6;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
}

.stat-card {
    border: 1px solid #eef1f6;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}

.stat-card .card-body {
    min-height: 106px;
    padding: 1rem 1.05rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.stat-card .card-body > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.15;
}

.stat-label {
    font-size: 13px;
    color: #6b7280;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    flex: 0 0 48px;
    margin-left: auto;
}

.dashboard-modern .chart-card {
    border: 0;
}

.dashboard-modern .chart-card .card-header {
    border-bottom: 0;
    padding: 1rem 1.1rem 0.15rem;
}

.dashboard-modern .chart-card .card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
}

.dashboard-modern .chart-card .card-body {
    padding: 0.8rem 1.1rem 1.1rem;
    min-height: 0;
}

.dashboard-modern .chart-canvas-wrap {
    position: relative;
    width: 100%;
    height: 280px;
    max-height: 280px;
    overflow: hidden;
}

.dashboard-modern .chart-canvas-wrap canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.quick-actions-card {
    border-radius: 16px !important;
}

.quick-actions-inline .btn-group {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.quick-actions-inline .btn,
.quick-actions-inline .dropdown-toggle {
    border-radius: 999px !important;
    padding: 0.4rem 0.75rem !important;
    font-size: 0.82rem;
    font-weight: 600;
}

.quick-actions-inline .btn i,
.quick-actions-inline .dropdown-toggle i {
    font-size: 0.82rem;
}

.quick-actions-sticky {
    right: 14px !important;
    gap: 8px !important;
}

.quick-actions-sticky .btn,
.quick-actions-sticky .btn-group > .btn {
    width: 38px !important;
    height: 38px !important;
    border-radius: 11px !important;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.23) !important;
}

.quick-actions-sticky .btn:hover,
.quick-actions-sticky .btn-group > .btn:hover {
    transform: translateY(-2px);
}

@media (max-width: 991.98px) {
    .dashboard-modern .chart-canvas-wrap {
        height: 245px;
        max-height: 245px;
    }

    .quick-actions-inline {
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 2px;
    }

    .quick-actions-inline .btn-group {
        flex-wrap: nowrap;
    }
}

@media (max-width: 767.98px) {
    .dashboard-modern .chart-canvas-wrap {
        height: 220px;
        max-height: 220px;
    }

    .dashboard-modern .stat-card,
    .dashboard-modern .chart-card {
        margin-bottom: 0.85rem;
    }

    .content-header,
    .content {
        padding-left: 0.45rem;
        padding-right: 0.45rem;
    }
}

/* ===== Premium Dark Mode Hardening ===== */
body.dark-mode,
body.dark-mode .content-wrapper,
body.theme-dark,
body.theme-dark .content-wrapper {
    background-color: #0f172a !important;
}

body.dark-mode .main-sidebar,
body.theme-dark .main-sidebar {
    background: #0b1220 !important;
    border-right: 1px solid #1f2937;
}

body.dark-mode .nav-sidebar .nav-link:hover,
body.theme-dark .nav-sidebar .nav-link:hover {
    background: rgba(37, 99, 235, 0.14);
}

body.dark-mode .nav-sidebar .nav-link.active,
body.theme-dark .nav-sidebar .nav-link.active {
    background: linear-gradient(90deg, #2563eb, #1d4ed8);
    color: #fff !important;
    border-radius: 8px;
}

body.dark-mode .card,
body.theme-dark .card,
body.dark-mode .dashboard-modern .stat-card,
body.dark-mode .dashboard-modern .chart-card,
body.theme-dark .dashboard-modern .stat-card,
body.theme-dark .dashboard-modern .chart-card {
    background: #111827 !important;
    border: 1px solid #1f2937 !important;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35) !important;
}

body.dark-mode .card-header,
body.theme-dark .card-header {
    border-bottom: 1px solid #1f2937 !important;
}

body.dark-mode .stat-number,
body.theme-dark .stat-number {
    color: #ffffff !important;
    font-weight: 700;
}

body.dark-mode .stat-label,
body.theme-dark .stat-label {
    color: #9ca3af !important;
}

body.dark-mode .stat-icon,
body.theme-dark .stat-icon {
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

body.dark-mode .quick-actions-card,
body.theme-dark .quick-actions-card,
body.dark-mode .quick-actions,
body.theme-dark .quick-actions {
    background: #111827 !important;
    border: 1px solid #1f2937 !important;
    border-radius: 12px !important;
}

body.dark-mode .quick-actions-inline .btn,
body.dark-mode .quick-actions-inline .dropdown-toggle,
body.dark-mode .quick-actions .btn,
body.theme-dark .quick-actions-inline .btn,
body.theme-dark .quick-actions-inline .dropdown-toggle,
body.theme-dark .quick-actions .btn {
    border: 1px solid #334155 !important;
    color: #e5e7eb !important;
    background: transparent !important;
}

body.dark-mode .quick-actions-inline .btn:hover,
body.dark-mode .quick-actions-inline .dropdown-toggle:hover,
body.dark-mode .quick-actions .btn:hover,
body.theme-dark .quick-actions-inline .btn:hover,
body.theme-dark .quick-actions-inline .dropdown-toggle:hover,
body.theme-dark .quick-actions .btn:hover {
    background: #1e293b !important;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode .card-title,
body.theme-dark h1,
body.theme-dark h2,
body.theme-dark h3,
body.theme-dark .card-title {
    color: #ffffff !important;
}

body.dark-mode small,
body.dark-mode .text-muted,
body.theme-dark small,
body.theme-dark .text-muted {
    color: #94a3b8 !important;
}

body.dark-mode .dashboard-modern::before,
body.dark-mode .dashboard-modern::after,
body.theme-dark .dashboard-modern::before,
body.theme-dark .dashboard-modern::after {
    content: none !important;
}

/* Footer should not be sticky on tablet/mobile */
@media (max-width: 991.98px) {
    body.layout-footer-fixed .wrapper .main-footer,
    body.layout-footer-fixed .main-footer {
        position: static !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;
        width: auto !important;
        margin-left: 0 !important;
    }

    body.layout-footer-fixed .content-wrapper,
    body.layout-footer-fixed .main-footer {
        margin-bottom: 0 !important;
    }

    body.layout-footer-fixed .quick-actions-bottom {
        bottom: 0 !important;
    }
}

/* ===== Global Dropdown Clipping Fix ===== */
.content-wrapper,
.main-header.navbar,
.navbar,
.row,
.card,
.quick-actions,
.quick-actions-card,
.quick-actions-card .card-body,
.quick-actions-inline,
.quick-actions-inline .btn-group {
    overflow: visible !important;
}

.card-body:not(.table-responsive) {
    overflow: visible !important;
}

body .dropdown-menu {
    z-index: 2000 !important;
    margin-top: 5px;
}

.dropdown-menu {
    position: absolute !important;
}

.dropdown {
    position: relative;
}

.card,
.quick-actions,
.quick-actions-card,
.main-header.navbar {
    position: relative;
}

.navbar,
.quick-actions-bottom,
.quick-actions-sticky,
.floating-actions,
.bottom-bar {
    z-index: 1000 !important;
}

.select2-container,
.select2-container--open,
.select2-dropdown {
    z-index: 10000 !important;
}

@media (max-width: 767.98px) {
    .quick-actions-inline {
        overflow-x: visible !important;
        overflow-y: visible !important;
        white-space: normal !important;
    }

    .quick-actions-inline .btn-group {
        flex-wrap: wrap !important;
    }
}

@media (max-width: 767.98px) {
    body,
    .wrapper,
    .content-wrapper,
    .container-fluid,
    .card,
    .card-body {
        overflow: visible !important;
    }

    .content-wrapper .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .content-wrapper .row > [class*="col-"] {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
}

/* ===== Dark Mode Hover Contrast Fix ===== */
body.dark-mode,
body.theme-dark {
    color: #e5e7eb;
}

body.dark-mode .sidebar-dark-primary .nav-sidebar .nav-link:hover,
body.theme-dark .sidebar-dark-primary .nav-sidebar .nav-link:hover {
    background-color: #1f2937 !important;
    color: #ffffff !important;
}

body.dark-mode .sidebar-dark-primary .nav-sidebar .nav-link.active,
body.theme-dark .sidebar-dark-primary .nav-sidebar .nav-link.active {
    background-color: #2563eb !important;
    color: #ffffff !important;
}

body.dark-mode .dropdown-menu,
body.theme-dark .dropdown-menu {
    background-color: #111827 !important;
}

body.dark-mode .dropdown-item:hover,
body.dark-mode .dropdown-item:focus,
body.theme-dark .dropdown-item:hover,
body.theme-dark .dropdown-item:focus {
    background-color: #1f2937 !important;
    color: #ffffff !important;
}

body.dark-mode .table-hover tbody tr:hover,
body.theme-dark .table-hover tbody tr:hover {
    background-color: #1e293b !important;
    color: #ffffff !important;
}

body.dark-mode .table-hover tbody tr:hover td,
body.dark-mode .table-hover tbody tr:hover th,
body.theme-dark .table-hover tbody tr:hover td,
body.theme-dark .table-hover tbody tr:hover th {
    color: #ffffff !important;
}

body.dark-mode .card:hover,
body.theme-dark .card:hover {
    background-color: #1f2937 !important;
    color: #ffffff !important;
}

body.dark-mode .card:hover .card-title,
body.dark-mode .card:hover .text-muted,
body.dark-mode .card:hover small,
body.theme-dark .card:hover .card-title,
body.theme-dark .card:hover .text-muted,
body.theme-dark .card:hover small {
    color: #ffffff !important;
}

body.dark-mode .btn-outline-primary:hover,
body.theme-dark .btn-outline-primary:hover {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
}

body.dark-mode .btn-primary:hover,
body.theme-dark .btn-primary:hover {
    background-color: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
    color: #ffffff !important;
}

/* ===== Global Legacy Stat Card Upgrade (small-box / info-box) ===== */
.content-wrapper .small-box {
    background: #ffffff !important;
    color: #1f2937 !important;
    border: 1px solid #eef1f6 !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06) !important;
    min-height: 106px;
    margin-bottom: 0.9rem !important;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.content-wrapper .small-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.11) !important;
}

.content-wrapper .small-box .inner {
    padding: 1rem 1.05rem !important;
    padding-right: 4rem !important;
}

.content-wrapper .small-box .inner h3 {
    font-size: 28px !important;
    font-weight: 700 !important;
    line-height: 1.15 !important;
    margin-bottom: 0.2rem !important;
    color: #1f2937 !important;
}

.content-wrapper .small-box .inner p {
    margin-bottom: 0 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #6b7280 !important;
}

.content-wrapper .small-box .icon {
    position: absolute !important;
    right: 14px !important;
    top: 14px !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 1 !important;
    overflow: hidden !important;
}

.content-wrapper .small-box .icon > i,
.content-wrapper .small-box .icon > i.fas,
.content-wrapper .small-box .icon > i.far,
.content-wrapper .small-box .icon > i.fa,
.content-wrapper .small-box .icon > i.fab {
    position: static !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
    font-size: 18px !important;
    line-height: 1 !important;
    color: inherit !important;
}

.content-wrapper .small-box .small-box-footer {
    display: none !important;
}

.content-wrapper .small-box.bg-primary .icon,
.content-wrapper .small-box.bg-info .icon {
    background: #dbeafe !important;
    color: #1d4ed8 !important;
}

.content-wrapper .small-box.bg-success .icon {
    background: #dcfce7 !important;
    color: #15803d !important;
}

.content-wrapper .small-box.bg-warning .icon {
    background: #fef3c7 !important;
    color: #b45309 !important;
}

.content-wrapper .small-box.bg-danger .icon {
    background: #fee2e2 !important;
    color: #b91c1c !important;
}

.content-wrapper .small-box.bg-secondary .icon {
    background: #e2e8f0 !important;
    color: #334155 !important;
}

.content-wrapper .info-box {
    background: #ffffff !important;
    border: 1px solid #eef1f6 !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06) !important;
    min-height: 106px;
    margin-bottom: 0.9rem !important;
    display: flex !important;
    align-items: center !important;
    padding: 1rem 1.05rem !important;
}

.content-wrapper .info-box .info-box-content {
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 !important;
}

.content-wrapper .info-box .info-box-number {
    font-size: 28px !important;
    font-weight: 700 !important;
    line-height: 1.15 !important;
    margin-top: 0.15rem !important;
    color: #1f2937 !important;
}

.content-wrapper .info-box .info-box-text {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #6b7280 !important;
}

.content-wrapper .info-box .info-box-icon {
    order: 2;
    margin-left: auto !important;
    margin-right: 0 !important;
    width: 48px !important;
    min-width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    font-size: 18px !important;
}

@media (max-width: 767.98px) {
    .content-wrapper .small-box .inner,
    .content-wrapper .info-box {
        padding: 0.85rem 0.9rem !important;
    }

    .content-wrapper .small-box .inner {
        padding-right: 3.8rem !important;
    }

    .content-wrapper .small-box .inner h3,
    .content-wrapper .info-box .info-box-number {
        font-size: 24px !important;
    }
}

body.dark-mode .content-wrapper .small-box,
body.theme-dark .content-wrapper .small-box,
body.dark-mode .content-wrapper .info-box,
body.theme-dark .content-wrapper .info-box {
    background: #111827 !important;
    border-color: #1f2937 !important;
}

body.dark-mode .content-wrapper .small-box .inner h3,
body.theme-dark .content-wrapper .small-box .inner h3,
body.dark-mode .content-wrapper .info-box .info-box-number,
body.theme-dark .content-wrapper .info-box .info-box-number {
    color: #ffffff !important;
}

body.dark-mode .content-wrapper .small-box .inner p,
body.theme-dark .content-wrapper .small-box .inner p,
body.dark-mode .content-wrapper .info-box .info-box-text,
body.theme-dark .content-wrapper .info-box .info-box-text {
    color: #94a3b8 !important;
}

body.dark-mode .content-wrapper .small-box.bg-primary .icon,
body.dark-mode .content-wrapper .small-box.bg-info .icon,
body.theme-dark .content-wrapper .small-box.bg-primary .icon,
body.theme-dark .content-wrapper .small-box.bg-info .icon,
body.dark-mode .content-wrapper .info-box .info-box-icon.bg-primary,
body.dark-mode .content-wrapper .info-box .info-box-icon.bg-info,
body.theme-dark .content-wrapper .info-box .info-box-icon.bg-primary,
body.theme-dark .content-wrapper .info-box .info-box-icon.bg-info {
    background: rgba(37, 99, 235, 0.22) !important;
    color: #93c5fd !important;
}

body.dark-mode .content-wrapper .small-box.bg-success .icon,
body.theme-dark .content-wrapper .small-box.bg-success .icon,
body.dark-mode .content-wrapper .info-box .info-box-icon.bg-success,
body.theme-dark .content-wrapper .info-box .info-box-icon.bg-success {
    background: rgba(22, 163, 74, 0.22) !important;
    color: #86efac !important;
}

body.dark-mode .content-wrapper .small-box.bg-warning .icon,
body.theme-dark .content-wrapper .small-box.bg-warning .icon,
body.dark-mode .content-wrapper .info-box .info-box-icon.bg-warning,
body.theme-dark .content-wrapper .info-box .info-box-icon.bg-warning {
    background: rgba(245, 158, 11, 0.24) !important;
    color: #fcd34d !important;
}

body.dark-mode .content-wrapper .small-box.bg-danger .icon,
body.theme-dark .content-wrapper .small-box.bg-danger .icon,
body.dark-mode .content-wrapper .info-box .info-box-icon.bg-danger,
body.theme-dark .content-wrapper .info-box .info-box-icon.bg-danger {
    background: rgba(239, 68, 68, 0.24) !important;
    color: #fca5a5 !important;
}

body.dark-mode .content-wrapper .small-box.bg-secondary .icon,
body.theme-dark .content-wrapper .small-box.bg-secondary .icon,
body.dark-mode .content-wrapper .info-box .info-box-icon.bg-secondary,
body.theme-dark .content-wrapper .info-box .info-box-icon.bg-secondary {
    background: rgba(148, 163, 184, 0.2) !important;
    color: #cbd5e1 !important;
}

/* ===== Global Delete Confirmation Modal Polish ===== */
.swal2-popup {
    border-radius: 14px !important;
}

.swal2-popup .swal2-title {
    font-weight: 700 !important;
}

.swal2-popup .swal2-actions .swal2-styled {
    border-radius: 10px !important;
    font-weight: 600 !important;
}

body.dark-mode .swal2-popup,
body.theme-dark .swal2-popup {
    background: #111827 !important;
    color: #e5e7eb !important;
}

body.dark-mode .swal2-popup .swal2-title,
body.dark-mode .swal2-popup .swal2-content,
body.theme-dark .swal2-popup .swal2-title,
body.theme-dark .swal2-popup .swal2-content {
    color: #e5e7eb !important;
}

body.dark-mode .swal2-toast,
body.theme-dark .swal2-toast {
    background: #111827 !important;
    color: #e5e7eb !important;
}

/* ===== SaaS Design System: Global Layer ===== */
:root {
    --space-1: 0.5rem;
    --space-2: 1rem;
    --space-3: 1.5rem;
    --space-4: 2rem;
    --btn-height-sm: 34px;
    --btn-height-md: 40px;
    --btn-height-lg: 46px;
}

.content-header,
.content {
    max-width: 100%;
}

.page-header-block {
    margin-bottom: var(--space-2);
}

.page-header-title {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.1rem;
}

.page-header-subtitle {
    color: #64748b;
    font-size: 0.88rem;
}

.section-card {
    border: 1px solid var(--saas-border);
    border-radius: 16px;
    box-shadow: var(--saas-shadow-sm);
    background: var(--saas-surface);
}

.section-card .card-header {
    padding: 0.95rem 1rem;
}

.section-card .card-body {
    padding: 1rem;
}

.btn {
    min-height: var(--btn-height-md);
}

.btn.btn-sm {
    min-height: var(--btn-height-sm);
}

.btn.btn-lg {
    min-height: var(--btn-height-lg);
}

.btn i {
    font-size: 0.88rem;
}

.btn.loading,
.btn[disabled].loading {
    pointer-events: none;
    opacity: 0.9;
}

.btn .btn-spinner {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    display: inline-block;
    animation: btnSpin 0.7s linear infinite;
    margin-right: 0.4rem;
    vertical-align: middle;
}

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

.form-section-card {
    border: 1px solid var(--saas-border);
    border-radius: 14px;
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--saas-surface);
}

.form-section-title {
    margin-bottom: 0.85rem;
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
}

label.required::after {
    content: " *";
    color: #dc2626;
    font-weight: 700;
}

.form-helper-text {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.form-error-block {
    margin-top: 0.3rem;
    font-size: 0.8rem;
    color: #dc2626;
}

.table-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.table-toolbar .table-search {
    min-width: 220px;
}

.table-row-hover tbody tr {
    transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

.table-row-hover tbody tr:hover {
    background: #eff6ff;
}

.empty-state-card {
    border: 1px dashed #cfd9e8;
    border-radius: 14px;
    padding: 1.5rem 1rem;
    text-align: center;
    background: #fbfdff;
}

.empty-state-card .empty-state-icon {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e0e7ff;
    color: #1d4ed8;
    margin-bottom: 0.6rem;
}

.empty-state-card .empty-state-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
}

.empty-state-card .empty-state-copy {
    font-size: 0.84rem;
    color: #64748b;
    margin-bottom: 0.8rem;
}

.badge-role,
.badge-status,
.badge-plan,
.badge-payment {
    border-radius: 999px;
    padding: 0.3rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.skeleton {
    border-radius: 10px;
    background: linear-gradient(90deg, #eff3f9 25%, #f8fafd 37%, #eff3f9 63%);
    background-size: 400% 100%;
    animation: skeletonWave 1.2s ease infinite;
}

@keyframes skeletonWave {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: 0 0;
    }
}

.skeleton-line {
    height: 11px;
    margin-bottom: 7px;
}

.skeleton-line:last-child {
    margin-bottom: 0;
}

.skeleton-card {
    padding: 1rem;
    min-height: 100px;
}

/* Topbar context pills */
.topbar-context {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-right: 0.4rem;
    max-width: 48vw;
}

.topbar-context-pill {
    border: 1px solid #d8e2f0;
    background: #ffffff;
    color: #334155;
    border-radius: 999px;
    padding: 0.28rem 0.62rem;
    font-size: 0.72rem;
    line-height: 1.1;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
    white-space: nowrap;
}

.topbar-context-pill .context-label {
    color: #64748b;
    font-weight: 600;
}

.topbar-context-pill .context-value {
    color: #0f172a;
    font-weight: 700;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-context-pill.is-trial {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.topbar-context-pill.is-active {
    background: #ecfdf3;
    border-color: #bbf7d0;
    color: #166534;
}

.topbar-context-pill.is-expired,
.topbar-context-pill.is-suspended,
.topbar-context-pill.is-cancelled {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.topbar-context-pill.is-impersonating {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

/* Mobile table stack */
@media (max-width: 767.98px) {
    .table-mobile-stack {
        border: 0 !important;
    }

    .table-mobile-stack thead {
        display: none;
    }

    .table-mobile-stack tbody,
    .table-mobile-stack tr,
    .table-mobile-stack td {
        display: block;
        width: 100%;
    }

    .table-mobile-stack tr {
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 0.4rem 0.6rem;
        margin-bottom: 0.55rem;
        background: #ffffff;
        box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
    }

    .table-mobile-stack td {
        border: 0 !important;
        border-bottom: 1px dashed #e2e8f0 !important;
        padding: 0.45rem 0.1rem !important;
        text-align: left !important;
        white-space: normal;
    }

    .table-mobile-stack td:last-child {
        border-bottom: 0 !important;
    }

    .table-mobile-stack td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.7rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: #64748b;
        margin-bottom: 0.2rem;
    }

    .filter-collapse-card .card-header {
        cursor: pointer;
    }

    .filter-collapse-body {
        display: none;
    }

    .filter-collapse-card.open .filter-collapse-body {
        display: block;
    }

    .topbar-context {
        margin-right: 0.2rem;
        max-width: 60vw;
        overflow: hidden;
    }

    .topbar-context-pill {
        max-width: 100%;
    }

    .topbar-context-pill .context-value {
        max-width: 90px;
    }
}

/* Dark mode support for new global layer */
body.dark-mode .page-header-subtitle,
body.theme-dark .page-header-subtitle,
body.dark-mode .form-helper-text,
body.theme-dark .form-helper-text {
    color: #94a3b8;
}

body.dark-mode .section-card,
body.dark-mode .form-section-card,
body.theme-dark .section-card,
body.theme-dark .form-section-card {
    background: #111827;
    border-color: #1f2937;
}

body.dark-mode .form-section-title,
body.theme-dark .form-section-title,
body.dark-mode .empty-state-card .empty-state-title,
body.theme-dark .empty-state-card .empty-state-title {
    color: #f8fafc;
}

body.dark-mode .empty-state-card,
body.theme-dark .empty-state-card {
    background: #0f172a;
    border-color: #334155;
}

body.dark-mode .empty-state-card .empty-state-copy,
body.theme-dark .empty-state-card .empty-state-copy {
    color: #94a3b8;
}

body.dark-mode .topbar-context-pill,
body.theme-dark .topbar-context-pill {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark-mode .topbar-context-pill .context-label,
body.theme-dark .topbar-context-pill .context-label {
    color: #94a3b8;
}

body.dark-mode .topbar-context-pill .context-value,
body.theme-dark .topbar-context-pill .context-value {
    color: #f8fafc;
}

body.dark-mode .table-mobile-stack tr,
body.theme-dark .table-mobile-stack tr {
    background: #111827;
    border-color: #334155;
}

body.dark-mode .table-mobile-stack td,
body.theme-dark .table-mobile-stack td {
    border-bottom-color: #1f2937 !important;
}
