/* QuoteCalc Admin Builder v2 */

.qc-app {
    max-width: 1100px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 13px;
    color: #1d2327;
}

/* ── Top bar ── */
.qc-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.qc-title-input {
    flex: 1;
    min-width: 200px;
    font-size: 18px !important;
    font-weight: 600 !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0 !important;
    color: #1d2327 !important;
    background: transparent !important;
}
.qc-title-input::placeholder { color: #bbb; font-weight: 400; }
.qc-topbar-right { display: flex; align-items: center; gap: 10px; }

/* ── Two panel layout ── */
.qc-panels {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 16px;
    margin-bottom: 16px;
    align-items: start;
}
@media (max-width: 900px) {
    .qc-panels { grid-template-columns: 1fr; }
}

/* ── Panel shared ── */
.qc-left-panel,
.qc-right-panel {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 18px;
}
.qc-panel-heading {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #50575e;
    margin-bottom: 14px;
}

/* ── Field list ── */
.qc-field-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.qc-empty { color: #aaa; font-style: italic; margin-bottom: 14px; }

/* ── Field card ── */
.qc-field-card {
    border: 1px solid #e2e4e7;
    border-radius: 5px;
    background: #fafafa;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.qc-field-card:hover { border-color: #c5c9d0; box-shadow: 0 1px 6px rgba(0,0,0,0.07); }

.qc-fc-header {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 11px;
}
.qc-drag-handle {
    color: #c5c9d0;
    cursor: grab;
    font-size: 16px;
    user-select: none;
    flex-shrink: 0;
}
.qc-drag-handle:hover { color: #787c82; }

.qc-type-pill {
    font-size: 11px;
    font-weight: 600;
    background: #e8f0fe;
    color: #1a56db;
    padding: 2px 7px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.qc-fc-label-input {
    flex: 1 !important;
    font-weight: 500 !important;
    border-color: transparent !important;
    background: transparent !important;
}
.qc-fc-label-input:hover,
.qc-fc-label-input:focus { border-color: #ddd !important; background: #fff !important; }

.qc-fc-body {
    padding: 12px 14px 14px;
    border-top: 1px solid #f0f0f0;
}
.qc-fc-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.qc-fc-group { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 140px; }
.qc-fc-group label { font-size: 11px; font-weight: 600; color: #646970; text-transform: uppercase; letter-spacing: 0.3px; }

.qc-field-id-hint {
    margin-top: 10px;
    font-size: 11px;
    color: #aaa;
}
.qc-field-id-hint code {
    background: #f0f0f1;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 11px;
    color: #555;
}

/* ── Unit label row ── */
.qc-unit-row { display: flex; flex-direction: column; gap: 5px; }
.qc-unit-input { width: 100% !important; }
.qc-unit-presets { display: flex; flex-wrap: wrap; gap: 4px; }
.qc-preset-btn {
    padding: 2px 8px;
    font-size: 11px;
    border: 1px solid #ddd !important;
    border-radius: 20px !important;
    background: #fff !important;
    color: #555 !important;
    cursor: pointer !important;
    transition: all 0.1s !important;
    box-shadow: none !important;
}
.qc-preset-btn:hover,
.qc-preset-btn.active { background: #2271b1 !important; color: #fff !important; border-color: #2271b1 !important; }

/* ── Options ── */
.qc-options { margin-top: 2px; }
.qc-options-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 11px; font-weight: 600; color: #646970; text-transform: uppercase; letter-spacing: 0.3px; }
.qc-options-header-row { display: flex; gap: 8px; margin-bottom: 4px; padding: 0 2px; }
.qc-col-label  { flex: 1; font-size: 11px; color: #aaa; }
.qc-col-price  { width: 110px; font-size: 11px; color: #aaa; flex-shrink: 0; }
.qc-col-del    { width: 24px; flex-shrink: 0; }
.qc-option-row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.qc-option-row .qc-col-label  { flex: 1; }
.qc-option-row .qc-col-price  { width: 110px; flex-shrink: 0; }

/* ── Add field panel ── */
.qc-add-panel { border-top: 1px dashed #e2e4e7; padding-top: 14px; }
.qc-add-label { font-size: 11px; color: #646970; margin: 0 0 8px; text-transform: uppercase; letter-spacing: 0.3px; font-weight: 600; }
.qc-add-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.qc-add-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: 1px dashed #c5c9d0 !important;
    border-radius: 4px !important;
    background: #fff !important;
    color: #50575e !important;
    font-size: 12px !important;
    cursor: pointer !important;
    transition: all 0.15s !important;
    box-shadow: none !important;
}
.qc-add-btn:hover { border-color: #2271b1 !important; color: #2271b1 !important; background: #f0f6fc !important; }

/* ── Live preview panel ── */
.qc-preview-panel { position: sticky; top: 32px; }
.qc-preview-header {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #50575e;
    margin-bottom: 14px;
}
.qc-preview-form { display: flex; flex-direction: column; gap: 14px; }
.qc-preview-empty { color: #bbb; font-style: italic; font-size: 13px; }
.qc-preview-field { display: flex; flex-direction: column; gap: 5px; }
.qc-preview-label { font-size: 13px; font-weight: 500; color: #1d2327; }

.qc-preview-lineitem { display: flex; align-items: center; gap: 8px; }
.qc-preview-qty { width: 80px !important; }
.qc-preview-unit { font-size: 12px; color: #646970; }
.qc-preview-unit-price { font-size: 12px; color: #aaa; }

.qc-preview-radios,
.qc-preview-checks { display: flex; flex-direction: column; gap: 6px; }
.qc-preview-radio-label { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.qc-preview-opt-price { font-size: 11px; color: #2271b1; font-weight: 500; }

.qc-preview-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0 0;
    border-top: 2px solid #1d2327;
    margin-top: 6px;
    font-weight: 600;
}
.qc-preview-total-amount { font-size: 20px; color: #2271b1; font-weight: 700; }

/* ── Bottom tabs ── */
.qc-bottom {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 16px;
    overflow: hidden;
}
.qc-tabs { display: flex; border-bottom: 1px solid #ddd; }
.qc-tab-btn {
    padding: 11px 20px;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    background: none !important;
    color: #646970 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.15s !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}
.qc-tab-btn:hover { color: #2271b1 !important; background: #f6f7f7 !important; }
.qc-tab-btn.active { color: #2271b1 !important; border-bottom-color: #2271b1 !important; background: #fff !important; }

.qc-tab-content { padding: 20px; }

/* ── Settings groups ── */
.qc-settings-group { margin-bottom: 22px; }
.qc-settings-group:last-child { margin-bottom: 0; }
.qc-settings-group h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: #50575e; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid #f0f0f1; }
.qc-settings-row { display: flex; gap: 16px; flex-wrap: wrap; }
.qc-settings-field { display: flex; flex-direction: column; gap: 5px; min-width: 130px; }
.qc-settings-field label { font-size: 11px; font-weight: 600; color: #646970; text-transform: uppercase; letter-spacing: 0.3px; }
.qc-settings-field-wide { flex: 1; min-width: 250px; }

/* ── Delivery radio options ── */
.qc-radio-group { display: flex; gap: 12px; flex-wrap: wrap; }
.qc-radio-option {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 12px 14px;
    border: 2px solid #e2e4e7;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}
.qc-radio-option input[type="radio"] { margin-top: 2px; flex-shrink: 0; }
.qc-radio-option strong { display: block; margin-bottom: 2px; }
.qc-radio-option p { margin: 0; color: #646970; font-size: 12px; }
.qc-radio-option.selected { border-color: #2271b1; background: #f0f6fc; }

/* ── Advanced formula ── */
.qc-advanced-toggle {
    font-size: 12px;
    font-weight: 600;
    color: #2271b1;
    cursor: pointer;
    user-select: none;
    padding: 4px 0;
}
.qc-advanced-toggle:hover { text-decoration: underline; }
.qc-advanced-body { margin-top: 10px; }
.qc-field-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.qc-field-tag {
    background: #e8f0fe;
    color: #1a56db;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid #c0d3f5;
    transition: background 0.1s;
}
.qc-field-tag:hover { background: #c0d3f5; }

/* ── Embed shortcode ── */
.qc-shortcode-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0f6fc;
    border: 1px solid #c0d3f5;
    border-radius: 5px;
    padding: 10px 14px;
    margin-top: 8px;
}
.qc-shortcode-box code { flex: 1; font-size: 14px; color: #1a56db; user-select: all; }
.qc-copy-btn {
    background: #2271b1 !important;
    color: #fff !important;
    border: none !important;
    padding: 5px 12px !important;
    border-radius: 3px !important;
    font-size: 12px !important;
    cursor: pointer !important;
    white-space: nowrap;
    box-shadow: none !important;
}
.qc-copy-btn:hover { background: #135e96 !important; }

/* ── Shared inputs ── */
.qc-input {
    padding: 6px 9px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    color: #1d2327 !important;
    background: #fff !important;
    box-shadow: none !important;
    transition: border-color 0.15s !important;
    line-height: 1.4 !important;
}
.qc-input:focus { border-color: #2271b1 !important; outline: none !important; box-shadow: 0 0 0 1px #2271b1 !important; }
.qc-input-full  { width: 100% !important; box-sizing: border-box !important; }
.qc-input-sm    { width: 90px !important; }

.qc-select {
    padding: 6px 9px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    background: #fff !important;
    cursor: pointer;
    box-shadow: none !important;
}

/* ── Buttons ── */
.qc-save-btn {
    background: #2271b1 !important;
    color: #fff !important;
    border: none !important;
    padding: 8px 18px !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background 0.15s !important;
    box-shadow: none !important;
}
.qc-save-btn:hover { background: #135e96 !important; }

.qc-icon-btn {
    background: none !important;
    border: 1px solid #e2e4e7 !important;
    color: #787c82 !important;
    font-size: 10px !important;
    padding: 3px 7px !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    box-shadow: none !important;
}
.qc-icon-btn:hover { background: #f6f7f7 !important; }

.qc-del-btn {
    background: none !important;
    border: none !important;
    color: #d63638 !important;
    font-size: 18px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    padding: 2px 5px !important;
    border-radius: 3px !important;
    box-shadow: none !important;
    flex-shrink: 0;
}
.qc-del-btn:hover { background: #fce8e8 !important; }

.qc-link-btn {
    background: none !important;
    border: none !important;
    color: #2271b1 !important;
    font-size: 12px !important;
    cursor: pointer !important;
    padding: 0 !important;
    box-shadow: none !important;
}
.qc-link-btn:hover { text-decoration: underline; }

/* ── Save status ── */
.qc-save-status { font-size: 12px; font-weight: 500; padding: 5px 10px; border-radius: 4px; }
.qc-save-saving { color: #856404; background: #fff3cd; }
.qc-save-saved  { color: #155724; background: #d4edda; }
.qc-save-error  { color: #721c24; background: #f8d7da; }

/* ── Bottom save bar ── */
.qc-bottom-save {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 4px 0 16px;
}

/* ── Misc ── */
.qc-hint { font-size: 12px; color: #787c82; margin: 4px 0 0; line-height: 1.5; }
/* Currency selector row */
.qc-settings-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-end;
}
.qc-settings-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.qc-settings-field label {
    font-size: 11px;
    font-weight: 600;
    color: #646970;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.qc-settings-field .qc-select,
.qc-settings-field .qc-input {
    min-width: 0;
}

.qc-settings-group-sm { margin-bottom: 8px !important; padding-top: 0 !important; }

/* Contact fields section */
.qc-add-label-contact {
    margin-top: 10px !important;
    color: #2271b1 !important;
}
.qc-add-btn-contact {
    border-color: #2271b1 !important;
    color: #2271b1 !important;
}
.qc-add-btn-contact:hover {
    background: #e8f0fe !important;
}
.qc-contact-field-info {
    margin-top: 6px;
    padding: 6px 10px;
    background: #e8f0fe;
    border-radius: 4px;
    border-left: 3px solid #2271b1;
}
.qc-contact-field-info p {
    margin: 0;
    font-size: 12px;
    color: #1a56db;
}
.qc-email-gate-hint { font-size: 0.875em; opacity: 0.65; margin: 0.8em 0; font-style: italic; }