/* Campaign Management — shared hub theme (forms, lists, hub pages) */
.cm-hub {
    --cm-bg: #f8fafc;
    --cm-card: #ffffff;
    --cm-border: #e2e8f0;
    --cm-text: #0f172a;
    --cm-muted: #64748b;
    --cm-primary: #ff6b00;
    --cm-primary-dark: #e55f00;
    --cm-primary-darker: #cc5600;
    --cm-primary-light: #fff4ed;
    --cm-primary-ring: rgba(255, 107, 0, 0.18);
    --cm-primary-shadow: rgba(255, 107, 0, 0.35);
    --cm-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 16px rgba(15, 23, 42, 0.04);
    --cm-shadow-hover: 0 8px 24px rgba(15, 23, 42, 0.1);
    --cm-radius: 14px;
    padding-bottom: 48px;
}

.cm-page-header {
    margin: 8px 0 24px;
    padding: 24px 28px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #334155 100%);
    border-radius: var(--cm-radius);
    color: #f8fafc;
    box-shadow: var(--cm-shadow);
}

.cm-page-header h1 {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
}

.cm-page-header p {
    margin: 0;
    font-size: 14px;
    color: #cbd5e1;
    max-width: 560px;
    line-height: 1.5;
}

.cm-page-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.cm-breadcrumb {
    margin: 0 0 14px;
    padding: 0;
    background: transparent;
    font-size: 12px;
}

.cm-breadcrumb > li + li:before { color: #94a3b8; }
.cm-breadcrumb a { color: #e2e8f0; }
.cm-breadcrumb .active { color: #94a3b8; }

.cm-header-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    white-space: nowrap;
}

.cm-header-btn-primary,
.cm-header-btn:not(.cm-header-btn-outline) {
    background: linear-gradient(135deg, var(--cm-primary), var(--cm-primary-dark));
    color: #fff !important;
    box-shadow: 0 4px 14px var(--cm-primary-shadow);
}

.cm-header-btn-primary:hover,
.cm-header-btn:not(.cm-header-btn-outline):hover {
    color: #fff !important;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 107, 0, 0.45);
}

.cm-header-btn-outline {
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc !important;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.cm-header-btn-outline:hover {
    color: #fff !important;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.4);
}

.cm-section { margin-bottom: 28px; }

.cm-panel {
    background: var(--cm-card);
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius);
    box-shadow: var(--cm-shadow);
    overflow: hidden;
}

.cm-form-panel { padding: 24px 26px 28px; }

.cm-form-errors {
    margin-bottom: 20px;
    padding: 14px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #b91c1c;
    font-size: 13px;
    line-height: 1.5;
}

.cm-form-errors h4 {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 700;
    color: #991b1b;
}

.ro-form label {
    font-size: 12px;
    font-weight: 600;
    color: var(--cm-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.ro-form .form-control {
    border-radius: 10px;
    border-color: var(--cm-border);
    font-size: 13px;
    min-height: 38px;
}

.ro-form .form-control:focus {
    border-color: var(--cm-primary);
    box-shadow: 0 0 0 3px var(--cm-primary-ring);
}

.ro-form .select2-container { width: 100% !important; }

.ro-form .select2-container--default .select2-selection--single,
.ro-form .select2-container--default .select2-selection--multiple {
    border-radius: 10px;
    border-color: var(--cm-border);
    min-height: 38px;
}

.ro-form .select2-container--default.select2-container--focus .select2-selection--multiple,
.ro-form .select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--cm-primary);
    box-shadow: 0 0 0 3px var(--cm-primary-ring);
}

.ro-section {
    background: #fafbfc;
    border: 1px solid var(--cm-border);
    border-radius: 12px;
    padding: 16px 18px 8px;
    margin-bottom: 20px;
}

.ro-section-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--cm-text);
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--cm-border);
}

.ro-section-heading .ro-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--cm-primary), var(--cm-primary-dark));
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.ro-section-heading .ro-section-sub {
    font-weight: 400;
    font-size: 11px;
    text-transform: none;
    letter-spacing: 0;
    color: var(--cm-muted);
    margin-left: auto;
    text-align: right;
}

.ro-costing-block {
    background: #fff;
    border: 1px dashed #d8dde2;
    border-radius: 10px;
    padding: 12px 14px 4px;
    margin-bottom: 12px;
}

.ro-costing-block .ro-costing-label {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--cm-muted);
    background: #f1f5f9;
    padding: 3px 10px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.ro-costing-block.ro-paid .ro-costing-label {
    background: var(--cm-primary-light);
    color: var(--cm-primary-darker);
}

