:root {
    --hustle-green: #387d70;
    --hustle-green-dark: #2c665c;
    --hustle-gold-dark: #c58f2e;
    --hustle-gold: #deb751;
    --hustle-gold-light: #f6de83;
    --hustle-yellow: #fdba40;
    --hustle-grey: #bcbec0;
    --hustle-ink: #17211f;
    --hustle-muted: #697a76;
    --hustle-border: rgba(56, 125, 112, .14);
    --hustle-bg: #f7f8f5;
    --hustle-card: #ffffff;
    --hustle-radius: 20px;
    --hustle-shadow: 0 16px 42px rgba(23, 33, 31, .08);
    --hustle-gold-gradient: linear-gradient(120deg, #c58f2e 0%, #deb751 48%, #f6de83 100%);
    --hustle-green-gradient: linear-gradient(180deg, #387d70 0%, #2d665d 100%);
    --bs-primary: #387d70;
    --bs-primary-rgb: 56, 125, 112;
    --bs-link-color: #387d70;
    --bs-link-hover-color: #2c665c;
    --card-radius: var(--hustle-radius);
}

html {
    min-height: 100%;
}

body {
    background:
        radial-gradient(circle at top right, rgba(246, 222, 131, .38), transparent 34rem),
        radial-gradient(circle at bottom left, rgba(56, 125, 112, .10), transparent 30rem),
        var(--hustle-bg);
    color: var(--hustle-ink);
    min-height: 100vh;
    font-family: "Source Code Variable", "Source Code Pro", Arial, Helvetica, sans-serif;
    overflow-x: hidden;
}

.admin-shell {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 286px;
    min-height: 100vh;
    background: var(--hustle-green-gradient);
    color: #fff;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    padding: 1.1rem;
    z-index: 1040;
    transition: transform .24s ease;
    overflow-y: auto;
    box-shadow: 18px 0 40px rgba(23, 33, 31, .12);
}

.brand-wrap {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .35rem .25rem 1rem;
    margin-bottom: .65rem;
    border-bottom: 1px solid rgba(255,255,255,.12);
}

.brand-logo {
    width: 164px;
    max-width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 12px 22px rgba(0,0,0,.15));
}

.brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    background: var(--hustle-gold-gradient);
    color: var(--hustle-green);
    box-shadow: 0 18px 34px rgba(197, 143, 46, .26);
    font-weight: 900;
}

.brand-name {
    font-weight: 900;
    font-size: 1.08rem;
    letter-spacing: -.03em;
}

.brand-subtitle {
    color: rgba(255,255,255,.68);
    font-size: .76rem;
}

.sidebar-nav {
    gap: .18rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: .76rem;
    color: rgba(255,255,255,.78);
    border-radius: 15px;
    padding: .62rem .8rem;
    font-weight: 700;
    font-size: .92rem;
    transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

.sidebar-nav .nav-link i {
    width: 1.1rem;
    text-align: center;
    color: var(--hustle-gold-light);
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    background: rgba(255, 255, 255, .14);
    color: #fff;
    transform: translateX(2px);
}

.sidebar-footer {
    margin-top: 1rem;
    padding: .9rem;
    border-radius: 16px;
    background: rgba(255,255,255,.09);
    border: 1px solid rgba(255,255,255,.11);
}

.admin-main {
    flex: 1;
    margin-left: 286px;
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .9rem 1.25rem;
    background: rgba(247, 248, 245, .88);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--hustle-border);
}

.topbar-title-wrap {
    min-width: 0;
}

.page-title {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: clamp(1.25rem, 2vw, 1.82rem);
    font-weight: 900;
    letter-spacing: -.035em;
    color: var(--hustle-ink);
}

.page-subtitle {
    color: var(--hustle-muted);
    font-size: .88rem;
    margin-top: .1rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-width: 0;
}

.topbar-icon-btn,
.sidebar-toggle {
    width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 14px;
}

.btn {
    border-radius: 14px;
    font-weight: 800;
}

.btn-primary,
.btn-dark {
    background: var(--hustle-green);
    border-color: var(--hustle-green);
    color: #fff;
}

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

