:root {
  color-scheme: light;
  --bg: #eef2f6;
  --panel: #ffffff;
  --panel-soft: #f7f9fc;
  --text: #1d2433;
  --muted: #667085;
  --border: #d9e0ea;
  --line: #edf1f6;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --brand-soft: #dff7f2;
  --accent: #315c9c;
  --danger: #c2410c;
  --danger-soft: #fff2e8;
  --success: #15803d;
  --success-soft: #e7f7ec;
  --warning: #a16207;
  --warning-soft: #fff7db;
  --shadow: 0 14px 34px rgba(25, 38, 56, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

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

button {
  border: 0;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.18);
  outline-offset: 2px;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

a {
  color: inherit;
}

.login-page {
  align-items: center;
  display: grid;
  min-height: 100vh;
  padding: 28px;
}

.login-shell {
  display: grid;
  gap: 0;
  grid-template-columns: minmax(320px, 420px) minmax(320px, 1fr);
  margin: 0 auto;
  max-width: 920px;
  width: 100%;
}

.login-brand,
.login-panel {
  background: var(--panel);
  border: 1px solid var(--border);
}

.login-brand {
  align-content: center;
  border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  display: grid;
  min-height: 520px;
  padding: 44px;
}

.login-panel {
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: var(--shadow);
  padding: 44px;
}

.brand-mark {
  align-items: center;
  background: var(--brand);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  font-size: 18px;
  font-weight: 800;
  height: 46px;
  justify-content: center;
  margin-bottom: 28px;
  width: 46px;
}

.login-brand h1,
.page-title h1 {
  font-size: 28px;
  line-height: 1.2;
  margin: 0;
}

.login-brand p,
.page-title p {
  color: var(--muted);
  line-height: 1.7;
  margin: 14px 0 0;
}

.demo-accounts {
  display: grid;
  gap: 10px;
  margin-top: 32px;
}

.demo-account {
  align-items: center;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
  text-align: left;
}

.demo-account:hover {
  background: #eef5fb;
  border-color: #c8d6e6;
}

.demo-account strong {
  display: block;
  font-size: 14px;
}

.demo-account span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 3px;
}

.login-panel h2 {
  font-size: 22px;
  margin: 0 0 24px;
}

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

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

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.filter-bar {
  align-items: end;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 14px;
  padding: 12px;
}

.filter-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: #344054;
  font-size: 13px;
  font-weight: 650;
}

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

.field-help.success {
  color: var(--success);
}

.field-help.warning {
  color: var(--warning);
}

.field input,
.field select,
.field textarea,
.search-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  min-height: 38px;
  outline: none;
  padding: 9px 11px;
  width: 100%;
}

.unit-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.unit-input input {
  border-radius: 6px 0 0 6px;
}

.unit-suffix {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-left: 0;
  border-radius: 0 6px 6px 0;
  color: var(--muted);
  display: inline-flex;
  font-size: 13px;
  font-weight: 650;
  min-height: 38px;
  padding: 0 11px;
  white-space: nowrap;
}

.unit-input:focus-within .unit-suffix {
  border-color: var(--brand);
}

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

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-box:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.toggle-row {
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  width: fit-content;
}

.toggle-row input[type="checkbox"] {
  accent-color: var(--brand);
  flex: 0 0 auto;
  height: 16px;
  min-height: 0;
  padding: 0;
  width: 16px;
}

.toggle-row span {
  color: #344054;
  font-size: 13px;
  font-weight: 650;
}

.error-text {
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #102331;
  color: #d6dee6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 18px;
}

.sidebar-brand {
  align-items: center;
  display: flex;
  gap: 10px;
  padding: 6px 4px 22px;
}

.sidebar-brand .brand-mark {
  flex: 0 0 auto;
  height: 36px;
  margin: 0;
  width: 36px;
}

.sidebar-brand strong {
  color: #fff;
  display: block;
  font-size: 16px;
}

.sidebar-brand span {
  color: #96a5b5;
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.nav-list {
  display: grid;
  gap: 5px;
}

.nav-button {
  align-items: center;
  background: transparent;
  border-radius: 6px;
  color: #c9d3de;
  cursor: pointer;
  display: flex;
  gap: 10px;
  justify-content: flex-start;
  min-height: 40px;
  padding: 9px 11px;
  text-align: left;
  transition:
    background 0.16s ease,
    color 0.16s ease;
}

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

.nav-button.active {
  box-shadow: inset 3px 0 0 var(--brand);
}

.nav-icon,
.btn-icon {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  font-weight: 800;
  height: 18px;
  justify-content: center;
  line-height: 1;
  width: 18px;
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: auto;
  padding-top: 14px;
}

.user-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  display: grid;
  gap: 5px;
  padding: 12px;
}