.ro-costing-block.ro-barter .ro-costing-label {
    background: #fff7ed;
    color: #c2410c;
}

.ro-costing-block.ro-totals .ro-costing-label {
    background: #ecfdf5;
    color: #047857;
}

.cm-form-footer {
    margin-top: 8px;
    padding-top: 20px;
    border-top: 1px solid var(--cm-border);
    text-align: right;
}

.cm-btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #fff !important;
    background: linear-gradient(135deg, var(--cm-primary), var(--cm-primary-dark));
    box-shadow: 0 4px 14px var(--cm-primary-shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.cm-btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 107, 0, 0.45);
    color: #fff !important;
}

.cm-btn-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.invoice-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.invoice-loader .loader-box { text-align: center; }

.invoice-loader .spinner-border {
    color: var(--cm-primary) !important;
    width: 2.5rem;
    height: 2.5rem;
}

.invoice-loader h3 {
    font-size: 16px;
    color: var(--cm-text);
    margin-top: 12px;
}

.d-none { display: none !important; }

input.costing-inactive,
select.costing-inactive {
    background-color: #f1f5f9 !important;
    cursor: not-allowed;
}

@media (max-width: 767px) {
    .cm-page-header { padding: 18px 16px; }
    .cm-page-header h1 { font-size: 22px; }
    .cm-form-panel { padding: 16px; }
    .cm-filter-panel { padding: 16px; }
    .cm-stat-grid { grid-template-columns: 1fr 1fr; }
    .ro-section-heading { flex-wrap: wrap; }
    .ro-section-heading .ro-section-sub {
        margin-left: 0;
        width: 100%;
        text-align: left;
        margin-top: 4px;
    }
}

@media (max-width: 480px) {
    .cm-stat-grid { grid-template-columns: 1fr; }
}

/* ---- RO list page ---- */

.cm-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--cm-border);
    flex-wrap: wrap;
}

.cm-section-head h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--cm-text);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.cm-section-head span,
.cm-section-head .cm-result-badge {
    font-size: 12px;
    color: var(--cm-muted);
}

.cm-result-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: var(--cm-primary-light);
    color: var(--cm-primary-darker);
    border-radius: 999px;
    font-weight: 600;
    font-size: 11px;
}

.cm-filter-panel { padding: 20px 22px; }

.cm-filter-panel label {
    font-size: 12px;
    font-weight: 600;
    color: var(--cm-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.cm-filter-panel .form-control {
    border-radius: 10px;
    border-color: var(--cm-border);
    font-size: 13px;
    height: 38px;
}

.cm-filter-panel .form-control:focus {
    border-color: var(--cm-primary);
    box-shadow: 0 0 0 3px var(--cm-primary-ring);
}

.cm-btn-filter {
    height: 38px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    background: linear-gradient(135deg, var(--cm-primary), var(--cm-primary-dark));
    border: none;
    color: #fff;
}

.cm-btn-clear {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--cm-muted);
    border: 1px solid var(--cm-border);
    border-radius: 8px;
    text-decoration: none;
    background: #fff;
    transition: border-color 0.15s, color 0.15s;
}

.cm-btn-clear:hover {
    color: var(--cm-text);
    border-color: #cbd5e1;
    text-decoration: none;
}

.cm-stat-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

.cm-stat-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 16px 14px;
    background: var(--cm-card);
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius);
    box-shadow: var(--cm-shadow);
    min-width: 0;
}

.cm-stat-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
}

