:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --surface-3: #eef2f5;
  --ink: #15202b;
  --muted: #617080;
  --subtle: #8a97a5;
  --line: #d9e0e7;
  --line-strong: #c7d0d9;
  --brand: #145c63;
  --brand-2: #1f7a7b;
  --accent: #b58a2a;
  --good: #21865a;
  --warn: #b96b18;
  --danger: #b9423c;
  --shadow: 0 18px 50px rgba(18, 33, 46, 0.12);
  --radius: 8px;
  --sidebar: 256px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

body {
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.lucide-icon {
  width: 18px;
  height: 18px;
  flex: none;
  display: block;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(380px, 0.9fr) minmax(480px, 1.1fr);
  background: #dceff0 url("../assets/cea1c82576cd25c970a9b83a6258c9f5.png") center / cover no-repeat;
}

.login-brand {
  min-height: 100vh;
  padding: 56px;
  color: #fff;
  background: rgba(16, 35, 41, 0.78);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  padding: 6px;
}

.brand-title {
  min-width: 0;
}

.brand-title strong {
  display: block;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}

.brand-title span {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.login-copy {
  max-width: 580px;
}

.login-copy h1 {
  margin: 0 0 18px;
  font-size: 42px;
  line-height: 1.12;
  letter-spacing: 0;
}

.login-copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 16px;
  line-height: 1.75;
}

.login-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 42px;
}

.metric-tile {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 16px;
}

.metric-tile strong {
  display: block;
  font-size: 22px;
  line-height: 1;
}

.metric-tile span {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
}

.login-panel-wrap {
  min-height: 100vh;
  padding: 40px;
  display: grid;
  place-items: center;
  background: rgba(244, 246, 248, 0.84);
  backdrop-filter: blur(8px);
}

