:root {
    --admin-font: "Cairo", system-ui, -apple-system, "Segoe UI", sans-serif;
    --admin-sidebar: #142033;
    --admin-sidebar-soft: #1e314a;
    --admin-text: #182230;
    --admin-muted: #667085;
    --admin-border: #d8e0ea;
    --admin-bg: #f3f6fa;
    --admin-panel: #ffffff;
    --admin-accent: #3b7cf7;
    --admin-success: #198754;
    --admin-warning: #b58105;
    --admin-danger: #c73434;
    --admin-teal: #0f9f9a;
    --admin-shadow: 0 12px 28px rgba(24, 34, 48, .07);
    --bs-body-font-family: var(--admin-font);
}

html,
body {
    min-height: 100%;
}

body {
    color: var(--admin-text);
    background: var(--admin-bg);
    font-family: var(--admin-font);
    font-size: 14px;
    text-rendering: optimizeLegibility;
}

.admin-shell {
    display: flex;
}

.admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 272px;
    padding: 18px 14px;
    background:
        linear-gradient(180deg, #142033 0%, #17253a 62%, #101a29 100%);
    color: #fff;
    overflow-y: auto;
    z-index: 20;
}

.admin-sidebar-brand {
    display: flex;
    gap: 12px;
    align-items: center;
    color: #fff;
    text-decoration: none;
    padding: 6px 8px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .10);
    margin-bottom: 12px;
}

.admin-sidebar-brand small {
    display: block;
    color: rgba(255, 255, 255, .68);
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-brand-mark {
    display: inline-grid;
    place-items: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--admin-accent), var(--admin-teal));
    color: #fff;
    font-weight: 800;
    letter-spacing: 0;
    overflow: hidden;
}

.admin-brand-mark.has-logo {
    background: #fff;
    border: 1px solid rgba(255, 255, 255, .25);
    padding: 4px;
}

.admin-brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.admin-nav {
    display: grid;
    gap: 12px;
}

.admin-nav-section {
    display: grid;
    gap: 3px;
}

.admin-nav-heading {
    display: block;
    min-height: 30px;
    padding: 5px 11px;
    color: rgba(255, 255, 255, .44);
    background: transparent;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
    line-height: 1.2;
    text-align: left;
    text-transform: uppercase;
}

.admin-nav-section.has-active .admin-nav-heading {
    color: rgba(255, 255, 255, .86);
}

.admin-nav-items {
    display: grid;
    gap: 3px;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 8px 11px;
    color: rgba(255, 255, 255, .76);
    text-decoration: none;
    border-radius: 6px;
}

.admin-nav a:hover,
.admin-nav a.active {
    color: #fff;
    background: var(--admin-sidebar-soft);
    box-shadow: inset 3px 0 0 var(--admin-teal);
}

.admin-nav i {
    width: 18px;
    text-align: center;
}

.admin-main {
    width: 100%;
    min-height: 100vh;
    margin-left: 272px;
}

.admin-topbar {
    min-height: 78px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 18px 24px;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--admin-border);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.admin-topbar h1 {
    font-size: 22px;
    margin: 0;
}

.admin-breadcrumb {
    color: var(--admin-muted);
    font-size: 12px;
    margin-bottom: 2px;
}

.admin-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-user-menu {
    position: relative;
}

.admin-user-button {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    padding: 5px 10px 5px 6px;
    color: var(--admin-text);
    background: #fff;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(24, 34, 48, .05);
}

.admin-user-button:hover,
.admin-user-button.show {
    color: var(--admin-text);
    border-color: rgba(59, 124, 247, .45);
    box-shadow: 0 10px 24px rgba(59, 124, 247, .13);
}

.admin-user-avatar {
    display: inline-grid;
    place-items: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    color: #fff;
    background: linear-gradient(135deg, var(--admin-accent), var(--admin-teal));
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
}

.admin-user-avatar-lg {
    flex-basis: 42px;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    font-size: 15px;
}

.admin-user-button-label {
    display: grid;
    min-width: 0;
    text-align: left;
    line-height: 1.1;
}