.btn-outline-primary,
.btn-outline-dark {
    color: var(--hustle-green);
    border-color: rgba(56, 125, 112, .44);
}

.btn-outline-primary:hover,
.btn-outline-dark:hover {
    background: var(--hustle-green);
    border-color: var(--hustle-green);
    color: #fff;
}

.btn-gold {
    background: var(--hustle-gold-gradient);
    border: 0;
    color: #1f211a;
    box-shadow: 0 12px 24px rgba(197, 143, 46, .22);
}

.account-dropdown {
    max-width: 260px;
    display: flex;
    align-items: center;
    border-radius: 14px;
}

.account-email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-content {
    padding: 1.25rem;
}

.content-card,
.metric-card,
.empty-state,
.login-card,
.stat-strip,
.modern-table-wrap {
    background: rgba(255, 255, 255, .92);
    border: 1px solid var(--hustle-border);
    border-radius: var(--hustle-radius);
    box-shadow: var(--hustle-shadow);
}

.content-card {
    padding: 1.15rem;
    margin-bottom: 1.15rem;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-heading h2,
.section-heading h3 {
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 900;
    letter-spacing: -.025em;
}

.section-eyebrow {
    color: var(--hustle-green);
    font-size: .74rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.notice-card {
    background: linear-gradient(135deg, rgba(56, 125, 112, .10), rgba(246, 222, 131, .22));
    border-left: 5px solid var(--hustle-green);
}

.metric-card {
    position: relative;
    overflow: hidden;
    padding: 1.15rem;
    height: 100%;
    min-height: 126px;
}

.metric-card::after {
    content: "";
    position: absolute;
    right: -24px;
    bottom: -28px;
    width: 90px;
    height: 90px;
    border-radius: 999px;
    background: rgba(246, 222, 131, .32);
}

.metric-label {
    color: var(--hustle-muted);
    font-weight: 900;
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .065em;
}

.metric-value {
    font-family: Arial, Helvetica, sans-serif;
    font-size: clamp(1.52rem, 4vw, 2.35rem);
    font-weight: 900;
    letter-spacing: -.05em;
}

.metric-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: rgba(56, 125, 112, .10);
    color: var(--hustle-green);
    position: relative;
    z-index: 1;
}

.dashboard-panel-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .85rem;
}

.dashboard-mini-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    padding: .9rem;
    border: 1px solid var(--hustle-border);
    border-radius: 16px;
    background: #fff;
    min-height: 76px;
}

.dashboard-mini-card .label {
    font-size: .82rem;
    color: var(--hustle-muted);
    font-weight: 800;
}

.dashboard-mini-card .value {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--hustle-ink);
}

.dashboard-mini-card .icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: rgba(253, 186, 64, .22);
    color: var(--hustle-gold-dark);
}

.quick-filter-bar {
    background: rgba(56, 125, 112, .055);
    border: 1px solid rgba(56, 125, 112, .10);
    border-radius: 18px;
    padding: .95rem;
}

.form-label {
    font-size: .79rem;
    font-weight: 900;
    color: var(--hustle-ink);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.form-control,
.form-select {
    border-radius: 14px;
    border-color: rgba(56, 125, 112, .20);
    min-height: 44px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--hustle-green);
    box-shadow: 0 0 0 .22rem rgba(56, 125, 112, .15);
}

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

.modern-table-wrap {
    padding: .35rem;
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    vertical-align: middle;
    padding: .9rem .85rem;
}

.table thead th {
    white-space: nowrap;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--hustle-muted);
    background: #f5f7f3;
    border-bottom: 1px solid var(--hustle-border);
}

.table tbody td {
    border-color: rgba(56, 125, 112, .08);
}

.table-hover tbody tr:hover td {
    background: rgba(246, 222, 131, .14);
}

.table thead input,
.table thead select {
    min-width: 100px;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
}

.badge {
    border-radius: 999px;
    padding: .45rem .62rem;
    font-weight: 900;
}