.login-panel {
  width: min(460px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
}

.panel-kicker {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.login-panel h2,
.drawer-title h3,
.section-title h2 {
  margin: 0;
  letter-spacing: 0;
}

.login-panel h2 {
  font-size: 28px;
}

.login-panel .hint {
  margin: 10px 0 28px;
  color: var(--muted);
  line-height: 1.6;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.product-image-upload {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 14px;
  background: #f8fbfb;
}

.product-image-upload > img {
  width: 112px;
  height: 92px;
  border: 1px solid var(--line);
  border-radius: 7px;
  object-fit: contain;
  background: #fff;
}

.product-image-upload-copy {
  display: grid;
  justify-items: start;
  gap: 8px;
  min-width: 0;
}

.product-image-upload-copy > span {
  max-width: 100%;
  color: var(--ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.image-upload-button {
  cursor: pointer;
}

@media (max-width: 560px) {
  .product-image-upload {
    grid-template-columns: 1fr;
  }
}

.input-with-action {
  position: relative;
}

.input-with-action input {
  padding-right: 46px;
}

.input-action {
  position: absolute;
  top: 50%;
  right: 5px;
  width: 34px;
  height: 34px;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
}

.input-action:hover,
.input-action:focus-visible {
  color: var(--brand);
  background: var(--surface-3);
  outline: none;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(31, 122, 123, 0.14);
}

.login-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}

.login-submit {
  width: 100%;
  min-height: 44px;
}

.quick-accounts {
  margin-top: 24px;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  background: #f4f6f8 url("../assets/92e724b7a3f8f92a3dcc1ed3b65bc09f.png") center / cover fixed no-repeat;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #102329;
  color: #fff;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-head {
  padding: 24px 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar .brand-mark img {
  width: 42px;
  height: 42px;
}

.sidebar .brand-title strong {
  font-size: 17px;
}

.sidebar .brand-title span {
  font-size: 12px;
}

.nav-list {
  padding: 14px;
  display: grid;
  gap: 6px;
}

.nav-btn {
  min-height: 44px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  text-align: left;
  padding: 0 12px;
}

.nav-btn:hover,
.nav-btn.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 800;
}

.nav-icon .lucide-icon {
  width: 19px;
  height: 19px;
}

.nav-count {
  min-width: 24px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0 7px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.12);
}

.sidebar-foot {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 12px;
}

.user-chip {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #102329;
  background: #d8c288;
  font-weight: 800;
}

.user-chip strong,
.user-chip span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip strong {
  font-size: 14px;
}

.user-chip span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  margin-top: 3px;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: rgba(244, 246, 248, 0.7);
}

.sidebar-scrim {
  display: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  min-height: 70px;
  background: rgba(244, 246, 248, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 28px;
}

.topbar-title {
  min-width: 0;
}

.topbar-title strong {
  display: block;
  font-size: 18px;
  line-height: 1.2;
}

.topbar-title span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.content {
  padding: 26px 28px 40px;
  display: grid;
  gap: 22px;
}

.section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.section-title h2 {
  font-size: 24px;
}

.section-title p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.section-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.kpi-grid.compact .kpi {
  min-height: 98px;
}

.kpi {
  min-height: 120px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: grid;
  align-content: space-between;
  gap: 18px;
}

.kpi span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.kpi strong {
  display: block;
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0;
}

.kpi small {
  display: block;
  margin-top: 8px;
  color: var(--subtle);
  font-size: 12px;
}

.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.9fr);
  gap: 18px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-head h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0;
}

.panel-head span {
  color: var(--muted);
  font-size: 12px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.compact-quote-table {
  min-width: 100%;
  table-layout: fixed;
}

.compact-quote-table th,
.compact-quote-table td {
  padding: 12px 10px;
}

.compact-quote-table th:nth-child(1),
.compact-quote-table td:nth-child(1) {
  width: 29%;
}

.compact-quote-table th:nth-child(2),
.compact-quote-table td:nth-child(2) {
  width: 18%;
}

.compact-quote-table th:nth-child(3),
.compact-quote-table td:nth-child(3) {
  width: 21%;
}

.compact-quote-table th:nth-child(4),
.compact-quote-table td:nth-child(4) {
  width: 18%;
}

.compact-quote-table th:nth-child(5),
.compact-quote-table td:nth-child(5) {
  width: 14%;
}

.compact-quote-table .status {
  min-height: 22px;
  padding: 0 7px;
  font-size: 11px;
}

th,
td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

th {
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

td {
  color: var(--ink);
}

tr:hover td {
  background: #fbfcfd;
}

.cell-title {
  display: grid;
  gap: 4px;
}

.cell-title strong {
  font-size: 13px;
}

.cell-title span {
  color: var(--subtle);
  font-size: 12px;
}

.product-cell {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.product-cell img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.status {
  display: inline-grid;
  place-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status.good {
  background: rgba(33, 134, 90, 0.1);
  color: var(--good);
  border-color: rgba(33, 134, 90, 0.22);
}

.status.warn {
  background: rgba(185, 107, 24, 0.1);
  color: var(--warn);
  border-color: rgba(185, 107, 24, 0.22);
}

.status.neutral {
  background: var(--surface-3);
  color: var(--muted);
  border-color: var(--line);
}

.btn {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--brand-2);
  color: var(--brand);
}

.btn.is-loading .lucide-icon {
  animation: icon-spin 0.8s linear infinite;
}

.btn.attention {
  box-shadow: 0 0 0 3px rgba(181, 138, 42, 0.16);
}

.danger-icon {
  color: var(--danger);
  border-color: rgba(185, 66, 60, 0.28);
}

@keyframes icon-spin {
  to {
    transform: rotate(360deg);
  }
}

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn.primary:hover {
  background: var(--brand-2);
  color: #fff;
}

.btn.ghost {
  background: transparent;
}

.sidebar .btn.ghost {
  width: 100%;
  color: rgba(255, 255, 255, 0.86);
  border-color: rgba(255, 255, 255, 0.28);
}

.sidebar .btn.ghost:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.08);
}

.btn.danger {
  color: var(--danger);
  border-color: rgba(185, 66, 60, 0.32);
}

.btn.danger:hover {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 16px;
}

.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.split-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.quote-builder {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.mini-list {
  display: grid;
  gap: 10px;
}

.mini-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.mini-row strong,
.mini-row span {
  display: block;
}

.mini-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.summary-item {
  padding: 16px 18px;
  border-right: 1px solid var(--line);
}

.summary-item:last-child {
  border-right: 0;
}

.summary-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.summary-item strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.search {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  padding: 0 12px;
  outline: none;
}

.inline-input {
  width: 108px;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--ink);
  outline: none;
}

.inline-input:focus,
.search:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(31, 122, 123, 0.12);
}

.permission-table {
  min-width: 920px;
}

.audit-table {
  min-width: 1080px;
}

.nowrap {
  white-space: nowrap;
}

.audit-action {
  display: inline-block;
  color: var(--brand);
  font-weight: 800;
  white-space: nowrap;
}

.audit-summary {
  max-width: 320px;
  line-height: 1.55;
}

.pagination-bar {
  min-height: 62px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.pagination-bar > span {
  color: var(--muted);
  font-size: 12px;
}

.quote-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.quote-facts > div {
  min-width: 0;
  padding: 13px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 6px;
}

.quote-facts > div:nth-child(2n) {
  border-right: 0;
}

.quote-facts > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.quote-facts span,
.audit-summary-box > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.quote-facts strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.audit-detail {
  display: grid;
  align-content: start;
  gap: 16px;
}

.audit-summary-box {
  padding: 14px;
  border-left: 4px solid var(--brand);
  background: var(--surface-2);
}

.audit-summary-box p {
  margin: 7px 0 0;
  line-height: 1.6;
}

.audit-json {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.audit-json > div {
  min-height: 42px;
  padding: 0 13px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 800;
}

.audit-json small {
  color: var(--subtle);
}

.audit-json.after > div {
  color: var(--good);
  background: rgba(33, 134, 90, 0.08);
}

.audit-json pre {
  max-height: 360px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  color: #20343d;
  background: #fbfcfd;
  font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.switch {
  width: 48px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-3);
  padding: 3px;
  display: inline-flex;
  align-items: center;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.switch span {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(18, 33, 46, 0.18);
  transform: translateX(0);
  transition: transform 0.18s ease;
}

.switch.on {
  background: var(--brand);
  border-color: var(--brand);
}

.switch.on span {
  transform: translateX(20px);
}

.toggle-field {
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.toggle-field > div {
  display: grid;
  gap: 4px;
}

.toggle-field strong {
  font-size: 13px;
}

.toggle-field div span {
  color: var(--muted);
  font-size: 12px;
}

.empty {
  padding: 36px 18px;
  text-align: center;
  color: var(--muted);
}

.empty-state {
  min-height: 180px;
  padding: 34px 20px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-align: center;
}

.empty-state .lucide-icon {
  color: var(--brand-2);
}

.empty-state strong {
  color: var(--ink);
  font-size: 15px;
}

.empty-state span {
  color: var(--subtle);
  font-size: 12px;
}

.empty-state.compact {
  min-height: 126px;
}

.empty-table-row:hover td {
  background: #fff;
}

.drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(11, 22, 28, 0.42);
  display: none;
  justify-content: flex-end;
}

.drawer-mask.open {
  display: flex;
}

.drawer {
  width: min(520px, 100%);
  height: 100%;
  background: var(--surface);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.drawer-title {
  padding: 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.drawer-title h3 {
  font-size: 20px;
}

.drawer-title p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.drawer-body {
  padding: 22px;
  overflow: auto;
}

.drawer-foot {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 16px 22px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.confirm-mask {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(11, 22, 28, 0.48);
  display: none;
  place-items: center;
  padding: 20px;
}

.confirm-mask.open {
  display: grid;
}

.confirm-dialog {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.confirm-dialog h3 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.confirm-dialog p:not(.panel-kicker) {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.confirm-actions {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.toast-stack {
  position: fixed;
  right: 20px;
  top: 84px;
  z-index: 80;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 40px));
}

.toast {
  border-radius: 6px;
  background: #102329;
  color: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  line-height: 1.5;
  font-size: 13px;
}

.toast.good {
  background: var(--good);
}

.toast.warn {
  background: var(--warn);
}

.toast.danger {
  background: var(--danger);
}

.settings-panel {
  max-width: 860px;
}

.connection-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--subtle);
}

.dot.online {
  background: var(--good);
}

.dot.offline {
  background: var(--warn);
}

.mobile-top {
  display: none;
}

@media (max-width: 1040px) {
  .login-page {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: auto;
    padding: 34px;
    gap: 46px;
  }

  .login-panel-wrap {
    min-height: auto;
    padding: 28px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 35;
    width: var(--sidebar);
    transform: translateX(-102%);
    transition: transform 0.18s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 34;
    display: block;
    border: 0;
    background: rgba(11, 22, 28, 0.42);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, visibility 0.18s ease;
  }

  .sidebar-scrim.open {
    opacity: 1;
    visibility: visible;
  }

  .mobile-top {
    display: inline-flex;
  }

  .work-grid,
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .login-page {
    display: block;
  }

  .login-brand {
    min-height: auto;
    padding: 24px 28px;
    gap: 0;
  }

  .login-copy,
  .login-metrics,
  .login-brand > .connection-line {
    display: none;
  }

  .login-panel-wrap {
    min-height: calc(100vh - 106px);
    padding: 28px 18px;
    align-items: start;
  }

  .login-panel {
    padding: 24px;
  }

  .login-copy h1 {
    font-size: 30px;
  }

  .login-metrics,
  .work-grid,
  .kpi-grid,
  .split-form,
  .summary-strip {
    grid-template-columns: 1fr;
  }

  .topbar {
    min-height: 68px;
    padding: 10px 14px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
  }

  .topbar-actions {
    width: auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 8px;
  }

  .topbar-title strong {
    font-size: 16px;
    white-space: nowrap;
  }

  .topbar-title span {
    margin-top: 3px;
    font-size: 10px;
  }

  .topbar-actions .connection-line {
    gap: 0;
  }

  .topbar-actions .connection-line span:last-child,
  .topbar-actions [data-route-jump] {
    display: none;
  }

  .content {
    padding: 18px 14px 30px;
  }

  .table-wrap table,
  .compact-quote-table {
    min-width: 720px;
    table-layout: auto;
  }

  .kpi-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-grid.compact .kpi {
    min-height: 116px;
    padding: 15px;
    gap: 12px;
  }

  .mobile-cards {
    display: block;
    width: 100%;
    min-width: 0 !important;
    table-layout: auto !important;
  }

  .mobile-cards thead {
    display: none;
  }

  .mobile-cards tbody {
    display: grid;
  }

  .mobile-cards tr:not(.empty-table-row) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
  }

  .mobile-cards tr:last-child {
    border-bottom: 0;
  }

  .mobile-cards td,
  .compact-quote-table td {
    min-width: 0;
    padding: 8px 8px 8px 0;
    border: 0;
    display: grid;
    align-content: start;
    gap: 5px;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }

  .compact-quote-table td {
    width: auto !important;
  }

  .mobile-cards td:nth-child(2n) {
    padding-right: 0;
    padding-left: 8px;
  }

  .mobile-cards td::before {
    content: attr(data-label);
    color: var(--subtle);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.25;
  }

  .mobile-cards td[data-mobile-span="full"] {
    grid-column: 1 / -1;
    padding-right: 0;
    padding-left: 0;
  }

  .mobile-cards tr:hover td {
    background: transparent;
  }

  .mobile-cards .nowrap {
    white-space: normal;
  }

  .mobile-cards .audit-summary {
    max-width: none;
  }

  .mobile-cards .inline-input {
    width: 100%;
    max-width: 140px;
  }

  .mobile-cards .status,
  .mobile-cards .btn,
  .mobile-cards .switch {
    justify-self: start;
  }

  .mobile-cards .product-cell {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .mobile-cards .product-cell img {
    width: 54px;
    height: 54px;
  }

  .mobile-cards .empty-table-row {
    display: block;
  }

  .mobile-cards .empty-table-row td {
    display: block;
    padding: 0;
  }

  .mobile-cards .empty-table-row td::before {
    display: none;
  }

  .pagination-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .pagination-bar .btn-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toast-stack {
    top: auto;
    right: 14px;
    bottom: 14px;
    width: calc(100vw - 28px);
  }

  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .summary-item {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .summary-item:last-child {
    border-bottom: 0;
  }

  .quote-facts {
    grid-template-columns: 1fr;
  }

  .quote-facts > div,
  .quote-facts > div:nth-child(2n),
  .quote-facts > div:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .quote-facts > div:last-child {
    border-bottom: 0;
  }
}

/* Independent prices stay together for each RTV solution, including on narrow screens. */
.rtv-price-grid { display: grid; gap: 10px; min-width: 320px; }
.rtv-price-line { display: grid; grid-template-columns: minmax(100px, 1fr) repeat(3, minmax(76px, 100px)); align-items: center; gap: 10px; }
.rtv-price-line > strong { font-size: 13px; }
.rtv-price-line small { display: block; margin-top: 3px; color: var(--muted); font-weight: 400; }
.rtv-price-line label { display: flex; align-items: center; gap: 5px; font-size: 12px; }
.rtv-price-line .inline-input { width: 100%; min-width: 0; }
@media (max-width: 640px) {
  .rtv-price-grid { min-width: 0; width: 100%; }
  .rtv-price-line { grid-template-columns: minmax(70px, 1fr) repeat(3, minmax(55px, 1fr)); gap: 6px; }
}

.rtv-price-summary { grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 10px; }
.rtv-price-summary > strong { font-size: 13px; line-height: 1.7; white-space: normal; overflow-wrap: anywhere; }

.rtv-price-line label > span { flex: none; white-space: nowrap; }

#coatingConfigForm [hidden] { display: none; }