.admin-user-button-label strong {
    max-width: 145px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.admin-user-button-label small {
    color: var(--admin-muted);
    font-size: 11px;
}

.admin-user-dropdown {
    width: 304px;
    padding: 8px;
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    box-shadow: var(--admin-shadow);
}

.admin-user-dropdown-head {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 8px 8px 10px;
}

.admin-user-dropdown-head span:last-child {
    display: grid;
    min-width: 0;
}

.admin-user-dropdown-head strong,
.admin-user-dropdown-head small,
.admin-user-dropdown-head em {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-user-dropdown-head small,
.admin-user-dropdown-head em {
    color: var(--admin-muted);
    font-size: 12px;
    font-style: normal;
}

.admin-user-dropdown .dropdown-header {
    padding: 4px 8px 6px;
    color: var(--admin-muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.admin-user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 7px 8px;
    border-radius: 8px;
}

.admin-user-menu-item i {
    display: inline-grid;
    place-items: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    color: var(--admin-accent);
    background: rgba(59, 124, 247, .10);
    border-radius: 7px;
}

.admin-user-menu-item span {
    display: grid;
    min-width: 0;
}

.admin-user-menu-item strong,
.admin-user-menu-item small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-user-menu-item strong {
    font-size: 13px;
}

.admin-user-menu-item small {
    color: var(--admin-muted);
    font-size: 11px;
}

.admin-user-menu-item.text-danger i {
    color: var(--admin-danger);
    background: rgba(199, 52, 52, .10);
}

.admin-global-search {
    position: relative;
    width: min(520px, 42vw);
}

.admin-global-search .input-group-text {
    background: #fff;
}

.admin-global-search-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(720px, 88vw);
    max-height: 72vh;
    overflow: auto;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    box-shadow: var(--admin-shadow);
    z-index: 40;
}

.admin-global-search-loading {
    color: var(--admin-muted);
    padding: 12px;
}

.admin-global-result {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid transparent;
}

.admin-global-result + .admin-global-result {
    border-top-color: #eef2f7;
}

.admin-global-result:hover {
    background: #f8fafc;
    border-color: #e7edf5;
}

.admin-global-result-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: var(--admin-accent);
    background: rgba(59, 124, 247, .09);
    border-radius: 8px;
}

.admin-global-result-main {
    min-width: 0;
}

.admin-global-result-meta,
.admin-global-result-subtitle,
.admin-global-result-matches {
    color: var(--admin-muted);
    font-size: 12px;
}

.admin-global-result-title {
    display: inline-block;
    color: var(--admin-text);
    font-weight: 900;
    text-decoration: none;
}

.admin-global-result-title:hover {
    color: var(--admin-accent);
}

.admin-global-result-subtitle {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-global-result-matches {
    display: grid;
    gap: 3px;
    margin-top: 6px;
}

.admin-global-result-matches span {
    color: #344054;
    font-weight: 800;
}

.admin-global-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.admin-global-view-all {
    display: block;
    padding: 10px;
    margin-top: 4px;
    color: var(--admin-accent);
    font-weight: 900;
    text-align: center;
    text-decoration: none;
    border-top: 1px solid #eef2f7;
}

.admin-global-search-form {
    max-width: 980px;
}

.admin-global-search-results {
    display: grid;
    gap: 8px;
}

.admin-global-search-results .admin-global-result {
    border: 1px solid #e7edf5;
}

.admin-global-detail-grid {
    display: grid;
    gap: 8px;
}

.admin-global-detail-row {
    display: grid;
    grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
    gap: 12px;
    padding: 10px;
    background: #f8fafc;
    border: 1px solid #edf1f6;
    border-radius: 8px;
}

.admin-global-detail-key {
    color: var(--admin-muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.admin-global-detail-value {
    min-width: 0;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.admin-content {
    padding: 24px;
}

.admin-panel,
.metric-tile,
.report-tile,
.admin-login-card {
    background: var(--admin-panel);
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(16, 32, 51, .04);
}

.admin-panel {
    padding: 18px;
    transition: box-shadow .18s ease, border-color .18s ease;
}

.admin-page-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 12px;
}

.admin-module-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.admin-module-search {
    width: min(420px, 100%);
}

.admin-panel:hover,
.metric-tile:hover,
.report-tile:hover {
    border-color: #cbd6e3;
    box-shadow: var(--admin-shadow);
}

.metric-tile {
    padding: 16px;
    min-height: 104px;
    position: relative;
    overflow: hidden;
}

.metric-tile::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--admin-accent), var(--admin-teal), var(--admin-warning));
}

.metric-tile span {
    display: block;
    color: var(--admin-muted);
    font-size: 12px;
    margin-bottom: 10px;
}

.metric-tile strong {
    display: block;
    font-size: 24px;
    line-height: 1.15;
    letter-spacing: 0;
}

.report-tile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 72px;
    padding: 14px 16px;
}

