:root {
  --ink: #17212b;
  --muted: #718092;
  --line: #e6ebf0;
  --soft: #f5f7f9;
  --paper: #ffffff;
  --navy: #1b3447;
  --teal: #167d78;
  --teal-soft: #e7f5f2;
  --gold: #c98326;
  --gold-soft: #fff4df;
  --red: #bd4d51;
  --red-soft: #fff0ef;
  --canvas: #f2f6f6;
  --shadow: 0 12px 32px rgba(21, 42, 57, .07);
  font-family: "Inter", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-size: 15px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell[hidden], .login-screen[hidden] { display: none; }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 28px 18px; background: #edf3f3; }
.login-card { width: min(420px, 100%); background: var(--paper); border: 1px solid var(--line); box-shadow: 0 18px 45px rgba(21, 42, 57, .11); padding: 34px; }
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 34px; }
.login-brand-mark { width: 38px; height: 38px; display: grid; place-items: center; background: var(--navy); color: #dceeea; font-size: 19px; font-weight: 800; }
.login-brand strong { display: block; font-size: 18px; }
.login-brand span:not(.login-brand-mark) { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.login-heading h1 { margin-bottom: 8px; font-size: 28px; }
.login-heading p:not(.eyebrow) { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.login-form { display: grid; gap: 13px; }
.login-form .form-field { gap: 7px; }
.login-form .form-field > span { font-size: 13px; font-weight: 650; }
.login-form input { min-height: 42px; }
.login-submit { width: 100%; min-height: 42px; margin-top: 4px; }
.login-error { margin: 0; padding: 9px 10px; background: var(--red-soft); color: var(--red); font-size: 13px; }
.login-error[hidden] { display: none; }
.login-demo-note { display: grid; gap: 4px; margin-top: 23px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.5; }
.login-demo-note strong { color: var(--ink); font-size: 13px; }
.account-menu-logout { color: var(--red) !important; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 248px; flex: 0 0 248px; background: var(--navy); color: #d9e5eb; display: flex; flex-direction: column; padding: 22px 14px 18px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 12px 34px; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; background: #dceeea; color: var(--navy); font-size: 18px; font-weight: 800; }
.brand strong { display: block; color: #fff; font-size: 17px; letter-spacing: .03em; }
.brand span { display: block; color: #9eb4c0; font-size: 12px; margin-top: 3px; }
.workspace-label { color: #76909f; font-size: 12px; letter-spacing: .12em; padding: 0 12px 9px; text-transform: uppercase; }
.nav-list { display: grid; gap: 5px; }
.nav-item { width: 100%; border: 0; background: transparent; color: #a9bdc8; text-align: left; padding: 12px 14px; display: flex; align-items: center; gap: 11px; border-radius: 5px; transition: background .18s, color .18s; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-item.is-active { color: #fff; background: #2a4a5d; box-shadow: inset 3px 0 var(--teal); }
.nav-icon { width: 20px; text-align: center; color: #8fb3ba; font-size: 19px; }
.nav-item.is-active .nav-icon { color: #9fe0d5; }
.sidebar-footer { margin-top: auto; padding: 16px 12px 0; border-top: 1px solid rgba(220, 238, 234, .14); }
.security-note { display: flex; align-items: center; gap: 7px; color: #8fa6b2; font-size: 13px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #58c6a7; box-shadow: 0 0 0 3px rgba(88,198,167,.14); }
.text-button { padding: 0; border: 0; background: none; color: #78909e; font-size: 13px; margin-top: 17px; }
.text-button:hover { color: #fff; }

.main-content { min-width: 0; flex: 1; background: var(--canvas); }
.topbar { height: 70px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.9); display: flex; justify-content: space-between; align-items: center; padding: 0 34px; }
.breadcrumb { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 14px; }
.breadcrumb b { font-weight: 400; color: #bdc8d1; }
.breadcrumb strong { color: var(--ink); font-weight: 650; }
.topbar-actions { display: flex; align-items: center; gap: 22px; }
.icon-button { border: 0; background: transparent; color: var(--muted); width: 34px; height: 34px; display: grid; place-items: center; position: relative; font-size: 22px; }
.icon-button:hover { color: var(--ink); background: var(--soft); }
.notification-button:hover { color: var(--ink); background: var(--soft); }
.notification-bell-icon { display: block; width: 23px; height: 23px; overflow: visible; }
.notification-badge { position: absolute; right: 0; top: 0; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 10px; background: var(--red); color: #fff; font-size: 10px; display: grid; place-items: center; font-weight: 700; }
.notification-badge[hidden] { display: none; }
.user-menu { position: relative; display: flex; align-items: center; min-width: 0; }
.account-trigger { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 5px 9px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--ink); text-align: left; transition: background .16s, border-color .16s; }
.account-trigger:hover, .account-trigger[aria-expanded="true"] { border-color: #e3ecea; background: #f7faf9; }
.account-identity { min-width: 104px; }
.account-identity strong, .account-identity > span { display: block; }
.account-identity strong { font-size: 13px; font-weight: 700; white-space: nowrap; }
.account-identity > span { margin-top: 2px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.avatar { width: 33px; height: 33px; display: flex; align-items: center; justify-content: center; flex: 0 0 33px; padding: 0; margin: 0; background: #e6f0ef; color: var(--teal); font-weight: 700; border-radius: 50%; line-height: 1; text-align: center; text-indent: 0; }
.account-caret { margin-left: 1px; color: #87959f; font-size: 16px; line-height: 1; transition: transform .16s; }
.account-trigger[aria-expanded="true"] .account-caret { transform: rotate(180deg); }
.account-menu { position: absolute; z-index: 60; top: calc(100% + 9px); right: 0; width: 232px; padding: 7px; border: 1px solid #e3e9ec; border-radius: 11px; background: #fff; box-shadow: 0 14px 36px rgba(24, 44, 58, .16); animation: fade-in .14s ease; }
.account-menu[hidden] { display: none; }
.account-menu-heading { display: grid; gap: 4px; padding: 11px 11px 13px; margin-bottom: 5px; border-bottom: 1px solid var(--line); }
.account-menu-heading strong { font-size: 13px; }
.account-menu-heading span { color: var(--muted); font-size: 12px; }
.account-menu > button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--ink); font-size: 13px; text-align: left; }
.account-menu > button:hover { background: #f2f7f6; }
.account-menu > button.account-menu-logout:hover { background: #fff3f2; }
.account-menu-icon { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 7px; background: #eef5f3; color: var(--teal); font-size: 12px; font-weight: 700; }
.account-menu-logout .account-menu-icon { background: #fff0ef; color: var(--red); font-size: 16px; }
.page-container { max-width: 1540px; margin: 0 auto; padding: 24px 30px 48px; }
.view { display: none; }
.view.is-visible { display: block; animation: fade-in .22s ease; }
@keyframes fade-in { from { opacity: .2; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.page-heading.compact { align-items: center; }
.eyebrow { color: var(--teal); letter-spacing: .12em; font-size: 11px; font-weight: 750; margin: 0 0 8px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: 29px; letter-spacing: -.02em; line-height: 1.15; margin-bottom: 8px; }
h2 { font-size: 17px; margin-bottom: 4px; letter-spacing: -.01em; }
.heading-copy, .panel-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.heading-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.button { min-height: 36px; border: 1px solid transparent; padding: 0 14px; border-radius: 4px; font-size: 14px; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: all .18s; }
.button.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.button.primary:hover { background: #116a66; border-color: #116a66; }
.button.secondary { background: #fff; color: var(--ink); border-color: #d8e0e5; }
.button.secondary:hover { border-color: var(--teal); color: var(--teal); }
.button.ghost { border: 0; color: var(--muted); background: transparent; padding: 0 8px; }
.button.ghost:hover { color: var(--teal); }
.link-button { border: 0; background: transparent; color: var(--teal); font-size: 13px; padding: 4px 0; }
.small-muted { color: var(--muted); font-size: 13px; }

.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric-card { background: var(--paper); border: 1px solid var(--line); min-height: 122px; padding: 18px 18px 15px; position: relative; overflow: hidden; }
.metric-card::after { content: ""; position: absolute; width: 58px; height: 58px; border-radius: 50%; background: var(--accent-soft); right: -20px; top: -20px; }
.metric-card .metric-label { color: var(--muted); font-size: 13px; position: relative; z-index: 1; }
.metric-card strong { display: block; font-size: 29px; line-height: 1.2; margin: 12px 0 6px; letter-spacing: -.04em; position: relative; z-index: 1; }
.metric-card .metric-foot { color: var(--muted); font-size: 12px; position: relative; z-index: 1; }
.metric-card .metric-foot em { font-style: normal; color: var(--teal); font-weight: 700; }
.data-clickable { cursor: pointer; }
.data-clickable:hover { background: #fbfdfd; }
.data-metric-grid .data-clickable:hover { border-color: var(--teal); transform: translateY(-1px); box-shadow: var(--shadow); }
.metric-card.accent-teal { --accent-soft: var(--teal-soft); }
.metric-card.accent-gold { --accent-soft: var(--gold-soft); }
.metric-card.accent-red { --accent-soft: var(--red-soft); }
.metric-card.accent-navy { --accent-soft: #eaf0f5; }
.dashboard-metric-card { width: 100%; color: inherit; text-align: left; font: inherit; cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.dashboard-metric-card:hover { border-color: #a9cfca; box-shadow: 0 7px 20px rgba(35, 75, 82, .09); transform: translateY(-1px); }
.dashboard-metric-card:focus-visible { outline: 3px solid rgba(22,125,120,.18); outline-offset: 2px; }
.dashboard-metric-card .metric-open-hint { position: absolute; right: 13px; bottom: 12px; z-index: 1; color: var(--teal); font-size: 11px; font-weight: 700; }
.dashboard-metric-card .metric-foot { display: block; padding-right: 76px; }
.dashboard-detail-panel table { min-width: 980px; }
.dashboard-detail-panel .customer-name-button { text-align: left; }
.table-cell-subtext { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.visit-panel { margin-bottom: 16px; }
.visit-list { display: grid; gap: 0; }
.visit-item { display: grid; grid-template-columns: 58px 1fr auto auto; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #eff2f4; }
.visit-item:last-child { border-bottom: 0; }
.visit-item.is-due { background: #fffaf2; margin: 0 -10px; padding-left: 10px; padding-right: 10px; }
.visit-time { color: var(--teal); font-size: 16px; font-weight: 750; }
.visit-item strong { display: block; font-size: 13px; }
.visit-customer-link { cursor: pointer; color: var(--ink); transition: color .18s; }
.visit-project-link { display: block; padding: 0; border: 0; background: transparent; color: var(--teal); font: inherit; font-size: 13px; font-weight: 700; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.visit-customer-link:hover, .visit-customer-link:focus { color: var(--teal); text-decoration: underline; outline: 0; }
.visit-item span:not(.visit-time):not(.status-tag) { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.reminder-banner { display: flex; align-items: center; gap: 11px; background: var(--gold-soft); border: 1px solid #f0d9aa; padding: 13px; }
.reminder-icon { width: 27px; height: 27px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: 0 0 27px; padding: 0; margin: 0; background: var(--gold); color: #fff; font-weight: 800; line-height: 1; text-align: center; text-indent: 0; }
.reminder-banner strong { font-size: 14px; }
.reminder-banner p { margin: 4px 0 0; color: #896329; font-size: 12px; }
.notification-alert { display: flex; align-items: center; gap: 11px; background: var(--red-soft); border: 1px solid #f1d2d1; padding: 13px; }
.notification-alert-icon { width: 27px; height: 27px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: 0 0 27px; padding: 0; margin: 0; background: var(--red); color: #fff; font-weight: 800; line-height: 1; text-align: center; text-indent: 0; }
.notification-alert strong { font-size: 14px; }
.notification-alert p { margin: 4px 0 0; color: #9b4c4d; font-size: 12px; }
.visit-history { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.dashboard-filter-panel { margin-bottom: 16px; padding: 14px 16px 16px; border: 1px solid #dfe9e8; background: #f7faf9; box-shadow: 0 4px 16px rgba(35, 75, 82, .04); }
.dashboard-filter-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.dashboard-filter-heading strong { display: block; color: var(--ink); font-size: 14px; }
.dashboard-filter-heading span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.dashboard-filter-grid { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 9px; }
.dashboard-filter-row-break { flex: 0 0 100%; height: 0; }
.dashboard-filter-field { display: grid; flex: 0 1 150px; gap: 5px; min-width: 130px; }
.dashboard-filter-field > span, .dashboard-owner-filter summary > span { color: #536471; font-size: 11px; font-weight: 700; }
.dashboard-filter-field select, .dashboard-filter-field input { width: 100%; height: 35px; min-width: 0; border: 1px solid #dce3e8; background: #fff; color: #51616f; padding: 0 9px; outline: 0; font-size: 12px; }
.dashboard-filter-field select:focus, .dashboard-filter-field input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(22,125,120,.08); }
.dashboard-date-range, .dashboard-visit-custom { flex-basis: 270px; }
.dashboard-visit-custom[hidden] { display: none; }
.dashboard-date-range > div, .dashboard-visit-custom > div { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 5px; }
.dashboard-date-range b, .dashboard-visit-custom b { color: var(--muted); font-size: 11px; font-weight: 400; }
.dashboard-project-search { flex-basis: 180px; }
.dashboard-owner-filter { position: relative; flex: 0 1 170px; min-width: 150px; }
.dashboard-owner-filter summary { display: grid; gap: 5px; list-style: none; cursor: pointer; }
.dashboard-owner-filter summary::-webkit-details-marker { display: none; }
.dashboard-owner-filter summary strong { display: flex; align-items: center; height: 35px; overflow: hidden; border: 1px solid #dce3e8; background: #fff; color: #51616f; padding: 0 28px 0 9px; font-size: 12px; font-weight: 400; white-space: nowrap; text-overflow: ellipsis; }
.dashboard-owner-filter summary strong::after { content: "⌄"; position: absolute; right: 10px; bottom: 9px; color: var(--muted); }
.dashboard-owner-filter > div { position: absolute; z-index: 20; top: calc(100% + 5px); left: 0; display: grid; width: 220px; max-height: 240px; overflow-y: auto; padding: 7px; border: 1px solid #dce3e8; background: #fff; box-shadow: 0 10px 24px rgba(31, 59, 70, .14); }
.dashboard-owner-filter label { display: flex; align-items: center; gap: 8px; padding: 7px 6px; color: #51616f; font-size: 12px; cursor: pointer; }
.dashboard-owner-filter label:hover { background: #f2f7f6; }
.dashboard-owner-filter input { width: 15px; height: 15px; accent-color: var(--teal); }
@media (max-width: 700px) {
  .dashboard-filter-panel { padding: 13px; }
  .dashboard-filter-field, .dashboard-owner-filter { flex: 1 1 calc(50% - 9px); }
  .dashboard-date-range, .dashboard-visit-custom { flex-basis: 100%; }
}
@media (max-width: 460px) {
  .dashboard-filter-field, .dashboard-owner-filter { flex-basis: 100%; }
}
.detail-section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.detail-section-heading strong { font-size: 14px; }
.detail-section-heading span { color: var(--muted); font-size: 11px; }
.history-item { display: grid; grid-template-columns: 66px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid #eff2f4; }
.history-item:last-child { border-bottom: 0; }
.history-date { color: var(--teal); font-size: 12px; font-weight: 750; }
.history-date small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; font-weight: 400; }
.history-main > div { display: flex; align-items: center; gap: 8px; }
.history-main strong { font-size: 13px; }
.history-main p { margin: 7px 0 5px; color: #52616d; font-size: 12px; line-height: 1.5; }
.history-main > span { color: var(--muted); font-size: 11px; }
.quick-record-box { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; padding: 13px 14px; border: 1px solid #dcebe8; background: #f4f8f8; }
.quick-record-box strong, .quick-record-box span { display: block; }
.quick-record-box strong { font-size: 13px; }
.quick-record-box span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.quick-record-box .button { flex-shrink: 0; }
.quick-record-box { display: block; }
.quick-record-heading, .quick-record-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.quick-record-heading > .status-tag { display: inline-flex; margin-top: 0; }
.quick-record-box textarea { display: block; width: 100%; min-height: 70px; margin: 12px 0 10px; resize: vertical; border: 1px solid #d3e3e0; background: #fff; outline: 0; padding: 9px 10px; color: var(--ink); font-size: 13px; }
.quick-record-box textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(22,125,120,.08); }
.recognizer-box textarea[data-original-lock] { background: #eef3f3; color: #61727d; cursor: not-allowed; opacity: 1; }
.recognizer-box textarea[data-original-lock]:focus { border-color: #d3e3e0; box-shadow: none; }
.quick-record-footer > span { color: var(--muted); font-size: 11px; }
.region-selects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.region-selects select { min-width: 0; width: 100%; }
.region-data-hint { margin-top: 6px; }
.detail-followup-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.detail-followup-row > div { display: flex; flex-direction: column; justify-content: center; min-height: 60px; background: #f7f9fa; padding: 10px; }
.detail-followup-row span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.detail-followup-row strong { font-size: 13px; }
.detail-grid > div.project-cell { display: block; }
.detail-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.detail-toolbar .category-editor { min-width: 86px; }
.detail-inline-meta { display: inline; margin-left: 8px; color: var(--muted); font-size: 11px; font-weight: 400; }
.detail-edit-button { flex: 0 0 auto; min-height: 30px; padding: 0 10px; margin-left: 8px; font-size: 12px; }
.customer-quote-history { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.customer-quote-history-list { display: grid; gap: 8px; }
.customer-quote-history-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 11px 12px; background: #f4f8f7; border: 1px solid var(--line); }
.customer-quote-history-item > div { display: grid; gap: 4px; min-width: 0; }
.customer-quote-history-item strong { font-size: 13px; }
.customer-quote-history-item span { color: var(--muted); font-size: 12px; }
.customer-quote-history-values { text-align: right; white-space: nowrap; }
.customer-quote-history-values strong { color: var(--teal); }
@media (max-width: 640px) {
  .customer-quote-history-item { grid-template-columns: minmax(0, 1fr) auto; }
  .customer-quote-history-item .table-action { grid-column: 1 / -1; justify-self: start; }
}
.data-metric-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); margin-top: 16px; }
.data-dashboard-grid { margin-top: 16px; }
.data-stage-chart { display: grid; gap: 15px; padding: 9px 0; }
.data-bar-row { display: grid; grid-template-columns: 72px 1fr 28px; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.data-bar-track { height: 12px; background: #eef2f4; overflow: hidden; }
.data-bar-fill { height: 100%; background: var(--teal); }
.data-bar-fill.intent { background: #58aaa2; }
.data-bar-fill.quoted { background: #d09a43; }
.data-bar-fill.signed { background: #3c927f; }
.data-bar-fill.unquoted { background: #d16a6d; }
.data-bar-fill.public { background: #8d9eaa; }
.data-bar-row strong { text-align: right; color: var(--ink); }
.status-summary { display: grid; gap: 0; }
.status-summary-row { display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: 9px; padding: 12px 0; border-bottom: 1px solid #eff2f4; font-size: 13px; }
.status-summary-row:last-child { border-bottom: 0; }
.status-summary-row .status-dot { width: 8px; height: 8px; box-shadow: none; background: var(--teal); }
.status-summary-row .status-dot.intent { background: #58aaa2; }
.status-summary-row .status-dot.quoted { background: #d09a43; }
.status-summary-row .status-dot.signed { background: #3c927f; }
.status-summary-row .status-dot.unquoted { background: #d16a6d; }
.status-summary-row .status-dot.public { background: #8d9eaa; }
.status-summary-row strong { font-size: 13px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(330px, 1fr); gap: 16px; margin-bottom: 16px; }
.panel { background: rgba(255,255,255,.94); border: 1px solid #dfe9e8; padding: 16px; min-width: 0; box-shadow: 0 4px 16px rgba(35, 75, 82, .045); }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 13px; margin-bottom: 15px; }
.funnel { display: grid; gap: 11px; padding: 9px 0 4px; }
.funnel-row { display: grid; grid-template-columns: 86px 1fr 48px; gap: 11px; align-items: center; font-size: 13px; }
.funnel-label { color: var(--muted); }
.funnel-track { background: #f1f4f6; height: 14px; overflow: hidden; }
.funnel-fill { height: 100%; background: var(--teal); min-width: 4px; }
.funnel-row:nth-child(2) .funnel-fill { background: #399994; }
.funnel-row:nth-child(3) .funnel-fill { background: #58aaa2; }
.funnel-row:nth-child(4) .funnel-fill { background: #73bab2; }
.funnel-row:nth-child(5) .funnel-fill { background: #8ec7bf; }
.funnel-row:nth-child(6) .funnel-fill { background: #aecfc9; }
.funnel-count { text-align: right; font-weight: 700; }
.attention-list { display: grid; gap: 0; }
.attention-item { display: grid; grid-template-columns: 8px 1fr auto; gap: 11px; align-items: start; padding: 12px 0; border-bottom: 1px solid #eff2f4; }
.attention-item:last-child { border-bottom: 0; }
.attention-marker { width: 7px; height: 7px; border-radius: 50%; background: var(--red); margin-top: 6px; }
.attention-item.warning .attention-marker { background: var(--gold); }
.attention-item strong { display: block; font-size: 13px; margin-bottom: 4px; }
.attention-item span { color: var(--muted); font-size: 12px; }
.attention-item button { border: 0; background: transparent; color: var(--teal); font-size: 12px; padding: 0; white-space: nowrap; }
.count-pill { min-width: 24px; padding: 3px 7px; color: var(--red); background: var(--red-soft); font-size: 12px; font-weight: 700; text-align: center; border-radius: 12px; }
.count-pill[hidden] { display: none; }
.approval-panel { margin-top: 16px; }
.approval-item { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 0; border-bottom: 1px solid #eff2f4; }
.approval-item:last-child { border-bottom: 0; }
.approval-item strong { display: block; font-size: 13px; }
.approval-item span { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.approval-item p { color: #52616d; font-size: 12px; margin: 6px 0 0; }
.approval-actions { display: flex; gap: 7px; flex-shrink: 0; }
.approval-actions .button { min-height: 30px; padding: 0 10px; font-size: 12px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th { text-align: left; color: #8593a0; font-size: 12px; font-weight: 650; padding: 0 12px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 14px 12px; border-bottom: 1px solid #eff2f4; font-size: 13px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #fbfcfc; }
.person-cell, .customer-cell { display: flex; align-items: center; gap: 9px; }
.mini-avatar { width: 28px; height: 28px; display: grid; place-items: center; color: var(--teal); background: var(--teal-soft); font-size: 12px; font-weight: 750; border-radius: 50%; line-height: 1; text-align: center; }
.person-cell strong, .customer-cell strong { display: block; font-size: 13px; font-weight: 700; }
.person-cell span, .customer-cell span { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.person-cell > .mini-avatar, .customer-cell > .mini-avatar { display: flex; align-items: center; justify-content: center; flex: 0 0 28px; width: 28px; height: 28px; margin: 0 !important; padding: 0 !important; font-size: 12px; line-height: 1 !important; text-align: center; text-indent: 0; vertical-align: middle; }
.customer-name-button { border: 0; background: transparent; color: var(--ink); display: block; font-size: 13px; font-weight: 700; padding: 0; text-align: left; }
.customer-name-button:hover { color: var(--teal); text-decoration: underline; }
.customer-pin-button { display: inline-flex; align-items: center; gap: 4px; border: 0; padding: 4px 0; color: var(--muted); background: transparent; font: inherit; font-size: 12px; white-space: nowrap; cursor: pointer; }
.customer-pin-button:hover, .customer-pin-button.is-pinned { color: #8a661f; }
.customer-pin-button > span:first-child { font-size: 15px; line-height: 1; }
.customer-created-at { white-space: nowrap; }
.progress-cell { min-width: 120px; }
.progress-label { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.progress-track { height: 5px; background: #edf1f3; overflow: hidden; }
.progress-bar { height: 100%; background: var(--teal); }
.table-action { border: 0; background: transparent; color: var(--teal); font-size: 12px; padding: 4px 0; }
.table-action:hover { text-decoration: underline; }
.table-action.danger { color: #ae464a; }
.table-action.danger:hover { color: #8f3439; }
.table-action + .table-action { margin-left: 12px; }
.row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; min-width: 145px; }
.row-actions .table-action + .table-action { margin-left: 0; }
.status-tag { display: inline-flex; align-items: center; min-height: 22px; padding: 0 7px; border-radius: 3px; font-size: 11px; white-space: nowrap; }
.status-tag.teal { background: var(--teal-soft); color: #17746f; }
.status-tag.gold { background: var(--gold-soft); color: #a46715; }
.status-tag.red { background: var(--red-soft); color: #ae464a; }
.status-tag.gray { background: #eff2f4; color: #6f7c87; }
.status-tag.navy { background: #eaf0f5; color: #456176; }

.filters-panel { padding: 13px 15px; margin-bottom: 16px; }
.customer-pool-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 260px)); gap: 10px; margin-bottom: 12px; }
.customer-pool-tab { display: grid; gap: 3px; min-height: 62px; padding: 10px 14px; border: 1px solid #d7e3e6; border-radius: 6px; background: #fff; color: var(--ink); text-align: left; }
.customer-pool-tab span { font-size: 15px; font-weight: 750; }
.customer-pool-tab small { color: var(--muted); font-size: 11px; }
.customer-pool-tab small b { color: inherit; }
.customer-pool-tab:hover { border-color: #9fcac1; background: #f6fbfa; }
.customer-pool-tab.is-active { border-color: var(--teal); background: var(--teal-soft); color: #11665f; box-shadow: inset 3px 0 0 var(--teal); }
.public-owner-cell { display: grid; gap: 2px; min-width: 115px; }
.public-owner-cell strong { color: #176f67; font-size: 12px; }
.public-owner-cell span, .public-owner-cell small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.claim-customer-button { min-height: 30px; padding: 0 11px; font-size: 12px; white-space: nowrap; }
.pending-transfer-label { color: var(--gold); font-size: 11px; }
.public-customer-notice { display: grid; gap: 4px; margin-bottom: 12px; padding: 12px 14px; border: 1px solid #b9ddd4; background: #edf8f5; }
.public-customer-notice strong { color: #126b61; font-size: 14px; }
.public-customer-notice span { color: #334e54; font-size: 13px; }
.public-customer-notice small { color: var(--muted); font-size: 11px; }
.approval-panel { scroll-margin-top: 20px; }
.approval-item.is-targeted { background: #fff7df; box-shadow: inset 4px 0 0 var(--gold), 0 0 0 2px rgba(201, 131, 38, .16); animation: approval-focus-pulse .8s ease-in-out 2; }
@keyframes approval-focus-pulse { 50% { background: #ffefbc; } }
.filter-row { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.material-filter-layout { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 12px; }
.material-filter-groups { flex: 1; min-width: 0; display: grid; gap: 8px; }
.material-filter-group { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.material-filter-label { flex: 0 0 42px; color: var(--muted); font-size: 12px; line-height: 28px; }
.material-filter-options { display: flex; flex: 1; flex-wrap: wrap; gap: 6px; min-width: 0; }
.material-filter-chip { min-height: 28px; padding: 0 9px; border: 1px solid #dce3e8; background: #fff; color: #51616f; font-size: 12px; cursor: pointer; }
.material-filter-chip:hover, .material-filter-chip.is-active { border-color: var(--teal); background: var(--teal-soft); color: #176d69; }
.material-filter-edit { flex: 0 0 auto; }
.search-box { display: flex; align-items: center; height: 35px; border: 1px solid #dce3e8; background: #fff; padding: 0 10px; min-width: 250px; flex: 1; max-width: 350px; }
.search-box-with-history { position: relative; z-index: 4; }
.search-history-popover { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30; padding: 4px; border: 1px solid #dce3e8; background: #fff; box-shadow: 0 10px 24px rgba(18, 32, 42, .14); }
.search-history-popover[hidden] { display: none; }
.search-history-item { display: flex; align-items: center; min-height: 32px; border-bottom: 1px solid #eff2f4; }
.search-history-item:last-child { border-bottom: 0; }
.search-history-value { flex: 1; min-width: 0; overflow: hidden; border: 0; background: transparent; color: var(--ink); padding: 7px 8px; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; font-size: 13px; }
.search-history-value:hover { background: #f4f8f8; color: var(--teal); }
.search-history-remove { flex: 0 0 28px; width: 28px; height: 28px; border: 0; background: transparent; color: #aeb9c0; font-size: 18px; line-height: 1; cursor: pointer; }
.search-history-remove:hover { color: #ae464a; background: #fff1f1; }
.search-box span { color: #9aa8b3; font-size: 19px; margin-right: 7px; line-height: 1; }
.search-box input { border: 0; outline: 0; width: 100%; color: var(--ink); background: transparent; font-size: 13px; }
select { border: 1px solid #dce3e8; background: #fff; height: 35px; color: #51616f; padding: 0 27px 0 10px; outline: 0; font-size: 13px; }
select:focus, .search-box:focus-within { border-color: var(--teal); }
.quote-summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 16px; padding: 0; }
.quote-summary-item { padding: 20px 24px; border-right: 1px solid var(--line); }
.quote-summary-item:last-child { border-right: 0; }
.quote-summary-item span { color: var(--muted); font-size: 13px; }
.quote-summary-item strong { display: block; font-size: 26px; margin-top: 10px; letter-spacing: -.03em; }
.quote-record-link, .quote-record-customer { border: 0; background: transparent; cursor: pointer; color: var(--ink); }
.quote-record-row { cursor: pointer; }
.quote-record-row:hover td { background: #f7fbfa; }
.quote-record-row:focus-visible td { outline: 2px solid var(--teal); outline-offset: -2px; }
.quote-record-link { padding: 0; font-size: 13px; font-weight: 750; text-align: left; }
.quote-record-link:hover, .quote-record-customer:hover { color: var(--teal); text-decoration: underline; }
.quote-record-customer { display: flex; align-items: center; gap: 9px; padding: 0; text-align: left; }
.quote-record-customer > span:last-child { display: block; }
.quote-record-customer strong, .quote-record-customer small { display: block; }
.quote-record-customer strong { font-size: 13px; }
.quote-record-customer small { color: var(--muted); font-size: 11px; margin-top: 3px; }
.quote-row-actions { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.quote-row-actions .table-action { padding: 5px 0; }
.quote-image-modal-body { display: flex; min-height: 0; flex: 1 1 auto; flex-direction: column; padding: 14px 18px 20px; background: #f3f7f6; }
.quote-image-preview { min-height: 0; max-height: calc(100vh - 240px); max-height: calc(100dvh - 240px); flex: 1 1 auto; overflow: auto; display: flex; justify-content: safe center; align-items: flex-start; padding: 14px; background: #e9f4f0; border: 1px solid #c9e0d7; }
.quote-image-preview svg { display: block; width: 595.35px; max-width: none; height: auto; flex: 0 0 595.35px; margin: 0 auto; zoom: 1; }
.quote-image-preview svg .subtitle { text-anchor: middle !important; transform: translateX(398px) !important; }
.quote-record-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-bottom: 14px; padding: 10px; background: #f2f8f6; border: 1px solid #dcebe5; }
.quote-product-group-filters { display: grid; gap: 8px; margin: 0 0 12px; padding: 11px 12px; background: #f8fbfa; border: 1px solid #e4eeeb; }
.quote-product-group-filters .product-group-toolbar { justify-content: flex-start; }
.quote-product-group-filters .product-group-toolbar span { display: none; }
.quote-record-filters .search-box { flex: 1 1 280px; min-width: 240px; max-width: 420px; }
.quote-record-filters select, .quote-record-filters input { height: 35px; min-width: 150px; border: 1px solid #dce3e8; background: #fff; color: var(--ink); padding: 0 10px; outline: 0; font-size: 13px; }
.quote-record-filters input:focus, .quote-record-filters select:focus { border-color: var(--teal); }
.quote-product-name { color: #176b50; }
.quote-product-group-display { display: block; margin-top: 7px; padding: 7px 9px; border: 1px solid #dcebe5; background: #f2f8f6; color: #28746d; font-size: 12px; }
.quote-product-group-display[hidden] { display: none; }
.quote-image-hint { color: #60737c; font-size: 12px; line-height: 1.55; padding: 10px 2px 0; }
.quote-image-modal-body .modal-actions { margin-top: 14px; }
.quote-record-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px 0 2px; }
.quote-record-pagination[hidden] { display: none; }
.quote-record-pagination span { color: var(--muted); font-size: 12px; }
.quote-record-pagination .button { min-height: 32px; padding: 0 11px; font-size: 12px; }
.quote-record-pagination .button:disabled { opacity: .45; cursor: not-allowed; }
.product-filters-panel { display: grid; gap: 12px; }
.industry-knowledge-panel { display: grid; gap: 13px; }
.industry-knowledge-tabs { display: flex; flex-wrap: wrap; gap: 9px; padding: 3px 0; }
.industry-knowledge-tab { min-height: 38px; padding: 0 17px; border: 1px solid #dce6e5; border-radius: 6px; background: #fff; color: #52646d; font-size: 13px; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.industry-knowledge-tab:hover, .industry-knowledge-tab.is-active { border-color: #a8d2c8; background: #e7f4f1; color: #176d69; }
.industry-knowledge-tab.is-active { font-weight: 700; box-shadow: 0 1px 3px #183b3012; }
.industry-knowledge-section[hidden] { display: none; }
.industry-knowledge-filters { display: grid; gap: 13px; padding: 15px; }
.industry-knowledge-intro { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.industry-knowledge-intro h2 { margin: 0; font-size: 16px; }
.industry-knowledge-intro p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.industry-filter-label { display: block; margin-bottom: 7px; color: #536471; font-size: 12px; }
.industry-knowledge-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.industry-knowledge-card { min-width: 0; padding: 14px; border: 1px solid #dce8e4; background: #fff; box-shadow: 0 2px 8px #17372d08; }
.industry-knowledge-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid #edf1f0; }
.industry-knowledge-card h3 { margin: 4px 0 0; color: var(--ink); font-size: 15px; line-height: 1.45; }
.industry-knowledge-category { color: #398177; font-size: 11px; }
.industry-knowledge-materials { display: grid; gap: 0; padding-top: 5px; }
.industry-knowledge-material { display: flex; justify-content: space-between; gap: 12px; padding: 7px 1px; border-bottom: 1px solid #f0f3f2; font-size: 12px; }
.industry-knowledge-material:last-child { border-bottom: 0; }
.industry-knowledge-material span { min-width: 0; color: #52616b; overflow-wrap: anywhere; }
.industry-knowledge-material strong { flex: none; color: #176d69; font-size: 12px; font-variant-numeric: tabular-nums; }
.industry-knowledge-card footer { padding-top: 8px; border-top: 1px solid #edf1f0; color: #87949a; font-size: 10px; }
.industry-knowledge-empty { grid-column: 1 / -1; }
.industry-process-panel { display: grid; gap: 12px; }
.industry-process-panel .panel-heading { margin-bottom: 0; }
.industry-construction-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.industry-construction-card { min-width: 0; padding: 14px; border: 1px solid #dce8e4; background: #fff; box-shadow: 0 2px 8px #17372d08; }
.industry-construction-card > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid #edf1f0; }
.industry-construction-card h3 { margin: 0; color: var(--ink); font-size: 15px; }
.industry-process-flow, .industry-process-condition { padding: 10px 0 0; }
.industry-process-flow > span, .industry-process-condition > span, .industry-process-stages > span { color: #398177; font-size: 11px; font-weight: 700; }
.industry-process-flow p, .industry-process-condition p { margin: 4px 0 0; color: #52616b; font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.industry-construction-card .table-wrap { margin-top: 9px; }
.industry-construction-card table { min-width: 340px; }
.industry-construction-card th, .industry-construction-card td { padding: 8px 9px; font-size: 11px; }
.industry-process-stages { padding-top: 11px; }
.industry-process-stages p { margin: 6px 0 0; color: #52616b; font-size: 11px; line-height: 1.6; }
.industry-process-stages p strong { color: var(--ink); }
.industry-process-note { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
@media (max-width: 760px) { .industry-knowledge-grid, .industry-construction-grid { grid-template-columns: 1fr; } .industry-knowledge-intro { align-items: flex-start; } }
.product-group-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.product-group-toolbar strong, .product-group-toolbar span { display: block; }
.product-group-toolbar strong { color: var(--ink); font-size: 14px; }
.product-group-toolbar span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.product-group-toolbar .button { min-height: 30px; }
.product-group-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.product-group-chip { min-height: 30px; padding: 0 11px; border: 1px solid #dce6e5; background: #f7faf9; color: #52646d; font-size: 12px; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.product-group-chip span { margin-left: 5px; color: #87969d; font-size: 11px; }
.product-group-chip:hover, .product-group-chip.is-active { border-color: #a8d2c8; background: #e7f4f1; color: #176d69; }
.product-group-chip.is-active { font-weight: 700; }
.product-group-chip.is-active span { color: #34847e; }
.product-group-badge { display: inline-block; margin-top: 5px; padding: 2px 6px; border-radius: 3px; background: #eaf4f2; color: #4d7974; font-size: 10px; line-height: 1.4; }
.product-group-management-list { display: grid; gap: 7px; max-height: 250px; overflow: auto; }
.product-group-management-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 28px; align-items: center; gap: 9px; min-height: 40px; padding: 5px 8px; border: 1px solid #e4eceb; background: #f8fbfa; }
.product-group-management-row strong { min-width: 0; color: var(--ink); font-size: 13px; }
.product-group-management-row > span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.category-management-list { display: grid; gap: 6px; max-height: 360px; overflow: auto; padding: 2px 1px; }
.category-management-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 28px; align-items: center; gap: 7px; }
.category-management-row input { min-width: 0; height: 32px; min-height: 32px; padding: 6px 9px; }
.category-management-row .small-muted { white-space: nowrap; font-size: 11px; }
.category-delete-button { width: 28px; height: 28px; border: 1px solid #eccfd1; background: #fff8f8; color: #ae464a; font-size: 19px; line-height: 1; cursor: pointer; }
.category-delete-button:hover { border-color: #c77a7d; color: #8f3439; background: #fff0f0; }
.category-delete-button:disabled { opacity: .35; cursor: not-allowed; }
.category-add-row { display: flex; align-items: center; gap: 9px; padding-top: 4px; }
.category-add-row .button { min-height: 32px; padding: 0 11px; }
.modal:has(#department-form) { width: min(520px, 100%); }
.department-modal-form { padding: 18px 20px 17px; }
.department-intro { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 14px; border: 1px solid #dcebe5; border-radius: 8px; background: linear-gradient(135deg, #f4faf8, #f8fbfd); }
.department-intro strong { display: block; color: var(--ink); font-size: 14px; }
.department-intro p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.department-count { flex: 0 0 auto; padding: 7px 10px; border-radius: 7px; background: #e2f3ed; color: #27766d; font-size: 11px; white-space: nowrap; }
.department-count b { margin-right: 3px; font-size: 18px; }
.department-list-heading { display: grid; grid-template-columns: minmax(0, 1fr) 65px 30px; gap: 8px; margin-top: 16px; padding: 0 10px 6px 42px; color: #89979d; font-size: 11px; }
.department-list-heading span:nth-child(2), .department-list-heading span:nth-child(3) { text-align: center; }
.department-management-row { grid-template-columns: 25px minmax(0, 1fr) 65px 30px; gap: 8px; min-height: 40px; padding: 4px 6px; border: 1px solid #e2ebe9; border-radius: 7px; background: #fbfdfd; transition: border-color .15s, background .15s; }
.department-management-row:hover { border-color: #b8d9cf; background: #f5faf8; }
.department-management-row input { height: 32px; min-height: 32px; border-color: #dce6e4; border-radius: 5px; }
.department-row-index { color: #9aa9ae; font-size: 11px; font-variant-numeric: tabular-nums; text-align: center; }
.department-management-row .small-muted { text-align: center; }
.department-management-row .category-delete-button { border-radius: 5px; }
.department-add-row { margin-top: 9px; padding: 10px 0 1px; border-top: 1px solid #edf2f1; }
.department-modal-form .modal-actions { margin-top: 17px; padding-top: 14px; }
.user-summary { display: grid; grid-template-columns: repeat(3, 1fr); padding: 0; margin-bottom: 16px; }
.user-summary .quote-summary-item { padding: 20px 24px; }
.account-security-note { background: #f5f8f8; border: 1px solid #e0ecea; padding: 10px 12px; margin-top: 18px; line-height: 1.55; }

.organization-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.organization-settings-grid > section { min-width: 0; padding: 14px; border: 1px solid #e2ebe9; background: #fbfdfd; }
.organization-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.organization-section-heading strong, .organization-section-heading span { display: block; }
.organization-section-heading strong { color: var(--ink); font-size: 15px; }
.organization-section-heading span { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.organization-section-heading b { flex: 0 0 auto; min-width: 28px; padding: 5px 7px; background: #e2f3ed; color: #27766d; font-size: 15px; text-align: center; }
.organization-add-button { width: 100%; margin-top: 10px; }
@media (max-width: 680px) { .organization-settings-grid { grid-template-columns: 1fr; } }
.modal-backdrop { position: fixed; inset: 0; background: rgba(18, 32, 42, .48); display: grid; place-items: center; padding: 20px; z-index: 20; }
.modal-backdrop[hidden] { display: none; }
.modal { position: relative; background: #fff; width: min(680px, 100%); max-height: calc(100vh - 40px); overflow: auto; box-shadow: 0 24px 70px rgba(16, 37, 50, .25); }
.modal:has(#material-category-form) { width: min(560px, 100%); }
.modal:has(.quote-image-preview) { width: min(680px, 100%); max-height: calc(100vh - 40px); overflow: hidden; display: flex; flex-direction: column; }
.modal-backdrop:has(#quote-form) { display: grid; place-items: center; overflow: auto; background: rgba(18, 32, 42, .48); padding: 20px; }
.modal:has(#quote-form) { width: min(680px, 100%); max-height: calc(100vh - 40px); margin: 0; background: #fff; border: 0; border-radius: 0; box-shadow: 0 24px 70px rgba(16, 37, 50, .25); overflow: auto; }
.modal:has(#quote-form) { width: min(1180px, calc(100vw - 48px)); max-height: calc(100vh - 32px); border-radius: 16px; background: #f4f8fc; }
.modal:has(#quote-form) .modal-header { padding: 24px 32px 18px; background: linear-gradient(135deg, #f4f8fc, #edf4fb); border-bottom: 1px solid #d9e4ee; }
.modal:has(#quote-form) .modal-header h2 { font-size: 30px; letter-spacing: -.02em; color: #10263b; }
.modal:has(#quote-form) .modal-header .eyebrow { color: #2c5a80; letter-spacing: .12em; }
.modal:has(#quote-form) #quote-form { padding: 26px 32px 30px; background: #f4f8fc; }
.quote-form-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.quote-overview-card { min-height: 112px; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 18px 24px; border: 1px solid #d9e5ef; border-radius: 14px; background: #fff; box-shadow: 0 8px 22px rgba(38, 75, 105, .08); }
.quote-overview-card span { color: #5b7185; font-size: 14px; font-weight: 700; }
.quote-overview-card strong { color: #10263b; font-size: 25px; line-height: 1.15; }
.quote-overview-card.area { color: #fff; border-color: #2479e5; background: linear-gradient(135deg, #176fe0, #2b8bea); }
.quote-overview-card.area span, .quote-overview-card.area strong { color: #fff; }
.quote-overview-card.type { background: linear-gradient(135deg, #fff, #f8fbfe); }
.quote-overview-card.valid { background: linear-gradient(135deg, #f2fbff, #e8f5ff); border-color: #cde5f8; }
.modal:has(#quote-form) #quote-form > .form-grid { gap: 18px; }
.modal:has(#quote-form) #quote-form > .form-grid > .form-field { padding: 18px 20px; border: 1px solid #dbe6ef; border-radius: 14px; background: #fff; box-shadow: 0 5px 16px rgba(38, 75, 105, .04); }
.modal:has(#quote-form) #quote-form > .form-grid > .form-field.full { padding: 22px; }
.modal:has(#quote-form) #quote-form > .form-grid > .form-field > label { color: #1b3349; font-size: 15px; }
.modal:has(#quote-form) #quote-form > .form-grid > .form-field input,
.modal:has(#quote-form) #quote-form > .form-grid > .form-field select { min-height: 48px; border-color: #c8d5e0; border-radius: 8px; padding: 10px 14px; font-size: 16px; }
.modal:has(#quote-form) #quote-form .quote-product-picker { gap: 12px; }
.modal:has(#quote-form) #quote-form .quote-formula-group-filters { padding: 14px; border-radius: 10px; background: #f3f8fd; border-color: #d7e5f0; }
.modal:has(#quote-form) #quote-form .quote-product-group-display { font-size: 13px; }
.modal:has(#quote-form) #quote-form .quote-weather-field { padding: 22px; border-radius: 14px; background: linear-gradient(135deg, #eef8ff, #f7fbff); border-color: #cfe2f1; }
.modal:has(#quote-form) #quote-form .quote-weather-actions label { color: #1b3349; font-size: 16px; }
.modal:has(#quote-form) #quote-form .quote-weather-actions .button { min-height: 40px; border-radius: 8px; background: #2178dd; border-color: #2178dd; color: #fff; }
.modal:has(#quote-form) #quote-form .quote-construction-plan { margin-top: 8px; padding: 18px; border-radius: 12px; background: #f8fcff; border-color: #d7e7f1; }
.modal:has(#quote-form) #quote-form .quote-plan-grid > div { padding: 14px; border-radius: 10px; background: #eaf8f5; }
.modal:has(#quote-form) #quote-form .modal-actions { margin-top: 24px; padding-top: 20px; }
.modal:has(#quote-form) #quote-form .modal-actions .button { min-height: 44px; border-radius: 8px; font-size: 14px; }
.modal:has(#quote-form) .modal-header { background: #fff; border-bottom-color: var(--line); padding: 18px 22px 13px; }
.modal:has(#quote-form) #quote-form { margin-top: 0; border: 0; border-radius: 0; background: #fff; box-shadow: none; }
.modal-header { padding: 18px 22px 13px; display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid var(--line); }
.modal-header h2 { font-size: 20px; margin: 0; }
.modal-header .icon-button { font-size: 26px; color: #9aa8b3; }
.form-body { padding: 18px 22px 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-grid.single { grid-template-columns: 1fr; }
.form-field { display: grid; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { color: #536471; font-size: 12px; font-weight: 700; }
.form-field input, .form-field select, .form-field textarea { width: 100%; border: 1px solid #dce3e8; background: #fff; outline: 0; padding: 9px 10px; min-height: 37px; color: var(--ink); font-size: 13px; }
.form-field textarea { resize: vertical; min-height: 82px; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(22,125,120,.08); }
.customer-search-picker { position: relative; }
.customer-search-picker > input { width: 100%; border: 1px solid #dce3e8; background: #fff; outline: 0; padding: 9px 10px; min-height: 37px; color: var(--ink); font-size: 13px; }
.customer-search-picker > input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(22,125,120,.08); }
.customer-search-options { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 25; max-height: 240px; overflow: auto; border: 1px solid #dce3e8; background: #fff; box-shadow: 0 12px 28px rgba(18, 32, 42, .16); }
.customer-search-options[hidden] { display: none; }
.customer-search-option { display: grid; width: 100%; gap: 3px; border: 0; border-bottom: 1px solid #eff2f4; background: #fff; padding: 9px 11px; color: var(--ink); text-align: left; cursor: pointer; }
.customer-search-option:last-child { border-bottom: 0; }
.customer-search-option:hover { background: var(--teal-soft); }
.customer-search-option strong { font-size: 13px; }
.customer-search-option span, .customer-search-empty { color: var(--muted); font-size: 11px; line-height: 1.4; }
.customer-search-empty { padding: 12px; text-align: center; }
.form-field input[type="date"], .form-field input[type="time"] { cursor: pointer; }
.form-hint { color: var(--muted); font-size: 11px; line-height: 1.5; }
#quote-form { padding: 18px 22px 20px; }
#quote-form .form-grid { gap: 15px; }
#quote-form .form-field { gap: 6px; }
#quote-form .form-field label { color: #536471; font-size: 12px; font-weight: 700; }
#quote-form .form-field input, #quote-form .form-field select { min-height: 37px; padding: 9px 10px; border-color: #dce3e8; border-radius: 0; font-size: 13px; color: var(--ink); }
#quote-form .form-field input:focus, #quote-form .form-field select:focus { border-color: #2478bd; box-shadow: 0 0 0 2px rgba(36,120,189,.12); }
#quote-form .form-hint { margin-top: 1px; line-height: 1.5; font-size: 11px; }
#quote-form .quote-product-picker { display: grid; gap: 7px; }
#quote-form .quote-product-combobox { position: relative; min-width: 0; }
#quote-form .quote-product-combobox > input { padding-right: 48px; }
#quote-form .quote-product-toggle { position: absolute; top: 1px; right: 1px; z-index: 2; width: 44px; height: 46px; border: 0; border-left: 1px solid #dce3e8; background: #fff; color: #334b5e; font-size: 16px; line-height: 1; }
#quote-form .quote-product-toggle:hover, #quote-form .quote-product-toggle:focus-visible { background: #eef7f5; color: var(--teal); outline: 0; }
#quote-form .quote-product-options { position: absolute; top: calc(100% + 5px); left: 0; right: 0; z-index: 80; max-height: min(360px, 48vh); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; border: 1px solid #c8d5e0; border-radius: 8px; background: #fff; box-shadow: 0 16px 34px rgba(18, 40, 58, .2); }
#quote-form .quote-product-options[hidden] { display: none; }
#quote-form .quote-product-option { display: grid; width: 100%; gap: 4px; border: 0; border-bottom: 1px solid #edf1f4; background: #fff; padding: 11px 13px; color: var(--ink); text-align: left; cursor: pointer; }
#quote-form .quote-product-option:last-child { border-bottom: 0; }
#quote-form .quote-product-option:hover, #quote-form .quote-product-option:focus { background: #eaf7f3; outline: 0; }
#quote-form .quote-product-option strong { font-size: 14px; line-height: 1.35; }
#quote-form .quote-product-option span { color: #607382; font-size: 12px; line-height: 1.4; }
#quote-form .quote-product-empty { padding: 18px 14px; color: var(--muted); font-size: 13px; text-align: center; }
#quote-form .quote-formula-group-filters { display: grid; gap: 7px; padding: 8px 9px; border: 1px solid #e4eeeb; background: #f8fbfa; }
#quote-form .quote-formula-group-filters > strong { color: var(--ink); font-size: 12px; }
#quote-form .quote-formula-group-filters .product-group-filters { gap: 6px; }
#quote-form .quote-formula-group-filters .product-group-chip { min-height: 28px; padding: 0 8px; font-size: 11px; }
#quote-form #quote-product-formula { width: 100%; }
#quote-form .quote-lines { gap: 9px; }
#quote-form .quote-line { grid-template-columns: minmax(0, 1.35fr) minmax(78px, .6fr) minmax(82px, .62fr) minmax(78px, .58fr) minmax(88px, .72fr) 34px; gap: 7px; }
#quote-form .quote-line input, #quote-form .quote-line select { min-height: 37px; padding: 9px 10px; border-color: #dce3e8; border-radius: 0; font-size: 13px; }
#quote-form .quote-line:nth-child(odd) input, #quote-form .quote-line:nth-child(odd) select { background: #f2f6fc; }
#quote-form .remove-line { width: 34px; height: 34px; border-radius: 0; font-size: 19px; }
#quote-form .add-line { min-height: 34px; border-color: #c4d3d7; background: #fbfdfd; font-size: 13px; }
#quote-form .quote-calculation { width: min(360px, 100%); margin: 15px 0 0 auto; padding: 13px; gap: 7px; border: 1px solid #e0ecea; border-radius: 0; background: #f5f8f8; }
#quote-form .calc-row { min-height: 0; padding: 0; font-size: 13px; color: var(--muted); }
#quote-form .calc-row + .calc-row { border-top: 1px solid #dce7f0; }
#quote-form .calc-row strong { color: #205485; font-size: 13px; }
#quote-form .calc-row.profit-row, #quote-form .calc-row.profit-row strong { color: #c43d43; }
#quote-form .calc-row.total { padding-top: 9px; margin-top: 2px; border-top: 1px solid #dce8e5; color: var(--ink); font-weight: 750; }
#quote-form .calc-row.total strong { color: var(--teal); font-size: 19px; }
#quote-form .modal-actions { margin-top: 22px; padding-top: 17px; }
#quote-form .modal-actions .button { min-height: 38px; padding: 0 16px; font-size: 13px; }
.quote-weather-field { background: #f5f9fa; border: 1px solid #dce9eb; padding: 12px; gap: 8px; }
.quote-weather-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.quote-weather-actions label { color: #536471; font-size: 12px; font-weight: 700; }
.quote-weather-actions .button { min-height: 32px; padding: 0 11px; font-size: 12px; }
.quote-weather-schedule { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.quote-weather-schedule > div { display: grid; grid-template-rows: minmax(34px, auto) auto; align-content: start; gap: 7px; min-width: 0; padding: 10px; border: 1px solid #e2ece9; background: #fff; }
.quote-weather-schedule label { display: flex; align-items: flex-end; min-height: 34px; color: #647680; font-size: 11px; line-height: 1.45; }
.quote-weather-schedule input { min-width: 0; width: 100%; }
.quote-default-range { display: grid; gap: 5px; align-content: start; }
.quote-default-range strong { min-height: 37px; display: flex; align-items: center; color: #176b50; font-size: 16px; line-height: 1.35; }
.quote-default-range > span { min-height: 15px; color: #71847e; font-size: 11px; line-height: 1.35; }
.custom-date-range-field { display: grid; gap: 5px; align-content: start; }
.custom-date-range-button { width: 100%; min-height: 37px; border: 1px solid #b9d9ce; background: #eef8f4; color: #176b50; padding: 0 10px; cursor: pointer; font-size: 13px; text-align: left; }
.custom-date-range-button:hover { border-color: var(--teal); background: #e1f3ec; }
.custom-date-range-summary { min-height: 15px; color: #71847e; font-size: 11px; line-height: 1.35; }
.date-range-picker { display: grid; gap: 18px; padding: 16px; background: #f4f9f7; border: 1px solid #dcebe5; }
.date-range-shortcuts { display: grid; gap: 5px; text-align: center; }
.date-range-shortcuts span { color: #176b50; font-size: 18px; font-weight: 750; }
.date-range-shortcuts small { color: #71847e; font-size: 12px; }
.date-range-fields { display: grid; grid-template-columns: 1fr 38px 1fr; align-items: end; gap: 10px; }
.date-range-arrow { padding-bottom: 10px; color: #71847e; text-align: center; font-weight: 700; }
.construction-date-range-popover { position: fixed; inset: 0; z-index: 25; display: grid; place-items: center; overflow-y: auto; padding: 16px; background: rgba(20, 43, 49, .34); }
.construction-date-range-popover form { width: min(620px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; margin: 0; padding: 18px; background: #fff; border: 1px solid #c9e0d7; box-shadow: 0 18px 42px rgba(16, 52, 43, .22); }
.quote-weather-panel { display: grid; gap: 3px; padding: 9px 10px; border-left: 3px solid #7b9aa7; background: #edf3f5; color: #506672; font-size: 12px; line-height: 1.5; }
.quote-weather-panel span, .quote-weather-panel small { display: block; }
.quote-weather-panel small { color: #71858e; font-size: 11px; }
.quote-weather-panel.is-good { border-left-color: #1b9c70; background: #eaf7f1; color: #176b50; }
.quote-weather-panel.is-warning { border-left-color: #d18b36; background: #fff7e9; color: #8b5b20; }
.quote-weather-panel.is-loading { color: #607883; }
.quote-construction-plan { display: grid; gap: 9px; padding: 11px 12px; border: 1px solid #dbe9e4; border-radius: 8px; background: #fbfefd; }
.quote-plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quote-plan-grid > div { display: grid; gap: 3px; padding: 8px 10px; background: #eef8f4; border-radius: 6px; }
.quote-construction-plan span, .quote-plan-detail span { color: #71847e; font-size: 11px; font-weight: 700; }
.quote-construction-plan strong { color: #176b50; font-size: 15px; }
.quote-plan-detail { display: grid; gap: 3px; }
.quote-plan-detail p { margin: 0; color: #425c54; font-size: 12px; line-height: 1.55; }
.quote-detail-plan { border-left-color: #1b9c70; background: #f1faf6; }
.quote-weather-schedule-list { display: grid; gap: 6px; max-height: 280px; overflow-y: auto; padding-right: 3px; }
.quote-weather-day { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 3px 10px; padding: 7px 9px; border-radius: 6px; background: #eef8f4; color: #3e5b52; font-size: 11px; }
.quote-weather-day > div { display: flex; gap: 8px; align-items: center; min-width: 0; }
.quote-weather-day strong { color: #176b50; }
.quote-weather-day span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-weather-day b { color: #176b50; font-size: 11px; }
.quote-weather-day small { grid-column: 1 / -1; color: #71847e; line-height: 1.4; }
.quote-weather-day.is-delayed { background: #fff4e7; border: 1px solid #f1d1a4; }
.quote-weather-day.is-delayed strong, .quote-weather-day.is-delayed b { color: #a66316; }
.permission-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; padding: 10px; border: 1px solid #dfe8e9; background: #f7faf9; }
.permission-option { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 9px 10px; border: 1px solid #e2e9ed; background: #fff; color: #425666; font-size: 13px; font-weight: 650; cursor: pointer; transition: border-color .18s, background .18s, color .18s, box-shadow .18s; }
.permission-option:hover { border-color: #9fcac5; background: #f5fbfa; color: var(--teal); }
.permission-option:has(input:checked) { border-color: #8bc8bf; background: var(--teal-soft); color: #176d69; box-shadow: inset 3px 0 var(--teal); }
.permission-option input[type="checkbox"] { flex: 0 0 17px; width: 17px; height: 17px; min-height: 17px; margin: 0; padding: 0; accent-color: var(--teal); cursor: pointer; }
.permission-option span { min-width: 0; line-height: 1.35; }
.permission-option-assignment { position: relative; border-color: #cbded9; background: #f8fcfb; }
.permission-option-assignment small { margin-left: auto; color: #7a8c91; font-size: 10px; font-weight: 500; }
.permission-option-assignment:has(input:checked) { border-color: #70b9ad; background: #e8f6f1; }
.permission-grid + .form-hint { display: block; margin-top: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--line); padding-top: 17px; margin-top: 22px; }
.category-editor { border: 0; outline: 0; cursor: pointer; padding-right: 22px; height: 22px; min-height: 22px; font-size: 11px; }
.inline-status-editor { width: auto; min-width: 78px; height: 28px; border: 0; border-radius: 3px; padding: 0 24px 0 8px; font-size: 11px; cursor: pointer; }
.inline-status-editor.gray { background: #eff2f4; color: #6f7c87; }
.inline-status-editor.gold { background: var(--gold-soft); color: #a46715; }
.inline-status-editor.navy { background: #eaf0f5; color: #456176; }
.inline-status-editor.teal { background: var(--teal-soft); color: #17746f; }
.project-address-cell, .project-name-cell { display: block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-address-cell { color: var(--ink); font-size: 12px; }
.project-name-cell { margin-top: 4px; color: var(--muted); font-size: 11px; }
.material-meta { display: block; max-width: 260px; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.price-changed { color: #c43d43; }
.price-change-badge { display: inline-block; margin-left: 6px; padding: 3px 5px; background: #fff0f0; color: #b2383f; font-size: 11px; white-space: nowrap; }
.recognizer-box { background: #f4f8f8; border: 1px solid #dcebe8; padding: 14px; margin-bottom: 18px; }
.recognizer-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.recognizer-heading strong, .recognizer-heading span { display: block; }
.recognizer-heading strong { font-size: 13px; }
.recognizer-heading > div > span { color: var(--muted); font-size: 11px; margin-top: 4px; }
.recognizer-badge { color: var(--teal); background: var(--teal-soft); padding: 4px 7px; font-size: 11px; white-space: nowrap; }
.recognizer-box textarea { width: 100%; min-height: 68px; resize: vertical; border: 1px solid #d3e3e0; background: #fff; outline: 0; padding: 9px 10px; font-size: 13px; color: var(--ink); }
.recognizer-box textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(22,125,120,.08); }
.recognizer-actions { display: flex; align-items: center; gap: 10px; margin-top: 9px; }
.recognizer-actions > span { color: var(--muted); font-size: 11px; }
.notification-explainer { color: #5c6d78; background: #f4f8f8; border: 1px solid #dcebe8; padding: 11px 12px; line-height: 1.5; font-size: 12px; }
.notification-list { display: grid; gap: 0; margin-top: 12px; }
.notification-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 0 2px; }
.notification-pagination span { color: var(--muted); font-size: 12px; }
.notification-pagination .button { min-height: 32px; padding: 0 11px; font-size: 12px; }
.notification-pagination .button:disabled { opacity: .45; cursor: not-allowed; }
.notification-item { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 13px 0; border-bottom: 1px solid #eff2f4; }
.notification-item:last-child { border-bottom: 0; }
.notification-item.is-read { opacity: .62; }
.notification-icon { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; flex: 0 0 28px; padding: 0; margin: 0; border-radius: 50%; background: var(--gold-soft); color: var(--gold); font-weight: 700; line-height: 1; text-align: center; text-indent: 0; }
.notification-item strong { display: block; font-size: 13px; }
.notification-item span { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.notification-item p { margin: 7px 0 4px; font-size: 12px; color: #50616d; line-height: 1.5; }
.quote-lines { display: grid; gap: 9px; }
.quote-line { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(82px, .65fr) minmax(88px, .65fr) minmax(92px, .75fr) 34px; gap: 7px; align-items: center; }
.quote-line-head { color: #778690; font-size: 11px; font-weight: 700; letter-spacing: .02em; margin-bottom: -3px; }
.quote-line-head span { padding: 0 10px; }
.quote-line-total { display: flex; align-items: center; min-height: 37px; padding: 0 10px; border: 1px solid #dce3e8; background: #f4f7f8; color: #1b6c56; font-size: 13px; font-weight: 700; white-space: nowrap; }
.quote-line-margin { display: flex; align-items: center; min-height: 37px; padding: 0 8px; border: 1px solid #edd8d8; background: #fff5f5; color: #c43d43; font-size: 12px; font-weight: 700; white-space: nowrap; }
.quote-line-margin.is-negative { border-color: #cfe4d6; background: #f1faf3; color: #198447; }
.product-lines { display: grid; gap: 9px; }
.product-line { display: grid; grid-template-columns: .8fr 1.5fr .7fr 34px; gap: 7px; align-items: center; }
.product-line input, .product-line select { min-width: 0; width: 100%; border: 1px solid #dce3e8; background: #fff; outline: 0; padding: 9px 10px; min-height: 37px; color: var(--ink); font-size: 13px; }
.product-line input:focus, .product-line select:focus { border-color: var(--teal); }
.quote-line input, .quote-line select { min-width: 0; }
.remove-line { border: 0; background: var(--red-soft); color: var(--red); width: 34px; height: 34px; }
.add-line { border: 1px dashed #c4d3d7; color: var(--teal); background: #fbfdfd; min-height: 34px; width: 100%; font-size: 13px; }
.quote-calculation { background: #f5f8f8; border: 1px solid #e0ecea; padding: 13px; margin-top: 15px; display: grid; gap: 7px; }
.quote-calculation .profit-row, .quote-calculation .profit-row strong { color: #c43d43; font-weight: 700; }
.calc-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.calc-row.total { color: var(--ink); font-weight: 750; border-top: 1px solid #dce8e5; padding-top: 9px; margin-top: 2px; }
.calc-row.total strong { color: var(--teal); font-size: 19px; }
.empty-state { text-align: center; color: var(--muted); padding: 31px 12px; font-size: 13px; }
.toast-stack { position: fixed; top: 84px; right: 28px; z-index: 30; display: grid; gap: 8px; width: min(340px, calc(100vw - 40px)); }
.toast { border-radius: 12px; border-left: 3px solid var(--gold); background: #ffffff; color: var(--ink); padding: 12px 14px; display: flex; align-items: flex-start; gap: 9px; box-shadow: 0 10px 26px rgba(95, 95, 95, .18); animation: toast-in .2s ease; font-size: 13px; }
.toast.success { border-left-color: var(--gold); }
.toast.warning { border-left-color: #b88732; }
@keyframes toast-in { from { transform: translateX(12px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Comfortable canvas and readable record rows.  These rules are visual-only. */
tbody tr:nth-child(odd) td { background: rgba(255,255,255,.72); }
tbody tr:nth-child(even) td { background: #f4f9f8; }
tbody tr:hover td { background: #e7f4f1; }

.visit-item:nth-child(odd),
.history-item:nth-child(odd),
.attention-item:nth-child(odd),
.approval-item:nth-child(odd),
.status-summary-row:nth-child(odd),
.notification-item:nth-child(odd) { background: rgba(255,255,255,.58); }
.visit-item:nth-child(even),
.history-item:nth-child(even),
.attention-item:nth-child(even),
.approval-item:nth-child(even),
.status-summary-row:nth-child(even),
.notification-item:nth-child(even) { background: #f4f9f8; }
.visit-item:hover,
.history-item:hover,
.attention-item:hover,
.approval-item:hover,
.status-summary-row:hover,
.notification-item:hover { background: #e7f4f1; }
.visit-item,
.history-item,
.attention-item,
.approval-item,
.status-summary-row,
.notification-item { padding-left: 10px; padding-right: 10px; transition: background .15s; }
.visit-item.is-due { background: #fffaf2; }
.notification-item.is-read { background: #f1f4f4; }

.quote-record-row:nth-child(odd) td { background: rgba(255,255,255,.72); }
.quote-record-row:nth-child(even) td { background: #f1f8f6; }
.quote-record-row:hover td { background: #e2f2ee; }
.quote-month-filter { display: grid; gap: 4px; min-width: 132px; color: var(--muted); font-size: 11px; font-weight: 700; }
.quote-month-filter input { width: 100%; min-height: 36px; border: 1px solid #dce3e8; background: #fff; padding: 8px 9px; color: var(--ink); font-size: 13px; }
.quote-period-filter { display: grid; gap: 4px; min-width: 104px; color: var(--muted); font-size: 11px; font-weight: 700; }
.quote-period-filter select { width: 100%; min-height: 36px; border: 1px solid #dce3e8; background: #fff; padding: 8px 9px; color: var(--ink); font-size: 13px; }
.period-all-button { align-self: end; min-height: 36px; white-space: nowrap; }
.conversion-metric { border-color: #9fd2c3; background: linear-gradient(135deg, #effaf5, #f8fcfb); }
.modal:has(#quote-form) #quote-form { font-size: 16px; }
.modal:has(#quote-form) #quote-form > .form-grid > .form-field > label,
.modal:has(#quote-form) #quote-form .quote-weather-actions label { font-size: 16px; line-height: 1.35; letter-spacing: 0; }
.modal:has(#quote-form) #quote-form > .form-grid > .form-field input,
.modal:has(#quote-form) #quote-form > .form-grid > .form-field select,
.modal:has(#quote-form) #quote-form > .form-grid > .form-field textarea { font-size: 17px; line-height: 1.35; }
.modal:has(#quote-form) #quote-form .form-hint,
.modal:has(#quote-form) #quote-form .quote-product-group-display,
.modal:has(#quote-form) #quote-form .quote-weather-field,
.modal:has(#quote-form) #quote-form .quote-construction-plan { font-size: 14px; line-height: 1.5; }
.modal:has(#quote-form) #quote-form .quote-formula-group-filters > strong { font-size: 15px; }
.modal:has(#quote-form) #quote-form .quote-formula-group-filters .product-group-chip { font-size: 14px; }
.modal:has(#quote-form) #quote-form .quote-line-head { font-size: 15px; line-height: 1.3; }
.modal:has(#quote-form) #quote-form .quote-line input,
.modal:has(#quote-form) #quote-form .quote-line select { font-size: 16px; line-height: 1.35; }
.modal:has(#quote-form) #quote-form .quote-line-total,
.modal:has(#quote-form) #quote-form .quote-line-margin { font-size: 15px; line-height: 1.3; }
.modal:has(#quote-form) #quote-form .quote-calculation,
.modal:has(#quote-form) #quote-form .calc-row { font-size: 16px; line-height: 1.35; }
.modal:has(#quote-form) #quote-form .calc-row strong { font-size: 16px; }
.modal:has(#quote-form) #quote-form .calc-row.total strong { font-size: 21px; }
.modal:has(#quote-form) #quote-form .modal-actions .button { font-size: 16px; }
.modal:has(#quote-form) { transform: scale(.8); transform-origin: center center; }

@media (max-width: 1100px) {
  .sidebar { width: 215px; flex-basis: 215px; }
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .data-metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .sidebar { width: 68px; flex-basis: 68px; padding-left: 9px; padding-right: 9px; }
  .brand { padding: 4px 5px 34px; }
  .brand > div:last-child, .workspace-label, .nav-item:not(.is-active)::after, .nav-item { font-size: 0; }
  .nav-item { justify-content: center; padding: 12px 5px; }
  .nav-item.is-active { font-size: 0; }
  .nav-icon { font-size: 19px; }
  .sidebar-footer { padding-left: 5px; padding-right: 5px; }
  .security-note span:last-child, .text-button { display: none; }
  .topbar { padding: 0 17px; }
  .account-identity { display: none; }
  .account-trigger { gap: 5px; padding: 4px; }
  .account-menu { right: -3px; }
  .department-intro { align-items: flex-start; flex-direction: column; }
  .department-count { align-self: flex-end; }
  .department-list-heading { grid-template-columns: minmax(0, 1fr) 58px 30px; padding-left: 34px; }
  .department-management-row { grid-template-columns: 20px minmax(0, 1fr) 58px 30px; gap: 5px; }
  .page-container { padding: 23px 17px 40px; }
  .page-heading, .page-heading.compact { align-items: flex-start; flex-direction: column; margin-bottom: 19px; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  h1 { font-size: 25px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .data-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quote-period-filter { min-width: 0; flex: 1; }
  .quote-month-filter { min-width: 0; flex: 1; }
  .metric-card { min-height: 108px; padding: 14px; }
  .metric-card strong { font-size: 25px; }
  .panel { padding: 15px; }
  .filter-row { align-items: stretch; }
  .search-box { min-width: 100%; max-width: none; }
  .filter-row select { flex: 1; min-width: 130px; }
  .quote-summary-item { padding: 16px 13px; }
  .quote-summary-item strong { font-size: 20px; }
  .quote-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quote-form-overview { gap: 10px; }
  .quote-overview-card { min-height: 92px; padding: 14px; }
  .quote-overview-card strong { font-size: 20px; }
  .modal-backdrop:has(#quote-form) { padding: 20px; }
  .modal:has(#quote-form) { width: min(680px, 100%); max-height: calc(100vh - 40px); }
  .modal:has(#quote-form) .modal-header { padding: 18px 22px 13px; }
  .modal:has(#quote-form) #quote-form { margin-top: 0; padding: 18px 22px 20px; }
  .modal:has(#quote-form) #quote-form { overflow-x: hidden; }
  .modal:has(#quote-form) #quote-form .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .modal:has(#quote-form) #quote-form .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal:has(#quote-form) #quote-form .form-field.full { grid-column: 1 / -1; }
  #quote-form .quote-line { grid-template-columns: minmax(0, 1.3fr) minmax(0, .58fr) minmax(0, .6fr) minmax(0, .56fr) minmax(0, .68fr) 38px; gap: 6px; }
  .form-field.full { grid-column: auto; }
  .permission-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-line { grid-template-columns: 1fr; }
  .product-line .remove-line { width: 100%; }
  .visit-item { grid-template-columns: 50px 1fr auto; }
  .visit-item .table-action { grid-column: 2; text-align: left; }
}
@media (max-width: 430px) {
  .login-card { padding: 27px 21px; }
  .topbar { height: 60px; }
  .breadcrumb span, .breadcrumb b { display: none; }
  .metric-grid { gap: 8px; }
  .metric-card .metric-foot { font-size: 11px; }
  .quote-summary-item span { font-size: 11px; }
  .quote-summary-item strong { font-size: 17px; }
  .quote-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .customer-pool-switch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal:has(#quote-form) { width: calc(100vw - 20px); max-height: calc(100vh - 20px); border-radius: 10px; }
  .modal:has(#quote-form) .modal-header { padding: 18px 18px 14px; }
  .modal:has(#quote-form) .modal-header h2 { font-size: 24px; }
  .modal:has(#quote-form) #quote-form { padding: 18px; }
  .quote-form-overview { grid-template-columns: 1fr; }
  .quote-weather-schedule { grid-template-columns: 1fr; }
  .modal:has(#quote-form) #quote-form .form-grid { grid-template-columns: 1fr; }
  #quote-form .quote-line { grid-template-columns: minmax(0, 1fr) 68px 76px 70px 82px 34px; gap: 5px; }
  .region-selects, .detail-followup-row { grid-template-columns: 1fr; }
  .permission-grid { grid-template-columns: 1fr; }
}

/* New quote layout: existing controls are only repositioned; quote logic remains unchanged. */
.modal-backdrop:has(#quote-form) { padding: 16px; }
.modal:has(#quote-form) {
  width: min(1060px, calc(100vw - 52px));
  max-height: calc(100vh - 30px);
  max-height: calc(100dvh - 30px);
  transform: none;
  zoom: .8;
}
.modal:has(#quote-form) .modal-header { padding: 16px 22px 12px; }
.modal:has(#quote-form) .modal-header h2 { font-size: 25px; letter-spacing: 0; }
.modal:has(#quote-form) #quote-form {
  padding: 16px 22px 20px;
  overflow-x: hidden;
  font-size: 15px;
}
#quote-form .quote-form-overview {
  gap: 10px;
  margin-bottom: 12px;
}
#quote-form .quote-overview-card {
  min-height: 78px;
  gap: 5px;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 5px 16px rgba(38, 75, 105, .05);
}
#quote-form .quote-overview-card span { font-size: 13px; }
#quote-form .quote-overview-card strong { font-size: 20px; }
#quote-form .quote-modal-sections { display: grid; gap: 12px; min-width: 0; }
#quote-form .quote-layout-section { min-width: 0; }
#quote-form .quote-layout-section > .form-field,
#quote-form .quote-layout-section > .form-grid > .form-field,
#quote-form .quote-pricing-layout > .form-field {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #dbe6ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(38, 75, 105, .04);
}
#quote-form .quote-layout-section .form-field { gap: 6px; }
#quote-form .quote-layout-section .form-field > label,
#quote-form .quote-weather-actions label {
  color: #1b3349;
  font-size: 15px;
  line-height: 1.35;
  letter-spacing: 0;
}
#quote-form .quote-layout-section .form-field input,
#quote-form .quote-layout-section .form-field select,
#quote-form .quote-layout-section .form-field textarea {
  min-height: 40px;
  padding: 8px 11px;
  font-size: 16px;
  line-height: 1.35;
}
#quote-form .quote-basic-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.modal:has(#quote-form) #quote-form .quote-basic-grid > .quote-customer-field,
.modal:has(#quote-form) #quote-form .quote-basic-grid > .form-field:has([name="customerId"]) { grid-column: span 2; }
.modal:has(#quote-form) #quote-form .quote-basic-grid > .quote-floor-type-field,
.modal:has(#quote-form) #quote-form .quote-basic-grid > .form-field:has([name="project"]) { grid-column: span 3; }
#quote-form .quote-cost-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  align-items: stretch;
  gap: 12px;
}
#quote-form .quote-cost-grid > .form-field {
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-content: start;
  align-items: start;
  gap: 0;
  width: 100%;
  min-width: 0;
  text-align: left;
}
#quote-form .quote-cost-grid > .form-field > label {
  width: 100%;
  min-height: 21px;
  margin: 0 0 8px;
  text-align: left;
}
#quote-form .quote-cost-grid > .form-field > input {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  text-align: left;
}
#quote-form .quote-cost-grid > .form-field > .form-hint {
  width: 100%;
  margin: 10px 0 0;
  text-align: left;
}
#quote-form .quote-formula-section > .form-field { padding: 14px; }
#quote-form .quote-formula-group-filters {
  gap: 9px;
  padding: 11px 12px;
  border-radius: 8px;
}
#quote-form .quote-formula-group-filters > strong { font-size: 17px; }
#quote-form .quote-formula-group-filters .product-group-filters { gap: 7px; }
.modal:has(#quote-form) #quote-form .quote-formula-group-filters .product-group-chip {
  min-height: 34px;
  padding: 0 11px;
  font-size: 16px;
}
#quote-form #quote-product-formula { font-size: 17px; }
#quote-form .quote-product-option {
  gap: 7px;
  padding: 15px 16px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: auto;
}
#quote-form .quote-product-option strong {
  color: #17212b;
  font-size: 19px;
  font-weight: 750;
  line-height: 1.5;
  letter-spacing: 0;
}
#quote-form .quote-product-option span {
  color: #536b7b;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.65;
  letter-spacing: 0;
}
#quote-form .quote-pricing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 260px);
  align-items: stretch;
  gap: 14px;
  min-width: 0;
}
#quote-form #quote-detail-field {
  align-content: start;
  gap: 7px;
  padding: 14px;
}
#quote-form #quote-detail-field > label { margin: 0; }
#quote-form #quote-detail-field > .form-hint { margin: 0 0 2px; }
#quote-form .quote-pricing-layout > #quote-detail-field { grid-column: auto; }
#quote-form #quote-detail-field[hidden],
#quote-form #quote-calculation[hidden] { display: none; }
#quote-form .quote-lines { gap: 8px; }
#quote-form .quote-line {
  grid-template-columns: minmax(170px, 1.55fr) repeat(4, minmax(82px, .72fr)) 34px;
  gap: 6px;
  align-items: center;
}
#quote-form .quote-line > * { min-width: 0; }
#quote-form .quote-line-head {
  min-height: 24px;
  font-size: 14px;
  line-height: 1.35;
}
#quote-form .quote-line-head span {
  padding: 0 8px;
  text-align: left;
}
#quote-form .quote-line-head span:nth-child(n + 2):nth-child(-n + 5) { text-align: right; }
#quote-form .quote-line input,
#quote-form .quote-line select {
  min-height: 40px;
  padding: 8px;
  font-size: 16px;
  text-align: left;
}
#quote-form .quote-line .quote-qty,
#quote-form .quote-line .quote-unit {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
#quote-form .quote-line-total,
#quote-form .quote-line-margin {
  justify-content: flex-end;
  min-height: 40px;
  padding: 0 8px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
#quote-form .quote-line .remove-line {
  align-self: center;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  line-height: 1;
}
#quote-form #add-quote-line {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-align: center;
}
#quote-form #quote-calculation {
  position: sticky;
  top: 0;
  align-self: stretch;
  align-content: start;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 14px;
  gap: 0;
  border-radius: 8px;
}
#quote-form .quote-calculation-heading {
  display: block;
  padding-bottom: 11px;
  border-bottom: 1px solid #dce7f0;
  color: #1b3349;
  font-size: 15px;
}
#quote-form #quote-calculation .calc-row {
  align-items: center;
  gap: 14px;
  min-height: 40px;
  padding: 9px 0;
  font-size: 14px;
  line-height: 1.45;
}
#quote-form #quote-calculation .calc-row span {
  min-width: 0;
  text-align: left;
}
#quote-form #quote-calculation .calc-row strong {
  margin-left: auto;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
#quote-form #quote-calculation .calc-row.total {
  min-height: 48px;
  margin: 0;
  padding: 12px 0 4px;
}
#quote-form #quote-calculation .calc-row.total strong { font-size: 22px; }
#quote-form .quote-weather-section > .quote-weather-field {
  padding: 14px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(38, 75, 105, .04);
}
#quote-form .quote-weather-actions .button { min-height: 36px; }
#quote-form .quote-weather-schedule label { font-size: 14px; }
#quote-form .quote-construction-plan span,
#quote-form .quote-plan-detail span { font-size: 13px; }
#quote-form .quote-plan-detail p { font-size: 14px; }
#quote-form .modal-actions { margin-top: 14px; padding-top: 14px; }
#quote-form .modal-actions .button { min-height: 40px; font-size: 15px; }

@media (max-width: 980px) {
  .modal:has(#quote-form) { width: min(900px, calc(100vw - 36px)); }
  #quote-form .quote-pricing-layout { grid-template-columns: 1fr; }
  #quote-form #quote-calculation { position: static; }
}

@media (max-width: 780px) {
  .modal-backdrop:has(#quote-form) { padding: 10px; }
  .modal:has(#quote-form) {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    transform: none;
    zoom: 1;
  }
  .modal:has(#quote-form) #quote-form { padding: 14px 16px 18px; }
  #quote-form .quote-basic-grid,
  #quote-form .quote-cost-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal:has(#quote-form) #quote-form .quote-basic-grid > .quote-customer-field,
  .modal:has(#quote-form) #quote-form .quote-basic-grid > .quote-floor-type-field,
  .modal:has(#quote-form) #quote-form .quote-basic-grid > .form-field:has([name="customerId"]),
  .modal:has(#quote-form) #quote-form .quote-basic-grid > .form-field:has([name="project"]) { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  #quote-form .quote-form-overview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #quote-form .quote-overview-card { min-height: 68px; padding: 9px; }
  #quote-form .quote-overview-card span { font-size: 11px; }
  #quote-form .quote-overview-card strong { font-size: 16px; }
  #quote-form .quote-basic-grid,
  #quote-form .quote-cost-grid { grid-template-columns: 1fr; }
  .modal:has(#quote-form) #quote-form .quote-basic-grid > .quote-customer-field,
  .modal:has(#quote-form) #quote-form .quote-basic-grid > .quote-floor-type-field,
  .modal:has(#quote-form) #quote-form .quote-basic-grid > .form-field:has([name="customerId"]),
  .modal:has(#quote-form) #quote-form .quote-basic-grid > .form-field:has([name="project"]) { grid-column: auto; }
  #quote-form .quote-line { grid-template-columns: minmax(135px, 1fr) 68px 76px 70px 82px 34px; }
  #quote-form #quote-detail-field { overflow-x: auto; }
}

/* AI sales assistant: isolated from quote and customer business logic. */
.modal-backdrop:has(#ai-analysis-form) { padding: 16px; overflow: auto; }
.modal:has(#ai-analysis-form) {
  width: min(1180px, calc(100vw - 48px));
  max-height: calc(100vh - 32px);
  border-radius: 16px;
  background: #f4f8fc;
  overflow: auto;
  transform: scale(.8);
  transform-origin: center center;
}
.modal:has(#ai-analysis-form) .modal-header { padding: 16px 22px 12px; background: #fff; border-bottom-color: var(--line); }
.modal:has(#ai-analysis-form) .modal-header h2 { color: #10263b; font-size: 25px; letter-spacing: 0; }
.modal:has(#ai-analysis-form) .modal-header .eyebrow { color: #2c5a80; letter-spacing: .12em; }
.ai-assistant-form { position: relative; padding: 14px 16px 18px; background: #f4f8fc; font-size: 16px; }
.ai-status-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 58px; margin-bottom: 12px; padding: 11px 14px; border: 1px solid #d7e5f0; border-radius: 8px; background: #eef5fb; }
.ai-status-bar > div { display: grid; gap: 3px; min-width: 0; }
.ai-status-bar strong { color: #1b3349; font-size: 15px; }
.ai-status-bar span { color: #60768a; font-size: 13px; line-height: 1.45; }
.ai-status-bar.is-enabled { border-color: #b8dfd6; background: #edf8f5; }
.ai-status-bar.is-enabled strong { color: #126b5d; }
.ai-status-bar.is-disabled { border-color: #ead9bd; background: #fff8eb; }
.ai-status-bar.is-disabled strong { color: #9a651f; }
.ai-toggle-button { flex: 0 0 auto; min-height: 36px; }
.ai-assistant-layout { display: grid; grid-template-columns: minmax(340px, .8fr) minmax(0, 1.45fr); gap: 14px; align-items: start; }
.ai-input-panel,
.ai-result-panel { min-width: 0; border: 1px solid #dbe6ef; border-radius: 8px; background: #fff; box-shadow: 0 4px 12px rgba(38, 75, 105, .04); }
.ai-input-panel { position: sticky; top: 0; display: grid; gap: 14px; padding: 16px; }
.ai-panel-heading { display: grid; gap: 7px; padding-bottom: 13px; border-bottom: 1px solid #e3ebf1; }
.ai-panel-heading > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ai-panel-heading > strong { color: #1b3349; font-size: 18px; }
.ai-case-library-button { min-height: 34px; padding: 0 11px; font-size: 14px; }
.ai-panel-heading span { color: #2c5a80; font-size: 13px; font-weight: 750; }
.ai-panel-heading strong { color: #1b3349; font-size: 18px; }
.ai-panel-heading small { color: var(--muted); font-size: 13px; line-height: 1.55; }
.ai-customer-snapshot { display: grid; gap: 8px; }
.ai-customer-snapshot > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 11px; border-radius: 7px; background: #f4f8fb; }
.ai-customer-snapshot span { color: #6b7d8c; font-size: 13px; }
.ai-customer-snapshot strong { color: #1d3549; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.ai-weather-toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 13px; border: 1px solid #d9e5ed; border-radius: 8px; background: #f8fbfd; cursor: pointer; }
.ai-weather-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ai-toggle-copy { display: grid; gap: 3px; min-width: 0; }
.ai-toggle-copy strong { color: #1b3349; font-size: 16px; }
.ai-toggle-copy small { color: var(--muted); font-size: 14px; line-height: 1.45; }
.ai-toggle-track { position: relative; flex: 0 0 48px; width: 48px; height: 26px; border-radius: 13px; background: #bac7d0; transition: background .18s; }
.ai-toggle-track > span { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(20, 45, 62, .2); transition: transform .18s; }
.ai-weather-toggle input:checked + .ai-toggle-track { background: var(--teal); }
.ai-weather-toggle input:checked + .ai-toggle-track > span { transform: translateX(22px); }
.ai-weather-toggle:focus-within { border-color: var(--teal); outline: 2px solid rgba(22, 125, 120, .12); }
.ai-chat-field { display: grid; gap: 8px; }
.ai-chat-field > span { color: #1b3349; font-size: 15px; font-weight: 700; }
.ai-chat-field textarea { width: 100%; min-height: 270px; resize: vertical; padding: 13px 14px; border: 1px solid #c8d5e0; border-radius: 8px; color: #17212b; background: #fff; font-size: 16px; line-height: 1.65; }
.ai-chat-field textarea:focus { border-color: #2178dd; outline: 2px solid rgba(33, 120, 221, .12); }
.ai-chat-field small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.ai-form-actions { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; }
.ai-form-actions .button { min-height: 42px; font-size: 15px; }
.ai-result-panel { display: grid; gap: 12px; padding: 14px; min-height: 630px; }
.ai-result-empty { min-height: 600px; display: grid; place-content: center; gap: 8px; padding: 30px; color: var(--muted); text-align: center; }
.ai-result-empty strong { color: #1b3349; font-size: 20px; }
.ai-result-empty span { max-width: 460px; font-size: 14px; line-height: 1.7; }
.ai-result-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-result-meta span { padding: 5px 8px; border-radius: 5px; background: #edf4f8; color: #5d7182; font-size: 12px; }
.ai-result-card { padding: 15px; border: 1px solid #dce6ed; border-radius: 8px; background: #fbfdfe; }
.ai-result-card-title { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding-bottom: 11px; border-bottom: 1px solid #e5edf2; }
.ai-result-card-title > span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 7px; background: #dcecf8; color: #23618e; font-size: 13px; font-weight: 800; }
.ai-result-card-title > div { display: grid; gap: 2px; }
.ai-result-card-title strong { color: #19354b; font-size: 17px; }
.ai-result-card-title small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.ai-analysis-row { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-bottom: 1px dashed #e3eaf0; }
.ai-analysis-row:last-child { border-bottom: 0; }
.ai-analysis-row span { color: #687b8b; font-size: 13px; }
.ai-analysis-row strong { color: #22394b; font-size: 14px; font-weight: 600; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-risk-card > p { margin: 0; padding: 12px 13px; border-left: 3px solid #c98326; border-radius: 5px; background: #fff7e9; color: #59421f; font-size: 16px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-weather-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid #e3eaf0; }
.ai-weather-heading strong { color: #1b3349; font-size: 14px; }
.ai-weather-heading span { color: var(--muted); font-size: 12px; }
.ai-weather-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 9px; }
.ai-weather-day { display: grid; gap: 3px; padding: 9px 10px; border-left: 3px solid #55a590; border-radius: 5px; background: #eff8f5; }
.ai-weather-day.is-risk { border-left-color: #cf6a65; background: #fff2f1; }
.ai-weather-day strong { font-size: 13px; }
.ai-weather-day span { color: #516979; font-size: 12px; }
.ai-weather-day small { color: #70818d; font-size: 11px; line-height: 1.45; }
.ai-weather-disabled-note { display: grid; gap: 5px; padding: 16px; border: 1px dashed #cddbe5; border-radius: 7px; background: #f3f7fa; }
.ai-weather-disabled-note strong { color: #405a6e; font-size: 16px; }
.ai-weather-disabled-note span { color: #6a7d8c; font-size: 14px; line-height: 1.55; }
.ai-replies-section { display: grid; gap: 9px; }
.ai-reply-card { padding: 12px; border: 1px solid #dce6ed; border-radius: 7px; background: #fff; }
.ai-reply-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ai-reply-heading > div { display: grid; gap: 2px; }
.ai-reply-heading strong { color: #1d3d55; font-size: 15px; }
.ai-reply-heading span { color: var(--muted); font-size: 12px; }
.ai-reply-heading .button { min-height: 32px; padding: 0 11px; font-size: 12px; }
.ai-reply-card p { margin: 10px 0 0; color: #243a49; font-size: 14px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.customer-ai-history { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.customer-ai-history-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.customer-ai-history-summary strong { color: #2c5a80; }
.customer-ai-history-items { display: grid; gap: 8px; }
.customer-ai-history-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 12px; border: 1px solid #dfe8ee; background: #f3f8fb; }
.customer-ai-history-item > div { display: grid; gap: 3px; min-width: 0; }
.customer-ai-history-item strong { color: #1d536f; font-size: 13px; }
.customer-ai-history-item span,
.customer-ai-history-item small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-personal-cases-panel { position: absolute; z-index: 5; inset: 14px 16px 18px; display: grid; grid-template-rows: auto auto auto minmax(180px, 1fr); gap: 14px; padding: 18px; border: 1px solid #d5e1ea; border-radius: 10px; background: #f7fafc; box-shadow: 0 18px 50px rgba(18, 42, 59, .2); overflow: auto; }
.ai-personal-cases-panel[hidden] { display: none; }
.ai-personal-cases-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 14px; border-bottom: 1px solid #dce6ed; }
.ai-personal-cases-header > div { display: grid; gap: 4px; }
.ai-personal-cases-header span { color: #2c5a80; font-size: 12px; font-weight: 750; letter-spacing: .1em; }
.ai-personal-cases-header strong { color: #18374e; font-size: 22px; }
.ai-personal-cases-header small { color: var(--muted); font-size: 14px; line-height: 1.5; }
.ai-personal-case-create { display: grid; grid-template-columns: minmax(220px, .45fr) minmax(0, 1.55fr); gap: 12px; padding: 14px; border: 1px solid #dce6ed; border-radius: 8px; background: #fff; }
.ai-personal-case-create label { display: grid; align-content: start; gap: 7px; }
.ai-personal-case-create label > span { color: #1b3349; font-size: 15px; font-weight: 700; }
.ai-personal-case-create input,
.ai-personal-case-create textarea { width: 100%; border: 1px solid #c8d5e0; border-radius: 7px; padding: 10px 12px; color: #17212b; background: #fff; font-size: 16px; line-height: 1.55; }
.ai-personal-case-create textarea { min-height: 124px; resize: vertical; }
.ai-personal-case-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ai-personal-case-actions span { color: var(--muted); font-size: 13px; }
.ai-personal-case-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.ai-personal-case-list-heading > div { display: flex; align-items: baseline; gap: 9px; }
.ai-personal-case-list-heading strong { color: #1b3349; font-size: 17px; }
.ai-personal-case-list-heading span { color: var(--muted); font-size: 13px; }
.ai-personal-case-list { display: grid; align-content: start; gap: 8px; min-height: 180px; }
.ai-personal-case-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid #dce6ed; border-radius: 7px; background: #fff; }
.ai-personal-case-item > div { display: grid; gap: 4px; min-width: 0; }
.ai-personal-case-item strong { color: #1d4058; font-size: 16px; }
.ai-personal-case-item span { color: var(--muted); font-size: 12px; }
.ai-personal-case-item p { display: -webkit-box; margin: 2px 0 0; overflow: hidden; color: #405767; font-size: 14px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 3; white-space: pre-wrap; }

/* AI assistant typography is intentionally one step larger for readability. */
.modal:has(#ai-analysis-form) .modal-header h2 { font-size: 27px; }
.modal:has(#ai-analysis-form) .modal-header .eyebrow { font-size: 13px; }
.ai-assistant-form { font-size: 18px; }
.ai-status-bar strong { font-size: 17px; }
.ai-status-bar span { font-size: 15px; }
.ai-toggle-button { font-size: 16px; }
.ai-panel-heading span { font-size: 15px; }
.ai-panel-heading strong { font-size: 20px; }
.ai-panel-heading > strong { font-size: 20px; }
.ai-panel-heading small { font-size: 15px; }
.ai-customer-snapshot span { font-size: 15px; }
.ai-customer-snapshot strong { font-size: 16px; }
.ai-chat-field > span { font-size: 17px; }
.ai-chat-field textarea { font-size: 18px; }
.ai-chat-field small { font-size: 14px; }
.ai-form-actions .button { font-size: 17px; }
.ai-result-empty strong { font-size: 22px; }
.ai-result-empty span { font-size: 16px; }
.ai-result-meta span { font-size: 14px; }
.ai-result-card-title > span { font-size: 15px; }
.ai-result-card-title strong { font-size: 19px; }
.ai-result-card-title small { font-size: 14px; }
.ai-analysis-row span { font-size: 15px; }
.ai-analysis-row strong { font-size: 16px; }
.ai-weather-heading strong { font-size: 16px; }
.ai-weather-heading span { font-size: 14px; }
.ai-weather-day strong { font-size: 15px; }
.ai-weather-day span { font-size: 14px; }
.ai-weather-day small { font-size: 13px; }
.ai-reply-heading strong { font-size: 17px; }
.ai-reply-heading span { font-size: 14px; }
.ai-reply-heading .button { font-size: 14px; }
.ai-reply-card p { font-size: 16px; }

@media (max-width: 980px) {
  .modal:has(#ai-analysis-form) { width: min(900px, calc(100vw - 36px)); }
  .ai-assistant-layout { grid-template-columns: 1fr; }
  .ai-input-panel { position: static; }
  .ai-result-panel { min-height: 0; }
  .ai-result-empty { min-height: 280px; }
}

@media (max-width: 780px) {
  .modal-backdrop:has(#ai-analysis-form) { padding: 10px; }
  .modal:has(#ai-analysis-form) { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); transform: none; }
  .ai-assistant-form { padding: 12px; }
  .ai-status-bar { align-items: stretch; flex-direction: column; }
  .ai-weather-list { grid-template-columns: 1fr; }
  .ai-personal-cases-panel { inset: 10px; padding: 14px; }
  .ai-personal-case-create { grid-template-columns: 1fr; }
  .ai-personal-case-actions { grid-column: auto; align-items: stretch; flex-direction: column; }
  .ai-personal-case-list-heading { align-items: stretch; flex-direction: column; }
  .ai-customer-snapshot > div,
  .ai-analysis-row { grid-template-columns: 1fr; gap: 4px; }
}

/* Global white-and-gold neumorphism theme. Visual overrides only. */
:root {
  --ink: #333333;
  --muted: #888888;
  --line: rgba(200, 164, 72, .14);
  --soft: #f5f5f5;
  --paper: #ffffff;
  --navy: #ffffff;
  --teal: #c8a448;
  --teal-soft: #f7f0dc;
  --gold: #c8a448;
  --gold-soft: #f7f0dc;
  --red: #a85d5d;
  --red-soft: #fbf1f1;
  --canvas: #f5f5f5;
  --shadow:
    8px 8px 18px rgba(174, 174, 174, .17),
    -8px -8px 18px rgba(255, 255, 255, .92);
  --neu-shadow-small:
    4px 4px 10px rgba(174, 174, 174, .14),
    -4px -4px 10px rgba(255, 255, 255, .92);
  --neu-inset:
    inset 3px 3px 7px rgba(174, 174, 174, .10),
    inset -3px -3px 7px rgba(255, 255, 255, .94);
}

html,
body {
  color: var(--ink);
  background: var(--canvas);
  letter-spacing: 0;
}

h1,
h2,
h3,
button,
input,
select,
textarea {
  letter-spacing: 0;
}

/* Shell and navigation */
.login-screen {
  background: var(--canvas);
}

.login-card,
.sidebar,
.topbar,
.account-menu {
  border: 0;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.login-card {
  border-radius: 20px;
}

.login-brand-mark,
.brand-mark {
  border-radius: 12px;
  background: var(--gold);
  color: #ffffff;
  box-shadow: var(--neu-shadow-small);
}

.sidebar {
  position: relative;
  z-index: 2;
  box-shadow: 9px 0 24px rgba(174, 174, 174, .16);
}

.brand strong,
.brand span,
.workspace-label,
.security-note,
.text-button {
  color: var(--muted);
}

.brand strong {
  color: var(--ink);
}

.workspace-label,
.eyebrow {
  color: var(--gold);
}

.nav-list {
  gap: 8px;
}

.nav-item {
  min-height: 44px;
  border-radius: 14px;
  color: #666666;
}

.nav-item:hover,
.nav-item.is-active {
  color: #745b1d;
  background: var(--gold-soft);
  box-shadow: var(--neu-shadow-small);
}

.nav-item.is-active {
  box-shadow: inset 3px 0 var(--gold), var(--neu-shadow-small);
}

.nav-icon,
.nav-item.is-active .nav-icon {
  color: var(--gold);
}

.sidebar-footer {
  border-top-color: var(--line);
}

.status-dot {
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 164, 72, .14);
}

.topbar {
  border: 0;
  box-shadow: 0 7px 20px rgba(174, 174, 174, .11);
}

.breadcrumb,
.breadcrumb strong {
  color: var(--muted);
}

.breadcrumb b {
  color: #c4c4c4;
}

.account-trigger:hover,
.account-trigger[aria-expanded="true"],
.icon-button:hover,
.notification-button:hover {
  border-color: transparent;
  background: var(--gold-soft);
  color: var(--gold);
}

.avatar,
.account-menu-icon {
  background: var(--gold-soft);
  color: #8a6c20;
}

.account-menu {
  border-radius: 16px;
}

.account-menu > button:hover {
  background: var(--gold-soft);
}

/* Titles and shared cards */
.page-heading h1,
.modal-header h2 {
  position: relative;
  color: var(--gold);
  letter-spacing: 0;
}

.page-heading h1 {
  font-size: 24px;
  font-weight: 800;
  padding-bottom: 11px;
}

.page-heading h1::after,
.modal-header h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 52px;
  height: 3px;
  border-radius: 2px;
  background: var(--gold);
}

.panel,
.metric-card,
.dashboard-filter-panel,
.customer-pool-tab,
.organization-settings-grid > section,
.quick-record-box,
.recognizer-box,
.notification-explainer,
.reminder-banner,
.notification-alert,
.quote-summary,
.user-summary,
.product-filters-panel {
  border: 0;
  border-radius: 20px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.panel,
.dashboard-filter-panel,
.organization-settings-grid > section {
  padding: 16px 18px;
}

.metric-card {
  border: 0;
  overflow: hidden;
}

.metric-card::after {
  background: var(--gold-soft);
}

.metric-card strong,
.quote-summary-item strong {
  color: var(--ink);
  letter-spacing: 0;
}

.metric-card .metric-foot em,
.dashboard-metric-card .metric-open-hint,
.visit-time,
.history-date,
.link-button,
.table-action,
.quote-record-link,
.quote-record-customer:hover,
.customer-name-button:hover,
.visit-project-link,
.attention-item button {
  color: var(--gold);
}

.data-clickable,
.dashboard-metric-card {
  transition: transform .16s ease, box-shadow .16s ease;
}

.data-metric-grid .data-clickable:hover,
.dashboard-metric-card:hover {
  border-color: transparent;
  background: #ffffff;
  box-shadow: 11px 11px 24px rgba(174, 174, 174, .20), -7px -7px 18px #ffffff;
  transform: translateY(-2px);
}

.data-bar-track {
  border-radius: 999px;
  background: #e9e9e9;
}

.data-bar-fill,
.data-bar-fill.intent,
.data-bar-fill.quoted,
.data-bar-fill.signed,
.data-bar-fill.unquoted,
.data-bar-fill.public {
  border-radius: 999px;
  background: var(--gold);
}

/* Inputs, selectors and actions */
.form-field input,
.form-field select,
.form-field textarea,
.dashboard-filter-field select,
.dashboard-filter-field input,
.dashboard-owner-filter summary strong,
.quote-record-filters select,
.quote-record-filters input,
.quote-month-filter input,
.quote-period-filter select,
.customer-search-picker > input,
.product-line input,
.product-line select,
.quick-record-box textarea,
.recognizer-box textarea,
.ai-chat-field textarea,
.ai-personal-case-create input,
.ai-personal-case-create textarea {
  border: 1px solid transparent;
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: var(--neu-inset);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
.dashboard-filter-field select:focus,
.dashboard-filter-field input:focus,
.quote-record-filters input:focus,
.quote-record-filters select:focus,
.customer-search-picker > input:focus,
.product-line input:focus,
.product-line select:focus,
.quick-record-box textarea:focus,
.recognizer-box textarea:focus,
.ai-chat-field textarea:focus,
.ai-personal-case-create input:focus,
.ai-personal-case-create textarea:focus {
  border-color: rgba(200, 164, 72, .7);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(200, 164, 72, .12), var(--neu-inset);
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--gold);
}

.button {
  border-radius: 12px;
  letter-spacing: 0;
}

.button.primary {
  border-color: var(--gold);
  background: var(--gold);
  color: #ffffff;
  box-shadow: var(--neu-shadow-small);
}

.button.primary:hover {
  border-color: #b38f39;
  background: #b38f39;
  color: #ffffff;
  transform: translateY(-1px);
}

.button.secondary,
.button.ghost {
  border: 1px solid var(--gold);
  background: #ffffff;
  color: var(--gold);
  box-shadow: var(--neu-shadow-small);
}

.button.secondary:hover,
.button.ghost:hover {
  border-color: var(--gold);
  background: var(--gold);
  color: #ffffff;
}

.icon-button,
.remove-line,
.category-delete-button {
  border-radius: 10px;
}

.remove-line,
.category-delete-button {
  border: 0;
  background: var(--red-soft);
  color: var(--red);
  box-shadow: var(--neu-shadow-small);
}

/* Tables, filters and record cards */
.table-wrap {
  border-radius: 16px;
  background: #ffffff;
}

thead th {
  background: var(--gold-soft);
  color: #6e5a29;
  border-bottom-color: rgba(200, 164, 72, .22);
}

tbody tr:nth-child(odd) td,
.quote-record-row:nth-child(odd) td {
  background: #ffffff;
}

tbody tr:nth-child(even) td,
.quote-record-row:nth-child(even) td {
  background: #faf9f6;
}

tbody tr:hover td,
.quote-record-row:hover td {
  background: var(--gold-soft);
}

#customer-table tr.is-pinned td { background: #fff7e4; }
#customer-table tr.is-pinned:hover td { background: #ffefd0; }

.filter-row,
.quote-record-filters,
.quote-product-group-filters,
.quote-formula-group-filters {
  border: 0;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: var(--neu-shadow-small);
}

.material-filter-chip,
.product-group-chip,
.customer-pool-tab,
.permission-option {
  border: 1px solid rgba(200, 164, 72, .34);
  border-radius: 12px;
  background: #ffffff;
  color: #666666;
}

.material-filter-chip:hover,
.material-filter-chip.is-active,
.product-group-chip:hover,
.product-group-chip.is-active,
.customer-pool-tab:hover,
.customer-pool-tab.is-active,
.permission-option:hover,
.permission-option:has(input:checked) {
  border-color: var(--gold);
  background: var(--gold);
  color: #ffffff;
  box-shadow: var(--neu-shadow-small);
}

.product-group-chip.is-active span,
.customer-pool-tab.is-active small,
.permission-option:has(input:checked) small {
  color: rgba(255, 255, 255, .86);
}

.visit-list,
.attention-list,
.status-summary,
.notification-list,
.customer-quote-history-list,
.customer-ai-history-items,
.ai-personal-case-list {
  gap: 10px;
}

.visit-item,
.history-item,
.attention-item,
.approval-item,
.status-summary-row,
.notification-item,
.customer-quote-history-item,
.customer-ai-history-item,
.version-item,
.product-group-management-row,
.department-management-row,
.ai-personal-case-item {
  border: 0;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: var(--neu-shadow-small);
}

.visit-item,
.history-item,
.attention-item,
.approval-item,
.status-summary-row,
.notification-item,
.customer-quote-history-item,
.customer-ai-history-item {
  padding: 12px 14px;
}

.visit-item:nth-child(odd),
.visit-item:nth-child(even),
.history-item:nth-child(odd),
.history-item:nth-child(even),
.attention-item:nth-child(odd),
.attention-item:nth-child(even),
.approval-item:nth-child(odd),
.approval-item:nth-child(even),
.status-summary-row:nth-child(odd),
.status-summary-row:nth-child(even),
.notification-item:nth-child(odd),
.notification-item:nth-child(even),
.notification-item.is-read {
  background: #ffffff;
}

.visit-item:hover,
.history-item:hover,
.attention-item:hover,
.approval-item:hover,
.status-summary-row:hover,
.notification-item:hover {
  background: var(--gold-soft);
}

.visit-item.is-due,
.approval-item.is-targeted {
  background: #fffaf0;
  box-shadow: inset 4px 0 0 var(--gold), var(--neu-shadow-small);
}

.status-tag {
  border-radius: 999px;
}

.status-tag.teal,
.status-tag.gold,
.status-tag.navy,
.status-tag.gray,
.inline-status-editor.teal,
.inline-status-editor.gold,
.inline-status-editor.navy,
.inline-status-editor.gray {
  background: var(--gold-soft);
  color: #80651d;
}

/* Modals and detail pages */
.modal-backdrop,
.modal-backdrop:has(#quote-form) {
  background: rgba(51, 51, 51, .28);
  backdrop-filter: blur(3px);
}

.modal,
.modal:has(#quote-form),
.modal:has(#ai-analysis-form) {
  border: 0;
  border-radius: 20px;
  background: var(--canvas);
  box-shadow: 20px 20px 55px rgba(95, 95, 95, .25), -12px -12px 30px rgba(255, 255, 255, .75);
}

.modal-header,
.modal:has(#quote-form) .modal-header,
.modal:has(#ai-analysis-form) .modal-header {
  border: 0;
  background: #ffffff;
}

.modal-header h2 {
  padding-bottom: 9px;
}

.modal-header h2::after {
  width: 42px;
  height: 2px;
}

.form-body,
.modal:has(#quote-form) #quote-form,
.ai-assistant-form {
  background: var(--canvas);
}

.detail-grid > div,
.detail-followup-row > div,
.detail-note,
.quick-record-box,
.recognizer-box {
  border: 0 !important;
  border-radius: 16px !important;
  background: #ffffff !important;
  box-shadow: var(--neu-shadow-small) !important;
}

.detail-grid > div {
  padding: 16px 18px !important;
}

.detail-grid span,
.detail-note > span,
.form-field label,
.form-field > span {
  color: var(--muted);
  font-size: 13px;
}

.detail-grid strong,
.detail-note p {
  color: var(--ink);
  font-size: 15px;
}

.modal-actions {
  border-top-color: var(--line);
}

/* Quote editor: preserve all geometry and calculations. */
.modal:has(#quote-form),
.modal:has(#quote-form) #quote-form {
  background: var(--canvas);
}

.quote-overview-card,
.quote-overview-card.area,
.quote-overview-card.type,
.quote-overview-card.valid,
.modal:has(#quote-form) #quote-form > .form-grid > .form-field,
.modal:has(#quote-form) #quote-form .quote-weather-field,
.modal:has(#quote-form) #quote-form .quote-construction-plan,
#quote-form #quote-detail-field,
#quote-form #quote-calculation {
  border: 0;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.modal:has(#quote-form) #quote-form .quote-basic-grid > .form-field,
.modal:has(#quote-form) #quote-form .quote-cost-grid > .form-field,
.modal:has(#quote-form) #quote-form .quote-formula-field,
.modal:has(#quote-form) #quote-form #quote-detail-field,
.modal:has(#quote-form) #quote-form #quote-calculation {
  border: 0;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: var(--neu-shadow-small);
}

.modal:has(#quote-form) #quote-form .quote-layout-section > .form-field,
.modal:has(#quote-form) #quote-form .quote-layout-section > .form-grid > .form-field,
.modal:has(#quote-form) #quote-form .quote-pricing-layout > .form-field {
  border: 0;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: var(--neu-shadow-small);
}

.modal:has(#quote-form) #quote-form .quote-formula-group-filters {
  border: 0;
  background: #ffffff;
  box-shadow: var(--neu-inset);
}

.quote-overview-card.area span,
.quote-overview-card.area strong,
.quote-overview-card span,
.quote-overview-card strong {
  color: var(--ink);
}

.quote-overview-card span {
  color: var(--muted);
}

.modal:has(#quote-form) .modal-header h2,
.modal:has(#quote-form) .modal-header .eyebrow,
.modal:has(#quote-form) #quote-form > .form-grid > .form-field > label,
.modal:has(#quote-form) #quote-form .quote-weather-actions label,
#quote-form .quote-formula-group-filters > strong,
#quote-form .calc-row strong,
#quote-form .calc-row.total strong {
  color: var(--gold);
}

#quote-form .form-field input,
#quote-form .form-field select,
#quote-form .quote-line input,
#quote-form .quote-line select,
#quote-form .quote-line:nth-child(odd) input,
#quote-form .quote-line:nth-child(odd) select {
  border: 1px solid transparent;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: var(--neu-inset);
}

#quote-form .form-field input:focus,
#quote-form .form-field select:focus,
#quote-form .quote-line input:focus,
#quote-form .quote-line select:focus {
  border-color: rgba(200, 164, 72, .7);
  box-shadow: 0 0 0 3px rgba(200, 164, 72, .12), var(--neu-inset);
}

#quote-form .quote-product-toggle {
  border: 0;
  border-radius: 0 10px 10px 0;
  background: #ffffff;
  color: var(--gold);
}

#quote-form .quote-product-toggle:hover,
#quote-form .quote-product-toggle:focus-visible {
  background: var(--gold-soft);
  color: var(--gold);
}

#quote-form .quote-product-options {
  border: 0;
  border-radius: 16px;
  box-shadow: 12px 12px 28px rgba(120, 120, 120, .20), -8px -8px 18px rgba(255, 255, 255, .9);
}

#quote-form .quote-product-option {
  border-bottom-color: rgba(200, 164, 72, .12);
}

#quote-form .quote-product-option:hover,
#quote-form .quote-product-option:focus {
  background: var(--gold-soft);
}

.modal:has(#quote-form) #quote-form .quote-product-group-display {
  border: 0;
  border-radius: 10px;
  background: #fbfaf7;
  color: var(--muted);
  box-shadow: var(--neu-inset);
}

#quote-form .quote-line-total,
#quote-form .quote-line-margin {
  border: 0;
  border-radius: 10px;
  box-shadow: var(--neu-inset);
}

#quote-form .quote-line-total {
  background: #ffffff;
  color: var(--gold);
}

#quote-form .calc-row + .calc-row,
#quote-form .calc-row.total {
  border-top-color: rgba(200, 164, 72, .22);
}

#quote-form .add-line {
  border: 1px solid var(--gold);
  border-radius: 12px;
  background: #ffffff;
  color: var(--gold);
}

#quote-form .add-line:hover {
  background: var(--gold);
  color: #ffffff;
}

.quote-weather-schedule > div,
.quote-plan-grid > div,
.quote-weather-day,
.quote-weather-panel,
.quote-weather-panel.is-good,
.quote-weather-panel.is-warning,
.quote-detail-plan {
  border: 0;
  border-radius: 14px;
  background: #fbfaf7;
  color: var(--ink);
  box-shadow: var(--neu-shadow-small);
}

.quote-construction-plan strong,
.quote-weather-day strong,
.quote-weather-day b {
  color: var(--gold);
}

.modal:has(#quote-form) #quote-form .quote-weather-actions .button {
  border-color: var(--gold);
  background: var(--gold);
  color: #ffffff;
}

.modal:has(#quote-form) #quote-form .quote-plan-grid > div,
.modal:has(#quote-form) #quote-form .quote-weather-schedule > div,
.modal:has(#quote-form) #quote-form .quote-weather-day,
.modal:has(#quote-form) #quote-form .quote-weather-panel {
  border: 0;
  border-radius: 14px;
  background: #fbfaf7;
  color: var(--ink);
  box-shadow: var(--neu-shadow-small);
}

.custom-date-range-button {
  border: 1px solid var(--gold);
  border-radius: 12px;
  background: #ffffff;
  color: var(--gold);
}

.date-range-picker,
.construction-date-range-popover form {
  border: 0;
  border-radius: 20px;
  background: var(--canvas);
  box-shadow: var(--shadow);
}

.quote-image-modal-body,
.quote-image-preview {
  border-color: transparent;
  background: var(--canvas);
}

/* AI assistant and personal cases */
.modal:has(#ai-analysis-form) .modal-header h2,
.modal:has(#ai-analysis-form) .modal-header .eyebrow,
.ai-panel-heading > strong,
.ai-panel-heading strong,
.ai-chat-field > span,
.ai-result-empty strong,
.ai-result-card-title strong,
.ai-reply-heading strong,
.ai-personal-cases-header strong,
.ai-personal-case-list-heading strong {
  color: var(--gold);
}

.ai-status-bar,
.ai-status-bar.is-enabled,
.ai-status-bar.is-disabled,
.ai-input-panel,
.ai-result-panel,
.ai-result-card,
.ai-reply-card,
.ai-personal-cases-panel,
.ai-personal-case-create,
.ai-personal-case-item,
.ai-customer-snapshot > div,
.ai-weather-toggle,
.ai-weather-disabled-note {
  border: 0;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.ai-status-bar,
.ai-input-panel,
.ai-result-panel,
.ai-result-card,
.ai-reply-card,
.ai-personal-case-create,
.ai-personal-case-item {
  box-shadow: var(--neu-shadow-small);
}

.ai-status-bar strong,
.ai-status-bar.is-enabled strong,
.ai-status-bar.is-disabled strong,
.ai-panel-heading span,
.customer-ai-history-summary strong,
.ai-personal-cases-header span {
  color: var(--gold);
}

.ai-panel-heading,
.ai-result-card-title,
.ai-personal-cases-header {
  border-bottom-color: var(--line);
}

.ai-result-card-title > span,
.ai-result-meta span,
.ai-weather-day,
.ai-weather-day.is-risk,
.ai-risk-card > p {
  border: 0;
  background: var(--gold-soft);
  color: #6b5726;
}

.ai-weather-toggle .ai-toggle-track {
  background: #b8bdc4;
}

.ai-weather-toggle input:checked + .ai-toggle-track {
  background: var(--gold);
}

.ai-weather-toggle:focus-within {
  border-color: transparent;
  outline: 3px solid rgba(200, 164, 72, .14);
}

/* Settings and organization */
.department-intro,
.department-management-row,
.product-group-management-row,
.organization-settings-grid > section,
.permission-option-assignment {
  border-color: transparent;
  background: #ffffff;
}

.department-intro,
.organization-settings-grid > section {
  border-radius: 20px;
  box-shadow: var(--neu-shadow-small);
}

.department-count,
.organization-section-heading b,
.product-group-badge,
.recognizer-badge {
  border-radius: 10px;
  background: var(--gold-soft);
  color: #80651d;
}

/* Keep responsive structure; make paired information single-column on phones. */
@media (max-width: 780px) {
  .brand {
    justify-content: center;
    padding-right: 0;
    padding-left: 0;
  }

  .brand > div:last-child {
    display: none;
  }

  .page-container {
    padding-right: 16px;
    padding-left: 16px;
  }

  .page-heading {
    align-items: stretch;
  }

  .dashboard-grid,
  .organization-settings-grid,
  .detail-grid,
  .form-grid:not(.quote-basic-grid):not(.quote-cost-grid) {
    grid-template-columns: 1fr;
  }

  .panel,
  .dashboard-filter-panel,
  .organization-settings-grid > section {
    padding: 16px;
  }
}

@media (max-width: 520px) {
  .page-heading h1 {
    font-size: 22px;
  }

  .customer-pool-switch {
    grid-template-columns: 1fr;
  }
}
