:root {
  --brand-blue: #007fa8;
  --brand-blue-dark: #006f94;
  --brand-blue-soft: #e7f4f8;
  --brand-orange: #f9a800;
  --brand-orange-dark: #e89900;
  --ink: #151d26;
  --muted: #687586;
  --line: #d8e0e7;
  --soft: #f3f8fb;
  --panel: #ffffff;
  --focus: #007fa8;
  --ok: #0f766e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f4f8fb;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

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

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 76px;
  padding: 12px clamp(16px, 4vw, 48px);
  background: var(--brand-blue);
  border-bottom: 3px solid var(--brand-orange);
  color: #fff;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: clamp(170px, 24vw, 260px);
  height: auto;
  padding: 6px 8px;
  background: #fff;
  border-radius: 4px;
}

.brand small {
  display: block;
}

.brand small {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 700;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.top-actions a {
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.lang-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, 42px);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 6px;
  overflow: hidden;
}

.lang-switch button {
  height: 34px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.lang-switch button.is-active {
  background: var(--brand-orange);
  color: #fff;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 56px;
}

.intro-band {
  padding: 38px 0 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand-orange-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
  color: var(--brand-blue);
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
  color: var(--brand-blue);
}

h3 {
  margin-bottom: 10px;
  font-size: 18px;
}

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

.workspace {
  display: grid;
  gap: 16px;
}

.ai-availability-warning {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin: 0 0 16px;
  padding: 15px 17px;
  border: 1px solid #f1bd57;
  border-left: 6px solid var(--brand-orange);
  border-radius: 7px;
  background: #fff7df;
  color: #713f12;
  box-shadow: 0 6px 18px rgba(113, 63, 18, 0.08);
}

.ai-availability-warning[hidden] {
  display: none;
}

.ai-availability-warning strong {
  display: block;
  margin-bottom: 3px;
  color: #713f12;
  font-size: 17px;
}

.ai-availability-warning p {
  margin: 0;
}

.ai-availability-symbol {
  display: inline-grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-orange);
  color: #fff;
  font-size: 23px;
  font-weight: 900;
  line-height: 1;
}

.draft-notice {
  padding: 12px 14px;
  border: 1px solid #8fc5d5;
  border-left: 5px solid var(--brand-blue);
  border-radius: 6px;
  background: var(--brand-blue-soft);
  font-weight: 700;
}

.draft-notice.is-submitted {
  border-color: #f3c35a;
  border-left-color: var(--brand-orange);
  background: #fff7df;
}

.deadline-notice {
  padding: 12px 14px;
  border: 1px solid #7cc7ae;
  border-left: 5px solid var(--ok);
  border-radius: 6px;
  background: #ecfdf5;
  color: #115e59;
  font-weight: 700;
}

.deadline-notice.is-late {
  border-color: #f3c35a;
  border-left-color: var(--brand-orange);
  background: #fff7df;
  color: #8a5700;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

.panel,
.login-panel,
.complaint-detail {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: clamp(18px, 3vw, 28px);
  box-shadow: 0 10px 24px rgba(0, 127, 168, 0.06);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.section-title span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  flex: 0 0 auto;
  background: var(--brand-blue);
  color: #fff;
  border-radius: 4px;
  font-weight: 800;
}

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

.question-blocks {
  display: grid;
  gap: 28px;
  margin-top: 30px;
}

.question-block {
  padding: clamp(18px, 2.5vw, 26px);
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand-blue);
  border-radius: 6px;
  background: #fbfcfd;
}

.question-block h3 {
  margin-bottom: 20px;
  color: var(--brand-blue-dark);
  font-size: 20px;
}

.question-fields {
  display: grid;
  gap: 22px;
}

.question-block .choice-grid {
  margin-bottom: 22px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #c8d3dc;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: 3px solid rgba(0, 127, 168, 0.2);
  outline-offset: 2px;
}