.cm-stat-primary .cm-stat-icon { background: linear-gradient(135deg, var(--cm-primary), var(--cm-primary-dark)); }
.cm-stat-slate .cm-stat-icon { background: linear-gradient(135deg, #475569, #334155); }
.cm-stat-sky .cm-stat-icon { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.cm-stat-emerald .cm-stat-icon { background: linear-gradient(135deg, #10b981, #059669); }
.cm-stat-amber .cm-stat-icon { background: linear-gradient(135deg, #f59e0b, #d97706); }

.cm-stat-body { min-width: 0; }

.cm-stat-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--cm-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.2;
}

.cm-stat-value {
    display: block;
    margin: 4px 0 2px;
    font-size: 20px;
    font-weight: 700;
    color: var(--cm-text);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.cm-stat-hint {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.3;
}

.cm-table-panel .table-responsive {
    max-width: 100%;
    overflow-x: auto;
}

.cm-toolbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 18px;
    border-bottom: 1px solid var(--cm-border);
    background: #fafbfc;
}

.cm-toolbar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 220px;
    max-width: 420px;
}

.cm-toolbar-search .form-control {
    height: 38px;
    border-radius: 10px;
    border-color: var(--cm-border);
    font-size: 13px;
}

.cm-toolbar-search .form-control:focus {
    border-color: var(--cm-primary);
    box-shadow: 0 0 0 3px var(--cm-primary-ring);
}

.cm-admin-user-cell .cm-user-name {
    display: block;
    font-weight: 700;
    font-size: 13px;
    color: var(--cm-text);
    line-height: 1.35;
}

.cm-admin-user-cell .cm-user-email {
    display: block;
    font-size: 12px;
    color: var(--cm-muted);
    line-height: 1.35;
}

.cm-admin-user-cell .cm-user-rights {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cm-campaign-access-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--cm-border);
    background: #fff;
    transition: border-color 0.15s, background 0.15s;
}

.cm-campaign-access-link:hover {
    border-color: #bbf7d0;
    background: #f0fdf4;
    text-decoration: none;
}

.cm-campaign-access-link.is-off {
    opacity: 0.55;
}

.cm-campaign-access-link.is-off:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.cm-action-cell .cm-action-icons {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.cm-action-cell .cm-action-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--cm-border);
    color: var(--cm-muted);
    background: #fff;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    text-decoration: none;
}

.cm-action-cell .cm-action-icons a:hover {
    border-color: #cbd5e1;
    color: var(--cm-text);
    background: #f8fafc;
    text-decoration: none;
}

.cm-action-cell .cm-action-icons a.cm-icon-edit:hover {
    border-color: #bbf7d0;
    color: #047857;
    background: #ecfdf5;
}

.cm-action-cell .cm-action-icons a.cm-icon-perms:hover {
    border-color: #bfdbfe;
    color: #1d4ed8;
    background: #eff6ff;
}

.cm-action-cell .cm-action-icons a.cm-icon-danger:hover {
    border-color: #fecaca;
    color: #b91c1c;
    background: #fef2f2;
}

.cm-action-cell .cm-action-icons a.cm-icon-success:hover {
    border-color: #bbf7d0;
    color: #047857;
    background: #ecfdf5;
}

.cm-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.cm-status-pill.active {
    background: #ecfdf5;
    color: #047857;
}

.cm-status-pill.inactive {
    background: #f1f5f9;
    color: #64748b;
}

.cm-ro-table {
    width: 100%;
    margin: 0;
    font-size: 12.5px;
    border-collapse: separate;
    border-spacing: 0;
}

.cm-ro-table thead th {
    background: #f8fafc;
    color: var(--cm-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 10px !important;
    border-bottom: 1px solid var(--cm-border);
    white-space: nowrap;
    vertical-align: middle;
}

.cm-ro-table tbody td {
    padding: 10px !important;
    vertical-align: top !important;
    border-bottom: 1px solid #f1f5f9;
    white-space: normal;
    color: var(--cm-text);
}

.cm-ro-table tbody tr:hover td { background: #fafbfc; }

.cm-ro-table tbody tr.highlight-row td {
    background-color: #fffbeb !important;
}

.cm-ro-table tbody tr.cm-row-deleted td {
    background: #fef2f2 !important;
}

.cm-ro-table tbody td b { font-weight: 600; color: var(--cm-text); }

.ro-financials {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 2px 8px;
    font-size: 12px;
    line-height: 1.35;
    min-width: 160px;
}

.ro-financials .lbl { color: var(--cm-muted); }
.ro-financials .val { font-weight: 600; color: var(--cm-text); }

.ro-docs a.cm-doc-link {
    display: inline-block;
    margin: 2px 0;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--cm-primary-darker);
    background: var(--cm-primary-light);
    border-radius: 6px;
    text-decoration: none;
}

.ro-docs a.cm-doc-link:hover {
    background: #ffe8d6;
    color: var(--cm-primary-darker);
    text-decoration: none;
}

.ro-docs .lbl {
    color: var(--cm-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.ro-type-pill {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--cm-primary-light);
    color: var(--cm-primary-darker);
    font-weight: 600;
    font-size: 11px;
    margin-bottom: 4px;
}

.ro-type-pill.barter { background: #fff7ed; color: #c2410c; }
.ro-type-pill.both { background: #ecfdf5; color: #047857; }

.ro-created-block .small-muted { color: var(--cm-muted); font-size: 11px; }
.ro-created-block .sales-poc,
.ro-created-block .cs-poc { display: block; }

.cm-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.3;
}

.cm-status-pending { background: #fff7ed; color: #c2410c; }
.cm-status-success { background: #ecfdf5; color: #047857; }
.cm-status-danger { background: #fef2f2; color: #b91c1c; }
.cm-status-hold { background: #fef9c3; color: #a16207; }

.cm-link {
    color: var(--cm-primary);
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
}

.cm-link:hover { color: var(--cm-primary-dark); text-decoration: underline; }

.campaign-toggle-btn {
    color: var(--cm-primary) !important;
    font-weight: 600;
    font-size: 12px;
    padding: 0 !important;
}

.ro-action-cell .form-control {
    font-size: 12px;
    padding: 4px 8px;
    height: auto;
    border-radius: 8px;
    border-color: var(--cm-border);
}

.ro-action-cell .cm-action-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
}

.ro-action-cell .cm-action-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--cm-border);
    color: var(--cm-muted);
    background: #fff;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.ro-action-cell .cm-action-icons a:hover {
    border-color: #cbd5e1;
    color: var(--cm-text);
    background: #f8fafc;
    text-decoration: none;
}

.ro-action-cell .cm-action-icons a.cm-icon-danger:hover {
    border-color: #fecaca;
    color: #b91c1c;
    background: #fef2f2;
}

.btn-manage-login {
    font-size: 11px;
    padding: 5px 8px;
    margin-top: 6px;
    white-space: normal;
    line-height: 1.3;
    border-radius: 8px;
    border: 1px solid var(--cm-border);
    background: #fff;
    color: var(--cm-text);
    font-weight: 600;
    width: 100%;
}

.btn-manage-login:hover {
    border-color: #ffc299;
    background: var(--cm-primary-light);
    color: var(--cm-primary-darker);
}

.cm-pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 18px;
    border-top: 1px solid var(--cm-border);
    background: #fafbfc;
}

.cm-pagination-bar .text-muted { font-size: 12px; color: var(--cm-muted) !important; }

.cm-pagination-bar .pagination { margin: 0; }

.cm-pagination-bar .page-link {
    border-radius: 8px;
    margin: 0 2px;
    border-color: var(--cm-border);
    color: var(--cm-muted);
    font-size: 12px;
    padding: 5px 10px;
}

.cm-pagination-bar .page-item.active .page-link {
    background: var(--cm-primary);
    border-color: var(--cm-primary);
}

.cm-empty-row td {
    padding: 40px 16px !important;
    text-align: center;
    color: var(--cm-muted);
    font-size: 14px;
}

.campaign-inline-row td {
    background: #f8fafc !important;
    border-bottom: 1px solid var(--cm-border) !important;
}

.campaign-inline-row .table {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--cm-border);
}

.cm-modal .modal-content {
    border: none;
    border-radius: var(--cm-radius);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
    overflow: hidden;
}

.cm-modal .modal-header {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #fff;
    border: none;
    padding: 16px 20px;
}

.cm-modal .modal-header .modal-title { color: #fff; font-weight: 600; }
.cm-modal .modal-header .close { color: #fff; opacity: 0.8; text-shadow: none; }
.cm-modal .modal-body { padding: 20px; }
.cm-modal .modal-footer {
    border-top: 1px solid var(--cm-border);
    padding: 14px 20px;
    background: #fafbfc;
}

#manageLoginModal .select2-container { width: 100% !important; }

@media (max-width: 1200px) {
    .cm-stat-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---- Application list (campaign/application_list.php) ---- */

.cm-app-toolbar #rejectdiv,
.cm-app-toolbar #acceptdiv,
.cm-app-toolbar #assignPocDiv,
.cm-app-toolbar #bulkPaymentTermsDiv,
.cm-app-toolbar #export,
.cm-app-toolbar #allocatediv {
    display: inline-block;
    margin-top: 0 !important;
    margin-left: 0;
    vertical-align: middle;
}

.cm-app-toolbar #assignPocDiv,
.cm-app-toolbar #bulkPaymentTermsDiv {
    margin-left: 8px !important;
}

.cm-app-toolbar #export,
.cm-app-toolbar #allocatediv {
    float: right;
    margin-left: 8px;
}

.cm-app-page-header {
    margin-bottom: 20px;
}

.cm-app-page-header h1 {
    font-size: 24px;
}

.cm-app-header-stats {
    margin-top: 20px;
    margin-left: -8px;
    margin-right: -8px;
}

.cm-app-header-stats > [class*="col-"] {
    padding-left: 8px;
    padding-right: 8px;
    margin-top: 0 !important;
}

.cm-app-page-header .cm-app-stat-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    margin-bottom: 0;
    height: 100%;
    overflow: hidden;
}

.cm-app-page-header .cm-app-stat-card .card-header {
    padding: 12px 16px 4px;
    background: transparent;
    border: none;
}

.cm-app-page-header .cm-app-stat-card .card-title {
    margin: 0;
}

.cm-app-page-header .cm-app-stat-card h3 {
    font-size: 1.65rem;
    font-weight: 700;
}

.cm-app-page-header .cm-app-stat-card .p-l-20 {
    padding-left: 16px !important;
    padding-right: 12px;
    padding-bottom: 12px;
}

.cm-app-page-header .cm-app-stat-card a {
    color: #fff !important;
    opacity: 0.9;
}

.cm-app-page-header .cm-app-budget-card {
    background: #fff;
    color: var(--cm-text);
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    height: 100%;
    margin-bottom: 0;
}

.cm-app-page-header .cm-app-budget-card .text-muted {
    color: var(--cm-muted) !important;
}

.cm-app-page-header .progress-bar.bg-primary,
.cm-app-page-header .cm-progress-brand {
    background-color: var(--cm-primary) !important;
}

.cm-app-nav-wrap {
    margin-bottom: 20px;
}

.cm-app-nav-wrap .nav-tabs {
    border-bottom: 1px solid var(--cm-border);
}

.cm-app-nav-wrap .nav-tabs .nav-link,
.cm-app-nav-wrap .nav-tabs-fillup > li > a {
    font-size: 13px;
    font-weight: 600;
    color: var(--cm-muted);
    border-radius: 8px 8px 0 0;
}

.cm-app-nav-wrap .nav-tabs .nav-item.active > a,
.cm-app-nav-wrap .nav-tabs .nav-item.active a.active,
.cm-app-nav-wrap .nav-tabs-fillup > li.active > a {
    color: var(--cm-primary-darker) !important;
    border-bottom: 2px solid var(--cm-primary);
}

.cm-app-toolbar {
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--cm-card);
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius);
    box-shadow: var(--cm-shadow);
}

.cm-app-filter-alert {
    margin-bottom: 16px;
}

.cm-app-filter-alert .alert {
    border-radius: 10px;
    border: 1px solid #bae6fd;
    background: #f0f9ff;
    color: #0369a1;
    margin-bottom: 0;
}

.cm-app-list-section {
    margin-bottom: 28px;
}

.cm-app-search-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--cm-border);
    background: #fafbfc;
    flex-wrap: wrap;
}

