/* Referral Program Dashboard - v20260127b */

.referral-program-content {
    max-width: 960px;
    padding: 0 24px 40px;
}

/* Header actions */
.rp-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Section Card */
.rp-section {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 24px;
    margin-bottom: 24px;
}

.rp-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.rp-section-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #111;
}

/* Public Link Banner */
.rp-link-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f0f4ff;
    border: 1px solid #d0d9ff;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    gap: 16px;
}

.rp-link-banner-left {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #667eea;
    min-width: 0;
}

.rp-link-banner-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.rp-link-banner-url {
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
    text-decoration: none;
    word-break: break-all;
}

.rp-link-banner-url:hover { text-decoration: underline; }

.rp-link-banner-right {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Status Banner */
.rp-status-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 20px;
}

.rp-status-disabled {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    color: #92400e;
}

.rp-btn-enable {
    margin-left: auto;
    background: #92400e !important;
    color: white !important;
}

/* Zero State - overlays the activity section */
.rp-behind-zero {
    opacity: 0.3;
    pointer-events: none;
    filter: blur(1px);
}

.rp-zero-state {
    text-align: center;
    padding: 60px 40px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    position: relative;
    z-index: 2;
    margin-bottom: -40px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.rp-zero-icon {
    color: #d1d5db;
    margin-bottom: 20px;
}

.rp-zero-state h2 {
    font-size: 22px;
    font-weight: 600;
    color: #111;
    margin-bottom: 8px;
}

.rp-zero-state p {
    font-size: 15px;
    color: #64748b;
    max-width: 400px;
    margin: 0 auto 24px;
}

/* Toggle */
.rp-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.rp-toggle input { display: none; }

.rp-toggle-slider {
    width: 44px;
    height: 24px;
    background: #d1d5db;
    border-radius: 12px;
    position: relative;
    transition: background 0.2s;
}

.rp-toggle-slider::after {
    content: '';
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
}

.rp-toggle input:checked + .rp-toggle-slider {
    background: #667eea;
}

.rp-toggle input:checked + .rp-toggle-slider::after {
    transform: translateX(20px);
}

.rp-toggle-label {
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

/* Form */
.rp-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.rp-form-group {
    margin-bottom: 12px;
}

.rp-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    margin-bottom: 6px;
}

.rp-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.rp-input:focus {
    outline: none;
    border-color: #667eea;
}

.rp-textarea {
    min-height: 80px;
    resize: vertical;
}

/* Rewards Row */
.rp-rewards-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.rp-reward-box {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
}

.rp-reward-box h3 {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.rp-reward-box .rp-form-row {
    margin-bottom: 8px;
}

/* Buttons */
.rp-btn {
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.rp-btn:hover { opacity: 0.9; }
.rp-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.rp-btn-primary {
    background: #667eea;
    color: white;
    padding: 10px 24px;
}

.rp-btn-lg {
    padding: 14px 32px;
    font-size: 16px;
}

.rp-btn-secondary {
    background: #f3f4f6;
    color: #333;
    padding: 10px 24px;
}

.rp-btn-outline {
    background: white;
    color: #667eea;
    border: 1px solid #667eea;
    padding: 8px 16px;
}

.rp-btn-sm {
    background: #f3f4f6;
    color: #333;
    padding: 6px 12px;
    font-size: 12px;
    text-decoration: none;
}

/* Badge */
.rp-badge {
    background: #f0f4ff;
    color: #667eea;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
}

/* Table */
.rp-table-container {
    overflow-x: auto;
}

.rp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.rp-table th {
    text-align: left;
    padding: 10px 12px;
    font-weight: 500;
    color: #888;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e5e7eb;
}

.rp-table td {
    padding: 12px;
    border-bottom: 1px solid #f3f4f6;
    color: #333;
}

.rp-table code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.rp-empty {
    text-align: center;
    color: #999;
    padding: 40px 12px !important;
}

/* Modal */
.rp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.rp-modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.rp-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.rp-modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.rp-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.rp-modal-close:hover { color: #333; }

.rp-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.rp-modal-toggle {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f3f4f6;
}

.rp-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
}

/* Mobile */
@media (max-width: 768px) {
    .referral-program-content { padding: 0 16px 40px; }
    .rp-form-row, .rp-rewards-row { grid-template-columns: 1fr; }
    .rp-link-banner { flex-direction: column; align-items: flex-start; }
    .rp-link-banner-right { width: 100%; }
    .rp-header-actions { display: none; }
    .rp-modal { max-width: 100%; margin: 0; border-radius: 12px; }
    .rp-status-banner { flex-wrap: wrap; }
}
