/* ==========================================================================
   settings.css - manager Settings page (tabs + quote editor)
   ========================================================================== */

.set-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}
.set-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'DM Sans', sans-serif;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: -1px;
}
.set-tab:hover { color: var(--text-primary); }
.set-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.set-panel { display: none; }
.set-panel.active { display: block; }

/* ── Logo upload ────────────────────────────────────────────────────── */
.logo-field { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.cq-field-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.logo-upload-row { display: flex; gap: 16px; align-items: flex-start; }
.logo-preview {
    width: 88px;
    height: 88px;
    flex-shrink: 0;
    border: 1px dashed var(--border);
    border-radius: 10px;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.logo-preview-empty { font-size: 26px; color: var(--text-light, var(--text-muted)); }
.logo-upload-actions { display: flex; flex-direction: column; gap: 6px; padding-top: 2px; }
.logo-upload-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.logo-remove-btn { color: #B91C1C; border-color: #f3d0d0; }
.logo-remove-btn:hover { color: #B91C1C; border-color: #B91C1C; }

/* ── Theme colour ───────────────────────────────────────────────────── */
.theme-colour-row { display: flex; align-items: center; gap: 10px; max-width: 260px; }
.theme-colour-row input[type="color"] {
    width: 44px;
    height: 40px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: none;
    cursor: pointer;
    flex-shrink: 0;
}
.theme-colour-hex { text-transform: uppercase; }

/* ── Quote editor ───────────────────────────────────────────────────── */
.qe-service {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 14px;
    overflow: hidden;
}
.qe-service-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 22px;
    cursor: pointer;
}
.qe-service-head:hover { background: var(--bg-light); }
.qe-service-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: var(--bg-accent);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}
.qe-service-name { font-weight: 600; color: var(--text-primary); }
.qe-service-meta { font-size: 12px; color: var(--text-muted); }
.qe-service-spacer { flex: 1; }
.qe-inactive-tag {
    font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
    background: var(--bg-card); color: var(--text-muted);
    border-radius: 5px; padding: 2px 7px;
}
.qe-icon-btn {
    width: 30px; height: 30px; border-radius: 8px;
    border: 1px solid var(--border); background: var(--bg-light);
    color: var(--text-secondary); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; font-size: 15px;
}
.qe-icon-btn:hover { color: var(--text-primary); border-color: var(--text-primary); }
.qe-icon-btn.danger:hover { color: #B91C1C; border-color: #B91C1C; }

.qe-service-body { padding: 6px 22px 18px; border-top: 1px solid var(--border); display: none; }
.qe-service.open .qe-service-body { display: block; }

.qe-q {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 0; border-bottom: 1px solid var(--bg-accent);
}
.qe-q:last-child { border-bottom: none; }
.qe-q-type {
    font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
    background: var(--bg-accent); color: var(--primary);
    border-radius: 5px; padding: 2px 8px; flex-shrink: 0;
}
.qe-q-label { font-size: 14px; color: var(--text-primary); flex: 1; }
.qe-q-summary { font-size: 12px; color: var(--text-muted); }
.qe-add-q {
    margin-top: 12px; background: none; border: 1px dashed var(--border);
    border-radius: 8px; padding: 9px 14px; width: 100%;
    color: var(--primary); font-weight: 600; font-size: 13px; cursor: pointer;
    font-family: 'DM Sans', sans-serif;
}
.qe-add-q:hover { background: var(--bg-accent); }

/* Option rows in the question builder */
.qe-opt-row { display: flex; gap: 8px; margin-bottom: 8px; }
.qe-opt-row .cq-input { flex: 1; }
.qe-opt-row .qe-opt-price { max-width: 120px; }
.qe-opt-remove {
    border: 1px solid var(--border); background: var(--bg-light); color: #B91C1C;
    border-radius: 8px; width: 38px; cursor: pointer; flex-shrink: 0;
}
.qe-add-opt {
    background: none; border: none; color: var(--primary); font-weight: 600;
    font-size: 13px; cursor: pointer; font-family: 'DM Sans', sans-serif; padding: 4px 0;
}
.qe-advanced { cursor: pointer; font-size: 13px; color: var(--text-secondary); font-weight: 600; }

/* Service icon picker (Add / Edit Service) */
.qe-icon-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-light);
}
.qe-icon-option {
    width: 100%;
    aspect-ratio: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--bg-card, #fff);
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    transition: border-color .12s, color .12s, background .12s;
}
.qe-icon-option:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg-accent);
}
.qe-icon-option.active {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg-accent);
    box-shadow: inset 0 0 0 1px var(--primary);
}
.qe-icon-option:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

/* ── Blocked Days (Settings → Booking) ──────────────────────────────── */
.bd-add-row { display: flex; gap: 10px; align-items: flex-end; }
.bd-add-row .cq-field { flex: 1; margin: 0; }
.bd-add-row .qm-btn,
.bd-weekday-save {
    width: auto; flex-shrink: 0; white-space: nowrap; padding: 0 18px; height: 38px;
}