.cm-app-search-bar .form-control {
    border-radius: 10px;
    border-color: var(--cm-border);
    max-width: 280px;
    font-size: 13px;
}

.cm-app-search-bar .form-control:focus {
    border-color: var(--cm-primary);
    box-shadow: 0 0 0 3px var(--cm-primary-ring);
}

.cm-app-table-panel .table-responsive {
    overflow-x: auto;
}

.cm-app-table-panel #tableWithSearch {
    min-height: 200px;
    margin-bottom: 0;
}

.cm-app-table-panel #tableWithSearch thead th {
    background: #f8fafc;
    color: var(--cm-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--cm-border);
    vertical-align: middle;
}

.cm-app-table-panel #tableWithSearch tbody td {
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
}

.cm-app-table-panel #tableWithSearch tbody tr:hover td {
    background: #fafbfc;
}

.cm-app-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    padding: 14px 18px;
    border-top: 1px solid var(--cm-border);
    background: #fafbfc;
    list-style: none;
    margin: 0;
}

.cm-app-pagination .paginate_button.btn-primary {
    background: var(--cm-primary) !important;
    border-color: var(--cm-primary) !important;
    color: #fff !important;
}

.cm-app-pagination .paginate_button.btn-default {
    background: #fff !important;
    border: 1px solid var(--cm-border) !important;
    color: var(--cm-muted) !important;
}