.admin-profile-summary {
    text-align: center;
}

.admin-profile-avatar {
    display: inline-grid;
    place-items: center;
    width: 78px;
    height: 78px;
    margin-bottom: 14px;
    color: #fff;
    background: linear-gradient(135deg, var(--admin-accent), var(--admin-teal));
    border-radius: 18px;
    font-size: 30px;
    font-weight: 900;
}

.admin-password-panel {
    max-width: 860px;
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #edf1f6;
}

.settings-eyebrow {
    display: block;
    color: var(--admin-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.settings-overview {
    display: grid;
    gap: 22px;
    padding: 0;
}

.settings-overview-section {
    display: grid;
    gap: 10px;
}

.settings-overview-section + .settings-overview-section {
    padding-top: 18px;
    border-top: 1px solid #edf1f6;
}

.settings-overview-heading {
    color: var(--admin-muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.settings-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.settings-overview-tile {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 72px;
    padding: 12px;
    color: var(--admin-text);
    text-align: left;
    text-decoration: none;
    background: #fff;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background-color .16s ease;
}

.settings-overview-tile i {
    display: inline-grid;
    place-items: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    color: #fff;
    font-size: 18px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--admin-accent), var(--admin-teal));
}

.settings-overview-tile strong,
.settings-overview-tile small {
    display: block;
}

.settings-overview-tile strong {
    font-size: 14px;
    line-height: 1.25;
}

.settings-overview-tile small {
    color: var(--admin-muted);
    margin-top: 3px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-overview-tile:hover,
.settings-overview-tile:focus-visible {
    color: var(--admin-text);
    background: #f8fbff;
    border-color: rgba(59, 124, 247, .36);
    box-shadow: 0 8px 20px rgba(24, 34, 48, .07);
    transform: translateY(-1px);
    outline: 0;
}

@media (max-width: 1199.98px) {
    .settings-overview-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .settings-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .settings-overview-grid {
        grid-template-columns: 1fr;
    }
}

.settings-detail-title {
    padding-top: 16px;
}

.settings-tab-content {
    padding-top: 18px;
}

.settings-section h3 {
    font-size: 15px;
    margin: 0 0 14px;
}

.settings-color-field {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 8px;
}

.settings-color-field .form-control-color {
    width: 52px;
    min-height: 42px;
    padding: 4px;
}

.settings-logo-upload {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.settings-logo-preview {
    width: 96px;
    height: 96px;
    object-fit: contain;
    padding: 8px;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    background: #fff;
}

.settings-logo-fields {
    display: grid;
    gap: 8px;
}

.customer-crm-layout {
    display: grid;
    grid-template-columns: minmax(260px, 310px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.customer-crm-sidebar {
    position: sticky;
    top: 100px;
    display: grid;
    gap: 14px;
    padding: 16px;
}

.customer-crm-identity {
    display: grid;
    justify-items: center;
    gap: 9px;
    padding-bottom: 14px;
    text-align: center;
    border-bottom: 1px solid #edf1f6;
}

.customer-crm-identity h2 {
    max-width: 100%;
    margin: 0;
    font-size: 20px;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.customer-crm-contact {
    display: grid;
    gap: 8px;
}

.customer-crm-detail {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    column-gap: 8px;
    align-items: center;
    min-width: 0;
    padding: 8px 0;
    border-bottom: 1px solid #f0f3f7;
}

.customer-crm-detail i {
    grid-row: span 2;
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    color: var(--admin-accent);
    border-radius: 8px;
    background: rgba(59, 124, 247, .09);
}

.customer-crm-detail span,
.customer-crm-stat span {
    color: var(--admin-muted);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.customer-crm-detail strong {
    min-width: 0;
    color: var(--admin-text);
    font-size: 13px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.customer-crm-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.customer-crm-stat {
    min-width: 0;
    padding: 10px;
    border: 1px solid #edf1f6;
    border-radius: 8px;
    background: #f8fafc;
}

.customer-crm-stat strong {
    display: block;
    min-width: 0;
    margin-top: 4px;
    color: var(--admin-text);
    font-size: 15px;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.customer-crm-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.customer-crm-actions .btn {
    justify-content: center;
}

.customer-crm-main {
    min-width: 0;
}

.customer-crm-edit-card .form-label {
    margin-bottom: 4px;
    color: var(--admin-muted);
    font-size: 12px;
    font-weight: 800;
}

.customer-compact-form .form-control,
.customer-compact-form .form-select,
.customer-compact-form .select2-container--bootstrap-5 .select2-selection {
    min-height: 40px;
}

.customer-profile-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px;
}

.customer-profile-main {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.customer-avatar {
    display: inline-grid;
    place-items: center;
    flex: 0 0 82px;
    width: 82px;
    height: 82px;
    color: #fff;
    font-size: 30px;
    font-weight: 900;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--admin-accent), var(--admin-teal));
    box-shadow: 0 14px 28px rgba(59, 124, 247, .20);
    overflow: hidden;
}

.customer-avatar.customer-avatar-lg {
    flex-basis: 92px;
    width: 92px;
    height: 92px;
    font-size: 34px;
}

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

.customer-profile-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.customer-profile-workspace {
    padding: 0;
    overflow: hidden;
}

.customer-profile-tabs {
    gap: 8px;
    padding: 14px;
    border-bottom: 1px solid var(--admin-border);
    background: #f8fafc;
}

.customer-profile-tabs .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 42px;
    color: #344054;
    font-weight: 850;
    border: 1px solid transparent;
    border-radius: 8px;
}

.customer-profile-tabs .nav-link:hover {
    color: var(--admin-accent);
    border-color: rgba(59, 124, 247, .22);
    background: #fff;
}

.customer-profile-tabs .nav-link.active {
    color: var(--admin-accent);
    border-color: rgba(59, 124, 247, .28);
    background: rgba(59, 124, 247, .10);
}

.customer-profile-tab-content {
    padding: 16px;
}

.customer-profile-card {
    min-height: 100%;
    padding: 16px;
    border: 1px solid #edf1f6;
    border-radius: 8px;
    background: #fff;
}

.customer-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.customer-field-grid-compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.customer-profile-modal .modal-body {
    background: #f8fafc;
}

.customer-profile-modal .customer-field-grid > div,
.customer-profile-modal .customer-related-table,
.customer-profile-modal .customer-record-card {
    background: #fff;
}

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

.customer-field-grid > div {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    background: #fff;
}

.customer-field-grid span {
    display: block;
    color: var(--admin-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.customer-field-grid strong {
    display: block;
    min-width: 0;
    margin-top: 4px;
    color: var(--admin-text);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.customer-profile-table {
    font-size: 13px;
}

.customer-profile-table td,
.customer-profile-table th {
    max-width: 240px;
    vertical-align: top;
}

.customer-data-details summary {
    cursor: pointer;
    color: var(--admin-accent);
    font-weight: 800;
}

.customer-data-details pre,
.customer-record-card pre {
    max-height: 280px;
    margin: 8px 0 0;
    padding: 10px;
    color: #d8e0ea;
    white-space: pre-wrap;
    overflow: auto;
    border-radius: 8px;
    background: #111827;
}

.customer-related-grid {
    display: grid;
    gap: 10px;
}

.customer-related-table,
.customer-record-card {
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    background: #fff;
}

.customer-related-table > summary,
.customer-record-card > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    padding: 10px 12px;
    cursor: pointer;
    font-weight: 800;
}

.customer-related-table > div,
.customer-record-card > div {
    padding: 0 12px 12px;
}

.customer-related-table summary::marker,
.customer-record-card summary::marker {
    content: '';
}

.customer-related-table summary strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 26px;
    padding: 0 8px;
    color: var(--admin-accent);
    border-radius: 999px;
    background: rgba(59, 124, 247, .10);
}

.customer-record-card {
    margin-bottom: 8px;
    background: #f8fafc;
}

.customer-record-card small {
    color: var(--admin-muted);
    font-weight: 700;
}

@media (max-width: 1199.98px) {
    .customer-crm-layout {
        grid-template-columns: 260px minmax(0, 1fr);
    }

    .customer-field-grid-compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .customer-crm-layout {
        grid-template-columns: 1fr;
    }

    .customer-crm-sidebar {
        position: static;
    }

    .customer-profile-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 12px;
    }

    .customer-profile-tabs .nav-link {
        white-space: nowrap;
    }

    .customer-section-header,
    .customer-profile-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .customer-profile-actions .btn,
    .customer-section-header .btn {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .settings-logo-upload {
        grid-template-columns: 1fr;
    }

    .customer-profile-hero,
    .customer-profile-main {
        align-items: flex-start;
        flex-direction: column;
    }

    .customer-field-grid {
        grid-template-columns: 1fr;
    }

    .customer-avatar {
        flex-basis: 74px;
        width: 74px;
        height: 74px;
    }

    .customer-avatar.customer-avatar-lg {
        flex-basis: 74px;
        width: 74px;
        height: 74px;
        font-size: 28px;
    }

    .customer-crm-stats,
    .customer-crm-actions {
        grid-template-columns: 1fr;
    }

}

.admin-login-bg {
    background:
        linear-gradient(120deg, rgba(45, 108, 223, .12), rgba(25, 135, 84, .12)),
        var(--admin-bg);
}

.admin-login-card {
    width: min(100%, 430px);
}

.table {
    margin-bottom: 0;
}

.table thead th {
    color: #475467;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    vertical-align: middle;
    background: #f8fafc;
    border-bottom: 1px solid var(--admin-border);
}

.table > :not(caption) > * > * {
    padding: .72rem .75rem;
    border-color: #edf1f6;
}

.table-hover > tbody > tr:hover > * {
    background: #f8fbff;
}

.admin-table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid #edf1f6;
}

.admin-table-limit {
    width: 84px;
}

.admin-skeleton {
    display: block;
    height: 18px;
    border-radius: 6px;
    background: linear-gradient(90deg, #eef2f7, #f7f9fc, #eef2f7);
    background-size: 200% 100%;
    animation: admin-skeleton 1.1s ease-in-out infinite;
}

@keyframes admin-skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: capitalize;
    background: #edf2f7;
    color: #344054;
}

.status-badge.active,
.status-badge.enabled,
.status-badge.success,
.status-badge.paid,
.status-badge.approved,
.status-badge.completed {
    background: rgba(25, 135, 84, .12);
    color: var(--admin-success);
}

.status-badge.pending,
.status-badge.authorized,
.status-badge.draft,
.status-badge.simulated,
.status-badge.warning {
    background: rgba(181, 129, 5, .12);
    color: var(--admin-warning);
}

.status-badge.failed,
.status-badge.declined,
.status-badge.cancelled,
.status-badge.inactive,
.status-badge.blocked,
.status-badge.suspended,
.status-badge.locked {
    background: rgba(199, 52, 52, .12);
    color: var(--admin-danger);
}

.admin-date-filter {
    width: 160px;
}

.modal textarea {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
}

.form-control,
.form-select,
.input-group-text,
.select2-container--bootstrap-5 .select2-selection {
    border-color: #cfd8e3;
}

.form-control:focus,
.form-select:focus,
.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
    border-color: var(--admin-accent);
    box-shadow: 0 0 0 .2rem rgba(59, 124, 247, .12);
}

.select2-container--bootstrap-5 .select2-dropdown {
    border-color: var(--admin-border);
    box-shadow: var(--admin-shadow);
}

.select2-container--bootstrap-5 .select2-results__option--highlighted {
    background-color: var(--admin-accent);
}

.btn-primary {
    --bs-btn-bg: var(--admin-accent);
    --bs-btn-border-color: var(--admin-accent);
    --bs-btn-hover-bg: #2d67dc;
    --bs-btn-hover-border-color: #2d67dc;
    color: #fff;
    border: 0;
    background-image: linear-gradient(135deg, #3b7cf7 0%, #0f9f9a 100%);
    background-size: 160% 160%;
    box-shadow: 0 7px 18px rgba(59, 124, 247, .20);
}

.btn-primary,
.btn-outline-primary {
    min-height: 42px;
    padding: .58rem 1.08rem;
    font-weight: 800;
    letter-spacing: 0;
    transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease, border-color .16s ease, background-position .2s ease;
}

.btn-primary.btn-sm,
.btn-outline-primary.btn-sm {
    min-height: 38px;
    padding: .48rem .9rem;
    font-size: .88rem;
}

.btn-primary i,
.btn-outline-primary i {
    margin-right: 2px;
}

.btn-primary:hover,
.btn-outline-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(59, 124, 247, .26);
}

.btn-primary:hover {
    color: #fff;
    background-position: 100% 0;
}

.btn-outline-primary {
    --bs-btn-color: var(--admin-accent);
    --bs-btn-border-color: rgba(59, 124, 247, .62);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-border-color: transparent;
    border-width: 1px;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus-visible {
    color: #fff;
    background-image: linear-gradient(135deg, #3b7cf7 0%, #0f9f9a 100%);
    background-size: 160% 160%;
    background-position: 100% 0;
}

.btn-primary:focus-visible,
.btn-outline-primary:focus-visible {
    outline: 0;
    transform: translateY(-2px);
    animation: admin-action-focus .95s ease-in-out infinite, admin-action-gradient 2.2s ease-in-out infinite;
}

@keyframes admin-action-focus {
    0%,
    100% {
        box-shadow:
            0 0 0 .18rem rgba(59, 124, 247, .22),
            0 0 0 .42rem rgba(15, 159, 154, .10),
            0 13px 28px rgba(59, 124, 247, .24);
    }

    50% {
        box-shadow:
            0 0 0 .28rem rgba(15, 159, 154, .28),
            0 0 0 .66rem rgba(59, 124, 247, .12),
            0 16px 34px rgba(59, 124, 247, .30);
    }
}

@keyframes admin-action-gradient {
    0%,
    100% {
        background-position: 0 50%;
    }

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

.modal-content {
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    box-shadow: var(--admin-shadow);
}

.modal-header,
.modal-footer {
    background: #f8fafc;
}

.admin-toggle-field {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
    display: inline-flex;
    gap: .8rem;
    min-height: auto;
    padding: 0;
    vertical-align: middle;
}

.admin-toggle-field.form-switch {
    padding-left: 0;
}

.admin-toggle-field .form-check-input {
    cursor: pointer;
    float: none;
    height: 1.55rem;
    margin: 0;
    width: 3.15rem;
}

.admin-toggle-field .form-check-input:checked {
    background-color: var(--admin-accent);
    border-color: var(--admin-accent);
}

.admin-toggle-field .form-check-input:focus {
    border-color: var(--admin-accent);
    box-shadow: 0 0 0 .22rem rgba(59, 124, 247, .18);
}

.admin-toggle-field .form-check-label {
    color: var(--admin-ink);
    cursor: pointer;
    font-weight: 800;
    min-width: 84px;
}

.admin-wizard {
    display: grid;
    gap: 18px;
}

.admin-wizard-steps {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.admin-wizard-steps button {
    align-items: flex-start;
    background: #fff;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    color: var(--admin-muted);
    display: grid;
    gap: 4px;
    min-height: 92px;
    padding: 12px;
    text-align: left;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.admin-wizard-steps button span {
    align-items: center;
    background: #eef5ff;
    border-radius: 999px;
    color: var(--admin-accent);
    display: inline-flex;
    font-size: 12px;
    font-weight: 900;
    height: 26px;
    justify-content: center;
    width: 26px;
}

.admin-wizard-steps button strong {
    color: var(--admin-ink);
    font-size: 14px;
    line-height: 1.1;
}

.admin-wizard-steps button small {
    font-size: 12px;
    line-height: 1.25;
}

.admin-wizard-steps button.active,
.admin-wizard-steps button.complete {
    border-color: rgba(59, 124, 247, .45);
    box-shadow: 0 12px 24px rgba(59, 124, 247, .12);
    color: var(--admin-ink);
}

.admin-wizard-steps button.active {
    transform: translateY(-1px);
}

.admin-wizard-steps button.complete span {
    background: #daf5e8;
    color: #14804a;
}

.admin-wizard-pane {
    display: none;
}

.admin-wizard-pane.active {
    display: block;
}

.admin-wizard-pane-heading {
    align-items: center;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 14px;
}

.admin-wizard-pane-heading i {
    align-items: center;
    background: linear-gradient(135deg, var(--admin-accent), var(--admin-teal));
    border-radius: 8px;
    color: #fff;
    display: inline-flex;
    flex: 0 0 auto;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.admin-wizard-pane-heading strong,
.admin-marketing-ops-title strong,
.admin-marketing-ops-card strong {
    color: var(--admin-ink);
    display: block;
    font-weight: 900;
}

.admin-wizard-pane-heading small,
.admin-marketing-ops-title div > span,
.admin-marketing-ops-card span {
    color: var(--admin-muted);
    display: block;
}

.admin-marketing-ops-summary,
.admin-marketing-ops-card {
    background: #fff;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    padding: 16px;
}

.admin-marketing-ops-title,
.admin-marketing-ops-card {
    align-items: center;
    display: flex;
    gap: 14px;
    justify-content: space-between;
}

.admin-marketing-ops-title {
    margin-bottom: 14px;
}

.admin-marketing-ops-card i {
    align-items: center;
    background: #eef5ff;
    border-radius: 8px;
    color: var(--admin-accent);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 20px;
    height: 44px;
    justify-content: center;
    width: 44px;
}

.admin-marketing-ops-card > div {
    flex: 1 1 auto;
}

.admin-marketing-ops-metrics {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 14px;
}

.admin-marketing-ops-metrics div {
    background: #f8fafc;
    border: 1px solid #e7edf5;
    border-radius: 8px;
    padding: 10px;
}

.admin-marketing-ops-metrics span,
.admin-marketing-ops-details span {
    color: var(--admin-muted);
    display: block;
    font-size: 12px;
    font-weight: 700;
}

.admin-marketing-ops-metrics strong {
    color: var(--admin-ink);
    display: block;
    font-size: 20px;
    font-weight: 900;
}

.admin-marketing-ops-details {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-marketing-ops-result {
    margin-top: 12px;
}

@media (max-width: 992px) {
    .admin-sidebar {
        position: static;
        width: 100%;
        max-height: none;
    }

    .admin-shell {
        display: block;
    }

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

    .admin-topbar {
        position: static;
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-topbar-actions,
    .admin-global-search {
        width: 100%;
    }

    .admin-user-menu,
    .admin-user-button {
        width: 100%;
    }

    .admin-user-button {
        justify-content: flex-start;
    }

    .admin-user-dropdown {
        width: min(100%, 340px);
    }

    .admin-global-search-panel {
        left: 0;
        right: auto;
        width: 100%;
    }

    .admin-content {
        padding: 16px;
    }

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

    .admin-module-search {
        width: 100%;
    }

    .admin-module-toolbar .ms-auto {
        margin-left: 0 !important;
        justify-content: flex-end;
    }

    .admin-global-detail-row {
        grid-template-columns: 1fr;
    }

    .admin-table-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-marketing-ops-card {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-marketing-ops-metrics,
    .admin-marketing-ops-details {
        grid-template-columns: 1fr;
    }

    .settings-actions {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .btn-primary,
    .btn-outline-primary {
        transition: none;
    }

    .btn-primary:hover,
    .btn-outline-primary:hover,
    .btn-primary:focus-visible,
    .btn-outline-primary:focus-visible {
        transform: none;
        animation: none;
    }
}
