/* ═══════════════════════════════════════════════════════════
   NP2 Classified Ad Builder
   ═══════════════════════════════════════════════════════════ */

.cab-wrapper {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.cab-main {
    flex: 1;
    min-width: 0;
}

.cab-sidebar {
    width: 340px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
}

/* ─── Sections ──────────────────────────────────────────── */

.cab-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
}

.cab-section-header {
    font-weight: 700;
    font-size: 13px;
    color: #374151;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cab-stats {
    font-weight: 500;
    font-size: 12px;
    color: #6b7280;
}

/* ─── Inputs ────────────────────────────────────────────── */

.cab-input, .cab-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s;
}

.cab-input:focus, .cab-select:focus, .cab-textarea:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.cab-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.15s;
}

/* ─── Format Options ────────────────────────────────────── */

.cab-format-options {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.cab-checkbox {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
}

.cab-checkbox input { cursor: pointer; }

/* ─── Customer Search ───────────────────────────────────── */

.cab-customer-area {
    position: relative;
}

.cab-search-results {
    position: absolute;
    z-index: 10;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-top: 4px;
}

.cab-search-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cab-search-item:hover { background: #eff6ff; }

.cab-search-type {
    font-size: 10px;
    padding: 2px 6px;
    background: #f3f4f6;
    border-radius: 4px;
    color: #6b7280;
}

.cab-search-empty {
    padding: 12px;
    color: #9ca3af;
    font-size: 13px;
    text-align: center;
}

.cab-selected-customer {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cab-customer-badge {
    padding: 6px 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    color: #1d4ed8;
}

.cab-clear-customer {
    border: none;
    background: none;
    color: #dc2626;
    font-size: 18px;
    cursor: pointer;
    font-weight: bold;
}

/* ─── Ad Preview ────────────────────────────────────────── */

.cab-ad-preview {
    min-height: 60px;
}

.cab-preview-placeholder {
    color: #9ca3af;
    font-size: 13px;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.cab-preview-ad {
    padding: 12px 14px;
    background: #fffff8;
    border-radius: 4px;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 12px;
    line-height: 1.5;
    color: #1a1a1a;
}

.cab-preview-bordered {
    border: 2px solid #374151;
}

.cab-preview-bold {
    font-weight: 700;
    font-size: 13px;
}

/* ─── Pricing ───────────────────────────────────────────── */

.cab-pricing-placeholder {
    color: #9ca3af;
    font-size: 13px;
    text-align: center;
    padding: 12px;
}

.cab-price-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 3px 0;
    color: #374151;
}

.cab-price-divider {
    border-top: 1px solid #e5e7eb;
    margin: 6px 0;
}

.cab-price-total {
    font-weight: 700;
    font-size: 16px;
    color: #059669;
    padding: 4px 0;
}

.cab-price-bonus {
    color: #059669;
    font-weight: 600;
}

.cab-price-discount {
    color: #2563eb;
    font-weight: 500;
}

/* ─── Rate Explanation ──────────────────────────────────── */

.cab-explain-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid #d1d5db;
    background: white;
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.cab-explain-btn:hover {
    background: #eff6ff;
    border-color: #2563eb;
    color: #2563eb;
}

.cab-explanation {
    background: #fffbeb;
    border-color: #fde68a;
}

.cab-explanation-text {
    font-size: 12px;
    line-height: 1.6;
    color: #92400e;
    font-family: monospace;
}

.cab-explain-line {
    padding: 1px 0;
}

/* ─── Actions ───────────────────────────────────────────── */

.cab-actions {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cab-submit-btn {
    width: 100%;
    padding: 10px;
    font-size: 14px;
}

.cab-total {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: #059669;
}

/* ─── Responsive ────────────────────────────────────────── */

@media (max-width: 800px) {
    .cab-wrapper {
        flex-direction: column;
    }
    .cab-sidebar {
        width: 100%;
        position: static;
    }
}