.cm-hub .btn-primary:not(.paginate_button) {
    background: linear-gradient(135deg, var(--cm-primary), var(--cm-primary-dark));
    border-color: var(--cm-primary-dark);
}

.cm-hub .btn-primary:not(.paginate_button):hover {
    background: var(--cm-primary-dark);
    border-color: var(--cm-primary-darker);
}

.cm-hub .badge.badge-warning {
    background: #fff7ed;
    color: #c2410c;
}

.cm-hub .badge.badge-success {
    background: #ecfdf5;
    color: #047857;
}

.cm-hub .badge.badge-secondary {
    background: #f1f5f9;
    color: #64748b;
}

.cm-hub .badge.badge-danger {
    background: #fef2f2;
    color: #b91c1c;
}

.cm-hub .left_filter_area .channel-switch .channel-switch-btn.active {
    background-color: var(--cm-primary);
    color: #fff;
}

@media (max-width: 767px) {
    .cm-app-page-header { padding: 18px 16px; }
    .cm-app-page-header h1 { font-size: 20px; }
    .cm-app-search-bar { justify-content: stretch; }
    .cm-app-search-bar .form-control { max-width: none; flex: 1; }
}

/* ---- Create new campaign wizard ---- */

.cm-campaign-top-card {
    padding: 18px 20px;
    margin-bottom: 24px;
}