.user-card strong {
  color: #fff;
}

.user-card span {
  color: #aab7c4;
  font-size: 12px;
}

.sidebar .button.ghost,
.sidebar-logout-button {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.48);
  color: #f8fafc;
}

.sidebar .button.ghost:hover,
.sidebar-logout-button:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.62);
  color: #fff;
}

.sidebar-logout-button {
  margin-top: 8px;
  width: 100%;
}

.main {
  min-width: 0;
}

.topbar {
  align-items: center;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 64px;
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}

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

.sync-status {
  align-items: center;
  background: #eef4ff;
  border: 1px solid #d6e4ff;
  border-radius: 999px;
  color: #315c9c;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  min-height: 28px;
  padding: 5px 10px;
  white-space: nowrap;
}

.sync-status::before {
  background: currentColor;
  border-radius: 999px;
  content: "";
  height: 7px;
  margin-right: 7px;
  width: 7px;
}

.sync-status.sync-idle,
.sync-status.sync-saved {
  background: var(--success-soft);
  border-color: #c9ecd3;
  color: var(--success);
}

.sync-status.sync-saving {
  background: #eef4ff;
  border-color: #d6e4ff;
  color: var(--accent);
}

.sync-status.sync-saving::before {
  animation: pulse 0.9s ease-in-out infinite;
}

.sync-status.sync-error {
  background: var(--danger-soft);
  border-color: #fed7aa;
  color: var(--danger);
}

.content {
  padding: 24px;
}

.page-head {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 18px;
}

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

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

.panel + .panel {
  margin-top: 16px;
}

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

.panel-head h2,
.panel-head h3 {
  font-size: 16px;
  margin: 0;
}

.panel-head p {
  color: var(--muted);
  margin: 4px 0 0;
}

.panel-body {
  padding: 16px;
}

.split-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 380px minmax(0, 1fr);
}

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

.metric {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.metric span {
  color: var(--muted);
  display: block;
  font-size: 13px;
}

.metric strong {
  display: block;
  font-size: 28px;
  margin-top: 6px;
}

.button {
  align-items: center;
  background: var(--brand);
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  gap: 7px;
  justify-content: center;
  min-height: 38px;
  padding: 9px 13px;
  text-decoration: none;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease;
  white-space: nowrap;
}

.button:hover {
  background: var(--brand-dark);
}

.button.secondary {
  background: #e9eef5;
  color: #203044;
}

.button.secondary:hover {
  background: #dce4ee;
}

.button.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: #203044;
}

.button.ghost:hover {
  background: var(--panel-soft);
}

.logout-top-button {
  border: 1px solid var(--border);
}

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

.button.danger:hover {
  background: #9a3412;
}

.button.success {
  background: var(--success);
}

.button.success:hover {
  background: #166534;
}

.button.is-processing,
.link-button.is-processing {
  opacity: 0.72;
  pointer-events: none;
  position: relative;
}

.button.is-processing::after {
  animation: spin 0.8s linear infinite;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 999px;
  content: "";
  height: 13px;
  width: 13px;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--panel-soft);
  color: #475467;
  font-size: 12px;
  font-weight: 750;
}

tbody tr:hover {
  background: #fbfcfe;
}

.nowrap {
  white-space: nowrap;
}

.muted {
  color: var(--muted);
}