.badge.text-bg-success,
.badge.bg-success {
    background-color: rgba(56, 125, 112, .14) !important;
    color: var(--hustle-green) !important;
}

.badge.text-bg-warning,
.badge.bg-warning {
    background-color: rgba(253, 186, 64, .22) !important;
    color: #7a500d !important;
}

.badge.text-bg-danger,
.badge.bg-danger {
    background-color: rgba(214, 69, 65, .12) !important;
    color: #b7332f !important;
}

.badge.text-bg-secondary,
.badge.bg-secondary {
    background-color: rgba(188, 190, 192, .28) !important;
    color: #4b5563 !important;
}

.empty-state {
    padding: 2.2rem 1.25rem;
    text-align: center;
    color: var(--hustle-muted);
}

.empty-state i {
    font-size: 2.4rem;
    color: var(--hustle-green);
    opacity: .62;
}

.empty-state h5 {
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 900;
    color: var(--hustle-ink);
    margin-top: .8rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
    gap: 1rem;
    align-items: start;
}

.detail-panel {
    border: 1px solid var(--hustle-border);
    border-radius: 18px;
    padding: 1rem;
    background: #fff;
    min-width: 0;
    overflow: hidden;
}

.detail-panel h3 {
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 900;
    color: var(--hustle-green);
}

.key-value-table {
    table-layout: fixed;
    width: 100%;
    margin-bottom: 0;
}

.key-value-table th,
.key-value-table td {
    word-break: normal;
    overflow-wrap: normal;
    vertical-align: middle;
}

.key-value-table th,
.key-value-table .key-value-label {
    color: var(--hustle-muted);
    width: 42%;
    max-width: 160px;
    font-size: .78rem;
}

.key-value-table td,
.key-value-table .key-value-cell {
    min-width: 0;
}

.key-value-text {
    display: block;
    max-width: 100%;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.action-card {
    border: 1px dashed rgba(56, 125, 112, .32);
    border-radius: 18px;
    padding: 1rem;
    background: rgba(246, 222, 131, .12);
}

.remote-modal-loader {
    min-height: 210px;
    display: grid;
    place-items: center;
}

.modal-content {
    border-radius: 24px;
    border: 1px solid var(--hustle-border);
    box-shadow: 0 24px 80px rgba(23, 33, 31, .24);
}

.modal-header {
    border-bottom-color: var(--hustle-border);
    background: linear-gradient(135deg, rgba(56, 125, 112, .08), rgba(246, 222, 131, .18));
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
}

.modal-title {
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 900;
}

.modal-footer {
    border-top-color: var(--hustle-border);
}

#remoteDetailModal .modal-body {
    overflow-x: hidden;
}

/* Keep KYC/profile detail cards wide enough so values such as email, phone and IDs do not stack one character per line. */
@media (min-width: 1200px) {
    #remoteDetailModal .detail-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.chat-window {
    height: 480px;
    overflow-y: auto;
    background: rgba(56, 125, 112, .06);
    border: 1px solid var(--hustle-border);
    border-radius: 1.15rem;
    padding: 1rem;
}

.chat-message {
    max-width: 84%;
    margin-bottom: .875rem;
    padding: .8rem .95rem;
    border-radius: 1.1rem;
    box-shadow: 0 8px 22px rgba(23, 33, 31, .06);
}

.chat-message.bot {
    background: #fff;
    border: 1px solid var(--hustle-border);
}

.chat-message.user {
    background: var(--hustle-green);
    color: #fff;
    margin-left: auto;
}

.schema-grid,
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.schema-card,
.config-card {
    border: 1px solid var(--hustle-border);
    border-radius: 18px;
    padding: 1rem;
    background: #fff;
}

.mobile-record-list {
    display: none;
}

.mobile-record-card {
    border: 1px solid var(--hustle-border);
    border-radius: 18px;
    background: #fff;
    padding: 1rem;
    margin-bottom: .875rem;
    box-shadow: 0 10px 26px rgba(23, 33, 31, .06);
}

.mobile-record-title {
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 900;
    font-size: 1rem;
    line-height: 1.24;
    word-break: break-word;
}

