/* The quotation workspace uses the same light surfaces and navy controls as CRM. */
:root {
    --ink: #17233a;
    --muted: #52627a;
    --line: #e4e8ee;
    --border: #d9e0e9;
    --surface: #fff;
    --canvas: #f7f9fc;
    --blue: #18365f;
    --blue-dark: #112947;
    --accent: #edf4ff;
    --ring: #5676a3;
    --green: #25815e;
    --danger: #c23b4a;
    --shadow: none;
    color-scheme: light;
    font-family: Inter, system-ui, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

.panel, .modal { border: 1px solid var(--line); border-radius: 10px; }
.panel { min-width: 0; }
.panel-heading, .data-toolbar { padding: 16px 20px; }
.panel-heading h3, .data-toolbar h3, .gold-price-results-heading h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 650;
    line-height: 1.45;
}
.data-toolbar p { font-size: 13px; line-height: 1.55; }
.eyebrow { display: none; }
.pill { color: var(--blue); background: var(--accent); font-weight: 600; }
.button, .sso-login-button {
    min-height: 36px;
    padding: 7px 14px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-weight: 600;
    box-shadow: none;
}
.button-ghost { color: var(--ink); border-color: var(--border); background: var(--surface); }
.button-ghost:hover { background: var(--canvas); }
.button-primary { border-color: var(--blue); }
.form-section-title, .field > span { font-weight: 600; }
.form-section-title span { background: var(--accent); color: var(--blue); }
.field input, .field textarea, .field select,
.toolbar-actions input, .toolbar-actions select,
.history-filter-bar input, .history-filter-bar select {
    min-width: 0;
    border-color: var(--border);
    border-radius: 6px;
}
.field input:focus, .field select:focus, .field textarea:focus,
.history-filter-bar input:focus, .history-filter-bar select:focus {
    border-color: var(--ring);
    box-shadow: 0 0 0 2px var(--accent);
}
.data-table th { color: var(--muted); background: var(--canvas); font-weight: 600; }
.data-table tbody tr:hover td { background: #f5f8fd; }
.history-filter-bar, .grid-meta, .role-summary { background: var(--canvas); }
.history-filter-bar label > span { font-size: 12px; font-weight: 500; }
.history-page-button.active, .rule-category-tabs button.active {
    color: var(--blue);
    border-color: #c4d5ec;
    background: var(--accent);
    box-shadow: none;
}

/* Empty and calculated results share a white panel, with totals set in CRM navy. */
.result-panel, .detail-result, .mid-sale-result-panel {
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: none;
}
.result-placeholder, .mid-sale-result-placeholder { color: var(--muted); }
.result-placeholder h3, .mid-sale-result-placeholder h3 {
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
}
.result-orbit, .quote-page .result-orbit, .mid-sale-result-placeholder > span {
    width: 46px;
    height: 46px;
    border: 1px solid #d7e3f3;
    border-radius: 10px;
    background: var(--accent);
    color: var(--blue);
    font-size: 21px;
    box-shadow: none;
}
.final-price { border-color: var(--line); }
.final-price strong, .final-price sup { color: var(--blue); font-variant-numeric: tabular-nums; }
.final-price small, .final-price em, .weight-grid small, .weight-grid span,
.quote-value-grid small, .breakdown span, .trace-note { color: var(--muted); }
.weight-grid > div, .quote-value-grid > div {
    background: var(--canvas);
    border: 1px solid var(--line);
    border-radius: 7px;
}
.quote-value-grid strong, .trace-note a { color: var(--blue); }
.metal-weight-warning { color: #962b3a; background: #fff2f3; border-color: #ebbac1; }
.breakdown > div { border-color: var(--line); }
.quote-page .form-panel .form-actions { background: var(--surface); box-shadow: none; }
.mid-sale-result-table { background: var(--canvas); border: 1px solid var(--line); border-radius: 7px; }
.mid-sale-result-row + .mid-sale-result-row, .mid-sale-result-row > * + *,
.mid-sale-result-row p[lang="en"] { border-color: var(--line); }
.mid-sale-result-index { color: var(--blue); background: var(--accent); }
.mid-sale-result-row p { color: var(--ink); font-weight: 550; }
.mid-sale-result-row p[lang="en"] { color: var(--muted); font-weight: 500; }

.sso-login-page, .sso-error-page { background: var(--canvas); }
.sso-login-card, .sso-error-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: none;
}
.sso-login-card .login-logo { display: block; width: 46px; height: 46px; margin: 0 auto 18px; }
.sso-login-card h1, .sso-error-card h1 { font-size: 22px; }
.sso-login-button { min-height: 40px; font-size: 14px; }
.sso-login-return, .sso-error-card p { color: var(--muted); }
.sso-error-card a { color: var(--blue); text-decoration: underline; }

@media (min-width: 1101px) {
    .quote-page .quote-layout { grid-template-columns: minmax(0, 1.7fr) minmax(260px, .8fr); }
}
@media (min-width: 761px) and (max-width: 1260px) {
    .quote-basics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .quote-basics .reference-field { grid-column: auto; grid-row: auto; }
}
@media (max-width: 760px) {
    .data-toolbar, .panel-heading { padding: 14px 16px; }
    .result-panel, .detail-result, .mid-sale-result-panel { min-height: auto; }
    .result-placeholder, .mid-sale-result-placeholder { min-height: 180px; }
    .data-table-wrap.history-table-wrap { max-height: max(310px, 58vh); }
}