.lookup-row,
.submit-row,
.admin-header,
.detail-head,
.wizard-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}

.wizard-actions {
  justify-content: flex-end;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  border: 0;
  border-radius: 4px;
  padding: 10px 16px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  background: var(--brand-orange);
  color: #fff;
}

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

.secondary-button {
  background: var(--brand-blue);
  color: #fff;
}

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

.primary-button:disabled,
.secondary-button:disabled {
  background: #d1d5db;
  color: #6b7280;
  cursor: not-allowed;
}

.primary-button:disabled:hover,
.secondary-button:disabled:hover {
  background: #d1d5db;
}

.choice-grid,
.upload-grid,
.product-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.choice-grid label,
.confirmations label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--brand-blue-soft);
}

.choice-grid input,
.confirmations input {
  width: auto;
}

.radio-field {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.radio-field legend {
  flex: 0 0 100%;
  margin-bottom: 2px;
  font-weight: 700;
}

.radio-field label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 92px;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--brand-blue-soft);
  cursor: pointer;
}

.radio-field input {
  width: auto;
}

.product-picker {
  margin-top: 16px;
}

.order-result,
.summary-block {
  display: grid;
  gap: 4px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--brand-blue-soft);
}

.order-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 16px;
  margin: 8px 0 4px;
}

.order-meta div {
  min-width: 0;
}

.order-meta dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.order-meta dd {
  margin: 2px 0 0;
  font-weight: 700;
}

.product-option {
  display: grid;
  gap: 4px;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.product-option:hover {
  border-color: var(--brand-orange);
  box-shadow: inset 4px 0 0 var(--brand-orange);
}

.product-option small,
.selected-item small {
  color: var(--muted);
}

.selected-items {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.selected-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 38px;
  gap: 10px;
  align-items: center;
  min-height: 60px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--brand-blue-soft);
}

.selected-item span {
  display: block;
  color: var(--muted);
}

.selected-item .claim-type-line {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
}

.selected-item button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 4px;
  background: #e5e7eb;
  cursor: pointer;
}

.claim-item {
  grid-template-columns: minmax(0, 1fr) auto;
}

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

.claim-status {
  display: inline-block;
  flex: 0 0 auto;
  color: #108a61;
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}

.selected-item .claim-edit {
  width: auto;
  min-width: 120px;
  padding: 0 12px;
  white-space: nowrap;
  background: var(--brand-blue);
  color: #fff;
  font-weight: 800;
}

.selected-item .claim-remove {
  flex: 0 0 38px;
}

.manual-item {
  display: grid;
  grid-template-columns: 1fr 2fr 110px auto;
  gap: 10px;
}

.lookup-fields {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr);
  gap: 40px;
  align-items: start;
  max-width: 980px;
}

.lookup-identifiers {
  display: grid;
  gap: 14px;
}

.or-separator {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: lowercase;
}

.or-separator::before,
.or-separator::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.inline-date {
  margin-top: 10px;
  max-width: 320px;
}

.items-table {
  display: grid;
  gap: 8px;
}

.items-head,
.items-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(190px, 1.7fr) minmax(72px, 0.55fr) minmax(130px, 0.8fr) minmax(190px, 1.25fr) minmax(150px, 1fr);
  gap: 10px;
  align-items: center;
}

