/* ============================================================
   AI Quotation — self-contained styles for the additive tab.
   No existing view selectors are overridden here.
   ============================================================ */

.ai-quotation {
    max-width: 1420px;
    margin: 0 auto;
}

.aiq-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
    padding: 22px 24px;
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-lg);
    background: linear-gradient(115deg, var(--gold-dim), var(--bg-card) 52%, rgba(59, 130, 246, 0.08));
    box-shadow: var(--shadow-sm);
}

.aiq-eyebrow {
    margin-bottom: 5px;
    color: var(--gold);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.aiq-hero h1,
.aiq-review-head h2,
.aiq-source-card h2,
.aiq-guide-card h2 {
    color: var(--text);
    font-size: 19px;
    font-weight: 750;
    letter-spacing: -0.25px;
}

.aiq-hero p,
.aiq-review-head p,
.aiq-section-title p,
.aiq-guide-card p {
    margin-top: 5px;
    color: var(--text2);
    font-size: 12.5px;
    line-height: 1.55;
}

.aiq-hero p {
    max-width: 790px;
}

.aiq-hero-marker,
.aiq-guide-icon {
    display: grid;
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(212, 168, 67, 0.42);
    border-radius: 14px;
    color: var(--gold2);
    background: rgba(212, 168, 67, 0.11);
    box-shadow: 0 0 22px rgba(212, 168, 67, 0.16);
    font-size: 23px;
}

.aiq-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.65fr);
    gap: 16px;
    align-items: stretch;
}

.aiq-source-card,
.aiq-guide-card,
.aiq-review-card {
    border-color: var(--border);
}

.aiq-source-card textarea {
    min-height: 292px;
    resize: vertical;
    line-height: 1.55;
}

.aiq-section-title,
.aiq-review-head,
.aiq-summary-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.aiq-section-title h2,
.aiq-section-title h3 {
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.aiq-source-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
}

.aiq-source-actions span,
.aiq-save-note,
.aiq-catalog-match {
    color: var(--text3);
    font-size: 11px;
    line-height: 1.4;
}

.aiq-voice-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.aiq-voice-tools .aiq-language-label {
    margin: 0 2px 0 8px;
    color: var(--text3);
    font-size: 11px;
}

.aiq-voice-tools select {
    width: auto;
    min-width: 132px;
    padding: 7px 28px 7px 9px;
    font-size: 11px;
}

.aiq-help {
    margin-top: 8px;
    color: var(--text3);
    font-size: 11px;
    line-height: 1.45;
}

.aiq-refinement {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-md);
    background: rgba(212, 168, 67, 0.06);
}

.aiq-refinement h3 {
    color: var(--text);
    font-size: 13px;
}

.aiq-refinement textarea {
    min-height: 150px;
    margin-top: 6px;
}

.aiq-refinement details {
    margin-top: 9px;
}

.aiq-refinement summary {
    color: var(--text2);
    cursor: pointer;
    font-size: 11px;
}

.aiq-fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.aiq-model-panel { margin-bottom: 16px; padding: 12px; border: 1px solid var(--border-gold); border-radius: var(--radius-md); }
.aiq-model-panel summary { cursor: pointer; color: var(--text2); font-size: 12px; margin-bottom: 10px; }
.ai-quotation .aiq-check { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0; font-size: 11px; line-height: 1.5; color: var(--text2); text-transform: none; }
.ai-quotation .aiq-check input { width: auto; flex: 0 0 auto; margin-top: 3px; }
.aiq-model-panel a { color: var(--gold); }

.aiq-fieldset:disabled {
    opacity: 0.82;
}

.aiq-guide-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.aiq-guide-card .aiq-guide-icon {
    margin-bottom: 16px;
}

.aiq-guide-card ul {
    display: grid;
    gap: 9px;
    margin: 17px 0 4px;
    padding: 0;
    list-style: none;
}

.aiq-guide-card li {
    position: relative;
    padding-left: 18px;
    color: var(--text2);
    font-size: 12px;
}

.aiq-guide-card li::before {
    position: absolute;
    top: 1px;
    left: 0;
    color: var(--gold);
    content: '✓';
    font-weight: 800;
}

.aiq-format-example {
    max-height: 236px;
    margin: 16px 0 12px;
    padding: 12px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: #c8cedf;
    background: rgba(0, 0, 0, 0.2);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10.5px;
    line-height: 1.55;
    white-space: pre-wrap;
}

.aiq-match-note {
    display: inline-block;
    margin-left: 6px;
    color: var(--success);
    font-size: 10.5px;
    font-weight: 600;
}

.aiq-review-card {
    margin-top: 18px;
}