.cm-campaign-top-card .form-control,
.cm-campaign-top-card .select2-container .select2-selection--single {
    border-radius: 10px;
    border-color: var(--cm-border);
    min-height: 38px;
}

.cm-campaign-top-card .form-control:focus {
    border-color: var(--cm-primary);
    box-shadow: 0 0 0 3px var(--cm-primary-ring);
}

.cm-campaign-wizard-panel {
    overflow: hidden;
    margin-bottom: 80px;
}

.cm-campaign-wizard-panel .wizard-box.ro-form label {
    font-size: 12px;
    font-weight: 600;
    color: var(--cm-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cm-campaign-wizard-panel .wizard-box.ro-form .form-control {
    border-radius: 10px;
    border-color: var(--cm-border);
}

.cm-campaign-wizard-panel .wizard-box.ro-form .form-control:focus {
    border-color: var(--cm-primary);
    box-shadow: 0 0 0 3px var(--cm-primary-ring);
}

.cm-campaign-wizard-panel .table thead th {
    background: #f8fafc;
    color: var(--cm-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--cm-border);
}

.cm-campaign-wizard-panel .btn-purple {
    background: linear-gradient(135deg, var(--cm-primary), var(--cm-primary-dark));
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 8px 18px;
}

.cm-campaign-wizard-panel .btn-purple:hover {
    background: var(--cm-primary-dark);
    color: #fff;
}

.cm-campaign-wizard-panel .floating-nav .btn-light {
    border: 1px solid var(--cm-border);
    border-radius: 10px;
    font-weight: 600;
}

.cm-ro-details-card {
    background: #fafbfc;
    border: 1px solid var(--cm-border);
    border-radius: 12px;
    margin-bottom: 16px;
}

.cm-ro-details-card .table {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0;
}

.cm-hub .btn-outline-primary {
    color: var(--cm-primary);
    border-color: #ffc299;
}

.cm-hub .btn-outline-primary:hover {
    background: var(--cm-primary-light);
    border-color: var(--cm-primary);
    color: var(--cm-primary-darker);
}

@media (max-width: 767px) {
    .wizard-header {
        flex-wrap: wrap;
    }

    .wizard-header div {
        flex: 1 1 50%;
        font-size: 11px;
        padding: 10px 6px;
    }

    .cm-campaign-top-card {
        padding: 14px;
    }

    .platform-group {
        padding-left: 0 !important;
    }
}

/* ---- Admin user: navigation rights ---- */

.cm-nav-user-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    margin-bottom: 22px;
    background: linear-gradient(135deg, #fff4ed 0%, #fff 100%);
    border: 1px solid #ffd8b8;
    border-radius: 12px;
}

.cm-nav-user-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cm-primary), var(--cm-primary-dark));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.cm-nav-user-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--cm-text);
    line-height: 1.3;
}

.cm-nav-user-email {
    font-size: 13px;
    color: var(--cm-muted);
    margin-top: 2px;
}

.cm-nav-rights-title {
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--cm-border);
    font-size: 15px;
    font-weight: 700;
    color: var(--cm-text);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cm-nav-rights-table-wrap {
    border: 1px solid var(--cm-border);
    border-radius: 12px;
    overflow: hidden;
    overflow-x: auto;
    background: #fff;
}

.cm-nav-rights-table {
    width: 100%;
    margin: 0;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}

