:root {
    --theme-primary: #111827;
    --theme-primary-hover: #000000;

    --theme-sidebar-bg: #ffffff;
    --theme-sidebar-hover: #f5f5f5;
    --theme-sidebar-active: #f0f0f0;
    --theme-sidebar-text: #374151;
    --theme-sidebar-muted: #9ca3af;
    --theme-sidebar-border: #e5e7eb;

    --theme-body-bg: #f8fafc;
    --theme-card-bg: #ffffff;
    --theme-text: #111827;
    --theme-muted: #6b7280;
    --theme-border: #e5e7eb;
    --theme-radius: 14px;
}

/* Base */
html,
body {
    font-family: "Inter", sans-serif;
    background: var(--theme-body-bg) !important;
    color: var(--theme-text);
}

a {
    color: var(--theme-primary);
}

a:hover {
    color: var(--theme-primary-hover);
}

.text-primary {
    color: var(--theme-primary) !important;
}

.text-muted {
    color: var(--theme-muted) !important;
}

/* Auth */
.auth-page-wrapper {
    background: var(--theme-body-bg) !important;
}

.auth-page-wrapper .bg-overlay,
.auth-one-bg .bg-overlay {
    display: none !important;
}

.auth-page-content {
    width: 100%;
}

.auth-page-content .card,
.card-bg-fill {
    background: var(--theme-card-bg) !important;
    border: 1px solid var(--theme-border) !important;
    border-radius: var(--theme-radius) !important;
    box-shadow: 0 18px 45px rgba(17, 24, 39, 0.08) !important;
}

.auth-one-bg {
    background:
        linear-gradient(
            rgba(17, 24, 39, 0.18),
            rgba(17, 24, 39, 0.18)
        ),
        url("../images/auth/erp-login-bg.jpg") center center / cover no-repeat !important;
}

.auth-one-bg h1,
.auth-one-bg h2,
.auth-one-bg h3,
.auth-one-bg h4,
.auth-one-bg h5,
.auth-one-bg h6 {
    color: #ffffff !important;
}

.auth-one-bg p,
.auth-one-bg .text-white-50 {
    color: rgba(255, 255, 255, 0.76) !important;
}

.auth-one-bg .rounded {
    background: rgba(17, 24, 39, 0.42) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    backdrop-filter: blur(8px);
}

.auth-one-bg .badge {
    background: rgba(17, 24, 39, 0.50) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Forms */
.form-label {
    color: var(--theme-text);
    font-weight: 500;
}

.form-control {
    height: 44px;
    border: 1px solid #d1d5db !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    color: var(--theme-text) !important;
}

.form-control::placeholder {
    color: #9ca3af;
}

.form-control:focus {
    border-color: var(--theme-primary) !important;
    box-shadow: 0 0 0 0.15rem rgba(17, 24, 39, 0.10) !important;
}

.password-addon {
    height: 44px;
    color: #6b7280 !important;
}

.password-addon:hover {
    color: var(--theme-primary) !important;
}

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

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

.form-check-input:focus {
    box-shadow: 0 0 0 0.15rem rgba(17, 24, 39, 0.10);
}

/* Buttons */
.btn-success,
.btn-primary,
.btn-dark {
    height: 44px;
    background: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
    color: #ffffff !important;
    border-radius: 10px !important;
    font-weight: 600;
}

.btn-success:hover,
.btn-primary:hover,
.btn-dark:hover,
.btn-success:focus,
.btn-primary:focus,
.btn-dark:focus {
    background: var(--theme-primary-hover) !important;
    border-color: var(--theme-primary-hover) !important;
}

/* Dashboard Layout */
#layout-wrapper,
.main-content,
.page-content {
    background: var(--theme-body-bg) !important;
}

.page-content {
    padding-top: calc(64px + 1.5rem);
}

.container-fluid {
    max-width: 100%;
}

.card {
    background: var(--theme-card-bg);
    border: 1px solid var(--theme-border) !important;
    border-radius: var(--theme-radius) !important;
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.05) !important;
}

/* Topbar */
#page-topbar {
    background: #ffffff !important;
    border-bottom: 1px solid var(--theme-border);
}

.navbar-header {
    height: 64px;
    background: #ffffff !important;
    padding: 0 1rem;
}

.page-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--theme-text);
}

.btn-topbar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: var(--theme-text);
}

.btn-topbar:hover {
    background: #f3f4f6;
}

.header-sidebar-toggle {
    flex: 0 0 40px;
    padding: 0;
    border: 0;
    background: transparent;
}

.header-sidebar-toggle .hamburger-icon {
    width: 20px;
    height: 16px;
}

.user-dropdown-btn {
    border: 0;
    background: transparent;
    padding: 10px;
}

.user-dropdown-btn:hover,
.topbar-user {
    background: transparent !important;
}

.avatar-sm {
    width: 40px;
    height: 40px;
}

.avatar-title {
    background: var(--theme-primary);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
}

.dropdown-menu {
    min-width: 240px;
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(17, 24, 39, 0.12);
}

/* Generic tooltips and popovers */
.theme-tooltip {
    --bs-tooltip-bg: #111827;
    --bs-tooltip-color: #ffffff;
    --bs-tooltip-opacity: 1;
    --bs-tooltip-padding-x: 9px;
    --bs-tooltip-padding-y: 6px;
    --bs-tooltip-border-radius: 6px;
    --bs-tooltip-font-size: 11px;
}

.theme-popover {
    --bs-popover-border-color: #d1d5db;
    --bs-popover-border-radius: 8px;
    --bs-popover-header-bg: #f8fafc;
    --bs-popover-header-color: #111827;
    --bs-popover-body-color: #374151;
    --bs-popover-box-shadow: 0 14px 32px rgba(17, 24, 39, .14);
    max-width: 320px;
    font-size: 12px;
}

.theme-popover .popover-header {
    font-size: 12px;
    font-weight: 700;
}

/* Sidebar */
.app-menu.navbar-menu {
    background: #ffffff !important;
    border-right: 1px solid #e5e7eb !important;
    box-shadow: 4px 0 16px rgba(15, 23, 42, 0.04);
}

.navbar-brand-box {
    height: 64px;
    background: #ffffff !important;
    border-bottom: 1px solid #e5e7eb !important;
    padding: 0 16px;
}

.sidebar-logo-text {
    color: #111827;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0;
}

.sidebar-logo-image {
    width: 30px;
    height: 30px;
    object-fit: contain;
    background: transparent;
}

/* Sidebar Full Width Menu */
.navbar-menu #scrollbar,
.navbar-menu #scrollbar > .simplebar-wrapper,
.navbar-menu #scrollbar .simplebar-content-wrapper,
.navbar-menu #scrollbar .simplebar-content,
.navbar-menu #scrollbar .container-fluid {
    width: 100%;
}

.navbar-menu #scrollbar .container-fluid {
    padding-right: 0;
    padding-left: 0;
}

.navbar-menu .navbar-nav {
    width: 100%;
    padding: 12px 0 20px;
}

.navbar-menu .navbar-nav .nav-item {
    width: 100%;
    margin: 0;
}

.navbar-menu .navbar-nav .nav-link {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    color: var(--theme-sidebar-text) !important;
    padding: 11px 18px 11px 20px !important;
    margin: 0 !important;
    border-radius: 0 !important;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    min-height: 44px;
    display: flex;
    align-items: center;
    transition: color 0.18s ease, background-color 0.18s ease;
}

.navbar-menu .navbar-nav .nav-link i {
    color: inherit !important;
    flex: 0 0 22px;
    width: 22px;
    min-width: 22px;
    font-size: 19px;
    line-height: 1;
    margin-right: 11px;
    text-align: center;
}

.navbar-menu .navbar-nav .nav-link:hover {
    color: #111827 !important;
    background: var(--theme-sidebar-hover) !important;
}

.navbar-menu .navbar-nav .nav-link.active {
    background: var(--theme-sidebar-active) !important;
    color: #111827 !important;
    font-weight: 600;
}

.navbar-menu .navbar-nav > .nav-item > .nav-link.active::before {
    content: "";
    position: absolute;
    top: 9px;
    bottom: 9px;
    left: 0;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: #111827;
}

.navbar-menu .navbar-nav .nav-link.active i {
    color: #111827 !important;
}

/* Sidebar Submenu */
.menu-dropdown {
    width: 100%;
    background: #f8fafc !important;
}

.menu-dropdown .nav {
    position: relative;
    width: 100%;
    padding: 5px 0 !important;
}

.menu-dropdown .nav::before {
    content: "";
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 30px;
    width: 1px;
    background: #d1d5db;
}

.navbar-menu .navbar-nav .nav-sm .nav-link {
    min-height: 38px !important;
    padding: 0.55rem 2.5rem !important;
    margin: 0 !important;
    border-radius: 0 !important;
    font-size: 13px !important;
    color: #6b7280 !important;
}

.menu-dropdown .nav-link::before {
    content: "" !important;
    position: absolute !important;
    top: 50% !important;
    left: 27px !important;
    width: 7px !important;
    height: 7px !important;
    border: 2px solid #f8fafc;
    border-radius: 50% !important;
    background: #9ca3af !important;
    transform: translateY(-50%);
}

.menu-dropdown .nav-link:hover {
    color: #111827 !important;
    background: #eef0f3 !important;
}

.menu-dropdown .nav-link.active {
    color: #111827 !important;
    background: var(--theme-sidebar-active) !important;
    font-weight: 600;
}

.menu-dropdown .nav-link:hover::before,
.menu-dropdown .nav-link.active::before {
    background: #111827 !important;
}

/* Sidebar Extras */
.sidebar-background {
    display: none !important;
}

.vertical-overlay {
    background: rgba(17, 24, 39, 0.45);
}

.simplebar-scrollbar::before {
    background: rgba(0, 0, 0, 0.15) !important;
}

/* Collapsed Sidebar */
[data-sidebar-size="sm"] .sidebar-logo-text {
    display: none;
}

[data-sidebar-size="sm"] .navbar-menu .navbar-nav .nav-link {
    justify-content: center;
    padding: 14px 0 !important;
}

[data-sidebar-size="sm"] .navbar-menu .navbar-nav .nav-link i {
    margin-right: 0;
}

[data-sidebar-size="sm"] .navbar-menu .navbar-nav .nav-link > span,
[data-sidebar-size="sm"] .navbar-menu .navbar-nav .nav-link::after {
    display: none;
}

@media (min-width: 992px) {
    html[data-layout="vertical"][data-sidebar-size="sm"]
        #navbar-nav > .nav-item > .nav-link > span,
    html[data-layout="vertical"][data-sidebar-size="sm"]
        #navbar-nav > .nav-item:hover > .nav-link > span,
    html[data-layout="vertical"][data-sidebar-size="sm-hover"]
        #navbar-nav > .nav-item > .nav-link > span,
    html[data-layout="vertical"][data-sidebar-size="sm-hover"]
        #navbar-nav > .nav-item:hover > .nav-link > span {
        display: none !important;
        width: 0 !important;
        max-width: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    [data-layout="vertical"][data-sidebar-size="sm-hover"] .navbar-menu,
    [data-layout="vertical"][data-sidebar-size="sm-hover"] .navbar-menu:hover {
        width: var(--vz-vertical-menu-width-sm) !important;
        background: var(--theme-sidebar-bg) !important;
    }

    [data-layout="vertical"][data-sidebar-size="sm-hover"]
        .navbar-menu:hover .navbar-brand-box {
        text-align: center;
    }

    [data-layout="vertical"][data-sidebar-size="sm-hover"]
        .navbar-menu:hover .logo .logo-lg,
    [data-layout="vertical"][data-sidebar-size="sm-hover"]
        .navbar-menu:hover .navbar-nav .nav-link > span,
    [data-layout="vertical"][data-sidebar-size="sm-hover"]
        .navbar-menu:hover .navbar-nav .nav-link::after,
    [data-layout="vertical"][data-sidebar-size="sm-hover"]
        .navbar-menu:hover .navbar-nav .nav-link::before {
        display: none !important;
    }

    [data-layout="vertical"][data-sidebar-size="sm-hover"]
        .navbar-menu:hover .logo .logo-sm {
        display: inline-block !important;
    }

    [data-layout="vertical"][data-sidebar-size="sm-hover"]
        .navbar-menu .navbar-nav .nav-link,
    [data-layout="vertical"][data-sidebar-size="sm-hover"]
        .navbar-menu:hover .navbar-nav .nav-link {
        justify-content: center;
        padding: 14px 0 !important;
    }

    [data-layout="vertical"][data-sidebar-size="sm-hover"]
        .navbar-menu .navbar-nav .nav-link i,
    [data-layout="vertical"][data-sidebar-size="sm-hover"]
        .navbar-menu:hover .navbar-nav .nav-link i {
        margin-right: 0;
        font-size: 22px;
    }

    [data-layout="vertical"]:is([data-sidebar-size="sm"], [data-sidebar-size="sm-hover"])
        .navbar-menu .simplebar-mask,
    [data-layout="vertical"]:is([data-sidebar-size="sm"], [data-sidebar-size="sm-hover"])
        .navbar-menu .simplebar-content-wrapper {
        overflow: visible !important;
    }

    [data-layout="vertical"][data-sidebar-size="sm"]
        .navbar-menu .navbar-nav .nav-item:hover > .menu-link {
        width: 100% !important;
        background: var(--theme-sidebar-hover) !important;
    }

    [data-layout="vertical"][data-sidebar-size="sm-hover"]
        .navbar-menu .navbar-nav .nav-item:hover > .menu-link {
        width: 100% !important;
        background: var(--theme-sidebar-hover) !important;
    }

    [data-layout="vertical"][data-sidebar-size="sm"]
        .navbar-menu .navbar-nav > .nav-item:hover > .nav-link > span,
    [data-layout="vertical"][data-sidebar-size="sm"]
        .navbar-menu .navbar-nav > .nav-item:hover > .nav-link::after {
        display: none !important;
    }

    [data-layout="vertical"][data-sidebar-size="sm-hover"]
        .navbar-menu .navbar-nav > .nav-item:hover > .nav-link > span,
    [data-layout="vertical"][data-sidebar-size="sm-hover"]
        .navbar-menu .navbar-nav > .nav-item:hover > .nav-link::after {
        display: none !important;
    }

    [data-layout="vertical"]:is([data-sidebar-size="sm"], [data-sidebar-size="sm-hover"])
        .navbar-menu .navbar-nav .nav-item:hover > .menu-dropdown {
        display: block !important;
        top: 0;
        left: calc(var(--vz-vertical-menu-width-sm) + 12px);
        width: 220px;
        height: auto !important;
        padding: 0 !important;
        overflow: visible;
        opacity: 1 !important;
        visibility: visible !important;
        background: var(--theme-sidebar-bg) !important;
        border: 1px solid var(--theme-sidebar-border);
        border-left: 0;
        border-radius: 0 6px 6px 0 !important;
        box-shadow: 12px 12px 28px rgba(15, 23, 42, 0.22) !important;
    }

    [data-layout="vertical"]:is([data-sidebar-size="sm"], [data-sidebar-size="sm-hover"])
        .navbar-menu .navbar-nav .nav-item:hover > .menu-dropdown::before {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        left: -12px;
        width: 12px;
        background: transparent;
    }

    [data-layout="vertical"]:is([data-sidebar-size="sm"], [data-sidebar-size="sm-hover"])
        .navbar-menu .navbar-nav .nav-item:hover > .menu-dropdown > .nav {
        display: block;
        opacity: 1;
        background: var(--theme-sidebar-bg) !important;
    }

    [data-layout="vertical"]:is([data-sidebar-size="sm"], [data-sidebar-size="sm-hover"])
        .navbar-menu .navbar-nav .nav-sm .nav-link {
        justify-content: flex-start;
        min-height: 42px !important;
        padding: 0.65rem 1.25rem 0.65rem 2.5rem !important;
        color: var(--theme-sidebar-text) !important;
        background: var(--theme-sidebar-bg) !important;
    }

    [data-layout="vertical"]:is([data-sidebar-size="sm"], [data-sidebar-size="sm-hover"])
        .navbar-menu .navbar-nav .nav-sm .nav-link:hover,
    [data-layout="vertical"]:is([data-sidebar-size="sm"], [data-sidebar-size="sm-hover"])
        .navbar-menu .navbar-nav .nav-sm .nav-link.active {
        color: #ffffff !important;
        background: #1f2937 !important;
    }
}

