:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-2: #eef3f1;
  --text: #172026;
  --muted: #687782;
  --line: #dce4e8;
  --charcoal: #26323a;
  --green: #1f8a5b;
  --green-dark: #166747;
  --orange: #d97706;
  --blue: #2563eb;
  --sky: #0284c7;
  --purple: #7c3aed;
  --red: #dc2626;
  --yellow: #ca8a04;
  --radius: 8px;
  --shadow: 0 12px 28px rgba(23, 32, 38, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0;
}

.landing-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 84% 20%, rgba(255, 91, 20, 0.14), transparent 32%),
    linear-gradient(135deg, #ffffff 0%, #f5f7f8 46%, #edf1f2 100%);
}

.landing-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.landing-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  padding: 22px clamp(18px, 5vw, 64px);
}

.landing-login {
  background: var(--charcoal);
  color: #fff;
}

.landing-login:hover {
  background: #11181d;
}

.landing-hero {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(280px, 1.05fr) minmax(280px, 0.95fr);
  gap: clamp(26px, 5vw, 64px);
  align-items: center;
  padding: 22px clamp(18px, 5vw, 64px) 56px;
}

.landing-logo-panel {
  display: grid;
  place-items: center;
}

.landing-logo-panel img {
  width: 100%;
  max-width: 640px;
  height: auto;
  filter: drop-shadow(0 18px 26px rgba(23, 32, 38, 0.12));
}

.landing-content {
  display: grid;
  gap: 22px;
}

.landing-kicker {
  margin: 0;
  color: var(--orange);
  font-weight: 900;
  text-transform: uppercase;
}

.landing-content h1 {
  margin: 0;
  color: var(--charcoal);
  font-size: clamp(54px, 8vw, 104px);
  line-height: 0.9;
}

.landing-copy {
  max-width: 560px;
  margin: 0;
  color: #44525c;
  font-size: 20px;
}

.contact-block {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.contact-block div {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  padding: 14px;
}

.contact-block span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.contact-block strong,
.contact-block a {
  color: var(--text);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.whatsapp-button {
  background: #1f8a5b;
  color: #fff;
}

.whatsapp-button:hover {
  background: #166747;
}

.secondary-light {
  border-color: #b7c5cb;
  background: rgba(255, 255, 255, 0.82);
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  min-height: 42px;
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  color: var(--charcoal);
  font-weight: 700;
  min-width: 0;
}

label input,
label select,
label textarea {
  font-weight: 500;
}

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

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

th {
  color: #4a5963;
  font-size: 12px;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  color: #25323a;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  min-height: 76px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.brand strong,
.brand small,
.user-menu strong,
.user-menu small {
  display: block;
}

.brand small,
.user-menu small {
  color: var(--muted);
  font-size: 12px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: var(--charcoal);
  color: #fff;
  font-weight: 900;
}

.brand-mark.large {
  width: 56px;
  height: 56px;
  font-size: 20px;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.main-nav a {
  color: #3c4b55;
  border-radius: var(--radius);
  padding: 9px 11px;
  font-weight: 800;
}

.main-nav a:hover,
.main-nav a.active {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: right;
}

.app-main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 28px;
}

.app-main.narrow {
  width: min(760px, 100%);
}

.login-page {
  min-height: 100vh;
  background: #e9f0ed;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

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

.login-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 26px;
}

.login-brand h1 {
  margin: 0;
  font-size: 28px;
}

.login-brand p {
  margin: 2px 0 0;
  color: var(--muted);
}

.page-header,
.claim-hero,
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.claim-hero {
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
}

.page-header h1,
.claim-hero h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.08;
}

.section-header {
  margin-top: 30px;
}

.section-header h2,
.detail-panel h2,
.form-section h2 {
  margin: 0;
  font-size: 20px;
}

.section-header p,
.eyebrow {
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

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

.metric {
  display: grid;
  gap: 6px;
  min-height: 112px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--charcoal);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
  color: var(--text);
  box-shadow: 0 6px 18px rgba(23, 32, 38, 0.05);
}

.metric:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.metric span {
  color: var(--muted);
  font-weight: 800;
}

.metric strong {
  font-size: 34px;
  line-height: 1;
}

.metric.blue { border-left-color: var(--blue); }
.metric.amber { border-left-color: var(--yellow); }
.metric.purple { border-left-color: var(--purple); }
.metric.green { border-left-color: var(--green); }
.metric.red { border-left-color: var(--red); }
.metric.charcoal { border-left-color: var(--charcoal); }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(23, 32, 38, 0.04);
}

.inline-table {
  box-shadow: none;
  margin: 14px 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 9px 14px;
  color: var(--text);
  background: #fff;
  font-weight: 900;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
}

.button:hover {
  text-decoration: none;
}

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

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

.button.secondary {
  border-color: #b7c5cb;
  background: #fff;
}

.button.ghost {
  border-color: transparent;
  background: transparent;
  color: #4c5b65;
}

.button.danger {
  background: var(--red);
  color: #fff;
}

.button.small {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
}

.button.full {
  width: 100%;
}

.action-row,
.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) repeat(5, minmax(150px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px;
  margin-bottom: 18px;
}

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

.form-section,
.detail-panel,
.item-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 20px;
  box-shadow: 0 8px 24px rgba(23, 32, 38, 0.04);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-title.inline {
  align-items: center;
}

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

.span-2 {
  grid-column: span 2;
}

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

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

.workflow-grid {
  align-items: start;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.summary-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
}

.summary-list div {
  display: grid;
  grid-template-columns: minmax(120px, 0.45fr) 1fr;
  gap: 10px;
}

.summary-list.compact div {
  grid-template-columns: minmax(80px, 0.4fr) 1fr;
}

dt {
  color: var(--muted);
  font-weight: 900;
}

dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.address-block {
  margin-top: 12px;
  color: #2c3941;
  font-style: normal;
}

.note-box {
  border-left: 4px solid var(--orange);
  background: #fff8ed;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 10px 12px;
  color: #4b3320;
}

.device-list {
  display: grid;
  gap: 14px;
}

.repeater-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfc;
  padding: 16px;
}