.cm-nav-rights-table thead th {
    background: #f8fafc;
    color: var(--cm-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 14px;
    border-bottom: 1px solid var(--cm-border);
    white-space: nowrap;
}

.cm-nav-rights-table tbody td {
    padding: 10px 12px;
    vertical-align: top;
    border-bottom: 1px solid #f1f5f9;
}

.cm-nav-rights-table tbody td.cm-nav-col-actions {
    vertical-align: middle;
}

.cm-nav-rights-table tbody tr:last-child td {
    border-bottom: none;
}

.cm-nav-rights-table tbody tr:hover td {
    background: #fafbfc;
}

.cm-nav-col-sno {
    width: 52px;
    text-align: center;
}

.cm-nav-col-parent {
    width: 24%;
    max-width: 260px;
}

.cm-nav-col-actions {
    width: auto;
}

.cm-nav-rights-table .cm-nav-col-actions {
    width: 76%;
}

.cm-nav-sno {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 8px;
    background: var(--cm-primary-light);
    color: var(--cm-primary-darker);
    font-size: 12px;
    font-weight: 700;
}

.cm-nav-parent-body {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    min-width: 0;
}

.cm-nav-parent-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--cm-text);
    line-height: 1.35;
    text-transform: capitalize;
    word-break: break-word;
}

.cm-nav-action-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    align-content: flex-start;
    gap: 6px 14px;
    width: 100%;
}

.cm-nav-action-chip {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    white-space: nowrap;
}

.cm-nav-action-chip:hover {
    background: transparent;
}

.cm-nav-action-chip .cm-nav-check-child {
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid var(--cm-border);
    background: #f8fafc;
    transition: border-color 0.15s, background 0.15s;
    display: inline-flex;
    width: auto;
    flex: 0 0 auto;
}

.cm-nav-action-grid .cm-nav-check {
    display: inline-flex;
    width: auto;
    flex: 0 0 auto;
}

.cm-nav-action-chip:hover .cm-nav-check-child {
    border-color: #ffc299;
    background: #fffaf5;
}

.cm-nav-no-actions {
    font-size: 13px;
}

.cm-nav-check-child {
    align-items: center;
}

.cm-nav-check-child .cm-nav-check-box {
    width: 18px;
    height: 18px;
    margin-top: 0;
    border-radius: 5px;
}

.cm-nav-check-child .cm-nav-check-input:checked + .cm-nav-check-box::after {
    left: 5px;
    top: 1px;
    width: 4px;
    height: 9px;
}

.cm-nav-check-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--cm-text);
    line-height: 1.3;
    white-space: nowrap;
}

.cm-nav-info-tip {
    color: var(--cm-primary);
    cursor: help;
    font-size: 12px;
    line-height: 1;
}

.cm-nav-info-tip .fa-info-circle {
    color: var(--cm-primary);
}

.cm-nav-right-item {
    transition: background 0.15s;
}

.cm-nav-right-head {
    margin-bottom: 10px;
}

.cm-nav-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
    cursor: pointer;
    user-select: none;
}

.cm-nav-check-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.cm-nav-check-box {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    position: relative;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.cm-nav-check-parent .cm-nav-check-box {
    width: 22px;
    height: 22px;
    border-radius: 7px;
}

.cm-nav-check-input:checked + .cm-nav-check-box {
    background: var(--cm-primary);
    border-color: var(--cm-primary);
    box-shadow: 0 2px 8px rgba(255, 107, 0, 0.35);
}

.cm-nav-check-input:checked + .cm-nav-check-box::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.cm-nav-check-parent .cm-nav-check-input:checked + .cm-nav-check-box::after {
    left: 7px;
    top: 3px;
}

.cm-nav-check-input:indeterminate + .cm-nav-check-box {
    background: var(--cm-primary-light);
    border-color: var(--cm-primary);
}

.cm-nav-check-input:indeterminate + .cm-nav-check-box::after {
    content: "";
    position: absolute;
    left: 4px;
    right: 4px;
    top: 8px;
    height: 2px;
    background: var(--cm-primary);
    border: none;
    transform: none;
}

.cm-nav-check:hover .cm-nav-check-box {
    border-color: var(--cm-primary);
}

.cm-nav-right-label {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--cm-text);
    line-height: 1.45;
}

.cm-nav-type-wrap {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.cm-nav-type-label {
    display: none;
}

.cm-nav-panel-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: middle;
}

.cm-nav-panel-badge.admin {
    background: #eef2ff;
    color: #4338ca;
}

.cm-nav-panel-badge.payment {
    background: #ecfdf5;
    color: #047857;
}

.cm-nav-form-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--cm-border);
}

.cm-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--cm-muted);
    border: 1px solid var(--cm-border);
    background: #fff;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s;
}

.cm-btn-back:hover {
    color: var(--cm-text);
    border-color: #cbd5e1;
    text-decoration: none;
}

/* ---- Admin user add/edit form ---- */

.cm-admin-form-wrap {
    max-width: 640px;
}

.cm-panel-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.cm-panel-access-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--cm-border);
    border-radius: 12px;
    background: #fafbfc;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    user-select: none;
}