.items-head {
  padding: 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.items-row {
  min-height: 62px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.quantity-field {
  margin: 0;
}

.quantity-field input {
  min-width: 0;
  width: 100%;
}

.summary-list {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.upload-box {
  min-height: 112px;
  padding: 16px;
  border: 1px dashed #83b8c9;
  border-radius: 6px;
  background: #fbfcfd;
  align-content: center;
}

.upload-box input {
  border: 0;
  padding: 0;
}

.optional-marker {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e7f2f6;
  color: var(--brand-blue-dark);
  font-size: 0.75rem;
  font-weight: 700;
}

.required-marker {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  background: #fde8e8;
  color: #9b1c1c;
  font-size: 0.75rem;
  font-weight: 700;
}

.upload-box.is-required,
.evidence-upload-status.status-missing.is-required {
  border-color: #dc6b6b;
}

.evidence-upload-field {
  display: grid;
  gap: 8px;
}

.evidence-upload-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.evidence-status-icon {
  display: inline-grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.evidence-status-copy {
  display: grid;
  flex: 1 1 160px;
  gap: 2px;
  min-width: 0;
}

.evidence-status-copy small {
  color: inherit;
  font-weight: 400;
  line-height: 1.35;
}

.evidence-upload-status.status-green {
  border-color: #86d4b7;
  background: #ecfdf5;
  color: #0f766e;
}

.evidence-upload-status.status-green .evidence-status-icon {
  background: #ccfbf1;
}

.evidence-upload-status.status-red {
  border-color: #f3a7a7;
  background: #fef2f2;
  color: #991b1b;
}

.evidence-upload-status.status-red .evidence-status-icon {
  background: #fee2e2;
}

.evidence-upload-status.status-yellow {
  border-color: #efcc6e;
  background: #fffbeb;
  color: #854d0e;
}

.evidence-upload-status.status-yellow .evidence-status-icon {
  background: #fef3c7;
}

.evidence-upload-status.status-incomplete {
  border-color: #f1bd57;
  background: #fff7df;
  color: #713f12;
}

.evidence-upload-status.status-incomplete .evidence-status-icon {
  background: #fde7ad;
}

.evidence-upload-status.status-missing {
  border-color: #d8e0e7;
  background: #f8fafc;
  color: var(--muted);
}

.evidence-upload-status.status-missing .evidence-status-icon {
  background: #e5e7eb;
}

.evidence-upload-status .ai-action {
  width: auto;
  margin-left: auto;
}

body.has-evidence-warning,
body.has-submission-receipt {
  overflow: hidden;
}

.submission-receipt-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  padding: 20px;
  place-items: center;
  overflow-y: auto;
  background: rgba(21, 29, 38, 0.72);
}

.submission-receipt-modal[hidden] {
  display: none;
}

.submission-receipt-panel {
  position: relative;
  display: grid;
  justify-items: center;
  width: min(620px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: clamp(26px, 5vw, 44px);
  border: 4px solid #15803d;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  text-align: center;
}

.submission-receipt-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  color: #166534;
  font-size: 32px;
  font-weight: 900;
  cursor: pointer;
}

.submission-receipt-symbol {
  display: grid;
  width: 96px;
  height: 96px;
  margin-bottom: 16px;
  place-items: center;
  border-radius: 50%;
  background: #15803d;
  color: #fff;
  font-size: 58px;
  font-weight: 900;
  line-height: 1;
}

.submission-receipt-panel h2 {
  margin: 0 0 12px;
  color: #166534;
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.1;
}

.submission-receipt-message {
  margin: 0 0 18px;
  font-size: 19px;
  line-height: 1.45;
}

.submission-receipt-case {
  width: 100%;
  margin: 0 0 22px;
  padding: 14px 16px;
  border-radius: 6px;
  background: #f0fdf4;
  color: #14532d;
  font-size: 18px;
}

.submission-receipt-panel .primary-button {
  width: min(360px, 100%);
}

.submission-receipt-hint {
  margin: 18px 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}

.evidence-warning-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  padding: 20px;
  place-items: center;
  overflow-y: auto;
  background: rgba(21, 29, 38, 0.72);
}

.evidence-warning-modal[hidden] {
  display: none;
}

.evidence-warning-panel {
  position: relative;
  display: grid;
  justify-items: center;
  width: min(680px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: clamp(24px, 5vw, 42px);
  border: 4px solid #dc2626;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  text-align: center;
}

.evidence-warning-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  color: #991b1b;
  font-size: 32px;
  font-weight: 900;
  cursor: pointer;
}

.evidence-warning-symbol {
  display: grid;
  width: 104px;
  height: 104px;
  margin-bottom: 16px;
  place-items: center;
  border-radius: 50%;
  background: #dc2626;
  color: #fff;
  font-size: 64px;
  font-weight: 900;
  line-height: 1;
}

.evidence-warning-panel h2 {
  margin: 0 0 12px;
  color: #991b1b;
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.05;
}

.evidence-warning-reason {
  width: 100%;
  margin: 0 0 20px;
  padding: 14px 16px;
  border-radius: 6px;
  background: #fef2f2;
  color: #7f1d1d;
  font-size: clamp(18px, 3vw, 23px);
  font-weight: 800;
  line-height: 1.35;
}

.evidence-warning-preview {
  display: grid;
  width: 100%;
  margin-bottom: 22px;
  place-items: center;
}

.evidence-warning-preview img {
  display: block;
  max-width: 100%;
  max-height: min(46vh, 460px);
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: contain;
}

.evidence-warning-preview img[hidden],
.evidence-warning-file[hidden] {
  display: none;
}

.evidence-warning-file {
  display: grid;
  width: min(220px, 100%);
  aspect-ratio: 4 / 3;
  place-items: center;
  border-radius: 6px;
  background: var(--brand-blue-soft);
  color: var(--brand-blue-dark);
  font-size: 32px;
  font-weight: 900;
}

.ai-action {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid currentColor;
  border-radius: 4px;
  background: #fff;
  color: var(--brand-blue-dark);
  font-weight: 800;
  cursor: pointer;
}

.ai-action:hover,
.ai-action:focus-visible {
  background: var(--brand-blue-soft);
}

.ai-reason {
  color: var(--muted);
  line-height: 1.35;
  white-space: normal;
}

.confirmations {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.signature-wrap {
  display: grid;
  gap: 12px;
}

.signature-optional-hint {
  margin: 0;
  font-weight: 700;
}

#signatureCanvas {
  width: 100%;
  height: 220px;
  background: #fff;
  border: 1px solid #c8ced8;
  border-radius: 4px;
  touch-action: none;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(420px, calc(100% - 36px));
  padding: 14px 16px;
  background: var(--brand-blue-dark);
  color: #fff;
  border-radius: 6px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.admin-shell {
  padding-top: 34px;
}

.login-panel {
  width: min(440px, 100%);
  margin: 60px auto;
}

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

.admin-panel {
  display: grid;
  gap: 18px;
}

.policy-editor {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(21, 29, 38, 0.05);
  overflow: hidden;
}

.policy-editor > summary {
  padding: 16px 20px;
  background: linear-gradient(90deg, var(--brand-blue-soft), #fff 45%);
  color: var(--brand-blue-dark);
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.policy-editor > summary::marker {
  color: var(--brand-blue);
}

.policy-editor[open] > summary {
  border-bottom: 1px solid #e7edf2;
}

.policy-editor form {
  display: grid;
  gap: 18px;
  padding: 18px 20px 20px;
}

.policy-hint {
  margin: 0;
  padding: 11px 14px;
  border-left: 4px solid var(--brand-blue);
  border-radius: 5px;
  background: var(--brand-blue-soft);
  color: #526273;
}

.policy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
  gap: 14px;
  align-items: stretch;
}

.policy-grid fieldset {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 14px 14px 16px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand-blue);
  border-radius: 7px;
  background: linear-gradient(180deg, #fff, #f8fbfd);
}

.policy-grid legend {
  padding: 0 7px;
  color: var(--brand-blue-dark);
  font-size: 16px;
  font-weight: 900;
}

.policy-threshold {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 6px 7px 6px 12px;
  border: 1px solid #dce5eb;
  border-radius: 6px;
  background: #fff;
}

.policy-threshold > span:first-child {
  color: #425466;
  font-size: 14px;
  font-weight: 800;
}

.policy-value {
  display: grid;
  grid-template-columns: minmax(48px, 72px) auto;
  align-items: center;
  min-width: 88px;
  border: 1px solid #bfcdd7;
  border-radius: 5px;
  background: #fff;
  color: var(--muted);
  overflow: hidden;
}

.policy-value:focus-within {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(0, 127, 168, 0.13);
}

.policy-value input {
  min-width: 0;
  padding: 8px 4px 8px 9px;
  border: 0;
  outline: 0;
  background: transparent;
  font-weight: 900;
  text-align: right;
}

.policy-value input:focus {
  outline: 0;
}

.policy-value > span {
  padding-right: 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.policy-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 2px;
}

#goodwillPolicyStatus:not(:empty) {
  padding: 7px 10px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 13px;
  font-weight: 800;
}

.admin-layout {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.complaint-browser {
  position: sticky;
  top: 94px;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.complaint-list-toolbar {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(21, 29, 38, 0.05);
}

.complaint-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.complaint-list-heading h2 {
  color: var(--ink);
  font-size: 18px;
}

.complaint-result-count {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--brand-blue-soft);
  color: var(--brand-blue-dark);
  font-size: 12px;
  font-weight: 900;
}

.complaint-search,
.complaint-status-filter {
  gap: 5px;
  color: #526273;
  font-size: 13px;
  font-weight: 800;
}

.complaint-search input,
.complaint-status-filter select {
  min-height: 44px;
  padding: 9px 11px;
  border-radius: 6px;
  font-size: 15px;
}

.complaint-search input {
  padding-left: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23687586' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-position: 12px center;
  background-repeat: no-repeat;
}

.complaint-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 270px);
  padding-right: 3px;
  overflow-y: auto;
  scrollbar-color: #b9c9d3 transparent;
}

.complaint-list-empty {
  margin: 0;
  padding: 22px 16px;
  border: 1px dashed #b9c9d3;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  text-align: center;
}

.complaint-row {
  display: grid;
  gap: 6px;
  width: 100%;
  min-height: 108px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(21, 29, 38, 0.025);
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.complaint-row:hover {
  border-color: #9fb8c6;
  box-shadow: 0 8px 18px rgba(21, 29, 38, 0.07);
  transform: translateY(-1px);
}

.complaint-row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.complaint-row-head > strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.complaint-customer {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.complaint-status {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.complaint-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.complaint-status-new {
  background: #e0f2fe;
  color: #075985;
}

.complaint-status-in_review {
  background: #ede9fe;
  color: #5b21b6;
}

.complaint-status-waiting_customer {
  background: #fff3d6;
  color: #92400e;
}

.complaint-status-accepted {
  background: #dcfce7;
  color: #166534;
}

.complaint-status-rejected {
  background: #fee2e2;
  color: #991b1b;
}

.complaint-status-closed {
  background: #e5e7eb;
  color: #374151;
}

.complaint-goodwill {
  justify-self: start;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.complaint-goodwill.goodwill-green {
  background: #dcfce7;
  color: #166534;
}

.complaint-goodwill.goodwill-yellow {
  background: #fef3c7;
  color: #854d0e;
}

.complaint-goodwill.goodwill-red {
  background: #fee2e2;
  color: #991b1b;
}

.complaint-row.is-active {
  border-color: var(--brand-orange);
  box-shadow: inset 4px 0 0 var(--brand-orange);
}

.complaint-customer,
.complaint-row small {
  color: var(--muted);
}

.complaint-detail {
  display: grid;
  gap: 18px;
}

.status-select {
  width: 210px;
}

.status-select select {
  border-left-width: 5px;
  font-weight: 800;
}

.status-select-new select {
  border-left-color: #0284c7;
}

.status-select-in_review select {
  border-left-color: #7c3aed;
}

.status-select-waiting_customer select {
  border-left-color: #d97706;
}

.status-select-accepted select {
  border-left-color: #16a34a;
}

.status-select-rejected select {
  border-left-color: #dc2626;
}

.status-select-closed select {
  border-left-color: #6b7280;
}

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

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

.detail-grid div {
  padding: 12px;
  background: var(--soft);
  border-radius: 4px;
}

.notification-delivery {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.notification-delivery h3 {
  margin: 0;
}

.notification-delivery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.notification-delivery-row {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-left: 5px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
}

.notification-delivery-row.delivery-sent {
  border-left-color: #16a34a;
}

.notification-delivery-row.delivery-failed {
  border-left-color: #dc2626;
}

.notification-delivery-row.delivery-pending {
  border-left-color: var(--brand-orange);
}

.notification-delivery-row.delivery-skipped,
.notification-delivery-row.delivery-not_attempted {
  border-left-color: #6b7280;
}

.notification-delivery-row small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.goodwill-card {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-left-width: 6px;
  border-radius: 6px;
  background: #fff;
}

.goodwill-card.goodwill-green {
  border-left-color: #16a34a;
}

.goodwill-card.goodwill-yellow {
  border-left-color: #eab308;
}

.goodwill-card.goodwill-red {
  border-left-color: #dc2626;
}

.goodwill-summary {
  display: flex;
  align-items: center;
  gap: 16px;
}

.goodwill-summary h3,
.goodwill-summary p {
  margin: 2px 0;
}

.traffic-light {
  display: grid;
  flex: 0 0 auto;
  gap: 5px;
  padding: 7px;
  border-radius: 18px;
  background: #26323c;
}

.traffic-light .light {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  opacity: 0.2;
}

.traffic-light .red {
  background: #ef4444;
}

.traffic-light .yellow {
  background: #facc15;
}

.traffic-light .green {
  background: #22c55e;
}

.traffic-light .is-active {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.92), 0 0 12px currentColor;
  opacity: 1;
}

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

.goodwill-metric {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-top: 4px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
}

.goodwill-metric > span,
.goodwill-metric > small {
  color: var(--muted);
}

.goodwill-metric.metric-green {
  border-top-color: #16a34a;
}

.goodwill-metric.metric-yellow {
  border-top-color: #eab308;
}

.goodwill-metric.metric-red {
  border-top-color: #dc2626;
}

.goodwill-lifetime-source {
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.ai-assessment-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-left-width: 6px;
  border-radius: 6px;
  background: #fff;
}

.ai-assessment-card.assessment-green {
  border-left-color: #16a34a;
}

.ai-assessment-card.assessment-yellow {
  border-left-color: #eab308;
}

.ai-assessment-card.assessment-red {
  border-left-color: #dc2626;
}

.ai-assessment-card.assessment-incomplete {
  border-style: dashed;
  border-left-style: solid;
  border-left-color: var(--brand-orange);
  background: #fffaf0;
}

.ai-assessment-card.assessment-pending {
  border-left-color: var(--brand-orange);
  background: #fffaf0;
}

.ai-assessment-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-assessment-head h3,
.ai-assessment-head p,
.ai-assessment-text {
  margin: 0;
}

.ai-assessment-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.assessment-light {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--line);
  background: #eab308;
}

.assessment-green .assessment-light {
  background: #22c55e;
}

.assessment-red .assessment-light {
  background: #ef4444;
}

.assessment-incomplete .assessment-light {
  background: var(--brand-orange);
}

.assessment-pending .assessment-light {
  background: var(--brand-orange);
}

.complaint-assessment {
  justify-self: start;
  margin: 0;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.complaint-assessment.assessment-green {
  background: #dcfce7;
  color: #166534;
}

.complaint-assessment.assessment-yellow {
  background: #fef3c7;
  color: #854d0e;
}

.complaint-assessment.assessment-red {
  background: #fee2e2;
  color: #991b1b;
}

.complaint-assessment.assessment-incomplete {
  background: #fff7df;
  color: #713f12;
}

.complaint-assessment.assessment-pending {
  background: #fff7df;
  color: #713f12;
}

.email-composer {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
}

.email-composer.is-incomplete {
  border-left: 6px solid var(--brand-orange);
  background: #fffaf0;
}

.email-composer-heading,
.email-composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.email-composer-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.email-composer-heading h3,
.email-composer-heading p,
.email-composer-hint {
  margin: 0;
}

.email-decision-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(180px, 0.8fr) minmax(240px, 1.5fr);
  align-items: end;
  gap: 12px;
}

.email-decision-grid.without-regulation {
  grid-template-columns: minmax(180px, 0.7fr) minmax(240px, 2.3fr);
}

.email-goodwill-field {
  min-height: 100%;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.email-goodwill-field legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.email-goodwill-field label {
  display: flex;
  align-items: center;
  min-height: 42px;
  flex-direction: row;
  gap: 9px;
}

.email-goodwill-field input {
  width: 20px;
  height: 20px;
}

.email-editor-label textarea {
  min-height: 280px;
  resize: vertical;
  background: #fff;
  font-family: inherit;
  line-height: 1.5;
}

dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

dd {
  margin: 3px 0 0;
}

.line-items,
.file-grid {
  display: grid;
  gap: 8px;
}

.line-items div,
.file-grid a {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.file-grid a {
  text-decoration: none;
}

.file-grid span,
.line-items span {
  color: var(--muted);
}

.admin-ai-status {
  justify-self: start;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.admin-ai-status.ai-status-green {
  background: #dcfce7;
  color: #166534;
}

.admin-ai-status.ai-status-yellow,
.admin-ai-status.ai-status-pending {
  background: #fef3c7;
  color: #854d0e;
}

.admin-ai-status.ai-status-red {
  background: #fee2e2;
  color: #991b1b;
}

.admin-ai-status.ai-status-incomplete {
  background: #fff7df;
  color: #713f12;
}

.long-text {
  white-space: pre-wrap;
}

@media (max-width: 860px) {
  .topbar,
  .intro-band,
  .lookup-row,
  .submit-row,
  .admin-header,
  .detail-head,
  .wizard-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .intro-band,
  .field-grid,
  .lookup-fields,
  .choice-grid,
  .upload-grid,
  .product-picker,
  .admin-layout,
  .detail-grid,
  .detail-grid.compact,
  .goodwill-metrics,
  .notification-delivery-grid {
    grid-template-columns: 1fr;
  }

  .email-decision-grid {
    grid-template-columns: 1fr;
  }

  .email-composer-heading,
  .email-composer-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .email-composer-buttons {
    display: grid;
    grid-template-columns: 1fr;
  }

  .ai-assessment-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .policy-actions,
  .goodwill-summary {
    align-items: flex-start;
  }

  .complaint-browser {
    position: static;
  }

  .complaint-list {
    max-height: none;
    padding-right: 0;
    overflow: visible;
  }

  .status-select {
    width: 100%;
  }

  .lookup-fields {
    gap: 28px;
  }

  .lookup-customer {
    margin-bottom: 6px;
  }

  .manual-item {
    grid-template-columns: 1fr;
  }

  .selected-item {
    grid-template-columns: 1fr 100px 38px;
  }

  .claim-item {
    grid-template-columns: 1fr;
  }

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

  .items-head {
    display: none;
  }

  .items-row {
    grid-template-columns: 1fr;
  }

  .order-meta {
    grid-template-columns: 1fr;
  }

  .top-actions {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 520px) {
  main {
    width: min(100% - 20px, 1180px);
  }

  .topbar {
    padding: 10px;
  }

  .selected-item {
    grid-template-columns: 1fr;
  }

  .selected-item button {
    width: 100%;
  }

  .claim-actions {
    display: grid;
    grid-template-columns: 1fr 44px;
  }

  .selected-item .claim-remove {
    width: 44px;
  }
}