.mobile-record-subtitle {
    color: var(--hustle-muted);
    font-size: .84rem;
    word-break: break-word;
}

.mobile-record-field {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-top: 1px solid rgba(56, 125, 112, .10);
    padding: .62rem 0;
}

.mobile-record-field:first-child {
    border-top: 0;
}

.mobile-record-label {
    color: var(--hustle-muted);
    font-size: .75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
    flex: 0 0 38%;
}

.mobile-record-value {
    text-align: right;
    min-width: 0;
    word-break: break-word;
}

.mobile-record-actions {
    display: grid;
    gap: .5rem;
    margin-top: .85rem;
}

.mobile-record-actions .btn,
.mobile-record-actions form,
.mobile-record-actions .dropdown,
.mobile-record-actions .btn-group {
    width: 100%;
}

.mobile-record-actions .btn {
    display: block;
}

.dataTables_wrapper .dt-search input,
.dt-container .dt-search input,
.dt-container .dt-length select {
    border-radius: 12px;
    border-color: rgba(56, 125, 112, .24);
}

.dt-container .dt-paging .dt-paging-button.current,
.dt-container .dt-paging .dt-paging-button.current:hover {
    background: var(--hustle-green) !important;
    color: #fff !important;
    border-color: var(--hustle-green) !important;
}

.login-page {
    background:
        radial-gradient(circle at top left, rgba(246, 222, 131, .42), transparent 34rem),
        var(--hustle-green-gradient);
    min-height: 100vh;
}

.login-card {
    padding: 2rem;
    max-width: 460px;
    width: 100%;
}

@media (max-width: 991.98px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    .admin-sidebar.show {
        transform: translateX(0);
    }
    .admin-main {
        margin-left: 0;
    }
}

.sidebar-backdrop {
    display: none;
}

@media (max-width: 767.98px) {
    .admin-sidebar {
        width: min(86vw, 320px);
        padding: .95rem;
    }
    .admin-sidebar.show + .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(23, 33, 31, .46);
        z-index: 1035;
    }
    .brand-wrap {
        margin-bottom: .7rem;
    }
    .brand-logo {
        width: 146px;
    }
    .sidebar-nav .nav-link {
        border-radius: 12px;
        padding: .64rem .72rem;
        font-size: .9rem;
    }
    .topbar {
        gap: .55rem;
        padding: .7rem .82rem;
        min-height: 64px;
    }
    .topbar-title-wrap {
        flex: 1 1 auto;
        min-width: 0;
    }
    .page-title {
        font-size: 1.08rem;
        line-height: 1.1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    .page-subtitle {
        display: none;
    }
    .topbar-actions {
        gap: .35rem;
        flex: 0 0 auto;
    }
    .topbar-icon-btn {
        width: 40px;
        height: 40px;
        padding: 0;
    }
    .account-dropdown {
        width: 42px;
        height: 40px;
        padding: 0;
        justify-content: center;
    }
    .account-dropdown .account-email,
    .account-dropdown::after {
        display: none;
    }
    .page-content {
        padding: .85rem;
    }
    .content-card,
    .metric-card,
    .login-card {
        border-radius: 18px;
        padding: .95rem;
    }
    .section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: .7rem;
    }
    .quick-filter-bar {
        padding: .875rem;
    }
    .desktop-table-wrap {
        display: none !important;
    }
    .mobile-record-list {
        display: block;
    }
    .dataTables_wrapper,
    .dt-container {
        display: none !important;
    }
    .detail-grid {
        grid-template-columns: 1fr;
    }
    .detail-panel {
        padding: .875rem;
        border-radius: .9rem;
    }
    .modal-dialog {
        margin: .55rem;
    }
    .modal-content,
    .modal-header {
        border-radius: 18px;
    }
    .key-value-table,
    .key-value-table tbody,
    .key-value-table tr,
    .key-value-table th,
    .key-value-table td {
        display: block;
        width: 100% !important;
    }
    .key-value-table tr {
        border-bottom: 1px solid rgba(56, 125, 112, .10);
        padding: .65rem 0;
    }
    .key-value-table th {
        padding-bottom: .15rem;
        font-size: .74rem;
        text-transform: uppercase;
        letter-spacing: .04em;
    }
    .key-value-table td {
        padding-top: .15rem;
    }
    .key-value-text {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        overflow-wrap: anywhere;
    }
    .mobile-record-field {
        align-items: flex-start;
    }
}

