/* Commission Setup - Dark Theme Styles */
/* Matches ModuleGroup / GlobalMenuBuilder card UI patterns */
/* Prefix: cs- (Commission Setup) */

/* ── Page Container ─────────────────────────────────────────────── */
.cs-page {
    background: #0F1412;
    min-height: 100vh;
    padding-bottom: 2rem;
}

/* ── Stats Bar ────────────────────────────────────────────────────── */
.cs-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 1rem 1.25rem;
    border-bottom: 2px solid #2E2E2E;
}

.cs-stat-card {
    background: #1A1D1C;
    border: 1px solid #2E2E2E;
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.cs-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.cs-stat-icon--total {
    background: rgba(45, 212, 191, 0.12);
    color: #2DD4BF;
}

.cs-stat-icon--active {
    background: rgba(34, 197, 94, 0.12);
    color: #22C55E;
}

.cs-stat-icon--earned {
    background: rgba(245, 158, 11, 0.12);
    color: #F59E0B;
}

.cs-stat-value {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.cs-stat-label {
    color: #6B7280;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

/* ── Tab Bar ──────────────────────────────────────────────────────── */
.cs-tabs {
    display: flex;
    gap: 0;
    padding: 0 1.25rem;
    border-bottom: 2px solid #2E2E2E;
    background: #0F1412;
}

.cs-tab {
    padding: 0.75rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #6B7280;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
    transition: color 0.2s, border-color 0.2s;
}

.cs-tab:hover {
    color: #D1D5DB;
}

.cs-tab--active {
    color: #2DD4BF;
    border-bottom-color: #2DD4BF;
}

.cs-tab i {
    font-size: 0.813rem;
}

/* ── Header ───────────────────────────────────────────────────────── */
.cs-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: #0F1412;
    border-bottom: 2px solid #2E2E2E;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.cs-header-info {
    flex: 1;
    min-width: 0;
}

.cs-header-title {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cs-header-title i {
    color: #2DD4BF;
    font-size: 1.125rem;
}

.cs-header-subtitle {
    color: #6B7280;
    font-size: 0.813rem;
}

/* ── Search Bar ────────────────────────────────────────────────────── */
.cs-search-bar {
    padding: 0.75rem 1.25rem;
    border-bottom: 2px solid #2E2E2E;
}

.cs-search-wrap {
    position: relative;
    max-width: 380px;
}

.cs-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.813rem;
    color: #6B7280;
    pointer-events: none;
}

.cs-search-input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    background: #1A1D1C;
    border: 1px solid #2E2E2E;
    border-radius: 0.625rem;
    color: #fff;
    font-size: 0.875rem;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cs-search-input:focus {
    border-color: #2DD4BF;
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.08);
}

/* ── Filter Bar ────────────────────────────────────────────────────── */
.cs-filter-bar {
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 2px solid #2E2E2E;
    flex-wrap: wrap;
}

.cs-filter-bar select,
.cs-filter-select,
.cs-filter-bar input[type="date"] {
    padding: 0.5rem 1rem;
    background: #1A1D1C;
    border: 1px solid #2E2E2E;
    border-radius: 0.5rem;
    color: #fff;
    font-size: 0.875rem;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    box-sizing: border-box;
}

.cs-filter-bar select:focus,
.cs-filter-select:focus,
.cs-filter-bar input[type="date"]:focus {
    border-color: #2DD4BF;
}

.cs-filter-bar input[type="date"] {
    cursor: text;
}

/* ── Card Grid ────────────────────────────────────────────────────── */
.cs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    padding: 1.25rem;
}

/* ── Commission Card ──────────────────────────────────────────────────── */
.cs-card {
    background: #1A1D1C;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0px 6px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
    border: none;
    position: relative;
}

.cs-card:hover {
    transform: translateY(-4px);
}

/* Hide borders on ALL structural card elements — matches ModuleGroup/GlobalMenuBuilder pattern */
.cs-card *,
.cs-card *::before,
.cs-card *::after {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background-image: none !important;
}

.cs-card-top,
.cs-card-info,
.cs-card-badges,
.cs-card-meta {
    background: transparent !important;
}

.cs-card-top {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.cs-card-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.18), rgba(34, 197, 94, 0.18));
    color: #2DD4BF;
}

.cs-card-icon-wrap--fixed {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(239, 68, 68, 0.12));
    color: #F59E0B;
}

.cs-card-icon-wrap--inactive {
    background: rgba(107, 114, 128, 0.15);
    color: #6B7280;
}

.cs-card-info {
    flex: 1;
    min-width: 0;
}