.aiq-review-head {
    margin-bottom: 18px;
}

.aiq-draft-badge {
    flex: 0 0 auto;
    padding: 5px 9px;
    border: 1px solid var(--border-gold);
    border-radius: 999px;
    color: var(--gold2);
    background: var(--gold-dim);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.55px;
    text-transform: uppercase;
}

.aiq-alert {
    margin: 9px 0;
    padding: 10px 12px;
    border: 1px solid;
    border-radius: var(--radius-sm);
    font-size: 12px;
    line-height: 1.45;
}

.aiq-alert.warning {
    border-color: var(--warning-border);
    color: #f8cd7d;
    background: var(--warning-bg);
}

.aiq-alert.info {
    border-color: var(--info-border);
    color: #98c7ff;
    background: var(--info-bg);
}

.aiq-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.aiq-field-grid .fg {
    margin-bottom: 0;
}

.aiq-wide {
    grid-column: 1 / -1;
}

.aiq-discount-control {
    display: flex;
}

.aiq-discount-control input {
    min-width: 0;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.aiq-discount-control select {
    width: 106px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.aiq-items-section {
    margin-top: 24px;
}

.aiq-table-wrap {
    margin-top: 10px;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.aiq-items-table {
    min-width: 650px;
}

.aiq-items-table input {
    width: 100%;
    padding: 6px 8px;
    font-size: 12px;
}

.aiq-items-table td {
    vertical-align: middle;
}

.aiq-number-input {
    min-width: 78px;
    text-align: right;
}

.aiq-num-col {
    width: 92px;
    text-align: center;
}

.aiq-price-col,
.aiq-total-col {
    width: 132px;
    text-align: right;
}

.aiq-row-total {
    color: var(--gold2);
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.aiq-catalog-match {
    display: block;
    margin-top: 4px;
    color: var(--success);
}

.aiq-empty-row {
    padding: 24px !important;
    color: var(--text3);
    text-align: center;
}

.aiq-notes-field {
    margin-top: 18px;
}

.aiq-summary-row {
    align-items: center;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.aiq-summary {
    display: grid;
    grid-template-columns: auto auto;
    gap: 4px 18px;
    min-width: 250px;
    color: var(--text2);
    font-size: 12px;
}

.aiq-summary strong {
    color: var(--text);
    text-align: right;
}

.aiq-grand-total-label,
.aiq-grand-total {
    margin-top: 5px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    color: var(--gold) !important;
    font-size: 15px;
    font-weight: 800;
}

.aiq-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 7px;
}

.aiq-generated-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border: 1px solid var(--success-border);
    border-radius: var(--radius-md);
    background: var(--success-bg);
}

.aiq-generated-result strong {
    display: block;
    color: #b9f6d5;
    font-size: 12.5px;
}

.aiq-generated-result span {
    display: block;
    margin-top: 3px;
    color: var(--text2);
    font-size: 11px;
}

.aiq-generated-actions {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}

.ai-quotation :is(input, select, textarea):disabled {
    cursor: default;
    opacity: 0.68;
}

@media (max-width: 900px) {
    .aiq-workspace {
        grid-template-columns: 1fr;
    }

    .aiq-guide-card {
        min-height: auto;
    }
}

@media (max-width: 768px) {
    .aiq-hero {
        align-items: flex-start;
        padding: 18px 16px;
    }

    .aiq-hero h1 {
        font-size: 18px;
    }

    .aiq-hero-marker {
        width: 42px;
        height: 42px;
        border-radius: 11px;
        font-size: 19px;
    }

    .aiq-field-grid {
        grid-template-columns: 1fr;
    }

    .aiq-wide {
        grid-column: auto;
    }

    .aiq-source-actions,
    .aiq-summary-row {
        align-items: stretch;
        flex-direction: column;
    }

    .aiq-voice-tools {
        align-items: stretch;
    }

    .aiq-voice-tools .btn,
    .aiq-voice-tools select {
        flex: 1 1 145px;
        justify-content: center;
        width: 100%;
    }

    .aiq-voice-tools .aiq-language-label {
        flex: 1 1 100%;
        margin: 2px 0 -3px;
    }

    .aiq-source-actions .btn,
    .aiq-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .aiq-actions {
        align-items: stretch;
    }

    .aiq-generated-result,
    .aiq-generated-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .aiq-generated-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .aiq-save-note {
        text-align: center;
    }

    .aiq-summary {
        width: 100%;
    }
}

/* ============================================================
   LIGHT MODE (White Mode) ADAPTATIONS
   ============================================================ */
:root[data-theme="light"] .aiq-hero,
body.light-mode .aiq-hero,
[data-theme="light"] .aiq-hero {
    background: linear-gradient(120deg, rgba(212, 168, 67, 0.12) 0%, #ffffff 42%, rgba(248, 250, 252, 0.96) 75%, rgba(59, 130, 246, 0.05) 100%) !important;
    border: 1px solid rgba(180, 130, 20, 0.3) !important;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04) !important;
}

:root[data-theme="light"] .aiq-hero h1,
body.light-mode .aiq-hero h1,
[data-theme="light"] .aiq-hero h1 {
    color: #0f172a !important;
    font-weight: 750 !important;
}

:root[data-theme="light"] .aiq-hero p,
body.light-mode .aiq-hero p,
[data-theme="light"] .aiq-hero p {
    color: #475569 !important;
}

:root[data-theme="light"] .aiq-eyebrow,
body.light-mode .aiq-eyebrow,
[data-theme="light"] .aiq-eyebrow {
    color: #b48214 !important;
}

:root[data-theme="light"] .aiq-hero-marker,
body.light-mode .aiq-hero-marker,
[data-theme="light"] .aiq-hero-marker {
    background: linear-gradient(135deg, rgba(212, 168, 67, 0.16), rgba(212, 168, 67, 0.06)) !important;
    border: 1px solid rgba(180, 130, 20, 0.35) !important;
    color: #b48214 !important;
    box-shadow: 0 2px 12px rgba(180, 130, 20, 0.14) !important;
}

:root[data-theme="light"] .aiq-section-title h2,
:root[data-theme="light"] .aiq-section-title h3,
:root[data-theme="light"] .aiq-review-head h2,
:root[data-theme="light"] .aiq-source-card h2,
:root[data-theme="light"] .aiq-guide-card h2,
:root[data-theme="light"] .aiq-refinement h3,
body.light-mode .aiq-section-title h2,
body.light-mode .aiq-section-title h3,
body.light-mode .aiq-review-head h2,
body.light-mode .aiq-source-card h2,
body.light-mode .aiq-guide-card h2,
body.light-mode .aiq-refinement h3,
[data-theme="light"] .aiq-section-title h2,
[data-theme="light"] .aiq-section-title h3,
[data-theme="light"] .aiq-review-head h2,
[data-theme="light"] .aiq-source-card h2,
[data-theme="light"] .aiq-guide-card h2,
[data-theme="light"] .aiq-refinement h3 {
    color: #0f172a !important;
}

:root[data-theme="light"] .aiq-source-card,
:root[data-theme="light"] .aiq-guide-card,
:root[data-theme="light"] .aiq-review-card,
body.light-mode .aiq-source-card,
body.light-mode .aiq-guide-card,
body.light-mode .aiq-review-card,
[data-theme="light"] .aiq-source-card,
[data-theme="light"] .aiq-guide-card,
[data-theme="light"] .aiq-review-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03) !important;
}

:root[data-theme="light"] .aiq-summary strong,
body.light-mode .aiq-summary strong,
[data-theme="light"] .aiq-summary strong {
    color: #0f172a !important;
}

:root[data-theme="light"] .aiq-format-example,
body.light-mode .aiq-format-example,
[data-theme="light"] .aiq-format-example {
    color: #334155 !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

:root[data-theme="light"] .aiq-refinement,
body.light-mode .aiq-refinement,
[data-theme="light"] .aiq-refinement {
    background: rgba(212, 168, 67, 0.05) !important;
    border: 1px solid rgba(180, 130, 20, 0.3) !important;
}

:root[data-theme="light"] .aiq-model-panel,
body.light-mode .aiq-model-panel,
[data-theme="light"] .aiq-model-panel {
    border: 1px solid rgba(180, 130, 20, 0.28) !important;
    background: #fbfbfd !important;
}

:root[data-theme="light"] .aiq-model-panel summary,
body.light-mode .aiq-model-panel summary,
[data-theme="light"] .aiq-model-panel summary {
    color: #334155 !important;
}

:root[data-theme="light"] .aiq-draft-badge,
body.light-mode .aiq-draft-badge,
[data-theme="light"] .aiq-draft-badge {
    background: rgba(180, 130, 20, 0.1) !important;
    border: 1px solid rgba(180, 130, 20, 0.3) !important;
    color: #8d6205 !important;
}

:root[data-theme="light"] .aiq-table-wrap,
body.light-mode .aiq-table-wrap,
[data-theme="light"] .aiq-table-wrap {
    border: 1px solid #e2e8f0 !important;
}

:root[data-theme="light"] .aiq-items-table th,
body.light-mode .aiq-items-table th,
[data-theme="light"] .aiq-items-table th {
    background: #f8fafc !important;
    color: #475569 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}