.bd-weekday-picker { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bd-weekday-chip {
    border: 1px solid var(--border); background: var(--white); color: var(--text-primary);
    border-radius: 8px; padding: 9px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
    font-family: 'DM Sans', sans-serif; transition: all 0.15s;
}
.bd-weekday-chip:hover { border-color: var(--primary); background: var(--bg-accent); }
.bd-weekday-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.bd-list-group { margin-bottom: 16px; }
.bd-list-group-title { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin: 0 0 8px; }
.bd-row {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px;
    border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; font-size: 14px;
    background: var(--white);
}
.bd-row-label { flex: 1; color: var(--text-primary); font-weight: 500; }
.bd-row-remove {
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); background: var(--bg-light); color: var(--text-muted);
    border-radius: 7px; width: 30px; height: 30px; cursor: pointer; flex-shrink: 0;
    font-size: 14px; transition: all 0.15s;
}
.bd-row-remove:hover { border-color: #FECACA; background: #FEE2E2; color: #B91C1C; }

/* Conflict / reschedule modal */
.bd-modal {
    position: fixed; inset: 0; background: rgba(17, 24, 39, 0.55);
    display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px;
    backdrop-filter: blur(1px);
}
.bd-modal[hidden] { display: none; }
.bd-modal-card {
    background: #fff; border-radius: 16px; max-width: 560px; width: 100%;
    max-height: 85vh; overflow-y: auto; padding: 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.bd-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.bd-modal-title {
    font-size: 18px; font-weight: 700; color: var(--text-primary); margin: 0;
    display: flex; align-items: center; gap: 9px;
}
.bd-modal-title i { color: #D97706; font-size: 20px; }
.bd-modal-close-btn {
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    border: 1px solid var(--border); background: var(--bg-light); color: var(--text-muted);
    border-radius: 50%; width: 32px; height: 32px; cursor: pointer; transition: all 0.15s;
}
.bd-modal-close-btn:hover { color: var(--text-primary); border-color: var(--text-primary); }
.bd-modal-sub { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin: 8px 0 20px; }

.bd-conflict-job {
    border: 1px solid var(--border); border-radius: 12px; padding: 16px;
    margin-bottom: 14px; background: var(--bg-light);
}
.bd-conflict-job:last-child { margin-bottom: 0; }
.bd-conflict-job-head { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; line-height: 1.5; }
.bd-conflict-job-head strong { display: block; font-size: 15px; color: var(--text-primary); margin-bottom: 2px; }

.bd-conflict-job .cq-field { margin-bottom: 12px; }
.bd-conflict-job .cq-foot { padding-top: 4px; border-top: none; }
.bd-conflict-job .qm-btn { width: auto; padding: 0 18px; height: 38px; }

/* Slot grid inside the reschedule card - mirrors the customer picker */
.bd-resched-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 4px;
}
.bd-slot-btn {
    padding: 10px 8px; border: 1px solid var(--border); background: var(--white);
    border-radius: 8px; text-align: center; cursor: pointer; transition: all 0.15s;
    font-family: 'DM Sans', sans-serif;
}
.bd-slot-btn:hover:not(:disabled) { border-color: var(--primary); background: var(--bg-accent); }
.bd-slot-btn.selected { border-color: var(--primary); background: var(--bg-accent); color: var(--primary); font-weight: 600; }
.bd-slot-btn:disabled {
    background: var(--bg-card, var(--bg-light)); color: var(--text-light, var(--text-muted));
    cursor: not-allowed; text-decoration: line-through; opacity: 0.5;
}
.bd-slot-time { display: block; font-size: 13px; font-weight: 600; color: inherit; }
.bd-slot-label { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Handled SaaS Billing tab ───────────────────────────────── */
.billing-wrap { max-width: 720px; }
.billing-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem 1.75rem;
    background: var(--bg-card, var(--white));
}
.billing-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.billing-kicker {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 .35rem;
}
.billing-plan {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}
.billing-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: .35rem .75rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 700;
    white-space: nowrap;
}
.billing-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}
.billing-status--ok { background: #d1fae5; color: #047857; }
.billing-status--trial,
.billing-status--first30 { background: #fef3c7; color: #b45309; }
.billing-status--warn { background: #ffedd5; color: #c2410c; }
.billing-status--locked { background: #fee2e2; color: #b91c1c; }
.billing-status--muted { background: #f3f4f6; color: #6b7280; }
.billing-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.25rem;
    margin: 0 0 1.5rem;
}
.billing-grid dt {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.billing-grid dd {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}
.billing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: .75rem;
}
.billing-actions .qm-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.billing-action-error {
    margin: 0 0 .75rem;
    font-size: 13px;
    color: #b91c1c;
}
.billing-footnote {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.45;
    margin: 0;
}
.billing-alert {
    border-radius: 12px;
    padding: 1rem 1.1rem;
    margin-bottom: 1.25rem;
}
.billing-alert--warn { background: #fff7ed; border: 1px solid #fdba74; }
.billing-alert--locked { background: #fef2f2; border: 1px solid #fca5a5; }
.billing-alert-title {
    font-weight: 700;
    margin: 0 0 .35rem;
    color: var(--text-primary);
}
.billing-alert-body {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* Soft-lock overlay on manager portal */
.billing-lock-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(15, 23, 42, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}
.billing-lock-panel {
    width: min(480px, 100%);
    background: var(--bg-card, #fff);
    border-radius: 18px;
    padding: 1.75rem;
    box-shadow: 0 20px 50px rgba(0,0,0,.25);
    text-align: left;
}
.billing-lock-panel h2 {
    margin: 0 0 .5rem;
    font-size: 1.35rem;
}
.billing-lock-panel p {
    margin: 0 0 1rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.billing-lock-panel .billing-actions { margin-bottom: 0; }

.sidebar-item.billing-nav-disabled {
    opacity: 0.35;
    pointer-events: none;
}

@media (max-width: 640px) {
    .billing-grid { grid-template-columns: 1fr; }
    .billing-hero { flex-direction: column; }
}