@media (min-width: 768px) {
    .desktop-table-wrap {
        display: block;
    }
}

[data-bs-theme="dark"] {
    --hustle-bg: #0e1514;
    --hustle-card: #121d1b;
    --hustle-ink: #e8f0ec;
    --hustle-muted: #a2b5af;
    --hustle-border: rgba(246, 222, 131, .16);
}

[data-bs-theme="dark"] body {
    background: #0e1514;
    color: var(--hustle-ink);
}

[data-bs-theme="dark"] .content-card,
[data-bs-theme="dark"] .metric-card,
[data-bs-theme="dark"] .empty-state,
[data-bs-theme="dark"] .login-card,
[data-bs-theme="dark"] .modern-table-wrap,
[data-bs-theme="dark"] .dashboard-mini-card,
[data-bs-theme="dark"] .detail-panel,
[data-bs-theme="dark"] .mobile-record-card,
[data-bs-theme="dark"] .config-card,
[data-bs-theme="dark"] .schema-card {
    background: #121d1b;
}

[data-bs-theme="dark"] .topbar {
    background: rgba(14, 21, 20, .88);
}

[data-bs-theme="dark"] .table thead th {
    background: #182522;
}

[data-bs-theme="dark"] .chat-window {
    background: #0f1917;
}

[data-bs-theme="dark"] .chat-message.bot {
    background: #14201d;
}

/* Reliable client-side table controls: works without CDN/DataTables and on mobile cards. */
.table-shell {
    display: grid;
    gap: 1rem;
}
.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    padding: .75rem;
    border: 1px solid rgba(56, 125, 112, .12);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(246, 222, 131, .18), rgba(255, 255, 255, .72));
}
.table-search-wrap {
    position: relative;
    min-width: min(100%, 280px);
    flex: 1 1 280px;
}
.table-search-wrap .bi {
    position: absolute;
    left: .8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--hustle-muted);
    pointer-events: none;
}
.table-search-wrap .form-control {
    padding-left: 2.25rem;
    border-radius: 999px;
}
.table-page-size {
    width: 86px;
    border-radius: 999px;
}
.table-pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    padding-top: .25rem;
}
.table-pagination-bar .pagination {
    gap: .25rem;
}
.table-pagination-bar .page-link {
    border-radius: 999px !important;
    color: var(--hustle-green);
    border-color: rgba(56, 125, 112, .16);
    min-width: 2rem;
    text-align: center;
}
.table-pagination-bar .page-item.active .page-link {
    background: var(--hustle-green);
    border-color: var(--hustle-green);
    color: #fff;
}
.table-empty-filtered {
    margin: 0;
}
.error-state {
    border-color: rgba(220, 53, 69, .18);
    background: rgba(220, 53, 69, .05);
}
.error-state .bi {
    color: #dc3545;
}
.remote-modal-loader {
    min-height: 260px;
}
@media (max-width: 575.98px) {
    .table-toolbar {
        align-items: stretch;
    }
    .table-toolbar > * {
        width: 100%;
    }
    .table-pagination-bar {
        justify-content: center;
        text-align: center;
    }
    .table-pagination-bar nav,
    .table-pagination-bar .pagination {
        width: 100%;
        justify-content: center;
    }
}
[data-bs-theme="dark"] .table-toolbar {
    background: linear-gradient(180deg, rgba(56, 125, 112, .18), rgba(18, 29, 27, .92));
    border-color: rgba(246, 222, 131, .14);
}
[data-bs-theme="dark"] .table-pagination-bar .page-link {
    background: #121d1b;
    border-color: rgba(246, 222, 131, .16);
    color: var(--hustle-gold-light);
}
[data-bs-theme="dark"] .table-pagination-bar .page-item.active .page-link {
    background: var(--hustle-gold);
    border-color: var(--hustle-gold);
    color: #15221f;
}