.cm-panel-access-card:hover {
    border-color: #cbd5e1;
    background: #fff;
}

.cm-panel-access-card input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.cm-panel-access-box {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    position: relative;
    transition: border-color 0.15s, background 0.15s;
}

.cm-panel-access-card input:checked + .cm-panel-access-box {
    background: var(--cm-primary);
    border-color: var(--cm-primary);
}

.cm-panel-access-card input:checked + .cm-panel-access-box::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.cm-panel-access-card input:checked ~ .cm-panel-access-body .cm-panel-access-title {
    color: var(--cm-text);
}

.cm-panel-access-card:has(input:checked) {
    border-color: #ffc299;
    background: #fffaf5;
    box-shadow: 0 0 0 1px rgba(255, 107, 0, 0.12);
}

.cm-panel-access-title {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--cm-muted);
    line-height: 1.35;
}

.cm-panel-access-hint {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: var(--cm-muted);
    line-height: 1.35;
}

.cm-form-hint {
    display: block;
    margin-top: 5px;
    font-size: 11px;
    color: var(--cm-muted);
}

/* ---- Campaign list ---- */

.cm-campaign-list .campaign-info {
    line-height: 1.4;
}

.cm-campaign-list .fw-600 {
    font-weight: 600;
    color: var(--cm-text);
}

.cm-campaign-list .badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.cm-campaign-list .badge-live {
    background: #ecfdf5;
    color: #047857;
}

.cm-campaign-list .badge-review {
    background: #fff7ed;
    color: #c2410c;
}

.cm-campaign-list .badge-completed {
    background: #fef2f2;
    color: #b91c1c;
}

.cm-campaign-list .badge-public {
    background: #ecfdf5;
    color: #047857;
}

.cm-campaign-list .badge-private {
    background: #fef2f2;
    color: #b91c1c;
}

.cm-campaign-list .badge-soft-primary {
    background: #eef2ff;
    color: #4338ca;
}

.cm-campaign-list .sortcmp {
    max-width: 72px;
    border-radius: 8px;
    height: 34px;
    font-size: 12px;
    padding: 4px 8px;
}

.cm-campaign-list .action-btns .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid var(--cm-border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.cm-campaign-list .btn-light-primary {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.cm-campaign-list .btn-light-info {
    background: #ecfeff;
    color: #0891b2;
    border-color: #a5f3fc;
}

.cm-campaign-list .btn-light-dark {
    background: #f8fafc;
    color: #475569;
    border-color: #e2e8f0;
}

.cm-campaign-list .btn-light-success {
    background: #ecfdf5;
    color: #047857;
    border-color: #bbf7d0;
}

.cm-campaign-list .btn-light-warning {
    background: #fffbeb;
    color: #b45309;
    border-color: #fde68a;
}

.cm-campaign-list .btn-gradient-primary1,
.cm-campaign-list .btn-gradient-primary {
    background: linear-gradient(135deg, var(--cm-primary), var(--cm-primary-dark));
    color: #fff !important;
    border: none;
}

.cm-campaign-list .btn-saas.btn-danger {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
}

.cm-campaign-list .dropdown {
    display: inline-block;
}

.cm-campaign-list .dropdown-menu {
    border-radius: 10px;
    border-color: var(--cm-border);
    box-shadow: var(--cm-shadow-hover);
}

.cm-campaign-list .dropdown-menu .dropdown-item {
    display: block !important;
    width: 100%;
    font-size: 13px;
}

.cm-pagination-info {
    font-size: 12px;
    color: var(--cm-muted);
    font-weight: 600;
}

.cm-pagination-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cm-pagination-links .btn-default {
    background: #fff;
    border: 1px solid var(--cm-border);
    color: var(--cm-muted);
    border-radius: 8px;
    font-size: 12px;
    padding: 5px 10px;
}

.cm-pagination-links .btn-primary {
    background: var(--cm-primary);
    border-color: var(--cm-primary);
    border-radius: 8px;
    font-size: 12px;
    padding: 5px 10px;
}

@media (max-width: 768px) {
    .cm-nav-rights-table {
        table-layout: auto;
    }

    .cm-nav-col-parent {
        min-width: 150px;
    }

    .cm-nav-rights-table .cm-nav-col-actions {
        width: auto;
        min-width: 220px;
    }

    .cm-nav-rights-table thead th,
    .cm-nav-rights-table tbody td {
        padding: 10px 12px;
    }

    .cm-nav-action-chip .cm-nav-check-child {
        padding: 4px 8px;
    }
}