/* Dashboard */
.dashboard-shell {
    display: grid;
    gap: 20px;
    padding-bottom: 12px;
}

.dashboard-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.dashboard-eyebrow {
    margin: 0 0 4px;
    color: var(--theme-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.dashboard-heading h1 {
    margin: 0;
    color: var(--theme-text);
    font-size: 25px;
    font-weight: 700;
    line-height: 1.25;
}

.dashboard-heading > div > p:last-child {
    margin: 5px 0 0;
    color: var(--theme-muted);
    font-size: 14px;
}

.dashboard-actions {
    display: flex;
    gap: 10px;
}

.dashboard-primary-btn,
.dashboard-secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 118px;
    height: 40px !important;
    padding: 0 14px;
    border-radius: 7px !important;
    font-size: 13px;
}

.dashboard-secondary-btn {
    color: var(--theme-text);
    background: #ffffff;
    border: 1px solid var(--theme-border);
}

.dashboard-secondary-btn:hover {
    color: var(--theme-text);
    background: #f9fafb;
    border-color: #d1d5db;
}

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.dashboard-kpi,
.dashboard-panel {
    min-width: 0;
    background: #ffffff;
    border: 1px solid var(--theme-border);
    border-radius: 8px;
}

.dashboard-kpi {
    padding: 18px;
}

.dashboard-kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 17px;
}

.dashboard-kpi-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 7px;
    font-size: 19px;
}