.repeater-title,
.item-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.repeater-title h3,
.item-title h3 {
  margin: 0;
  font-size: 17px;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  padding: 12px;
  box-shadow: 0 -10px 24px rgba(23, 32, 38, 0.08);
}

.status-badge,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.badge-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.pill {
  background: var(--surface-2);
  color: var(--charcoal);
}

.archive-pill {
  background: #e5e7eb;
  color: #374151;
}

.archive-banner {
  display: grid;
  gap: 4px;
  border: 1px solid #c9d3d8;
  border-left: 6px solid var(--charcoal);
  border-radius: var(--radius);
  background: #fbfcfc;
  padding: 14px 16px;
  margin-bottom: 18px;
}

.archive-banner span {
  color: var(--muted);
}

.status-new-instruction-received { background: #dbeafe; color: #1d4ed8; }
.status-customer-contact-pending { background: #fef3c7; color: #92400e; }
.status-customer-contacted { background: #e0f2fe; color: #0369a1; }
.status-collection-scheduled { background: #ede9fe; color: #6d28d9; }
.status-collection-attempted { background: #ffedd5; color: #c2410c; }
.status-collected { background: #dcfce7; color: #166534; }
.status-partially-collected { background: #ccfbf1; color: #0f766e; }
.status-not-collected { background: #fee2e2; color: #b91c1c; }
.status-unable-to-contact-customer { background: #fef3c7; color: #92400e; }
.status-cancelled-by-insurer { background: #e5e7eb; color: #374151; }
.status-returned-delivered { background: #dbeafe; color: #1e40af; }
.status-closed { background: #d1d5db; color: #1f2937; }

.alert {
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-weight: 800;
}

.alert.success {
  border: 1px solid #b7e3c9;
  background: #ecfdf3;
  color: #17603f;
}

.alert.danger {
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}

.timeline {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.timeline-item {
  border-left: 3px solid var(--line);
  padding-left: 12px;
}

.timeline-item div {
  display: grid;
  gap: 2px;
}

.timeline-item span,
.timeline-item small,
.muted {
  color: var(--muted);
}

.file-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.file-row {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfc;
  padding: 12px;
}

.file-row:hover {
  text-decoration: none;
  border-color: #a7b7bf;
}

.file-row small {
  color: var(--muted);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
}

.check-row input {
  width: auto;
  min-height: 0;
}

.danger-zone {
  border-color: #fecaca;
  background: #fffafa;
}

.empty-state {
  display: grid;
  justify-items: start;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 28px;
}

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

@media (max-width: 860px) {
  .topbar {
    position: static;
    grid-template-columns: 1fr;
    align-items: start;
    padding: 16px;
  }

  .user-menu {
    justify-content: space-between;
    text-align: left;
  }

  .app-main {
    padding: 18px;
  }

  .page-header,
  .claim-hero,
  .section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-grid,
  .form-grid,
  .detail-grid,
  .workflow-grid,
  .item-grid,
  .filter-bar {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .summary-list div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .landing-hero {
    grid-template-columns: 1fr;
    align-content: start;
    text-align: center;
  }

  .landing-content {
    justify-items: center;
  }

  .contact-block {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .sticky-actions {
    justify-content: stretch;
  }

  .sticky-actions .button {
    flex: 1;
  }
}

@media (max-width: 520px) {
  .main-nav,
  .action-row,
  .filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .button {
    white-space: normal;
  }

  .landing-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .landing-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .login-panel {
    padding: 22px;
  }
}