/* Final polish: desktop tables must scroll horizontally instead of clipping columns. */
@media (min-width: 768px) {
    .modern-table-wrap.desktop-table-wrap,
    .desktop-table-wrap.table-responsive {
        overflow-x: auto !important;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-gutter: stable both-edges;
    }
    .desktop-table-wrap table {
        min-width: 860px;
    }
    .desktop-table-wrap::-webkit-scrollbar {
        height: 10px;
    }
    .desktop-table-wrap::-webkit-scrollbar-track {
        background: rgba(56, 125, 112, .08);
        border-radius: 999px;
    }
    .desktop-table-wrap::-webkit-scrollbar-thumb {
        background: rgba(56, 125, 112, .42);
        border-radius: 999px;
    }
    .desktop-table-wrap::-webkit-scrollbar-thumb:hover {
        background: rgba(56, 125, 112, .62);
    }
}

/* Keep intro cards close to the working area so pages do not look empty. */
.notice-card {
    margin-bottom: .9rem;
}
.notice-card + .row,
.notice-card + .content-card,
.notice-card + .table-shell {
    margin-top: 0 !important;
}

/* Cleaner logo sizing after switching to the simple dollar brand mark. */
.brand-logo {
    width: 152px;
}
@media (max-width: 767.98px) {
    .brand-logo { width: 138px; }
}


/* Feedback patch: safer spacing so cards never visually stick together. */
.row + .row,
.content-card + .content-card,
.metric-card + .metric-card,
.modern-table-wrap + .content-card,
.content-card + .row {
    margin-top: 1.25rem;
}
.content-card,
.metric-card,
.dashboard-mini-card,
.mobile-record-card,
.detail-panel {
    overflow-wrap: break-word;
}
.media-preview {
    display: grid;
    gap: .45rem;
    max-width: 220px;
}
.media-preview img {
    width: 100%;
    max-height: 160px;
    object-fit: contain;
    border-radius: 14px;
    border: 1px solid var(--hustle-border);
    background: #fff;
    padding: .25rem;
}
[data-bs-theme="dark"] .media-preview img {
    background: #0f1917;
}


/* Admin role permissions and tighter messaging layout. */
.permission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: .65rem;
}
.permission-pill {
    display: flex;
    align-items: center;
    gap: .55rem;
    border: 1px solid rgba(56, 125, 112, .18);
    border-radius: 14px;
    padding: .68rem .78rem;
    background: rgba(255, 255, 255, .78);
    font-weight: 800;
    min-width: 0;
}
.permission-pill span {
    min-width: 0;
    overflow-wrap: break-word;
}
.permission-pill input {
    flex: 0 0 auto;
}
.page-content > .content-card + .row,
.page-content > .alert + .row {
    margin-top: 0;
}
.content-card.notice-card {
    margin-bottom: 1rem;
}


/* Text wrapping fix: keep labels, buttons, names, and compact status text from splitting mid-word. */
.btn,
.badge,
.dropdown-item,
.dropdown-item-text,
.form-check-label,
.table-page-size,
.table-pagination-bar .page-link {
    white-space: nowrap;
}
.btn:not(.w-100):not(.flex-fill) {
    min-width: fit-content;
}
.sidebar-nav .nav-link {
    min-width: 0;
}
.sidebar-nav .nav-link span,
.account-email {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.account-dropdown {
    min-width: fit-content;
}
.admin-table-cell {
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.admin-table-cell .badge,
.admin-table-cell a:not(.btn) {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
}
.admin-action-cell {
    min-width: fit-content;
    white-space: nowrap;
}
.mobile-record-title,
.mobile-record-subtitle {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: normal;
}
.mobile-record-actions .btn {
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 767.98px) {
    .quick-filter-bar .d-flex {
        flex-wrap: wrap;
    }
    .admin-table-cell {
        max-width: none;
    }
}