.cs-card-title {
    color: #FFFFFF;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cs-card-desc {
    color: #A3A3A3;
    font-size: 13px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Commission Value Display ─────────────────────────────────────── */
.cs-card-value {
    background: #252927 !important;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.cs-card-value-label {
    color: #9CA3AF;
    font-size: 12px;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cs-card-value-amount {
    color: #2DD4BF;
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.cs-card-value-amount--fixed {
    color: #F59E0B;
}

/* ── Card Badges ──────────────────────────────────────────────────── */
.cs-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.cs-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.cs-card-badge--active {
    background: rgba(34, 197, 94, 0.12);
    color: #22C55E;
}

.cs-card-badge--inactive {
    background: rgba(107, 114, 128, 0.12);
    color: #6B7280;
}

.cs-card-badge--target {
    background: rgba(45, 212, 191, 0.12);
    color: #2DD4BF;
}

.cs-card-badge--type {
    background: #252927;
    color: #9CA3AF;
}

/* ── Card Meta ─────────────────────────────────────────────────────── */
.cs-card-meta {
    margin-bottom: 16px;
}

.cs-card-meta-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
}

.cs-card-meta-row:last-child {
    margin-bottom: 0;
}

.cs-card-meta-label {
    color: #9CA3AF;
}

.cs-card-meta-value {
    color: #FFFFFF;
    font-weight: 600;
}

.cs-card-meta-value--priority {
    color: #F59E0B;
}

/* ── Card Actions ──────────────────────────────────────────────────── */
.cs-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.cs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.813rem;
    border-radius: 0.5rem;
    transition: all 0.15s;
    font-family: inherit;
}

.cs-btn--primary {
    padding: 0.625rem 1rem;
    border: none;
    background: linear-gradient(135deg, #2DD4BF, #22C55E);
    color: #0F1412;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(45, 212, 191, 0.2);
}

.cs-btn--primary:hover {
    box-shadow: 0 4px 16px rgba(45, 212, 191, 0.3);
    transform: translateY(-1px);
}

.cs-btn--edit {
    flex: 1;
    padding: 10px;
    background: #252927;
    border-radius: 12px;
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: inherit;
}

.cs-btn--edit:hover {
    background: #2E2E2E;
}

.cs-btn--toggle {
    flex: 1;
    padding: 10px;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 12px;
    color: #22C55E;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: inherit;
}

.cs-btn--toggle:hover {
    background: rgba(34, 197, 94, 0.2);
}

.cs-btn--toggle--deactivate {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
}

.cs-btn--toggle--deactivate:hover {
    background: rgba(245, 158, 11, 0.2);
}

.cs-btn--delete {
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 12px;
    color: #EF4444;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: inherit;
}

.cs-btn--delete:hover {
    background: rgba(239, 68, 68, 0.2);
}

.cs-btn--back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #252927;
    border-radius: 10px;
    color: #D1D5DB;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease;
}

.cs-btn--back:hover {
    background: #2E2E2E;
}

.cs-btn--cancel {
    flex: 1;
    padding: 0.75rem;
    border-radius: 0.625rem;
    font-weight: 600;
    font-size: 0.875rem;
    background: #1A1D1C;
    color: #D1D5DB;
    cursor: pointer;
    font-family: inherit;
}

.cs-btn--cancel:hover {
    background: #252927;
}

.cs-btn--danger {
    flex: 1;
    padding: 0.75rem;
    border-radius: 0.625rem;
    border: none;
    font-weight: 700;
    font-size: 0.875rem;
    background: #EF4444;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
}

.cs-btn--danger:hover {
    background: #DC2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* ── Empty State ───────────────────────────────────────────────────── */
.cs-empty {
    text-align: center;
    padding: 4rem 1rem;
}

.cs-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    color: #4B5563;
    display: block;
}

.cs-empty-icon--large {
    font-size: 3rem;
    color: #6B7280;
}

.cs-empty-title {
    color: #fff;
    font-size: 1.063rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.cs-empty-desc {
    color: #6B7280;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

/* ── Delete Confirmation Overlay ─────────────────────────────────── */
.cs-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.cs-overlay-card {
    background: #1A1D1C;
    border-radius: 0.875rem;
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.cs-overlay-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.25rem;
    color: #EF4444;
}

.cs-overlay-title {
    color: #fff;
    font-size: 1.063rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.cs-overlay-desc {
    color: #9CA3AF;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.cs-overlay-actions {
    display: flex;
    gap: 0.75rem;
}

/* ── Transactions Table ──────────────────────────────────────────── */
.cs-table-wrap {
    padding: 1.25rem;
    overflow-x: auto;
}

.cs-table {
    width: 100%;
    border-collapse: collapse;
    background: #1A1D1C;
    border-radius: 14px;
    overflow: hidden;
    min-width: 760px;
}

.cs-table thead th {
    background: #252927;
    color: #9CA3AF;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 14px 16px;
    text-align: left;
}

.cs-table tbody td {
    padding: 14px 16px;
    color: #D1D5DB;
    font-size: 0.875rem;
    border-top: 1px solid #252927;
}

.cs-table tbody tr:hover {
    background: rgba(45, 212, 191, 0.04);
}

.cs-table-amount {
    color: #2DD4BF;
    font-weight: 700;
}

.cs-table-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.cs-table-status--pending {
    background: rgba(245, 158, 11, 0.12);
    color: #F59E0B;
}

.cs-table-status--paid {
    background: rgba(34, 197, 94, 0.12);
    color: #22C55E;
}

.cs-table-status--cancelled {
    background: rgba(239, 68, 68, 0.12);
    color: #EF4444;
}

/* ── Commission Calculator ───────────────────────────────────────── */
.cs-calc {
    padding: 1.25rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.cs-calc-form {
    background: #1A1D1C;
    border-radius: 16px;
    padding: 24px;
}

.cs-calc-result {
    background: #1A1D1C;
    border-radius: 16px;
    padding: 24px;
}

.cs-calc-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cs-calc-title i {
    color: #2DD4BF;
}

.cs-calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #252927;
}

.cs-calc-row:last-child {
    border-bottom: none;
}

.cs-calc-row--highlight {
    margin-top: 8px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.12), rgba(34, 197, 94, 0.08));
    border-radius: 12px;
    border-bottom: none;
}

.cs-calc-label {
    color: #9CA3AF;
    font-size: 0.875rem;
}

.cs-calc-value {
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
}

.cs-calc-value--big {
    color: #2DD4BF;
    font-size: 1.75rem;
    font-weight: 700;
}

.cs-calc-value--net {
    color: #22C55E;
    font-size: 1.25rem;
    font-weight: 700;
}

.cs-calc-hint {
    color: #6B7280;
    font-size: 0.813rem;
    margin-top: 1rem;
    line-height: 1.5;
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .cs-calc {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .cs-stats {
        grid-template-columns: 1fr;
    }

    .cs-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .cs-btn--primary {
        width: 100%;
        justify-content: center;
    }

    .cs-grid {
        grid-template-columns: 1fr;
    }

    .cs-card-actions {
        flex-direction: column;
    }

    .cs-overlay-card {
        margin: 1rem;
    }

    .cs-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .cs-filter-bar select,
    .cs-filter-select,
    .cs-filter-bar input[type="date"] {
        width: 100%;
    }
}

/* ── Fee Settings Card ────────────────────────────────────────── */
.cs-fee-card {
    background: #1A1D1C;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.cs-fee-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.cs-fee-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid #2E2E2E;
    gap: 16px;
    flex-wrap: wrap;
}
.cs-fee-row:last-of-type {
    border-bottom: none;
}
.cs-fee-label {
    flex: 1;
    min-width: 200px;
}
.cs-fee-name {
    font-size: 15px;
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cs-fee-name i { color: #2DD4BF; font-size: 14px; }
.cs-fee-desc {
    font-size: 12px;
    color: #9CA3AF;
    line-height: 1.4;
}
.cs-fee-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.cs-fee-input {
    width: 120px;
    padding: 10px 12px;
    background: #0F1412;
    border: 1px solid #2E2E2E;
    border-radius: 10px;
    color: #E8E8E8;
    font-size: 16px;
    font-weight: 600;
    text-align: right;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.cs-fee-input:focus { border-color: #2DD4BF; }
.cs-fee-unit {
    font-size: 14px;
    font-weight: 600;
    color: #9CA3AF;
    min-width: 16px;
}
.cs-fee-select {
    padding: 10px 32px 10px 12px;
    background: #0F1412;
    border: 1px solid #2E2E2E;
    border-radius: 10px;
    color: #E8E8E8;
    font-size: 14px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239CA3AF' d='M6 8.825L1.175 4 2.238 2.938 6 6.7 9.763 2.938 10.825 4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
}
.cs-fee-select:focus { border-color: #2DD4BF; }
.cs-fee-select option { background: #1A1D1C; color: #E8E8E8; }
.cs-fee-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #2E2E2E;
}