.money {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tag {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  min-height: 24px;
  padding: 3px 9px;
  white-space: nowrap;
}

.tag.admin {
  background: var(--success-soft);
  color: var(--success);
}

.tag.manager,
.tag.pending,
.tag.cancelRequested,
.tag.approved {
  background: var(--warning-soft);
  color: var(--warning);
}

.tag.finance {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.tag.engineer {
  background: #eef2ff;
  color: #3730a3;
}

.tag.dispatcher,
.tag.sales,
.tag.draft {
  background: #e8f0ff;
  color: var(--accent);
}

.tag.rejected,
.tag.disabled,
.tag.financeRejected,
.tag.cancelled,
.tag.deleted {
  background: var(--danger-soft);
  color: var(--danger);
}

.tag.settled {
  background: var(--success-soft);
  color: var(--success);
}

.tag.assigned {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.tag.bonus-draft {
  background: #e8f0ff;
  color: var(--accent);
}

.tag.bonus-pending {
  background: var(--warning-soft);
  color: var(--warning);
}

.tag.bonus-approved {
  background: var(--success-soft);
  color: var(--success);
}

.tag.bonus-rejected {
  background: var(--danger-soft);
  color: var(--danger);
}

.tag.sales-bonus-pending {
  background: var(--warning-soft);
  color: var(--warning);
}

.tag.sales-bonus-approved {
  background: var(--success-soft);
  color: var(--success);
}

.tag.sales-bonus-rejected {
  background: var(--danger-soft);
  color: var(--danger);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag.change.added,
.tag.modified {
  background: #e8f0ff;
  color: var(--accent);
}

.tag.change.modified {
  background: var(--warning-soft);
  color: var(--warning);
}

.tag.change.deleted {
  background: var(--danger-soft);
  color: var(--danger);
}

.tag.active {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.inline-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.link-button {
  background: #edf4ff;
  border: 1px solid #d8e6fb;
  border-radius: 999px;
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  min-height: 28px;
  padding: 4px 9px;
  text-decoration: none;
  white-space: nowrap;
}

.link-button:hover {
  background: #e2edff;
  border-color: #bfd3f3;
  text-decoration: none;
}

.link-button.danger {
  background: var(--danger-soft);
  border-color: #fed7aa;
  color: var(--danger);
}

.link-button.danger:hover {
  background: #ffe7d4;
  border-color: #fdba74;
}

.link-button:disabled {
  background: #f1f5f9;
  border-color: var(--border);
  color: var(--muted);
}

.notice {
  background: #f5fbff;
  border: 1px solid #cfe7ff;
  border-radius: var(--radius);
  color: #24527a;
  line-height: 1.6;
  padding: 12px 14px;
}

.notice.warning {
  background: var(--warning-soft);
  border-color: #f6da87;
  color: #744b00;
}

.notice.error {
  background: var(--danger-soft);
  border-color: #fed7aa;
  color: var(--danger);
}

.empty-state {
  align-items: center;
  color: var(--muted);
  display: grid;
  min-height: 160px;
  place-items: center;
  text-align: center;
}

.item-picker {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.item-results {
  display: grid;
  max-height: 260px;
  overflow: auto;
}

.item-result {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 10px 12px;
  text-align: left;
}

.item-result:hover {
  background: var(--panel-soft);
}

.quote-builder {
  display: grid;
  gap: 16px;
}

.quote-lines {
  display: grid;
  gap: 10px;
}

.quote-line {
  align-items: end;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(170px, 1.3fr) minmax(88px, 0.45fr) minmax(110px, 0.7fr) minmax(110px, 0.7fr) minmax(130px, 0.8fr) minmax(110px, 0.55fr) auto;
  padding: 12px;
}

.quote-line.deleted {
  background: #fff7f4;
  border-color: #fed7aa;
}

.quote-summary {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 12px;
}

.quote-summary span {
  color: var(--muted);
  display: block;
  font-size: 12px;
}

.quote-summary strong {
  display: block;
  font-size: 18px;
  margin-top: 4px;
}

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

.line-title strong {
  font-size: 14px;
}

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

.line-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 4px;
}

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

.change-log-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  gap: 8px;
  padding: 10px 12px;
}

.change-log-meta {
  display: grid;
  gap: 3px;
}

.change-log-meta span {
  color: var(--muted);
  font-size: 12px;
}

.change-log-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.change-log-fields span {
  background: var(--panel-soft);
  border-radius: 6px;
  color: #344054;
  font-size: 12px;
  padding: 5px 7px;
}

.receipt-preview {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px;
}

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

.receipt-preview img {
  border-radius: 6px;
  max-height: 260px;
  max-width: 100%;
  object-fit: contain;
}

.form-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.signed-order-current {
  margin-top: -4px;
}

.signed-order-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.signed-order-card {
  align-items: center;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  display: grid;
  gap: 10px;
  grid-template-columns: 58px minmax(0, 1fr);
  min-height: 76px;
  padding: 10px;
  text-decoration: none;
}

.signed-order-card:hover {
  border-color: #bfd3f3;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.signed-order-thumb,
.signed-order-file-icon {
  align-items: center;
  background: #e8f0ff;
  border-radius: 6px;
  color: var(--accent);
  display: flex;
  font-size: 12px;
  font-weight: 800;
  height: 56px;
  justify-content: center;
  object-fit: cover;
  width: 56px;
}

.signed-order-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.signed-order-meta strong,
.signed-order-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signed-order-meta span {
  color: var(--muted);
  font-size: 12px;
}

.template-items {
  display: grid;
  gap: 8px;
  max-height: 230px;
  overflow: auto;
  padding: 4px;
}

.check-row {
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  gap: 8px;
  padding: 8px 10px;
}

.check-row input {
  margin: 0;
}

.detail-list {
  display: grid;
  gap: 8px;
}

.quote-detail-page {
  display: grid;
  gap: 16px;
}

.quote-detail-grid {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
}

.assignment-backdrop {
  background: rgba(15, 23, 42, 0.38);
  inset: 0;
  position: fixed;
  z-index: 50;
}

.assignment-drawer {
  background: var(--panel);
  box-shadow: -16px 0 36px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 680px;
  position: fixed;
  right: 0;
  top: 0;
  width: min(680px, 100%);
  z-index: 60;
}

.assignment-head {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 18px;
}

.assignment-head h2 {
  font-size: 20px;
  margin: 0;
}

.assignment-head p {
  color: var(--muted);
  margin: 6px 0 0;
}

.assignment-body {
  display: grid;
  gap: 14px;
  overflow: auto;
  padding: 18px;
}

.assignment-engineers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.assignment-engineers span {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
}

.assignment-selected {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
}

.assignment-selected-chip {
  align-items: center;
  background: #eef6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  color: #1e3a8a;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  gap: 6px;
  padding: 6px 10px;
}

.assignment-selected-chip strong {
  color: #64748b;
  line-height: 1;
}

.assignment-picker {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(160px, 1fr) auto;
  margin-top: 8px;
}

.assignment-lines {
  display: grid;
  gap: 10px;
}

.assignment-line {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(180px, 0.75fr) minmax(240px, 1fr);
  padding: 12px;
}

.assignment-line strong,
.assignment-line span {
  display: block;
}

.bonus-assignment-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.sales-bonus-expense-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.settlement-project-summary {
  margin-bottom: 12px;
}

.settlement-bonus-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.settlement-bonus-breakdown span,
.assignment-chip-list span {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: #344054;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
}

.settlement-project-table {
  min-width: 1180px;
}

.assignment-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.category-bonus-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  gap: 10px;
  padding: 12px;
}

.category-bonus-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

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

.bonus-assignment-list {
  display: grid;
  gap: 4px;
}

.bonus-assignment-list span {
  white-space: nowrap;
}

.settlement-bonus-list span {
  white-space: normal;
}

.muted-row {
  background: #f8fafc;
  color: var(--muted);
}

.detail-row {
  display: grid;
  gap: 8px;
  grid-template-columns: 120px minmax(0, 1fr);
}

.detail-row span:first-child {
  color: var(--muted);
}

.toast {
  background: #172334;
  border-radius: 6px;
  bottom: 18px;
  box-shadow: var(--shadow);
  color: #fff;
  left: 50%;
  max-width: min(520px, calc(100vw - 32px));
  padding: 11px 14px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 80;
}

.toast-success {
  background: #166534;
}

.toast-warning {
  background: #a16207;
}

.toast-error {
  background: #b42318;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.92);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

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

.modal-backdrop {
  align-items: center;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 90;
}

.modal-dialog {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  max-width: 420px;
  padding: 22px;
  width: min(420px, 100%);
}

.modal-dialog.password-dialog {
  max-width: 480px;
  width: min(480px, 100%);
}

.modal-dialog h3 {
  color: var(--text);
  font-size: 18px;
  margin: 0 0 8px;
}

.modal-dialog p {
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 18px;
}

.modal-dialog .inline-actions {
  justify-content: flex-end;
}

.hidden {
  display: none !important;
}

@media (max-width: 1080px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .login-brand {
    border-radius: var(--radius) var(--radius) 0 0;
    border-right: 1px solid var(--border);
    min-height: auto;
    padding: 30px;
  }

  .login-panel {
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 30px;
  }

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

  .sidebar {
    min-height: auto;
    padding: 12px;
  }

  .sidebar-brand {
    padding-bottom: 12px;
  }

  .nav-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav-button {
    flex: 0 0 auto;
  }

  .sidebar-footer {
    display: none;
  }

  .topbar,
  .content {
    padding-left: 14px;
    padding-right: 14px;
  }

  .page-head {
    display: grid;
  }

  .form-grid.two,
  .form-grid.three,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

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

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

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

  .assignment-line {
    grid-template-columns: 1fr;
  }

  .assignment-picker {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }

  .filter-actions {
    justify-content: flex-start;
  }
}