.kpi-icon-blue { color: #1d4ed8; background: #eff6ff; }
.kpi-icon-green { color: #047857; background: #ecfdf5; }
.kpi-icon-amber { color: #b45309; background: #fffbeb; }
.kpi-icon-red { color: #b91c1c; background: #fef2f2; }

.dashboard-trend {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 12px;
    font-weight: 700;
}

.dashboard-trend.is-up { color: #047857; }
.dashboard-trend.is-down { color: #b91c1c; }

.dashboard-kpi > p {
    margin: 0 0 5px;
    color: var(--theme-muted);
    font-size: 13px;
    font-weight: 500;
}

.dashboard-kpi-value {
    color: var(--theme-text);
    font-size: 25px;
    font-weight: 700;
    line-height: 1.2;
}

.dashboard-kpi > small {
    display: block;
    margin-top: 7px;
    color: #9ca3af;
    font-size: 12px;
}

.dashboard-finance-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
    background: #ffffff;
    border: 1px solid var(--theme-border);
    border-radius: 8px;
}

.dashboard-finance-strip > div {
    min-width: 0;
    padding: 11px 12px;
    background: #f9fafb;
    border: 1px solid #eef2f7;
    border-radius: 7px;
}

.dashboard-finance-strip span,
.dashboard-finance-strip strong,
.dashboard-finance-strip small {
    display: block;
}

.dashboard-finance-strip span {
    color: var(--theme-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.dashboard-finance-strip strong {
    margin-top: 4px;
    color: var(--theme-text);
    font-size: 16px;
    font-weight: 750;
    word-break: break-word;
}

.dashboard-finance-strip small {
    margin-top: 3px;
    color: var(--theme-muted);
    font-size: 12px;
}

.dashboard-main-grid,
.dashboard-lower-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 0.8fr);
    gap: 20px;
    align-items: start;
}

.dashboard-lower-grid {
    grid-template-columns: minmax(0, 2fr) minmax(300px, 0.8fr);
}

.dashboard-panel {
    padding: 20px;
}

.dashboard-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.dashboard-panel-header h2 {
    margin: 0;
    color: var(--theme-text);
    font-size: 15px;
    font-weight: 700;
}

.dashboard-panel-header p {
    margin: 4px 0 0;
    color: var(--theme-muted);
    font-size: 12px;
}

.dashboard-select {
    width: 145px;
    height: 36px;
    border-color: var(--theme-border);
    border-radius: 6px;
    color: var(--theme-text);
    font-size: 12px;
}

.revenue-summary {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-top: 22px;
}

.revenue-summary > div {
    display: grid;
    gap: 2px;
}

.revenue-summary span,
.chart-legend {
    color: var(--theme-muted);
    font-size: 11px;
}

.revenue-summary strong {
    color: var(--theme-text);
    font-size: 17px;
}

.revenue-summary .chart-legend {
    display: flex;
    grid-auto-flow: column;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.revenue-summary .chart-legend + .chart-legend {
    margin-left: -12px;
}

.legend-dot,
.plan-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.revenue-dot { background: #2563eb; }
.target-dot { background: #cbd5e1; }

.dashboard-chart {
    width: 100%;
    height: 290px;
    margin-top: 4px;
}

.dashboard-icon-btn,
.dashboard-row-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    color: var(--theme-muted);
    border: 0;
    background: transparent;
}

.dashboard-icon-btn:hover,
.dashboard-row-action:hover {
    color: var(--theme-text);
    background: #f3f4f6;
}

.dashboard-donut {
    width: 100%;
    height: 220px;
    margin-top: 8px;
}

.plan-list {
    display: grid;
    gap: 12px;
    margin-top: 4px;
}

.plan-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--theme-text);
    font-size: 12px;
}

.plan-list-item span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.plan-list-item strong {
    font-size: 12px;
}

.plan-list-item small {
    margin-left: 4px;
    color: var(--theme-muted);
    font-weight: 500;
}

.plan-enterprise { background: #111827; }
.plan-growth { background: #2563eb; }
.plan-starter { background: #14b8a6; }

.dashboard-text-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #2563eb;
    font-size: 12px;
    font-weight: 600;
}

.dashboard-table {
    margin-top: 14px;
    white-space: nowrap;
}

.dashboard-table > :not(caption) > * > * {
    padding: 13px 10px;
    border-bottom-color: #eef0f3;
}

.dashboard-table thead th {
    color: #9ca3af;
    background: #fafafa;
    border-top: 1px solid #eef0f3;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.dashboard-table tbody td {
    color: #374151;
    font-size: 12px;
}

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

.merchant-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.merchant-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
}

.avatar-coral { color: #9f1239; background: #fff1f2; }
.avatar-blue { color: #1d4ed8; background: #eff6ff; }
.avatar-green { color: #047857; background: #ecfdf5; }
.avatar-violet { color: #6d28d9; background: #f5f3ff; }

.merchant-cell strong,
.merchant-cell small {
    display: block;
}

.merchant-cell strong {
    color: var(--theme-text);
    font-size: 12px;
}

.merchant-cell small {
    margin-top: 2px;
    color: var(--theme-muted);
    font-size: 10px;
}

.status-pill,
.system-operational {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
}

.status-active { color: #047857; background: #ecfdf5; }
.status-trial { color: #1d4ed8; background: #eff6ff; }
.status-review { color: #b45309; background: #fffbeb; }

.dashboard-side-stack {
    display: grid;
    gap: 20px;
}

.system-operational {
    gap: 6px;
    color: #047857;
    background: #ecfdf5;
}

.system-operational i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
}

.health-list {
    display: grid;
    gap: 13px;
    margin-top: 18px;
}

.health-list > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--theme-muted);
    font-size: 12px;
}

.health-list strong {
    color: var(--theme-text);
    font-size: 12px;
}

.activity-list {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.activity-item {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
}

.activity-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    font-size: 15px;
}

.activity-paid { color: #047857; background: #ecfdf5; }
.activity-failed { color: #b91c1c; background: #fef2f2; }
.activity-plan { color: #1d4ed8; background: #eff6ff; }

.activity-item strong,
.activity-item p,
.activity-item small {
    display: block;
}

.activity-item strong {
    color: var(--theme-text);
    font-size: 12px;
}

.activity-item p {
    margin: 2px 0;
    color: var(--theme-muted);
    font-size: 11px;
    line-height: 1.4;
}

.activity-item small {
    color: #9ca3af;
    font-size: 10px;
}

/* Roles */
.role-shell {
    display: grid;
    gap: 20px;
    padding-bottom: 12px;
}

.role-heading,
.role-title-line,
.role-heading-actions,
.role-toolbar,
.role-row-actions,
.role-form-actions {
    display: flex;
    align-items: center;
}

.role-heading {
    justify-content: space-between;
    gap: 24px;
}

.role-eyebrow {
    margin: 0 0 4px;
    color: var(--theme-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.role-heading h1 {
    margin: 0;
    color: var(--theme-text);
    font-size: 25px;
    font-weight: 700;
    line-height: 1.25;
}

.role-heading > div > p:last-child {
    margin: 5px 0 0;
    color: var(--theme-muted);
    font-size: 14px;
}

.role-title-line {
    gap: 10px;
}

.role-heading-actions {
    gap: 10px;
}

.role-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.role-primary-btn,
.role-secondary-btn,
.role-danger-btn,
.role-save-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 40px !important;
    padding: 0 14px;
    border-radius: 7px !important;
    font-size: 13px;
    font-weight: 600;
}

.role-secondary-btn,
.role-danger-btn {
    color: var(--theme-text);
    background: #ffffff;
    border: 1px solid var(--theme-border);
}

.role-secondary-btn:hover {
    color: var(--theme-text);
    background: #f9fafb;
    border-color: #d1d5db;
}

.role-danger-btn {
    color: #b91c1c;
    border-color: #fecaca;
}

.role-danger-btn:hover {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fca5a5;
}

.role-back-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 7px;
    color: var(--theme-muted);
    font-size: 12px;
    font-weight: 600;
}

.role-back-link:hover {
    color: var(--theme-text);
}

.card-box,
.stat-summary-card {
    min-width: 0;
    background: #ffffff;
    border: 1px solid var(--theme-border);
    border-radius: 8px;
}

.role-toolbar {
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid #eef0f3;
}

.role-search-form {
    display: flex;
    align-items: center;
    width: min(360px, 100%);
    height: 38px;
    padding: 0 11px;
    color: #9ca3af;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 7px;
}

.role-search-form:focus-within {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 0.15rem rgba(17, 24, 39, 0.08);
}

.role-search-form input {
    flex: 1;
    min-width: 0;
    padding: 0 9px;
    color: var(--theme-text);
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 13px;
}

.role-search-form a {
    color: #9ca3af;
    font-size: 16px;
}

.role-count {
    color: var(--theme-muted);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.role-table {
    white-space: nowrap;
}

.role-table > :not(caption) > * > * {
    padding: 14px 18px;
    border-bottom-color: #eef0f3;
}

.role-table thead th {
    color: #9ca3af;
    background: #fafafa;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.role-table tbody td {
    color: #4b5563;
    font-size: 12px;
}

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

.role-name-link,
.role-description {
    display: block;
}

.role-name-link {
    color: var(--theme-text);
    font-size: 13px;
    font-weight: 700;
}

.role-description {
    max-width: 300px;
    margin-top: 3px;
    overflow: hidden;
    color: var(--theme-muted);
    font-size: 11px;
    text-overflow: ellipsis;
}

.role-badge,
.role-stat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    padding: 4px 8px;
    color: #4b5563;
    background: #f3f4f6;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
}

.role-badge.is-system {
    color: #1d4ed8;
    background: #eff6ff;
}

.role-stat {
    min-width: 28px;
    color: var(--theme-text);
}

.role-row-actions {
    justify-content: flex-end;
    gap: 3px;
}

.role-row-actions form {
    margin: 0;
}

.role-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    color: var(--theme-muted);
    background: transparent;
    border: 0;
    border-radius: 6px;
}

.role-icon-btn:hover {
    color: var(--theme-text);
    background: #f3f4f6;
}

.role-icon-btn.is-danger:hover {
    color: #b91c1c;
    background: #fef2f2;
}

.role-pagination {
    border-top: 1px solid #eef0f3;
}

.custom-pagination-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: #ffffff;
    font-size: 13px;
    color: #4b5563;
    border-radius: 0 0 8px 8px;
}

.custom-pagination-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.per-page-dropdown {
    width: 80px;
    height: 32px !important;
    padding: 0 8px !important;
    font-size: 13px !important;
    border-color: #d1d5db !important;
    border-radius: 6px !important;
    color: var(--theme-text) !important;
    background-position: right 8px center !important;
    background-size: 8px 8px !important;
}

.range-info {
    color: #4b5563;
    font-size: 13px;
}

.custom-pagination-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--theme-primary) !important;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    font-size: 13px;
    border: none;
    background: transparent;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background-color 0.15s;
}

.pagination-btn:hover {
    color: var(--theme-primary-hover) !important;
    background-color: #f3f4f6;
}

.pagination-btn.disabled {
    color: #9ca3af !important;
    cursor: not-allowed;
}

.pagination-btn.disabled:hover {
    background-color: transparent;
}

.page-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-input {
    width: 44px;
    height: 32px !important;
    padding: 0 4px !important;
    text-align: center;
    font-size: 13px !important;
    border-color: #d1d5db !important;
    border-radius: 6px !important;
    -moz-appearance: textfield;
}

.page-input::-webkit-outer-spin-button,
.page-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.total-pages {
    color: #4b5563;
    font-size: 13px;
    white-space: nowrap;
}

.role-alert {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
}

.role-alert-success {
    color: #047857;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}

.role-alert-error {
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.role-form-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
    gap: 20px;
    align-items: start;
}

.card-box-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid #eef0f3;
}

.card-box-header h2,
.card-box-header h3 {
    margin: 0;
    color: var(--theme-text);
    font-size: 15px;
    font-weight: 700;
}

.card-box-header p {
    margin: 4px 0 0;
    color: var(--theme-muted);
    font-size: 12px;
}

.card-box-body {
    padding: 20px;
}

.role-textarea.form-control {
    height: auto;
    min-height: 120px;
    resize: vertical;
}

.role-link-btn,
.permission-module-toggle {
    height: auto;
    padding: 0;
    color: #2563eb;
    background: transparent;
    border: 0;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.role-link-btn:hover,
.permission-module-toggle:hover {
    color: #1d4ed8;
}

.permission-module + .permission-module,
.role-detail-module + .role-detail-module {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid #eef0f3;
}

.permission-module-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 11px;
}

.permission-module-title h3,
.role-detail-module h3 {
    margin: 0;
    color: var(--theme-text);
    font-size: 12px;
    font-weight: 700;
}

.permission-module-title span {
    display: block;
    margin-top: 2px;
    color: #9ca3af;
    font-size: 10px;
}

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

.permission-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    padding: 11px 12px;
    cursor: pointer;
    background: #fafafa;
    border: 1px solid #eef0f3;
    border-radius: 7px;
}

.permission-option:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

.permission-option .form-check-input {
    flex: 0 0 auto;
    margin-top: 2px;
}

.permission-option strong,
.permission-option small {
    display: block;
}

.permission-option strong {
    color: var(--theme-text);
    font-size: 12px;
}

.permission-option small {
    margin-top: 2px;
    color: var(--theme-muted);
    font-size: 10px;
    line-height: 1.4;
}

.role-form-actions {
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.role-empty-state {
    padding: 58px 20px;
    text-align: center;
}

.role-empty-state.compact {
    padding: 28px 12px;
}

.role-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin-bottom: 12px;
    color: #4b5563;
    background: #f3f4f6;
    border-radius: 9px;
    font-size: 22px;
}

.role-empty-state h2,
.role-empty-state h3 {
    margin: 0;
    color: var(--theme-text);
    font-size: 15px;
    font-weight: 700;
}

.role-empty-state p {
    max-width: 430px;
    margin: 5px auto 16px;
    color: var(--theme-muted);
    font-size: 12px;
}

.stat-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.stat-summary-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 17px;
}

.stat-summary-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    color: #374151;
    background: #f3f4f6;
    border-radius: 7px;
    font-size: 18px;
}

.stat-summary-card strong,
.stat-summary-card span {
    display: flex;
}

.stat-summary-card strong {
    color: var(--theme-text);
    font-size: 16px;
}

.stat-summary-card div span {
    margin-top: 2px;
    color: var(--theme-muted);
    font-size: 11px;
}

.role-detail-module h3 {
    margin-bottom: 10px;
}

.role-permission-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.role-permission-pills span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 9px;
    color: #374151;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.role-permission-pills i {
    color: #047857;
}

.permission-toolbar {
    align-items: center;
}

.permission-filter-form {
    display: flex;
    align-items: center;
    gap: 9px;
    width: min(820px, 100%);
}

.permission-filter-form .role-search-form {
    flex: 1;
}

.permission-module-filter {
    width: 175px;
    height: 38px;
    border-color: #d1d5db;
    border-radius: 7px;
    color: var(--theme-text);
    font-size: 12px;
}


.permission-filter-form .role-secondary-btn {
    height: 38px !important;
}

.permission-clear-link {
    color: var(--theme-muted);
    font-size: 11px;
    font-weight: 600;
}

.permission-key,
.permission-detail-key {
    font-family: Consolas, "Courier New", monospace;
}

.permission-detail-key {
    overflow-wrap: anywhere;
}

.permission-form-shell {
    max-width: 920px;
    margin: 0 auto;
}

.permission-form-card code {
    color: #374151;
    background: #f3f4f6;
    padding: 2px 4px;
    border-radius: 4px;
}

.role-permission-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.assigned-role-list {
    display: grid;
    grid-template-columns: repeat(var(--grid-template-columns, 2), minmax(0, 1fr));
    gap: 10px;
}

.assigned-role-item {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 12px;
    color: var(--theme-text);
    background: #fafafa;
    border: 1px solid #eef0f3;
    border-radius: 7px;
}

.assigned-role-item:hover {
    color: var(--theme-text);
    background: #f9fafb;
    border-color: #d1d5db;
}

.assigned-role-item strong,
.assigned-role-item small {
    display: block;
}

.assigned-role-item strong {
    font-size: 12px;
}

.assigned-role-item small {
    margin-top: 2px;
    overflow: hidden;
    color: var(--theme-muted);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-form-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 20px; align-items: start; }
.admin-form-main { display: grid; gap: 20px; }
.admin-status-switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 66px; padding: 10px 12px; cursor: pointer; background: #fafafa; border: 1px solid #dfe3e8; border-radius: 9px; transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease; }
.admin-status-switch:hover { background: #f9fafb; border-color: #c7cdd5; }
.admin-status-copy { min-width: 0; }
.admin-status-copy strong, .admin-status-copy small { display: block; }
.admin-status-copy strong { color: var(--theme-text); font-size: 12px; }
.admin-status-copy small { margin-top: 3px; color: var(--theme-muted); font-size: 9px; line-height: 1.35; }
.admin-switch-control { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.admin-switch-control input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.admin-switch-track { position: relative; display: block; width: 44px; height: 24px; background: #d1d5db; border-radius: 999px; transition: background-color .18s ease; }
.admin-switch-thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(17, 24, 39, .24); transition: transform .18s ease; }
.admin-switch-control input:checked + .admin-switch-track { background: #111827; }
.admin-switch-control input:checked + .admin-switch-track .admin-switch-thumb { transform: translateX(20px); }
.admin-status-switch:has(input:focus-visible) { border-color: var(--theme-primary); box-shadow: 0 0 0 .15rem rgba(17, 24, 39, .10); }
.admin-switch-state { min-width: 20px; color: var(--theme-muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.admin-status-switch.is-locked { cursor: not-allowed; opacity: .66; }
.admin-status-switch.is-invalid { border-color: #ef4444; }
.admin-status-help { display: flex; align-items: center; gap: 5px; }
.admin-role-options, .admin-permission-options { display: grid; gap: 9px; }
.admin-role-option { display: grid; grid-template-columns: auto 36px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 12px; cursor: pointer; background: #fafafa; border: 1px solid #eef0f3; border-radius: 7px; }
.admin-role-option:hover { border-color: #d1d5db; }
.admin-role-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; color: #374151; background: #f3f4f6; border-radius: 7px; }
.admin-role-option strong, .admin-role-option small { display: block; }
.admin-role-option strong { color: var(--theme-text); font-size: 12px; }
.admin-role-option small { margin-top: 2px; color: var(--theme-muted); font-size: 10px; }
.admin-direct-permissions { max-height: 850px; overflow: auto; }
.admin-user-cell { display: flex; align-items: center; gap: 10px; }
.admin-avatar { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 36px; width: 36px; height: 36px; color: #fff; background: var(--theme-primary); border-radius: 8px; font-size: 12px; font-weight: 700; }
.admin-role-pills { display: flex; flex-wrap: wrap; gap: 5px; max-width: 230px; }
.admin-role-pills span { padding: 4px 7px; color: #374151; background: #f3f4f6; border-radius: 5px; font-size: 10px; font-weight: 600; }
.admin-role-pills .is-muted { color: #9ca3af; background: transparent; }
.admin-status-inactive { color: #b91c1c; background: #fef2f2; }
.admin-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.admin-parent-context { display: inline-flex; align-items: center; gap: 5px; margin-top: 7px; color: var(--theme-muted); font-size: 11px; }
.category-form-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 20px; align-items: start; }
.category-form-side { display: grid; gap: 20px; }
.category-slug-input { display: flex; align-items: center; }
.category-slug-input > span { display: inline-flex; align-items: center; height: 44px; padding: 0 12px; color: var(--theme-muted); background: #f3f4f6; border: 1px solid #d1d5db; border-right: 0; border-radius: 10px 0 0 10px; }
.category-slug-input .form-control { border-radius: 0 10px 10px 0 !important; }
.category-preview, .category-list-cell, .category-detail-title { display: flex; align-items: center; gap: 12px; }
.category-preview { padding: 14px; background: #fafafa; border: 1px solid #eef0f3; border-radius: 9px; }
.category-preview-icon, .category-list-icon, .category-detail-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; color: var(--category-color); background: color-mix(in srgb, var(--category-color) 10%, white); border-radius: 8px; }
.category-preview-icon { width: 44px; height: 44px; font-size: 21px; }
.category-preview strong, .category-preview small { display: block; }
.category-preview strong { color: var(--theme-text); font-size: 13px; }
.category-preview small { margin-top: 2px; color: var(--theme-muted); font-size: 10px; }
.category-color-input { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; }
.category-color-input input[type=color] { width: 44px; height: 44px; padding: 3px; background: #fff; border: 1px solid #d1d5db; border-radius: 9px; cursor: pointer; }
.category-list-icon { width: 38px; height: 38px; font-size: 18px; }
.category-slug { color: #475569; background: #f3f4f6; padding: 4px 7px; border-radius: 5px; font-size: 10px; }
.category-detail-title { align-items: flex-start; }
.category-detail-icon { width: 54px; height: 54px; font-size: 25px; }
.category-detail-title > div > p { margin: 5px 0 0; color: var(--theme-muted); font-size: 14px; }
.category-summary-text { overflow-wrap: anywhere; font-family: Consolas, "Courier New", monospace; font-size: 13px !important; }
.category-config-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.category-config-grid > div { padding: 14px; background: #fafafa; border: 1px solid #eef0f3; border-radius: 7px; }
.category-config-grid span, .category-config-grid strong { display: block; }
.category-config-grid span { color: var(--theme-muted); font-size: 10px; text-transform: uppercase; font-weight: 700; }
.category-config-grid strong { margin-top: 7px; color: var(--theme-text); font-size: 12px; }
.category-color-dot { display: inline-block; width: 10px; height: 10px; margin-right: 7px; background: var(--category-color); border-radius: 50%; }

@media (max-width: 1199.98px) {
    .dashboard-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-main-grid,
    .dashboard-lower-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-side-stack {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .dashboard-shell {
        gap: 16px;
    }

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

    .dashboard-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-kpi-grid,
    .dashboard-side-stack {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-panel {
        padding: 16px;
    }

    .role-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .role-heading-actions {
        align-items: stretch;
    }

    .role-heading-actions > *,
    .role-heading-actions form,
    .role-heading-actions button {
        flex: 1;
    }

    .role-form-grid,
    .stat-summary-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .role-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .role-toolbar-actions {
        align-items: stretch;
        justify-content: space-between;
        margin-left: 0;
    }

    .role-search-form {
        width: 100%;
    }

    .permission-filter-form {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .permission-filter-form .role-search-form {
        flex: 1 0 100%;
    }

    .permission-module-filter {
        flex: 1;
        width: auto;
    }

    .role-permission-options,
    .assigned-role-list,
    .admin-form-grid,
    .admin-detail-grid,
    .category-form-grid,
    .category-config-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .revenue-summary {
        flex-wrap: wrap;
        gap: 14px 20px;
    }

    .revenue-summary .chart-legend {
        margin-left: 0;
    }

    .revenue-summary .chart-legend + .chart-legend {
        margin-left: 0;
    }
}

@media (max-width: 479.98px) {
    .dashboard-heading h1 {
        font-size: 22px;
    }

    .dashboard-panel-header {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-select {
        width: 100%;
    }

    .permission-options {
        grid-template-columns: minmax(0, 1fr);
    }

    .card-box-header,
    .card-box-body {
        padding: 16px;
    }

    .role-form-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

/* Footer */
.footer {
    background: #ffffff !important;
    border-top: 1px solid var(--theme-border);
    padding: 14px 0;
    min-height: auto;
    color: var(--theme-muted);
}

.footer-copy,
.footer-links {
    color: var(--theme-muted);
    font-size: 13px;
}

.footer-version {
    font-weight: 600;
    color: var(--theme-text);
}

.footer-powered {
    color: var(--theme-muted);
}

/* Responsive */
@media (max-width: 991.98px) {
    .auth-one-bg {
        min-height: 360px;
    }

    .auth-page-content {
        width: 100%;
    }

    .app-menu.navbar-menu {
        background: var(--theme-sidebar-bg) !important;
    }
}


:is([data-layout=vertical],[data-layout=semibox])[data-sidebar-size=sm] .navbar-menu .navbar-nav .nav-item:hover .nav-link span {
    display: none !important;
}

:is([data-layout=vertical],[data-layout=semibox])[data-sidebar-size=sm] .navbar-menu .navbar-nav .nav-item:hover>a.menu-link:after{
    display: none !important;
}

[data-layout="vertical"]:is([data-sidebar-size="sm"], [data-sidebar-size="sm-hover"]) .navbar-menu .navbar-nav .nav-item:hover > .menu-dropdown {
    left: calc(var(--vz-vertical-menu-width-sm) + 1px) !important;
}

/* Compact Shopify/Stripe-inspired admin polish — black, white & light gray */
:root {
    --theme-primary: #18181b;
    --theme-primary-hover: #000000;
    --theme-primary-soft: #f1f1f2;
    --theme-sidebar-bg: #ffffff;
    --theme-sidebar-hover: #f6f6f7;
    --theme-sidebar-active: #f6f6f7;
    --theme-sidebar-text: #42474c;
    --theme-sidebar-muted: #6d7175;
    --theme-sidebar-border: #dfe3e8;
    --theme-body-bg: #f6f6f7;
    --theme-card-bg: #ffffff;
    --theme-text: #202223;
    --theme-muted: #6d7175;
    --theme-border: #dfe3e8;
    --theme-radius: 8px;
}

body {
    font-size: 13px;
    letter-spacing: 0;
}

#layout-wrapper,
.main-content,
.page-content {
    background: var(--theme-body-bg) !important;
}

.page-content {
    padding-top: calc(56px + 1rem) !important;
    padding-bottom: 20px;
}

.container-fluid {
    padding-right: 18px;
    padding-left: 18px;
}

.card,
.card-box,
.dashboard-kpi,
.dashboard-panel,
.auth-page-content .card,
.card-bg-fill {
    border-color: var(--theme-border) !important;
    border-radius: var(--theme-radius) !important;
    box-shadow: 0 1px 0 rgba(26, 26, 26, 0.04) !important;
}

#page-topbar,
.navbar-header {
    background: #ffffff !important;
}

#page-topbar {
    border-bottom-color: var(--theme-border);
    box-shadow: none;
}

.navbar-header {
    height: 56px !important;
    padding: 0 14px;
}

.page-title {
    color: var(--theme-text);
    font-size: 14px;
    font-weight: 650;
}

.navbar-header small,
.role-eyebrow,
.dashboard-eyebrow {
    color: var(--theme-muted) !important;
}

.btn-topbar,
.header-sidebar-toggle {
    width: 34px;
    height: 34px;
    border-radius: 7px;
}

.btn-topbar:hover,
.user-dropdown-btn:hover,
.role-icon-btn:hover,
.dashboard-icon-btn:hover,
.dashboard-row-action:hover {
    background: #f1f2f3 !important;
}

.topbar-user .avatar-sm,
.avatar-sm {
    width: 34px;
    height: 34px;
}

.avatar-title,
.admin-avatar {
    background: var(--theme-primary);
}

.user-dropdown-btn {
    padding: 6px 8px;
    border-radius: 8px;
}

.dropdown-menu {
    border-color: var(--theme-border);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(32, 34, 35, 0.14);
}

.app-menu.navbar-menu {
    background: var(--theme-sidebar-bg) !important;
    border-right-color: var(--theme-sidebar-border) !important;
    box-shadow: none;
}

.navbar-brand-box {
    height: 56px !important;
    background: var(--theme-sidebar-bg) !important;
    border-bottom-color: var(--theme-sidebar-border) !important;
    padding: 0 14px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.sidebar-logo-text,
.sidebar-logo-text.text-white {
    color: var(--theme-text) !important;
    font-size: 15px;
    font-weight: 700;
}

.navbar-menu .navbar-nav {
    padding: 6px 8px 16px;
}

.sidebar-section-label {
    padding: 16px 10px 4px;
    list-style: none;
}

.sidebar-section-label span {
    display: block;
    color: #9ba0a5;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    user-select: none;
}

.navbar-menu .navbar-nav > .nav-item:first-child > .sidebar-section-label,
li.sidebar-section-label:first-child {
    padding-top: 8px;
}

.navbar-menu .navbar-nav .nav-link {
    min-height: 32px;
    padding: 5px 10px !important;
    color: var(--theme-sidebar-text) !important;
    border: 1px solid transparent;
    border-radius: 7px !important;
    font-size: 13px;
    font-weight: 500;
}

.navbar-menu .navbar-nav .nav-link i {
    width: 18px;
    min-width: 18px;
    flex-basis: 18px;
    margin-right: 8px;
    font-size: 16px;
}

.navbar-menu .navbar-nav .nav-link:hover,
.navbar-menu .navbar-nav .nav-link.active,
.menu-dropdown .nav-link:hover,
.menu-dropdown .nav-link.active {
    color: var(--theme-text) !important;
    background: var(--theme-sidebar-active) !important;
    border-color: var(--theme-sidebar-border);
}

.navbar-menu .navbar-nav .nav-link:hover i,
.navbar-menu .navbar-nav .nav-link.active i,
.menu-dropdown .nav-link:hover i,
.menu-dropdown .nav-link.active i {
    color: var(--theme-primary) !important;
}

.navbar-menu .navbar-nav > .nav-item > .nav-link.active::before {
    top: 7px;
    bottom: 7px;
    left: -1px;
    width: 3px;
    background: var(--theme-primary);
}

.menu-dropdown {
    margin: 2px 0 4px;
    background: transparent !important;
}

.menu-dropdown .nav {
    padding: 2px 0 2px 18px !important;
}

.menu-dropdown .nav::before {
    left: 14px;
    background: #c9cccf;
}

.navbar-menu .navbar-nav .nav-sm .nav-link {
    min-height: 28px !important;
    padding: 4px 8px 4px 16px !important;
    color: var(--theme-sidebar-muted) !important;
    font-size: 12px !important;
}

.menu-dropdown .nav-link::before {
    left: 0 !important;
    width: 5px !important;
    height: 5px !important;
    border: 0;
    background: #8c9196 !important;
}

[data-sidebar-size="sm"] .navbar-menu .navbar-nav .nav-link {
    padding: 8px 0 !important;
}

.dashboard-shell,
.role-shell {
    display: grid;
    gap: 14px;
}

.dashboard-heading,
.role-heading {
    gap: 14px;
    padding-bottom: 2px;
}

.dashboard-heading h1,
.role-heading h1 {
    color: var(--theme-text);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
}

.dashboard-heading > div > p:last-child,
.role-heading > div > p:last-child {
    margin-top: 3px;
    font-size: 12px;
}

.dashboard-kpi-grid,
.dashboard-main-grid,
.dashboard-lower-grid,
.role-form-grid,
.admin-form-grid,
.category-form-grid,
.stat-summary-grid,
.category-config-grid {
    gap: 12px;
}

.dashboard-kpi,
.dashboard-panel,
.card-box {
    background: #ffffff;
    padding: 15px;
}

.dashboard-kpi {
    padding: 13px;
}

.dashboard-kpi-top {
    margin-bottom: 10px;
}

.dashboard-kpi-icon,
.stat-summary-icon,
.role-empty-icon {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    font-size: 16px;
}

.kpi-icon-blue,
.kpi-icon-green {
    color: var(--theme-primary);
    background: var(--theme-primary-soft);
}

.kpi-icon-amber {
    color: #a16207;
    background: #fef3c7;
}

.kpi-icon-red {
    color: #b42318;
    background: #fee4e2;
}

.dashboard-kpi-value {
    font-size: 21px;
}

.dashboard-panel,
.card-box-body {
    padding: 14px;
}

.card-box-header {
    padding: 13px 14px;
}

.dashboard-panel-header h2,
.card-box-header h2,
.card-box-header h3 {
    font-size: 14px;
}

.dashboard-panel-header p,
.card-box-header p,
.dashboard-kpi > p,
.dashboard-kpi > small {
    font-size: 11px;
}

.revenue-summary {
    gap: 14px;
    margin-top: 14px;
}

.revenue-summary strong {
    font-size: 15px;
}

.dashboard-chart {
    min-height: 250px;
}

.dashboard-donut {
    min-height: 190px;
}

.btn,
.btn-success,
.btn-primary,
.btn-dark,
.role-primary-btn,
.role-secondary-btn,
.role-save-btn,
.dashboard-primary-btn,
.dashboard-secondary-btn,
.dashboard-select,
.permission-module-filter {
    min-height: 34px;
    height: 34px !important;
    padding: 0 12px;
    border-radius: 7px !important;
    font-size: 12px;
    font-weight: 650;
}

.btn-success,
.btn-primary,
.btn-dark,
.role-primary-btn,
.role-save-btn,
.dashboard-primary-btn {
    background: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
}

.btn-success:hover,
.btn-primary:hover,
.btn-dark:hover,
.role-primary-btn:hover,
.role-save-btn:hover,
.dashboard-primary-btn:hover {
    background: var(--theme-primary-hover) !important;
    border-color: var(--theme-primary-hover) !important;
}

.role-secondary-btn,
.dashboard-secondary-btn {
    color: var(--theme-text) !important;
    background: #ffffff !important;
    border: 1px solid #c9cccf !important;
}

.role-secondary-btn:hover,
.dashboard-secondary-btn:hover {
    background: #f6f6f7 !important;
    border-color: #8c9196 !important;
}

.form-label {
    margin-bottom: 5px;
    color: var(--theme-text);
    font-size: 12px;
    font-weight: 650;
}

.form-control,
.form-select,
.role-search-form,
.role-search-form input,
.page-input,
.per-page-dropdown {
    min-height: 34px;
    height: 34px !important;
    border-color: #c9cccf !important;
    border-radius: 7px !important;
    color: var(--theme-text) !important;
    font-size: 12px !important;
}

.form-control {
    padding: 6px 10px;
}

.form-control:focus,
.form-select:focus,
.role-search-form:focus-within,
.page-input:focus {
    border-color: var(--theme-primary) !important;
    box-shadow: 0 0 0 2px rgba(0, 128, 96, 0.18) !important;
}

.jquery-validation-error {
    display: block;
    margin-top: 5px;
    color: #b42318;
    font-size: 11px;
}

.password-addon {
    height: 34px !important;
}

.role-toolbar {
    padding: 11px 14px;
    gap: 10px;
}

.role-search-form {
    gap: 7px;
    padding: 0 10px;
    background: #ffffff;
}

.permission-filter-form {
    gap: 7px;
}

.role-count,
.range-info,
.total-pages,
.per-page-label,
.permission-clear-link {
    font-size: 12px;
}

.table > :not(caption) > * > * {
    padding: 9px 12px;
}

.role-table thead th,
.dashboard-table thead th {
    color: #5c5f62;
    background: #fafbfb;
    border-bottom: 1px solid var(--theme-border);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.role-table tbody td,
.dashboard-table tbody td {
    color: var(--theme-text);
    border-color: #ebedef;
    font-size: 12px;
}

.role-name-link {
    color: var(--theme-text);
    font-size: 13px;
    font-weight: 650;
}

.role-name-link:hover,
.dashboard-text-link,
.permission-clear-link,
.role-link-btn {
    color: var(--theme-primary) !important;
}

.role-description,
.admin-role-option small,
.permission-option small,
.assigned-role-item small {
    color: var(--theme-muted);
    font-size: 11px;
}

.role-badge,
.status-pill,
.category-slug,
.admin-role-pills span,
.role-permission-pills span {
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
}

.status-active,
.role-badge.is-system {
    color: #008060;
    background: #e3f1df;
}

.admin-status-inactive,
.status-review {
    color: #b42318;
    background: #fee4e2;
}

.status-trial {
    color: #8a6116;
    background: #fff4d6;
}

.role-icon-btn,
.dashboard-icon-btn,
.dashboard-row-action {
    width: 28px;
    height: 28px;
    border-radius: 6px;
}

.custom-pagination-container {
    padding: 10px 14px;
    border-radius: 0 0 8px 8px;
}

.permission-option,
.admin-role-option,
.assigned-role-item,
.category-preview,
.category-config-grid > div,
.admin-status-switch {
    padding: 10px;
    background: #fafbfb;
    border-color: #ebedef;
    border-radius: 7px;
}

.permission-option:hover,
.admin-role-option:hover,
.assigned-role-item:hover,
.category-preview:hover,
.admin-status-switch:hover {
    background: #ffffff;
    border-color: #c9cccf;
}

.merchant-list-cell,
.merchant-detail-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 240px;
}

.merchant-list-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    color: var(--theme-primary);
    background: var(--theme-primary-soft);
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    overflow: hidden;
}

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

.merchant-list-avatar.is-large {
    flex-basis: 42px;
    width: 42px;
    height: 42px;
    font-size: 14px;
}

.merchant-owner-name {
    display: block;
    color: var(--theme-text);
    font-size: 12px;
    font-weight: 650;
}

.merchant-list-cell code {
    display: inline-flex;
    margin-top: 4px;
}

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

.merchant-detail-grid.is-single {
    grid-template-columns: minmax(0, 1fr);
}

.merchant-detail-grid > div {
    min-width: 0;
    padding: 10px;
    background: #fafbfb;
    border: 1px solid #ebedef;
    border-radius: 7px;
}

.merchant-detail-grid span,
.merchant-detail-grid strong {
    display: flex;
}

.merchant-detail-grid span {
    color: var(--theme-muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.merchant-detail-grid strong {
    margin-top: 6px;
    color: var(--theme-text);
    overflow-wrap: anywhere;
    font-size: 12px;
}

.merchant-detail-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
    vertical-align: middle;
    border: 1px solid var(--theme-border);
    border-radius: 6px;
    background: #ffffff;
}

.merchant-logo-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    margin-top: 9px;
    padding: 8px;
    background: #fafbfb;
    border: 1px solid #ebedef;
    border-radius: 7px;
}

.merchant-logo-preview-frame {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    color: var(--theme-muted);
    background: #ffffff;
    border: 1px dashed #c9cccf;
    border-radius: 7px;
    overflow: hidden;
}

.merchant-logo-preview.has-image .merchant-logo-preview-frame {
    border-style: solid;
}

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

.merchant-logo-preview.is-large {
    width: 180px;
    height: 180px;
}

.permission-options {
    gap: 8px;
}

.permission-module + .permission-module,
.role-detail-module + .role-detail-module {
    margin-top: 16px;
    padding-top: 16px;
}

.auth-page-wrapper {
    background: #f6f6f7 !important;
}

.auth-page-content {
    max-width: 980px;
}

.auth-page-content .card {
    overflow: hidden;
}

.auth-one-bg {
    background:
        linear-gradient(rgba(0, 70, 50, 0.20), rgba(0, 70, 50, 0.20)),
        url("../images/auth/erp-login-bg.jpg") center center / cover no-repeat !important;
}

.auth-page-content h1 {
    color: var(--theme-text) !important;
    font-size: 28px !important;
}

.footer {
    padding: 10px 0;
    background: #ffffff !important;
}

#layout-wrapper {
    min-height: 100vh;
}

.main-content {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-content {
    flex: 1 0 auto;
    min-height: 0;
    padding-bottom: 24px !important;
}

.footer {
    position: relative !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    z-index: 1;
    flex: 0 0 auto;
    width: 100%;
    min-height: 42px;
}

@media (max-width: 767.98px) {
    .container-fluid {
        padding-right: 12px;
        padding-left: 12px;
    }

    .dashboard-heading,
    .role-heading {
        align-items: stretch;
    }

    .dashboard-actions,
    .role-heading-actions {
        gap: 8px;
    }

    .custom-pagination-container,
    .custom-pagination-left,
    .custom-pagination-right {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }
}

/* Sidebar submenu: Shopify-like tree and hover */
.menu-dropdown {
    margin: 2px 8px 5px 34px !important;
    padding: 2px 0 !important;
    width: auto !important;
    background: transparent !important;
}

.menu-dropdown .nav::before,
.menu-dropdown .nav-sm::before {
    display: none !important;
    content: none !important;
}

.menu-dropdown .nav-sm {
    position: relative;
    gap: 1px;
    width: 100% !important;
    padding: 0 !important;
}

.menu-dropdown .nav-sm .nav-item {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    padding-left: 14px;
}

.menu-dropdown .nav-sm .nav-item::before {
    content: "" !important;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 1px;
    background: #c9cccf;
}

.menu-dropdown .nav-sm .nav-item:first-child::before {
    top: 50%;
}

.menu-dropdown .nav-sm .nav-item:last-child::before {
    bottom: 50%;
}

.menu-dropdown .nav-sm .nav-item:only-child::before {
    top: 50%;
    bottom: 50%;
}

/* Dot at each T-junction */
.menu-dropdown .nav-sm .nav-item::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 5px;
    height: 5px;
    background: var(--theme-sidebar-bg);
    border: 1.5px solid #c9cccf;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.menu-dropdown .nav-sm .nav-item:has(.nav-link:hover)::after {
    border-color: #6d7175;
    background: #ffffff;
}

.menu-dropdown .nav-sm .nav-item:has(.nav-link.active)::after {
    background: var(--theme-primary);
    border-color: var(--theme-primary);
}

.navbar-menu .navbar-nav .nav-sm .nav-link {
    position: relative;
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 28px !important;
    margin: 2px 0 !important;
    padding: 4px 10px !important;
    color: #5c5f62 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    font-size: 12px !important;
    font-weight: 500;
    line-height: 1.35;
    transition: background-color 0.14s ease, color 0.14s ease;
}

.navbar-menu .navbar-nav .nav-sm .nav-link::before,
.navbar-menu .navbar-nav .nav-sm .nav-link:before,
.menu-dropdown .nav-link::before,
.menu-dropdown .nav-link:before {
    content: "" !important;
    position: absolute !important;
    top: 50% !important;
    left: -14px !important;
    width: 11px !important;
    height: 1px !important;
    background: #c9cccf !important;
    border: 0 !important;
    border-radius: 0 !important;
    opacity: 1 !important;
    transform: translateY(-50%) !important;
}

.navbar-menu .navbar-nav .nav-sm .nav-link:hover {
    color: #202223 !important;
    background: #e8eaed !important;
    border: 0 !important;
    box-shadow: none !important;
}

.navbar-menu .navbar-nav .nav-sm .nav-link.active {
    color: #202223 !important;
    background: #f6f6f7 !important;
    border: 0 !important;
    font-weight: 600;
}

.navbar-menu .navbar-nav .nav-sm .nav-link:hover::before,
.navbar-menu .navbar-nav .nav-sm .nav-link:hover:before {
    background: #8c9196 !important;
}

.navbar-menu .navbar-nav .nav-sm .nav-link.active::before,
.navbar-menu .navbar-nav .nav-sm .nav-link.active:before {
    background: var(--theme-primary) !important;
}

/* Keep submenu collapse vertical spacing inside the animated area to avoid a closing snap. */
.navbar-menu .menu-dropdown {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.navbar-menu .menu-dropdown > .nav-sm {
    padding-top: 2px !important;
    padding-bottom: 5px !important;
}

.navbar-menu .menu-dropdown.collapsing {
    overflow: hidden !important;
    transition: height 0.18s ease !important;
}

/* Generic page utilities */
.topbar-avatar-image {
    width: 34px;
    height: 34px;
    object-fit: cover;
    background: transparent !important;
    border: 0 !important;
}

.page-shell {
    display: grid;
    gap: 14px;
}

.page-heading {
    padding-bottom: 2px;
}

.page-heading h1 {
    margin: 0;
    color: var(--theme-text);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
}

.page-heading > div > p:last-child {
    margin-top: 3px;
    color: var(--theme-muted);
    font-size: 12px;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 14px;
    align-items: start;
}

.content-main,
.content-side {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.profile-panel {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: #ffffff;
    border: 1px solid var(--theme-border);
    border-radius: 8px;
    box-shadow: 0 1px 0 rgba(26, 26, 26, 0.04);
}

.avatar-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    color: #ffffff;
    background: var(--theme-primary);
    border-radius: 8px;
    overflow: hidden;
    font-size: 18px;
    font-weight: 700;
}

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

.profile-panel h2 {
    margin: 0;
    color: var(--theme-text);
    font-size: 16px;
    font-weight: 700;
}

.profile-panel p {
    margin: 3px 0 0;
    color: var(--theme-muted);
    overflow-wrap: anywhere;
    font-size: 12px;
}

.upload-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    background: #ffffff;
    border: 1px dashed #c9cccf;
    border-radius: 7px;
}

.avatar-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 88px;
    width: 88px;
    height: 88px;
    color: #000000;
    background: transparent;
    border: 1px solid #dfe3e8;
    border-radius: 8px;
    overflow: hidden;
    font-size: 22px;
    font-weight: 700;
}

.avatar-box.is-sm {
    flex-basis: 74px;
    width: 74px;
    height: 74px;
    font-size: 18px;
}

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

.avatar-preview.has-image {
    background: transparent;
    border-color: transparent;
}

.avatar-box:has(img) {
    background: transparent;
    border-color: transparent;
}

.upload-content {
    min-width: 0;
    flex: 1 1 auto;
}

.address-list {
    display: grid;
    gap: 12px;
}

.address-item {
    padding: 14px;
    background: #fbfcfc;
    border: 1px solid #ebedef;
    border-radius: 8px;
}

.address-item-header,
.address-item-actions {
    display: flex;
    align-items: center;
}

.address-item-header {
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.address-item-header strong {
    display: block;
    color: var(--theme-text);
    font-size: 13px;
    font-weight: 700;
}

.address-item-header span {
    color: var(--theme-muted);
    font-size: 12px;
}

.address-item-actions {
    gap: 10px;
}

.address-default-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: var(--theme-muted);
    font-size: 12px;
}

.form-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #ebedef;
}

.profile-card {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 14px;
    background: #ffffff;
    border: 1px solid #ebedef;
    border-radius: 7px;
    text-align: center;
}

.profile-card strong {
    color: var(--theme-text);
    font-size: 14px;
    font-weight: 700;
}

.profile-card span {
    color: #ffffff;
    overflow-wrap: anywhere;
    font-size: 12px;
}

.profile-card .avatar-box {
    margin-bottom: 4px;
}

.meta-list {
    display: grid;
    gap: 7px;
    margin-top: 10px;
}

.meta-list > div {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 10px;
    background: #fafbfb;
    border: 1px solid #ebedef;
    border-radius: 7px;
}

.meta-list span {
    flex: 0 0 auto;
    color: var(--theme-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.meta-list strong {
    min-width: 0;
    color: var(--theme-text);
    overflow-wrap: anywhere;
    font-size: 12px;
    font-weight: 650;
    text-align: right;
}

@media (max-width: 991.98px) {
    .content-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .content-side {
        grid-row: 1;
    }
}

@media (max-width: 575.98px) {
    .profile-panel {
        grid-template-columns: 48px minmax(0, 1fr);
    }

    .profile-panel .status-pill {
        grid-column: 2;
        justify-self: start;
    }

    .avatar-box {
        width: 48px;
        height: 48px;
        font-size: 15px;
    }

    .upload-row {
        align-items: stretch;
        flex-direction: column;
    }

    .address-item-header,
    .address-item-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .avatar-preview {
        width: 120px;
        height: 120px;
    }
}

/* Top action bar — mirrors the bottom Save/Cancel bar so forms are usable without scrolling */
.role-form-actions-top {
    margin-top: 0;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--theme-border);
}

.form-footer-top {
    margin-top: 0;
    margin-bottom: 16px;
    padding-top: 0;
    padding-bottom: 14px;
    border-top: none;
    border-bottom: 1px solid #ebedef;
}

/* Generic delete confirmation modal */
.theme-confirm-modal .modal-content {
    position: relative;
    padding: 8px;
    border: 0;
    border-radius: 14px;
    box-shadow: 0 24px 48px -12px rgba(17, 24, 39, 0.25);
}

.theme-confirm-close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    color: var(--theme-muted);
    background: transparent;
    border: 0;
    border-radius: 6px;
    font-size: 16px;
}

.theme-confirm-close:hover {
    color: var(--theme-text);
    background: #f3f4f6;
}

.theme-confirm-modal .modal-body {
    padding: 36px 28px 12px;
    text-align: center;
}

.theme-confirm-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 16px;
    color: #b91c1c;
    background: #fef2f2;
    border-radius: 50%;
    font-size: 22px;
}

.theme-confirm-title {
    margin-bottom: 8px;
    color: var(--theme-text);
    font-size: 17px;
    font-weight: 700;
}

.theme-confirm-message {
    margin: 0;
    color: var(--theme-muted);
    font-size: 13px;
    line-height: 1.5;
}

.theme-confirm-modal .modal-footer {
    justify-content: center;
    gap: 10px;
    padding: 16px 28px 28px;
    border-top: 0;
}

.theme-confirm-modal .modal-footer .btn {
    min-width: 110px;
}

/* ── Plan Features — form ── */
.plan-feature-item {
    position: relative;
}

.plan-feature-num {
    color: var(--theme-text);
    font-size: 12px;
    font-weight: 650;
}

/* Star (highlight) toggle */
.plan-feature-highlight-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.14s;
}

.plan-feature-highlight-label:hover {
    background: #f3f4f6;
}

.plan-feature-highlight-cb {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.plan-feature-highlight-label i {
    font-size: 16px;
    color: #c9cccf;
    transition: color 0.14s;
}

.plan-feature-highlight-label:has(.plan-feature-highlight-cb:checked) i {
    color: #f59e0b;
}

/* Included toggle */
.plan-feature-included-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    user-select: none;
}

.plan-feature-included-cb {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.plan-feature-included-track {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 16px;
    transition: background-color 0.14s, color 0.14s;
    background: #ecfdf5;
    color: #047857;
}

.plan-feature-included-label:has(.plan-feature-included-cb:not(:checked)) .plan-feature-included-track {
    background: #fef2f2;
    color: #b91c1c;
}

.plan-feature-icon-no { display: none; }

.plan-feature-included-label:has(.plan-feature-included-cb:not(:checked)) .plan-feature-icon-yes { display: none; }
.plan-feature-included-label:has(.plan-feature-included-cb:not(:checked)) .plan-feature-icon-no  { display: block; }

.plan-feature-included-text {
    font-size: 11px;
    font-weight: 650;
    color: #047857;
    white-space: nowrap;
}

.plan-feature-included-label:has(.plan-feature-included-cb:not(:checked)) .plan-feature-included-text {
    color: #b91c1c;
}

/* Empty state */
.plan-feature-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 36px 20px;
    color: var(--theme-muted);
    text-align: center;
}

.plan-feature-empty i {
    font-size: 28px;
    color: #c9cccf;
}

.plan-feature-empty p {
    margin: 0;
    font-size: 12px;
}

/* ── Plan Features — show page ── */
.plan-show-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr);
    gap: 14px;
    align-items: start;
}

.plan-feature-row {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-bottom: 1px solid #ebedef;
    font-size: 12px;
    transition: background-color 0.12s;
}

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

.plan-feature-row:hover {
    background: #fafbfb;
}

.plan-feature-row.is-highlight {
    background: #fffbeb;
}

.plan-feature-row.is-highlight:hover {
    background: #fef3c7;
}

.plan-feature-row-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 13px;
    color: #047857;
    background: #ecfdf5;
    flex-shrink: 0;
}

.plan-feature-row.is-not-included .plan-feature-row-icon {
    color: #b91c1c;
    background: #fef2f2;
}

.plan-feature-row-label {
    color: var(--theme-text);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.plan-feature-row.is-not-included .plan-feature-row-label {
    color: var(--theme-muted);
    text-decoration: line-through;
    text-decoration-color: #c9cccf;
}

.plan-feature-star {
    color: #f59e0b;
    font-size: 11px;
}

.plan-feature-row-value {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--theme-muted);
    font-size: 11px;
    font-weight: 650;
    white-space: nowrap;
}

.plan-feature-note {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #8c9196;
    cursor: help;
    font-size: 13px;
}

@media (max-width: 991.98px) {
    .plan-show-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ─── Tax module ─────────────────────────────────────────────────────────── */

.tax-rate-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-weight: 650;
    font-size: 13px;
}

.tax-rate-badge i {
    font-size: 12px;
    color: var(--theme-muted);
}

.tax-compound-yes,
.tax-compound-no {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}

.tax-compound-yes {
    background: #dcfce7;
    color: #15803d;
}

.tax-compound-no {
    background: #f3f4f6;
    color: #6b7280;
}

/* Rate input with suffix */
.tax-rate-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.tax-rate-input-wrapper .form-control {
    padding-right: 36px;
}

.tax-rate-suffix {
    position: absolute;
    right: 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--theme-muted);
    pointer-events: none;
    user-select: none;
}

/* Compound toggle layout */
.tax-compound-toggle {
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
}

/* Show page detail list */
.tax-detail-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
}

.tax-detail-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    align-items: baseline;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f3f4;
}

.tax-detail-row:last-child {
    border-bottom: none;
}

.tax-detail-row dt {
    color: var(--theme-muted);
    font-size: 12.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tax-detail-row dd {
    margin: 0;
    font-size: 13.5px;
    color: var(--theme-text);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.tax-rate-highlight {
    font-size: 20px;
    font-weight: 700;
    color: var(--theme-text);
    letter-spacing: -0.5px;
}

.tax-detail-note {
    font-size: 11.5px;
    color: var(--theme-muted);
}

/* Info list in sidebar card */
.tax-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tax-info-list li {
    font-size: 12px;
    color: var(--theme-muted);
    line-height: 1.5;
    padding-left: 14px;
    position: relative;
}

.tax-info-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #9ca3af;
}

.tax-info-list li strong {
    color: var(--theme-text);
    font-weight: 600;
}

@media (max-width: 767.98px) {
    .tax-detail-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

/* ============================================================
   INVOICE MODULE
   ============================================================ */

/* Status badges */
.inv-status-badge,
.inv-pay-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* Invoice status */
.inv-status-draft      { background: #f3f4f6; color: #6b7280; }
.inv-status-sent       { background: #eff6ff; color: #2563eb; }
.inv-status-cancelled  { background: #fef2f2; color: #dc2626; }
.inv-status-voided     { background: #fdf4ff; color: #9333ea; }
.inv-status-accepted   { background: #f0fdf4; color: #15803d; }
.inv-status-declined   { background: #fef2f2; color: #b91c1c; }

/* ── Portal Domain Card (Account Settings) ─────────────────────────────────── */
.domain-portal-card {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px; border-radius: 8px;
    border: 1px solid #e5e7eb;
}
.domain-portal-card.is-active { background: #f0fdf4; border-color: #bbf7d0; }
.domain-portal-card.is-pending { background: #fef9c3; border-color: #fde68a; }
.domain-portal-icon {
    width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}
.domain-portal-card.is-active  .domain-portal-icon { background: #dcfce7; color: #15803d; }
.domain-portal-card.is-pending .domain-portal-icon { background: #fef9c3; color: #a16207; }
.domain-portal-body { flex: 1; min-width: 0; }
.domain-portal-body strong { display: block; font-size: 13px; font-weight: 700; color: #111; }
.domain-portal-body span   { font-size: 11px; color: #6b7280; }

/* ── DNS Provider Picker ────────────────────────────────────────────────────── */
.dns-provider-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}
.dns-provider-card { position: relative; cursor: pointer; }
.dns-provider-card input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.dns-provider-card-inner {
    border: 2px solid #e5e7eb; border-radius: 10px;
    padding: 14px 12px; text-align: center;
    transition: border-color .15s, box-shadow .15s, background .15s;
    background: #fff;
}
.dns-provider-card:hover .dns-provider-card-inner { border-color: #9ca3af; }
.dns-provider-card input:checked + .dns-provider-card-inner {
    border-color: var(--dns-color, #111);
    box-shadow: 0 0 0 3px rgba(17,24,39,.08);
    background: #fafafa;
}
.dns-provider-icon {
    width: 38px; height: 38px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 8px; font-size: 18px;
    background: #f3f4f6; color: #374151;
}
.dns-provider-card input:checked + .dns-provider-card-inner .dns-provider-icon {
    background: var(--dns-color, #111);
    color: #fff;
}
.dns-provider-name { font-size: 12px; font-weight: 700; color: #111; margin-bottom: 2px; }
.dns-provider-desc { font-size: 10px; color: #9ca3af; line-height: 1.3; }
.dns-auto-badge {
    display: inline-block; font-size: 9px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; padding: 1px 6px; border-radius: 3px; margin-top: 5px;
    background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0;
}
.dns-manual-badge {
    display: inline-block; font-size: 9px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; padding: 1px 6px; border-radius: 3px; margin-top: 5px;
    background: #f3f4f6; color: #6b7280;
}

/* Provider credential panel */
.dns-cred-panel { display: none; }
.dns-cred-panel.active { display: block; }
.dns-connect-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 18px; border-radius: 6px;
    font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer;
    border: 2px solid #111; background: #111; color: #fff;
    transition: background .12s, border-color .12s;
}
.dns-connect-btn:hover { background: #374151; border-color: #374151; color: #fff; }
.dns-connect-btn-sec {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 18px; border-radius: 6px;
    font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer;
    border: 1px solid #d1d5db; background: #fff; color: #374151;
}
.dns-connect-btn-sec:hover { background: #f9fafb; }

/* ── Product Catalog Modal ──────────────────────────────────────────────────── */
/* Type badges (table uses role-table; pagination uses custom-pagination-container) */
.catalog-type-badge {
    display: inline-block;
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; padding: 2px 7px; border-radius: 3px; white-space: nowrap;
}
.catalog-type-goods        { background: #eff6ff; color: #1d4ed8; }
.catalog-type-service      { background: #f0fdf4; color: #15803d; }
.catalog-type-subscription { background: #fdf4ff; color: #7e22ce; }
.catalog-add-btn { white-space: nowrap; font-size: 12px !important; padding: 4px 12px !important; }
.inv-catalog-btn { display: inline-flex; align-items: center; gap: 6px; }

/* Payment status */
.inv-pay-unpaid             { background: #fef9c3; color: #a16207; }
.inv-pay-partially-paid     { background: #fff7ed; color: #c2410c; }
.inv-pay-paid               { background: #f0fdf4; color: #16a34a; }
.inv-pay-overpaid           { background: #ecfdf5; color: #059669; }
.inv-pay-partially-refunded { background: #fff7ed; color: #d97706; }
.inv-pay-refunded           { background: #f5f3ff; color: #7c3aed; }
.inv-pay-voided             { background: #f3f4f6; color: #6b7280; }

/* Form layout */
.inv-form-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    align-items: start;
}

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

.inv-form-main  { display: flex; flex-direction: column; gap: 20px; }
.inv-form-side  { display: flex; flex-direction: column; gap: 20px; }

/* Items editor table */
.inv-items-editor thead th {
    background: #f8fafc;
    font-size: 11.5px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
}

.inv-items-editor tbody td {
    padding: 8px 10px;
    vertical-align: middle;
    border-bottom: 1px solid #f3f4f6;
}

.inv-items-editor .form-control-sm,
.inv-items-editor .form-select-sm {
    font-size: 13px;
    padding: 5px 8px;
}

.inv-add-item-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid #f3f4f6;
}

.inv-quick-add { flex: 1; max-width: 280px; }

.inv-row-total { font-variant-numeric: tabular-nums; }

/* Totals sidebar */
.inv-totals-card .inv-total-display {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.inv-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13.5px;
    color: var(--theme-text);
}

.inv-total-row label {
    font-size: 13px;
    font-weight: 500;
    color: var(--theme-text);
    margin-bottom: 0;
}

.inv-total-discount span:last-child { color: #dc2626; }

.inv-total-grand {
    border-top: 1px solid #e5e7eb;
    padding-top: 10px;
    margin-top: 4px;
    font-size: 15px;
    font-weight: 700;
}

.inv-total-paid span:last-child { color: #16a34a; }
.inv-total-due { font-size: 15px; font-weight: 700; color: #dc2626; }

.inv-adj-input {
    width: 110px;
    text-align: right;
}

/* Invoice document (show page) */
.inv-document {
    padding: 0;
    overflow: hidden;
}

.inv-doc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 28px 32px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.inv-doc-from {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.inv-doc-from strong {
    font-size: 22px;
    font-weight: 700;
    color: var(--theme-text);
    letter-spacing: -0.5px;
}

.inv-doc-from span { font-size: 13px; color: var(--theme-muted); }
.inv-ref { font-size: 12px; color: var(--theme-muted); }

.inv-doc-dates {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: right;
}

.inv-doc-dates > div {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    font-size: 13px;
}

.inv-doc-dates span { color: var(--theme-muted); }
.inv-doc-dates strong { color: var(--theme-text); font-weight: 600; }

.inv-doc-parties {
    padding: 20px 32px;
    border-bottom: 1px solid #f0f2f5;
}

.inv-doc-party {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 13.5px;
}

.inv-party-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--theme-muted);
    margin-bottom: 4px;
}

.inv-doc-party strong { font-size: 15px; font-weight: 700; }
.inv-doc-party p { margin: 0; color: var(--theme-muted); }

/* Items table in document */
.inv-items-table thead th {
    background: #f8fafc;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #6b7280;
    padding: 10px 32px;
    border-bottom: 1px solid #e5e7eb;
}

.inv-items-table tbody td {
    padding: 12px 32px;
    font-size: 13.5px;
    color: var(--theme-text);
    border-bottom: 1px solid #f3f4f6;
}

.inv-item-num { color: var(--theme-muted); font-size: 12px; }
.inv-item-product { display: block; font-size: 11.5px; color: var(--theme-muted); margin-top: 2px; }
.inv-item-rate { color: var(--theme-muted); margin-left: 4px; }
.inv-item-total { font-weight: 600; font-variant-numeric: tabular-nums; }

.inv-doc-totals-wrap {
    display: flex;
    justify-content: flex-end;
    padding: 20px 32px;
    border-top: 1px solid #f0f2f5;
}

.inv-doc-totals {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 280px;
}

.inv-doc-footer-section {
    border-top: 1px solid #f0f2f5;
    padding: 20px 32px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.inv-doc-note strong {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--theme-muted);
    margin-bottom: 4px;
}

.inv-doc-note p { font-size: 13px; color: var(--theme-text); margin: 0; }
.inv-doc-footer-text { border-top: 1px dashed #e5e7eb; padding-top: 12px; text-align: center; }

/* ============================================================
   SUBSCRIPTION MODULE
   ============================================================ */

/* Status badges */
.sub-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.sub-badge-active    { background: #f0fdf4; color: #16a34a; }
.sub-badge-trialing  { background: #eff6ff; color: #2563eb; }
.sub-badge-past-due  { background: #fff7ed; color: #c2410c; }
.sub-badge-cancelled { background: #fef2f2; color: #dc2626; }
.sub-badge-expired   { background: #f3f4f6; color: #6b7280; }

/* Plan highlight in show page */
.sub-plan-highlight {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.sub-plan-highlight-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bs-dark);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.sub-plan-pricing-label {
    display: block;
    font-size: 12.5px;
    color: var(--theme-muted);
    margin-top: 2px;
}

/* Plan info sidebar block */
.sub-plan-info-block { font-size: 13px; }

.sub-plan-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
    color: var(--theme-text);
}

.sub-plan-detail-row:last-child { border-bottom: none; }
.sub-plan-detail-row span { color: var(--theme-muted); }

/* Subscription detail layout */
.sub-detail-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Sub user create/edit */
.admin-user-form-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.admin-user-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 0;
}

.admin-user-summary span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 6px 10px;
    color: #374151;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 650;
}

.admin-user-summary i {
    color: #6b7280;
    font-size: 15px;
}

.admin-user-summary .is-active {
    color: #047857;
    background: #ecfdf5;
    border-color: #bbf7d0;
}

.admin-user-summary .is-inactive {
    color: #b42318;
    background: #fef2f2;
    border-color: #fecaca;
}

.admin-user-form-grid {
    grid-template-columns: minmax(0, 1fr);
}

.admin-user-form-grid .card-box {
    border-color: #e5e7eb;
    box-shadow: 0 8px 22px rgba(17, 24, 39, .04) !important;
}

.admin-access-header {
    align-items: center;
}

.admin-access-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    padding: 5px 9px;
    color: #374151;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.admin-user-form-grid .admin-role-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.admin-user-form-grid .admin-role-option {
    position: relative;
    grid-template-columns: auto 34px minmax(0, 1fr) auto;
    align-items: center;
    width: 100%;
    max-width: 100%;
    min-height: 72px;
    border-color: #e5e7eb;
    background: #ffffff;
    transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

.admin-user-form-grid .admin-role-option:hover,
.admin-user-form-grid .permission-option:hover {
    border-color: #9ca3af;
    box-shadow: 0 8px 18px rgba(17, 24, 39, .06);
}

.admin-user-form-grid .admin-role-option:has(input:checked),
.admin-user-form-grid .permission-option:has(input:checked) {
    background: #f8fafc;
    border-color: #111827;
    box-shadow: inset 0 0 0 1px #111827;
}

.admin-user-form-grid .admin-role-icon {
    width: 34px;
    height: 34px;
    background: #f3f4f6;
}

.admin-user-form-grid .admin-role-option:has(input:checked) .admin-role-icon {
    color: #ffffff;
    background: #111827;
}

.admin-user-form-grid .admin-role-option strong,
.admin-user-form-grid .permission-option strong {
    overflow-wrap: anywhere;
}

.admin-direct-permissions {
    max-height: none !important;
    overflow: visible;
}

.admin-permission-toolbar {
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin: -2px 0 14px;
    padding: 2px 0 10px;
    background: #ffffff;
    border-bottom: 1px solid #eef0f3;
}

.admin-permission-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.admin-permission-table {
    width: 100%;
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 0;
}

.admin-permission-table th,
.admin-permission-table td {
    height: 42px;
    padding: 8px 12px;
    border-right: 1px solid #eef0f3;
    border-bottom: 1px solid #eef0f3;
    vertical-align: middle;
}

.admin-permission-table th:last-child,
.admin-permission-table td:last-child {
    border-right: 0;
}

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

.admin-permission-row {
    background: #ffffff;
}

.admin-permission-row:hover {
    background: #fafbfb;
}

.admin-permission-module-cell {
    width: 235px;
    background: #f8fafc;
}

.admin-permission-module-cell strong,
.admin-permission-module-cell small {
    display: block;
}

.admin-permission-module-cell strong {
    color: var(--theme-text);
    font-size: 12px;
    font-weight: 750;
}

.admin-permission-module-cell small {
    margin-top: 3px;
    color: var(--theme-muted);
    font-size: 11px;
    font-weight: 600;
}

.admin-permission-list-cell {
    background: #ffffff;
}

.admin-permission-check-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.admin-permission-check-item {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    min-width: 0;
    width: 100%;
    max-width: none;
    min-height: 48px;
    margin: 0;
    padding: 9px 10px;
    cursor: pointer;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

.admin-permission-check-item:hover {
    border-color: #9ca3af;
    background: #fbfbfc;
}

.admin-permission-check-item:has(input:checked) {
    border-color: #111827;
    background: #f8fafc;
    box-shadow: inset 0 0 0 1px #111827;
}

.admin-permission-check-item .form-check-input {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    margin-top: 2px;
}

.admin-permission-check-item span {
    min-width: 0;
}

.admin-permission-check-item strong,
.admin-permission-check-item small {
    display: block;
}

.admin-permission-check-item strong {
    color: var(--theme-text);
    font-size: 12px;
    font-weight: 700;
}

.admin-permission-check-item small {
    margin-top: 2px;
    color: var(--theme-muted);
    font-size: 10px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.admin-permission-search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 10px;
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 7px;
}

.admin-permission-search i {
    color: #6b7280;
    font-size: 15px;
}

.admin-permission-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    color: var(--theme-text);
    background: transparent;
    font-size: 12px;
}

.admin-user-form-grid .admin-role-option .form-check-input {
    width: 16px;
    height: 16px;
    margin-top: 0;
}

@media (max-width: 1199.98px) {
    .admin-user-form-grid {
        grid-template-columns: 1fr;
    }

    .admin-direct-permissions {
        max-height: none;
    }

    .admin-permission-check-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .admin-user-form-grid .admin-role-options {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .admin-access-header,
    .admin-permission-toolbar {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .admin-access-header {
        flex-direction: column;
    }

    .admin-permission-table {
        min-width: 620px;
    }

    .admin-permission-check-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-user-form-grid .admin-role-option {
        width: 100%;
        max-width: 100%;
    }

    .admin-user-form-grid .admin-role-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.admin-user-action-footer {
    margin-top: 4px;
    padding-top: 14px;
    padding-bottom: 0;
    background: transparent;
    border-top: 1px solid var(--theme-border);
}

@media (max-width: 767.98px) {
    .admin-permission-table {
        min-width: 560px;
    }

    .admin-permission-module-cell {
        width: 190px;
    }

    .admin-user-form-grid .admin-role-option {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 575.98px) {
    .admin-user-form-grid .admin-role-options,
    .admin-permission-check-list {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   BILLING ENGINE — Payment, Refund, Gateway, Sequence styles
   ============================================================ */

/* ── Payment status badges ──────────────────────────────── */
.pay-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: capitalize;
    white-space: nowrap;
}
.pay-badge-sm { padding: 2px 7px; font-size: 0.68rem; }
.pay-badge-captured        { background: #d1fae5; color: #065f46; }
.pay-badge-authorized      { background: #dbeafe; color: #1e40af; }
.pay-badge-partially_captured { background: #fef3c7; color: #92400e; }
.pay-badge-voided          { background: #f1f5f9; color: #475569; }
.pay-badge-canceled        { background: #f1f5f9; color: #475569; }
.pay-badge-failed          { background: #fee2e2; color: #991b1b; }
.pay-badge-refunded        { background: #ede9fe; color: #5b21b6; }
.pay-badge-partially_refunded { background: #fef9c3; color: #78350f; }

/* ── Refund status badges ────────────────────────────────── */
.refund-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: capitalize;
    white-space: nowrap;
}
.refund-badge-succeeded  { background: #d1fae5; color: #065f46; }
.refund-badge-processing { background: #dbeafe; color: #1e40af; }
.refund-badge-pending    { background: #fef3c7; color: #92400e; }
.refund-badge-failed     { background: #fee2e2; color: #991b1b; }
.refund-badge-canceled   { background: #f1f5f9; color: #475569; }

/* ── Payment transaction rows ─────────────────────────────── */
.pay-txn-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    border-bottom: 1px solid var(--theme-border);
    font-size: 0.85rem;
}
.pay-txn-row:last-child { border-bottom: none; }
.pay-txn-type { font-weight: 600; color: var(--theme-text-main); text-transform: capitalize; }
.pay-txn-meta { display: flex; align-items: center; gap: 8px; color: var(--theme-text-muted); }

/* ── Payment Gateway cards ────────────────────────────────── */
.pgw-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.pgw-card {
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius);
    background: #fff;
    transition: box-shadow 0.15s;
}
.pgw-card:hover { box-shadow: 0 4px 18px rgba(0,0,0,0.08); }
.pgw-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--theme-border);
}
.pgw-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--theme-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.pgw-card-meta { flex: 1; min-width: 0; }
.pgw-card-meta h3 { font-size: 0.95rem; font-weight: 700; margin: 0 0 2px; }
.pgw-provider-label { font-size: 0.78rem; color: var(--theme-text-muted); }
.pgw-status-active   { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 0.7rem; font-weight: 600; background: #d1fae5; color: #065f46; }
.pgw-status-inactive { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 0.7rem; font-weight: 600; background: #f1f5f9; color: #64748b; }
.pgw-card-body { padding: 14px 20px; }
.pgw-stat-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.82rem; color: var(--theme-text-muted); margin-bottom: 4px; }
.pgw-stat-row strong { color: var(--theme-text-main); }
.pgw-card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--theme-border);
    display: flex;
    gap: 10px;
}
.pgw-config-preview { margin-top: 12px; }
.pgw-config-row { display: flex; align-items: baseline; gap: 10px; padding: 4px 0; font-size: 0.82rem; border-bottom: 1px solid var(--theme-border); }
.pgw-config-row:last-child { border-bottom: none; }
.pgw-config-key { width: 160px; flex-shrink: 0; color: var(--theme-text-muted); font-weight: 500; }
.pgw-config-value { font-family: monospace; font-size: 0.82rem; color: var(--theme-text-main); word-break: break-all; }
.pgw-config-masked { font-family: monospace; letter-spacing: 2px; color: var(--theme-text-muted); }

/* ── Invoice sequence preview ─────────────────────────────── */
.inv-sequence-preview {
    font-family: monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--theme-primary, #1a1a2e);
    background: var(--theme-bg);
    border: 2px dashed var(--theme-border);
    border-radius: var(--theme-radius);
    padding: 22px;
    text-align: center;
    letter-spacing: 2px;
    margin-bottom: 12px;
}
.inv-sequence-meta { font-size: 0.78rem; color: var(--theme-text-muted); text-align: center; }

/* ── Invoice form: single-column stack layout ─────────────── */
.inv-form-stack { display: flex; flex-direction: column; gap: 24px; }
.inv-totals-block { padding: 16px 20px 20px; border-top: 1px solid var(--theme-border); margin-top: 8px; }
.inv-totals-inner { max-width: 380px; margin-left: auto; }
.inv-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 0.88rem;
    color: var(--theme-text-muted);
    border-bottom: 1px solid var(--theme-border);
}
.inv-total-row:last-of-type { border-bottom: none; }
.inv-total-row label { color: var(--theme-text-main); font-weight: 500; }
.inv-total-grand {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0 0;
    border-top: 2px solid var(--theme-text-main);
    margin-top: 6px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--theme-text-main);
}
.inv-row-total-cell { font-weight: 600; color: var(--theme-text-main); }

/* Subscription plan info pill */
.sub-plan-info-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--theme-bg);
    border: 1px solid var(--theme-border);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--theme-text-main);
}

/* ── Role title line (badge next to heading) ──────────────── */
.role-title-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   BILLING ENGINE v2 — UI/UX Improvements
   ============================================================ */

/* ── Form top-bar (sticky save button strip) ─────────────── */
.inv-form-topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px 0 16px;
    border-bottom: 1px solid var(--theme-border, #e5e7eb);
}

/* ── Items editor: right-align number columns ─────────────── */
.inv-items-editor th.text-end,
.inv-items-editor td.text-end { text-align: right !important; }

.inv-items-editor .item-qty,
.inv-items-editor .item-price,
.inv-items-editor .item-discount { text-align: right; }

.inv-items-editor .inv-row-total-cell { text-align: right; }

/* Row number column */
.inv-th-sn,
.inv-td-sn {
    width: 38px !important;
    text-align: center !important;
    padding-left: 12px !important;
    padding-right: 4px !important;
    color: #9ca3af;
    font-size: 12px;
    user-select: none;
}

/* Row delete button — tighter */
.inv-items-editor tbody td:last-child { width: 40px; padding: 6px 8px 6px 4px; }

/* Quick add strip (above table) */
.inv-quick-add-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    background: #fffdf0;
    border-bottom: 1px solid #fde68a;
    font-size: 13px;
}
.inv-quick-add-strip label {
    font-size: 12px;
    font-weight: 700;
    color: #92400e;
    white-space: nowrap;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.inv-quick-add-strip .form-select { max-width: 340px; font-size: 13px; }

/* Totals block — v2 (overrides earlier definition) */
.inv-totals-block {
    padding: 16px 24px 20px;
    background: #f8fafc;
    border-top: 2px solid #f1f5f9;
    margin-top: 0;
}
.inv-totals-inner {
    max-width: 360px;
    margin-left: auto;
}
.inv-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    font-size: 13.5px;
    border-bottom: 1px solid #f1f5f9;
    color: #374151;
    gap: 16px;
}
.inv-total-row:last-of-type { border-bottom: none; }
.inv-total-label { font-weight: 500; color: #6b7280; }
.inv-total-value { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.inv-adj-input { width: 120px !important; text-align: right !important; }

/* Grand total bar */
.inv-total-grand {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    margin-top: 12px;
    background: #1e293b;
    border-radius: 10px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.inv-total-grand strong {
    font-size: 18px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.3px;
}

/* ── Add item row ─────────────────────────────────────────── */
.inv-add-item-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #fafafa;
    border-top: 1px solid #f1f5f9;
}

/* ── Record payment action bar (invoice show) ─────────────── */
.bil-pay-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #86efac;
    border-radius: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.bil-pay-action-left { display: flex; align-items: center; gap: 14px; }
.bil-pay-action-icon {
    width: 44px; height: 44px;
    background: #16a34a;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.2rem; flex-shrink: 0;
}
.bil-pay-action-text h4 { font-size: 14px; font-weight: 700; color: #14532d; margin: 0 0 2px; }
.bil-pay-action-text p  { font-size: 13px; color: #16a34a; margin: 0; }

/* ── Invoice show: amount due row ─────────────────────────── */
.inv-total-due {
    background: #fff1f2;
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 4px;
}
.inv-total-due strong { color: #dc2626; font-variant-numeric: tabular-nums; }

/* ── Sub detail layout — proper 2-column grid ─────────────── */
.sub-detail-layout {
    display: grid;
    grid-template-columns: minmax(300px, 340px) 1fr;
    gap: 20px;
    align-items: start;
}
@media (max-width: 991.98px) {
    .sub-detail-layout { grid-template-columns: 1fr; }
}

/* ── Sub plan highlight (show page) ──────────────────────── */
.sub-plan-highlight {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #eff6ff 0%, #e0e7ff 100%);
    border: none;
    border-radius: 0;
    border-bottom: 1px solid #c7d2fe;
}
.sub-plan-highlight strong {
    font-size: 0.94rem;
    color: #1e293b;
    display: block;
    line-height: 1.3;
}
.sub-plan-highlight-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #4f46e5;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}
.sub-plan-pricing-label {
    display: block;
    font-size: 0.775rem;
    color: #4f46e5;
    font-weight: 600;
    margin-top: 2px;
}

/* ── Plan info pill (form header) ────────────────────────── */
.sub-plan-info-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #1d4ed8;
}

/* ── Gateway card: provider icon colors ─────────────────── */
.pgw-icon-stripe        { background: #f0eeff; color: #635bff; }
.pgw-icon-paypal        { background: #e6f4ff; color: #0070ba; }
.pgw-icon-bank_transfer { background: #ecfeff; color: #0891b2; }
.pgw-icon-cash          { background: #f0fdf4; color: #16a34a; }
.pgw-icon-easypaisa     { background: #f0fdf4; color: #059669; }
.pgw-icon-jazzcash      { background: #fff1f2; color: #dc2626; }

/* Gateway stat row fix */
.pgw-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #6b7280;
    padding: 4px 0;
    border-bottom: 1px solid #f3f4f6;
}
.pgw-stat-row:last-child { border-bottom: none; }
.pgw-stat-row strong { color: #1e293b; font-weight: 600; }
.pgw-card-footer { gap: 8px; }

/* ── Invoice show: payment history table ─────────────────── */
.bil-pay-history-empty {
    padding: 16px 20px;
    font-size: 13px;
    color: #9ca3af;
}

/* ── Invoice items table (show page) — better column widths ── */
.inv-items-table thead th { white-space: nowrap; }
.inv-items-table .text-end { text-align: right; }

/* ── Role title line ─────────────────────────────────────── */
.role-title-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.role-title-line h1 { margin: 0; }

/* ── Invoice sequence preview ────────────────────────────── */
.inv-sequence-preview {
    font-family: 'Courier New', monospace;
    font-size: 1.6rem;
    font-weight: 800;
    color: #1e293b;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    letter-spacing: 3px;
    margin-bottom: 8px;
}
.inv-sequence-meta { font-size: 12px; color: #9ca3af; text-align: center; }

/* ─── Payment Gateway: per-provider config sections (v3) ─────────────────── */
.pgw-cfg-section { padding: 0; }
.pgw-cfg-section-label {
    font-weight: 600;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #64748b;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .45rem;
}
.pgw-cfg-placeholder { text-align: center; padding: 2rem 1rem; }
.pgw-security-note {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: .75rem 1rem;
    font-size: .85rem;
}
.pgw-security-note > i { font-size: 1.2rem; color: #0891b2; margin-top: .1rem; flex-shrink: 0; }
/* Provider icon text colors for section labels */
.pgw-icon-stripe-text      { color: #635bff; }
.pgw-icon-paypal-text      { color: #0070ba; }
.pgw-icon-bank_transfer-text { color: #0891b2; }
.pgw-icon-cash-text        { color: #16a34a; }
.pgw-icon-easypaisa-text   { color: #059669; }
.pgw-icon-jazzcash-text    { color: #dc2626; }

/* ─── Invoice form: totals rows with inline inputs ───────────────────────── */
.inv-total-row-input {
    align-items: center;
    flex-wrap: nowrap;
    gap: .5rem;
}
.inv-total-row-input .inv-total-label {
    white-space: nowrap;
    flex-shrink: 0;
}

/* ─── Invoice form: product/pricing picker inside row ────────────────────── */
.inv-item-picker { margin-bottom: .25rem; }
.inv-item-picker .item-product-select,
.inv-item-picker .item-pricing-select {
    font-size: .78rem;
    color: #64748b;
    border-color: #cbd5e1;
    background-color: #f8fafc;
}
.inv-item-picker .item-product-select:focus,
.inv-item-picker .item-pricing-select:focus {
    background-color: #fff;
    border-color: #6366f1;
    color: #1e293b;
}
.inv-td-desc { min-width: 220px; }

/* Payment gateway provider radio cards */
.pgw-provider-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 10px;
    margin-top: 6px;
}
.pgw-pcard {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 14px 8px 12px;
    border: 2px solid var(--theme-border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s;
    text-align: center;
    background: var(--theme-surface);
    user-select: none;
    -webkit-user-select: none;
}
.pgw-pcard:hover { border-color: #a5b4fc; background: #f8f8ff; }
.pgw-pcard.is-selected { border-color: #6366f1; background: #eef2ff; box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.pgw-pcard-icon { width: 38px; height: 38px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; }
.pgw-pcard-name { font-size: 0.73rem; font-weight: 600; color: var(--theme-text-main); line-height: 1.3; }

/* Invoice line-item discount type + value group */
.inv-disc-group {
    display: flex;
    gap: 4px;
    align-items: center;
}
.inv-disc-group .item-disc-type {
    width: 50px;
    flex-shrink: 0;
    min-width: 0;
    padding: 0.25rem 0.15rem;
    font-size: 0.78rem;
    text-align: center;
}
.inv-disc-group .item-disc-val { width: 72px; min-width: 0; }
.inv-td-disc  { min-width: 132px; white-space: nowrap; }
.inv-th-disc  { white-space: nowrap; }

/* Product picker row (select + clear button side-by-side) */
.inv-picker-row {
    display: flex;
    align-items: center;
    gap: 0;
}
.inv-picker-row .item-product-select { flex: 1; min-width: 0; }
.inv-clear-product { font-size: 0.72rem; flex-shrink: 0; }

/* ── Transactions Module ────────────────────────────────────────────────── */

/* Summary stat cards row */
.txn-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
@media (max-width: 1024px) { .txn-stats-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 576px)  { .txn-stats-row { grid-template-columns: 1fr; } }

.txn-stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-radius: 12px;
    border: 1px solid var(--theme-border);
    background: var(--theme-surface);
}
.txn-stat-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.txn-stat-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.txn-stat-label { font-size: 0.74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--theme-text-muted); }
.txn-stat-value { font-size: 1.35rem; font-weight: 700; color: var(--theme-text-main); font-variant-numeric: tabular-nums; line-height: 1.2; }
.txn-stat-sub   { font-size: 0.72rem; color: var(--theme-text-muted); }

/* Per-card accent colours */
.txn-stat-collected .txn-stat-icon { background: #dcfce7; color: #16a34a; }
.txn-stat-collected .txn-stat-value { color: #16a34a; }
.txn-stat-refunded  .txn-stat-icon  { background: #fee2e2; color: #dc2626; }
.txn-stat-refunded  .txn-stat-value { color: #dc2626; }
.txn-stat-net-positive .txn-stat-icon  { background: #dbeafe; color: #1d4ed8; }
.txn-stat-net-positive .txn-stat-value { color: #1d4ed8; }
.txn-stat-net-negative .txn-stat-icon  { background: #fee2e2; color: #dc2626; }
.txn-stat-net-negative .txn-stat-value { color: #dc2626; }
.txn-stat-count .txn-stat-icon { background: #f1f5f9; color: #475569; }

/* Filter bar */
.txn-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px 12px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--theme-border);
}
.txn-filter-bar form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}
.txn-filter-search { flex: 1 1 200px; min-width: 160px; }
.txn-filter-select { width: auto; min-width: 130px; font-size: 0.82rem; }
.txn-date-range    { display: flex; align-items: center; gap: 6px; }
.txn-filter-date   { width: 130px; font-size: 0.82rem; }
.txn-date-sep      { color: var(--theme-text-muted); font-size: 0.85rem; }

/* Ledger table */
.txn-ledger-table thead th { font-size: 0.78rem; white-space: nowrap; }

/* Transaction type badges */
.txn-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 0.73rem;
    font-weight: 700;
    white-space: nowrap;
}
.txn-type-payment { background: #dcfce7; color: #15803d; }
.txn-type-refund  { background: #fee2e2; color: #b91c1c; }

/* Amount display */
.txn-amount {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: 0.9rem;
    white-space: nowrap;
}
.txn-amount-credit { color: #16a34a; }
.txn-amount-debit  { color: #dc2626; }

/* Reference code */
.txn-ref {
    font-family: monospace;
    font-size: 0.78rem;
    color: var(--theme-text-main);
    background: var(--theme-surface-alt, #f8fafc);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--theme-border);
    max-width: 160px;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

/* Date column */
.txn-date { font-size: 0.83rem; color: var(--theme-text-main); white-space: nowrap; }

/* Method + gateway cell */
.txn-method-cell  { display: flex; flex-direction: column; gap: 2px; }
.txn-method-icon  { margin-right: 4px; color: var(--theme-text-muted); }
.txn-method-label { font-size: 0.82rem; color: var(--theme-text-main); }
.txn-gateway-name { font-size: 0.72rem; color: var(--theme-text-muted); }

/* Row hover accent */
.txn-row-payment:hover { background: #f0fdf4; }
.txn-row-refund:hover  { background: #fff5f5; }

/* ── Subscription Show: stat strip ──────────────────────────────────────── */
.sub-stats-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}
@media (max-width: 1024px) { .sub-stats-strip { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 576px)  { .sub-stats-strip { grid-template-columns: 1fr 1fr; } }

.sub-stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 12px;
    background: var(--theme-surface);
    border: 1px solid var(--theme-border);
}
.sub-stat-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.sub-stat-icon-amount   { background: #dbeafe; color: #1d4ed8; }
.sub-stat-icon-interval { background: #f3e8ff; color: #7c3aed; }
.sub-stat-icon-customer { background: #dcfce7; color: #16a34a; }
.sub-stat-icon-next     { background: #fef9c3; color: #a16207; }
.sub-stat-icon-overdue  { background: #fee2e2; color: #dc2626; }

.sub-stat-body    { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sub-stat-label   { font-size: 0.72rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; color: var(--theme-text-muted); }
.sub-stat-value   { font-size: 1rem; font-weight: 700; color: var(--theme-text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.sub-stat-meta    { font-size: 0.72rem; color: var(--theme-text-muted); }

/* ── Subscription Show: key-value detail list (stacked) ─────────────────── */
.sub-kv-list { margin: 0; padding: 0; }
.sub-kv-row {
    padding: 10px 20px;
    border-bottom: 1px solid var(--theme-border);
}
.sub-kv-row:last-child { border-bottom: none; }
.sub-kv-row dt {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 700;
    color: var(--theme-text-muted);
    margin-bottom: 3px;
}
.sub-kv-row dt i { font-size: 0.8rem; }
.sub-kv-row dd {
    margin: 0;
    font-size: 0.855rem;
    color: var(--theme-text-main);
    font-weight: 500;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.45;
}
.sub-kv-row dd a { color: var(--bs-primary); text-decoration: none; }
.sub-kv-row dd a:hover { text-decoration: underline; }

/* ── Subscription Show: invoices section ────────────────────────────────── */
.sub-invoices-section { margin-top: 20px; }
.sub-inv-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #e2e8f0;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 10px;
    margin-left: 6px;
    vertical-align: middle;
}
.sub-inv-empty {
    text-align: center;
    padding: 32px 24px;
    color: var(--theme-text-muted);
}
.sub-inv-empty-icon {
    font-size: 2.4rem;
    display: block;
    margin-bottom: 8px;
    opacity: .35;
}

/* ── Subscription form: billing cycle picker ─────────────────────────────── */
.sub-cycle-picker { display: flex; flex-direction: column; gap: 6px; }
.sub-cycle-custom {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #f8fafc;
    border: 1px solid var(--theme-border);
    border-radius: 8px;
}

/* ── Subscription show: billing status banner ────────────────────────────── */
.sub-billing-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 500;
    margin-bottom: 16px;
}
.sub-billing-banner i { font-size: 1rem; flex-shrink: 0; }
.sub-billing-banner-ready    { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.sub-billing-banner-billed   { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.sub-billing-banner-early    { background: #fefce8; color: #a16207; border: 1px solid #fde68a; }
.sub-billing-banner-inactive { background: #f3f4f6; color: #6b7280; border: 1px solid #e5e7eb; }

/* Billing document template settings */
.billing-template-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.billing-template-options {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}
.billing-template-card {
    border: 1px solid var(--theme-border);
    border-radius: 8px;
    background: var(--theme-surface);
    padding: 10px;
}
.billing-template-card strong {
    display: block;
    margin-top: 8px;
    font-size: .82rem;
    color: var(--theme-text-main);
}
.billing-template-card p {
    margin: 2px 0 0;
    color: var(--theme-text-muted);
    font-size: .72rem;
    line-height: 1.35;
}
.billing-template-preview {
    height: 70px;
    border-radius: 6px;
    border: 1px solid #d8dee8;
    background: #fff;
    padding: 8px;
}
.billing-template-preview span,
.billing-template-preview strong,
.billing-template-preview em {
    display: block;
    height: 6px;
    border-radius: 4px;
    background: #d9deea;
}
.billing-template-preview span { width: 34%; background: #635bff; }
.billing-template-preview strong { width: 82%; margin-top: 12px; }
.billing-template-preview em { width: 56%; margin-top: 8px; }
.billing-template-preview-classic { border-top: 5px solid #2563eb; }
.billing-template-preview-modern { background: linear-gradient(#0f766e 0 26px, #fff 26px); }
.billing-template-preview-modern span { background: #fff; }
.billing-template-preview-compact { height: 58px; padding: 6px; }
.billing-template-preview-ledger strong,
.billing-template-preview-ledger em { height: 8px; border-radius: 0; }
.billing-color-field {
    display: flex;
    align-items: center;
    gap: 8px;
}
.billing-color-field input[type="color"] {
    width: 44px;
    height: 38px;
    padding: 4px;
    border: 1px solid var(--theme-border);
    border-radius: 6px;
    background: var(--theme-surface);
}
.billing-branding-row {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: end;
    gap: 16px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--theme-border);
}
@media (max-width: 1100px) {
    .billing-template-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    .billing-template-grid,
    .billing-branding-row { grid-template-columns: 1fr; }
    .billing-template-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
    .billing-template-options { grid-template-columns: 1fr; }
}

/* Payment method selector */
.payment-method-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}
.payment-method-card {
    position: relative;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 10px 12px;
    border: 1px solid var(--theme-border);
    border-radius: 8px;
    background: var(--theme-surface);
    cursor: pointer;
    transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}
.payment-method-card:hover {
    border-color: #9ca3af;
    background: #ffffff;
}
.payment-method-card.is-selected {
    border-color: #111827;
    background: #f8fafc;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, .08);
}
.payment-method-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.payment-method-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #374151;
    background: #f3f4f6;
    font-size: 1.05rem;
}
.payment-method-name {
    min-width: 0;
    color: var(--theme-text-main);
    font-size: .82rem;
    font-weight: 700;
    line-height: 1.25;
}
.payment-method-check {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 18px;
    height: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #111827;
    color: #fff;
    font-size: .75rem;
}
.payment-method-card.is-selected .payment-method-check { display: inline-flex; }

/* Payment gateway configuration form */
.pgw-provider-grid {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 12px;
}
.pgw-pcard {
    align-items: flex-start;
    min-height: 132px;
    padding: 14px;
    border-width: 1px;
    border-radius: 8px;
    background: var(--theme-surface);
}
.pgw-pcard-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.pgw-pcard:hover,
.pgw-pcard.is-focused {
    border-color: #9ca3af;
    background: #ffffff;
}
.pgw-pcard.is-selected {
    border-color: #111827;
    background: #f8fafc;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, .08);
}
.pgw-pcard-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 18px;
    height: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #111827;
    color: #fff;
    font-size: .72rem;
}
.pgw-pcard.is-selected .pgw-pcard-check { display: inline-flex; }
.pgw-pcard-name {
    font-size: .84rem;
    font-weight: 800;
}
.pgw-pcard-copy {
    display: block;
    color: var(--theme-text-muted);
    font-size: .72rem;
    line-height: 1.35;
}
.pgw-cfg-heading,
.pgw-guide-title,
.pgw-security-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.pgw-guide-title-text {
    display: flex;
    flex-direction: column;
}

.pgw-cfg-heading {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--theme-border);
}
.pgw-cfg-heading h3,
.pgw-guide-title strong {
    margin: 0;
    color: var(--theme-text-main);
    font-size: .95rem;
    font-weight: 800;
}
.pgw-cfg-heading p,
.pgw-guide-title span,
.pgw-guide-panel p {
    margin: 2px 0 0;
    color: var(--theme-text-muted);
    font-size: .78rem;
    line-height: 1.45;
}
.pgw-cfg-placeholder {
    display: grid;
    place-items: center;
    min-height: 180px;
    color: var(--theme-text-muted);
    text-align: center;
}
.pgw-cfg-placeholder i {
    display: block;
    margin-bottom: 8px;
    font-size: 2rem;
    color: #94a3b8;
}
.pgw-active-switch {
    min-height: 100%;
    margin: 0;
}
.pgw-guide-card {
    position: sticky;
    top: 80px;
}
@media (max-width: 991px) {
    .pgw-guide-card { position: static; }
}

.report-shell {
    gap: 18px;
}
.report-filter-card {
    align-items: center;
    display: flex;
    justify-content: space-between;
    padding: 16px;
}
.report-filter-form {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.report-filter-form > div {
    min-width: 160px;
}
.report-kpi-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.report-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 2fr) minmax(280px, .85fr);
}
.report-grid-balanced {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.report-chart-card,
.report-side-card {
    min-height: 380px;
    padding: 15px;
}
.report-chart {
    min-height: 320px;
}
.report-donut-chart {
    align-items: center;
    display: flex;
}
.report-breakdown-list {
    display: grid;
    gap: 10px;
}
.report-breakdown-list > div,
.report-empty-mini {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    padding: 12px 14px;
}
.report-breakdown-list span {
    color: #202223;
    display: grid;
    font-weight: 600;
}
.report-breakdown-list small,
.report-empty-mini {
    color: #6b7280;
    font-size: 12px;
    font-weight: 500;
}
.report-breakdown-list strong {
    color: #111827;
    font-size: 14px;
    white-space: nowrap;
}
.report-empty-mini {
    justify-content: center;
    min-height: 48px;
    text-align: center;
}

.document-sequence-shell {
    max-width: 1280px;
}

.document-sequence-card .card-box-header {
    align-items: center;
    gap: 16px;
}

.document-sequence-table {
    min-width: 1040px;
}

.document-sequence-table th {
    white-space: nowrap;
}

.document-sequence-table td {
    vertical-align: top;
}

.document-sequence-table .form-control,
.document-sequence-table .form-select {
    min-height: 38px;
    font-size: 13px;
}

.document-sequence-name {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 190px;
}

.document-sequence-name > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    color: var(--theme-text);
    background: #f3f4f6;
    border: 1px solid var(--theme-border);
    border-radius: 7px;
    font-size: 17px;
}

.document-sequence-name strong,
.document-sequence-name small {
    display: block;
}

.document-sequence-name strong {
    color: var(--theme-text);
    font-size: 13px;
    font-weight: 700;
}

.document-sequence-name small,
.document-sequence-reset {
    color: var(--theme-muted);
    font-size: 12px;
}

.document-sequence-preview {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    color: var(--theme-text);
    background: #f9fafb;
    border: 1px solid var(--theme-border);
    border-radius: 7px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.document-sequence-reset {
    display: block;
    margin-top: 5px;
}

.system-health-shell {
    gap: 18px;
}

.system-health-overview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px;
    background: #ffffff;
    border: 1px solid var(--theme-border);
    border-radius: 8px;
}

.system-health-state {
    display: flex;
    align-items: center;
    gap: 14px;
}

.system-health-state > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 8px;
    font-size: 24px;
}

.system-health-status-healthy .system-health-state > span,
.system-health-check-healthy .system-health-check-icon {
    color: #047857;
    background: #ecfdf5;
}

.system-health-status-warning .system-health-state > span,
.system-health-check-warning .system-health-check-icon {
    color: #b45309;
    background: #fffbeb;
}

.system-health-status-critical .system-health-state > span,
.system-health-check-critical .system-health-check-icon {
    color: #b91c1c;
    background: #fef2f2;
}

.system-health-state p,
.system-health-state h2,
.system-health-state small {
    margin: 0;
}

.system-health-state p,
.system-health-env span,
.system-health-detail-list span {
    color: var(--theme-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.system-health-state h2 {
    margin-top: 2px;
    color: var(--theme-text);
    font-size: 22px;
    font-weight: 750;
}

.system-health-state small {
    display: block;
    margin-top: 4px;
    color: var(--theme-muted);
    font-size: 13px;
}

.system-health-env {
    display: grid;
    grid-template-columns: repeat(4, minmax(110px, 1fr));
    gap: 10px;
}

.system-health-env > div,
.system-health-detail-list > div {
    padding: 11px 12px;
    background: #f9fafb;
    border: 1px solid #eef2f7;
    border-radius: 7px;
}

.system-health-env strong,
.system-health-detail-list strong {
    display: block;
    margin-top: 3px;
    color: var(--theme-text);
    font-size: 13px;
    font-weight: 700;
    word-break: break-word;
}

.system-health-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
}

.system-health-stat {
    position: relative;
    overflow: hidden;
    min-width: 0;
    padding: 16px;
    background: #ffffff;
    border: 1px solid var(--theme-border);
    border-radius: 8px;
}

.system-health-stat::after {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: #111827;
}

.system-health-stat-green::after { background: #047857; }
.system-health-stat-blue::after { background: #2563eb; }
.system-health-stat-amber::after { background: #b45309; }
.system-health-stat-red::after { background: #b91c1c; }
.system-health-stat-slate::after { background: #475569; }

.system-health-stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 7px;
    color: #111827;
    background: #f3f4f6;
    font-size: 19px;
}

.system-health-stat-green .system-health-stat-icon { color: #047857; background: #ecfdf5; }
.system-health-stat-blue .system-health-stat-icon { color: #2563eb; background: #eff6ff; }
.system-health-stat-amber .system-health-stat-icon { color: #b45309; background: #fffbeb; }
.system-health-stat-red .system-health-stat-icon { color: #b91c1c; background: #fef2f2; }
.system-health-stat-slate .system-health-stat-icon { color: #475569; background: #f8fafc; }

.system-health-stat-pill {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 8px;
    color: var(--theme-muted);
    background: #f9fafb;
    border: 1px solid #eef2f7;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.system-health-stat p {
    margin: 12px 0 5px;
    color: var(--theme-muted);
    font-size: 13px;
    font-weight: 650;
}

.system-health-stat .dashboard-kpi-value {
    font-size: 24px;
}

.system-health-stat small {
    display: block;
    margin-top: 5px;
    color: var(--theme-muted);
    font-size: 12px;
}

.system-health-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.system-health-chart-wide {
    grid-column: span 2;
}

.system-health-chart-card {
    padding: 15px;
    min-height: 330px;
}

.system-health-chart {
    min-height: 260px;
}

.system-health-donut {
    display: flex;
    align-items: center;
    min-height: 260px;
}

.system-health-signal-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.system-health-signal {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
    padding: 13px;
    background: #ffffff;
    border: 1px solid var(--theme-border);
    border-radius: 8px;
}

.system-health-signal > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 7px;
    font-size: 18px;
}

.system-health-signal-healthy > span {
    color: #047857;
    background: #ecfdf5;
}

.system-health-signal-warning > span {
    color: #b45309;
    background: #fffbeb;
}

.system-health-signal p,
.system-health-signal strong,
.system-health-signal small {
    display: block;
    margin: 0;
}

.system-health-signal p {
    color: var(--theme-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.system-health-signal strong {
    margin-top: 3px;
    color: var(--theme-text);
    font-size: 18px;
    font-weight: 750;
}

.system-health-signal small {
    margin-top: 3px;
    color: var(--theme-muted);
    font-size: 12px;
}

.system-health-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, .8fr);
    gap: 18px;
}

.system-health-side {
    display: grid;
    align-content: start;
    gap: 18px;
}

.system-health-check-list,
.system-health-detail-list {
    display: grid;
    gap: 10px;
}

.system-health-check {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
    padding: 13px;
    background: #ffffff;
    border: 1px solid var(--theme-border);
    border-radius: 8px;
}

.system-health-check-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 7px;
    font-size: 20px;
}

.system-health-check-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.system-health-check-title strong {
    color: var(--theme-text);
    font-size: 14px;
}

.system-health-check-title span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 700;
}

.system-health-check-healthy .system-health-check-title span { color: #047857; }
.system-health-check-warning .system-health-check-title span { color: #b45309; }
.system-health-check-critical .system-health-check-title span { color: #b91c1c; }

.system-health-check p {
    margin: 4px 0 0;
    color: var(--theme-text);
    font-size: 13px;
}

.system-health-check small {
    display: block;
    margin-top: 3px;
    color: var(--theme-muted);
    font-size: 12px;
    word-break: break-word;
}

.system-health-extension-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.system-health-extension-grid span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.system-health-extension-grid .is-loaded {
    color: #047857;
    background: #ecfdf5;
}

.system-health-extension-grid .is-missing {
    color: #b91c1c;
    background: #fef2f2;
}

@media (max-width: 1199px) {
    .dashboard-finance-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .system-health-overview,
    .system-health-grid {
        grid-template-columns: 1fr;
    }

    .system-health-overview {
        align-items: stretch;
        flex-direction: column;
    }

    .system-health-env {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .system-health-signal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .dashboard-finance-strip {
        grid-template-columns: 1fr;
    }

    .system-health-env {
        grid-template-columns: 1fr;
    }

    .system-health-check-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .system-health-chart-grid,
    .system-health-signal-grid {
        grid-template-columns: 1fr;
    }

    .system-health-chart-wide {
        grid-column: auto;
    }
}

@media (max-width: 1199px) {
    .report-kpi-grid,
    .report-grid,
    .report-grid-balanced {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 767px) {
    .report-filter-card,
    .report-filter-form {
        align-items: stretch;
        flex-direction: column;
    }
    .report-filter-form > div,
    .report-filter-form .btn,
    .report-filter-card .role-count {
        width: 100%;
    }
    .report-kpi-grid,
    .report-grid,
    .report-grid-balanced {
        grid-template-columns: 1fr;
    }
}

/* Admin website management */
.admin-website-page {
    color: var(--theme-text, #111827);
}

.admin-website-page .container-fluid > .d-flex:first-child,
.admin-website-page .container-fluid > .row:first-child .d-flex {
    align-items: flex-start !important;
    gap: 16px;
    padding: 18px 20px;
    margin-bottom: 18px !important;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
}

.admin-website-page h4 {
    color: #111827;
    font-size: 18px;
    letter-spacing: 0;
}

.admin-website-page .text-muted,
.admin-website-page .form-text {
    color: #6b7280 !important;
}

.admin-website-page .btn-primary,
.admin-website-page .nav-tabs .nav-link.active {
    color: #fff !important;
    background: #111827 !important;
    border-color: #111827 !important;
}

.admin-website-page .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 8px 14px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.1;
    box-shadow: none !important;
    transition: color .16s ease, background-color .16s ease, border-color .16s ease, transform .16s ease;
}

.admin-website-page .btn-sm {
    min-height: 32px;
    padding: 7px 12px;
    font-size: 11px;
}

.admin-website-page .btn i {
    margin: 0 !important;
    font-size: 13px;
    line-height: 1;
}

.admin-website-page .btn-light,
.admin-website-page .btn-outline-secondary {
    color: #111827 !important;
    background: #fff !important;
    border-color: #d1d5db !important;
}

.admin-website-page .btn-light:hover,
.admin-website-page .btn-outline-secondary:hover {
    color: #fff !important;
    background: #111827 !important;
    border-color: #111827 !important;
    transform: translateY(-1px);
}

.admin-website-page .btn-primary:hover {
    background: #000 !important;
    border-color: #000 !important;
    transform: translateY(-1px);
}

.admin-website-page .btn-soft-primary,
.admin-website-page .badge-soft-primary {
    color: #111827 !important;
    background: #f3f4f6 !important;
    border: 1px solid #e5e7eb;
}

.admin-website-page .btn-soft-danger {
    color: #991b1b !important;
    background: #fef2f2 !important;
}

.admin-website-page .btn-soft-primary,
.admin-website-page .btn-soft-secondary,
.admin-website-page .btn-soft-danger {
    min-width: 32px;
    padding-left: 9px;
    padding-right: 9px;
}

.admin-website-page .btn-soft-primary:hover,
.admin-website-page .btn-soft-secondary:hover {
    color: #fff !important;
    background: #111827 !important;
    border-color: #111827 !important;
}

.admin-website-page .btn-soft-danger:hover {
    color: #fff !important;
    background: #991b1b !important;
    border-color: #991b1b !important;
}

.admin-website-page .card-body > .d-flex.flex-column.gap-2 .btn {
    justify-content: flex-start;
    width: 100%;
    min-height: 34px;
    padding: 9px 12px;
    color: #111827 !important;
    background: #f9fafb !important;
    border: 1px solid #e5e7eb !important;
}

.admin-website-page .card-body > .d-flex.flex-column.gap-2 .btn:hover {
    color: #fff !important;
    background: #111827 !important;
    border-color: #111827 !important;
}

.admin-website-page .card-box,
.admin-website-page .card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
}

.admin-website-page .card-body {
    padding: 18px;
}

.admin-website-page .table {
    color: #111827;
}

.admin-website-page .table thead.table-light th {
    color: #4b5563;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.admin-website-page .table td {
    border-color: #edf0f3;
    vertical-align: middle;
}

.admin-website-page .form-control,
.admin-website-page .form-select {
    border-color: #d1d5db;
    border-radius: 8px;
}

.admin-website-page .form-control:focus,
.admin-website-page .form-select:focus {
    border-color: #111827;
    box-shadow: 0 0 0 .15rem rgba(17, 24, 39, .10);
}

.admin-website-page .nav-tabs-custom {
    gap: 6px;
    border-bottom: 1px solid #e5e7eb;
}

.admin-website-page .nav-tabs-custom .nav-link {
    color: #4b5563;
    border: 1px solid transparent;
    border-radius: 8px 8px 0 0;
    font-weight: 700;
}

.admin-website-page .role-pagination {
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

.admin-website-page .custom-pagination-container {
    padding: 12px 16px;
    border-radius: 0 0 8px 8px;
    color: #4b5563;
}

.admin-website-page .custom-pagination-left,
.admin-website-page .custom-pagination-right {
    gap: 10px;
}

.admin-website-page .per-page-label,
.admin-website-page .range-info,
.admin-website-page .total-pages {
    color: #6b7280;
    font-size: 12px;
}

.admin-website-page .per-page-dropdown,
.admin-website-page .page-input {
    height: 32px !important;
    border-color: #d1d5db !important;
    border-radius: 7px !important;
    color: #111827 !important;
    background-color: #fff !important;
    font-size: 12px !important;
    font-weight: 700;
}

.admin-website-page .pagination-btn {
    min-height: 32px;
    padding: 7px 10px;
    color: #111827 !important;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 800;
}

.admin-website-page .pagination-btn:hover {
    color: #fff !important;
    background: #111827;
    border-color: #111827;
}

.admin-website-page .pagination-btn.disabled,
.admin-website-page .pagination-btn.disabled:hover {
    color: #9ca3af !important;
    background: #f9fafb;
    border-color: #e5e7eb;
}

@media (max-width: 767px) {
    .admin-website-page .custom-pagination-container,
    .admin-website-page .custom-pagination-left,
    .admin-website-page .custom-pagination-right {
        align-items: stretch;
        flex-direction: column;
    }
}
