:root {
  color-scheme: light;
  --navy: #142568;
  --navy-deep: #0c1748;
  --blue: #3e63d8;
  --ink: #17234f;
  --muted: #707b98;
  --line: #e3e8f2;
  --surface: #ffffff;
  --page: #f4f7fb;
  --green: #188458;
  --green-bg: #e9f8f1;
  --amber: #9d6810;
  --amber-bg: #fff6dd;
  --red: #b6423d;
  --red-bg: #fff0ef;
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page);
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(
      circle at 15% 15%,
      rgba(103, 142, 255, 0.42),
      transparent 34%
    ),
    radial-gradient(
      circle at 85% 82%,
      rgba(44, 78, 187, 0.35),
      transparent 36%
    ),
    linear-gradient(145deg, #07123d, #142568 58%, #203a8e);
}
.login-card {
  width: min(100%, 470px);
  padding: 44px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}
.brand-logo {
  width: 152px;
  height: auto;
  display: block;
  margin-bottom: 32px;
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
}
.login-card h1,
.hero-row h1 {
  margin: 0;
  color: var(--navy-deep);
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.08;
}
.login-copy {
  margin: 14px 0 30px;
  color: var(--muted);
  line-height: 1.6;
}
label {
  display: block;
  margin: 17px 0 8px;
  font-size: 13px;
  font-weight: 750;
  color: #485372;
}
input,
textarea,
select {
  width: 100%;
  border: 1px solid #d7dfed;
  border-radius: 14px;
  background: #fbfcff;
  color: var(--ink);
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
input {
  height: 52px;
  padding: 0 15px;
}
select {
  height: 46px;
  padding: 0 38px 0 13px;
}
textarea {
  padding: 13px 15px;
  resize: vertical;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(62, 99, 216, 0.12);
}
.primary-button,
.secondary-button,
.approve-button,
.reject-button,
.text-button,
.view-button {
  border: 0;
  border-radius: 13px;
  font-weight: 800;
}
.primary-button {
  width: 100%;
  min-height: 54px;
  margin-top: 24px;
  color: white;
  background: var(--navy);
}
.primary-button:disabled,
.approve-button:disabled,
.reject-button:disabled {
  cursor: wait;
  opacity: 0.62;
}
.form-message,
.dialog-message {
  min-height: 21px;
  margin: 12px 0 0;
  color: var(--red);
  font-size: 13px;
  line-height: 1.5;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  background: rgba(255, 255, 255, 0.93);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.topbar-inner {
  max-width: 1600px;
  min-height: 76px;
  margin: auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand-group,
.account-group {
  display: flex;
  align-items: center;
  gap: 15px;
}
.brand-group {
  font-weight: 850;
}
.topbar-logo {
  width: 112px;
}
.account-group {
  color: var(--muted);
  font-size: 13px;
}
.text-button {
  padding: 10px 14px;
  color: var(--navy);
  background: #edf1fb;
}
.dashboard-main {
  max-width: 1600px;
  margin: auto;
  padding: 48px 28px 70px;
}
.hero-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}
.hero-row p:last-child {
  margin: 14px 0 0;
  color: var(--muted);
}
.secondary-button {
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid #ced6e8;
  color: var(--navy);
  background: white;
}
.portal-tabs {
  width: max-content;
  max-width: 100%;
  margin-top: 32px;
  padding: 5px;
  display: flex;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
}
.portal-tab {
  min-height: 42px;
  padding: 0 17px;
  border: 0;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}
.portal-tab.active {
  color: white;
  background: var(--navy);
}
.portal-tab span {
  min-width: 21px;
  height: 21px;
  margin-left: 6px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: var(--navy);
  background: white;
  font-size: 11px;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 34px 0 22px;
}
.warranty-summary {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.summary-card {
  min-height: 104px;
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: white;
  color: var(--muted);
  box-shadow: 0 8px 28px rgba(27, 48, 96, 0.05);
}
.summary-card strong {
  color: var(--ink);
  font-size: 30px;
}
.summary-card.active {
  border-color: var(--navy);
  box-shadow: inset 0 0 0 1px var(--navy);
  color: var(--navy);
}
.queue-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: white;
  box-shadow: 0 14px 42px rgba(27, 48, 96, 0.07);
}
.queue-toolbar {
  padding: 24px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}
.queue-toolbar h2 {
  margin: 0 0 4px;
  font-size: 21px;
}
.queue-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.registry-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  align-items: end;
  gap: 12px;
  width: min(100%, 980px);
}
.period-field,
.search-field {
  margin: 0;
}
.period-field > span,
.search-field > span:not(.sr-only) {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.search-field {
  width: 100%;
}
.search-field input {
  height: 46px;
}
.period-field input {
  height: 46px;
}
.clear-filters {
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid #ced6e8;
  border-radius: 13px;
  color: var(--navy);
  background: white;
  font-weight: 800;
}

.export-button {
  align-self: end;
  min-height: 48px;
  white-space: nowrap;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
.registry-table {
  min-width: 1540px;
}
th {
  padding: 14px 18px;
  text-align: left;
  color: #8791a9;
  background: #fafbfe;
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
td {
  padding: 18px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
  font-size: 14px;
}
.cell-primary {
  display: block;
  color: var(--ink);
  font-weight: 800;
}
.cell-secondary {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}
.contact-email {
  overflow-wrap: anywhere;
}
.account-id {
  max-width: 220px;
  overflow-wrap: anywhere;
}
.address-cell {
  width: 250px;
  max-width: 290px;
}
.address-cell .cell-primary {
  line-height: 1.45;
}
.mobile-cell-label {
  display: none;
}
.status-pill {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  text-transform: capitalize;
}
.status-pending {
  color: var(--amber);
  background: var(--amber-bg);
}
.status-approved,
.status-verified {
  color: var(--green);
  background: var(--green-bg);
}
.status-rejected,
.status-cancelled {
  color: var(--red);
  background: var(--red-bg);
}
.link-linked {
  color: var(--green);
  background: var(--green-bg);
}
.link-unlinked {
  color: var(--muted);
  background: #eef1f7;
}
.coverage-pill {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 850;
}
.coverage-standard {
  color: var(--navy);
  background: #edf1fb;
}
.coverage-extended {
  color: #77550d;
  background: #fff3c9;
}
.view-button {
  min-height: 38px;
  padding: 0 15px;
  white-space: nowrap;
  color: var(--navy);
  background: #edf1fb;
}
.empty-state {
  padding: 70px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.empty-state strong {
  color: var(--ink);
  font-size: 18px;
}
.pagination {
  min-height: 70px;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  border-top: 1px solid var(--line);
}
.pagination span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}
.pagination button:disabled {
  cursor: default;
  opacity: 0.45;
}

dialog {
  width: min(92vw, 760px);
  max-height: 88vh;
  padding: 0;
  border: 0;
  border-radius: 24px;
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(5, 13, 40, 0.4);
}
dialog::backdrop {
  background: rgba(6, 15, 47, 0.66);
  backdrop-filter: blur(5px);
}
.dialog-card {
  padding: 28px;
  overflow: auto;
}
.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.dialog-heading h2 {
  margin: 0;
  font-size: 27px;
}
.close-button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: #eef1f7;
  font-size: 25px;
  line-height: 1;
}
.dialog-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 24px 0 20px;
}
.detail-item {
  min-width: 0;
  padding: 14px;
  border-radius: 13px;
  background: #f5f7fb;
}
.detail-item.wide {
  grid-column: 1 / -1;
}
.detail-item span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.detail-item strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 14px;
}
.edit-field {
  margin: 0;
  display: grid;
  gap: 7px;
}
.edit-field.wide {
  grid-column: 1 / -1;
}
.edit-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.edit-field input,
.edit-field select {
  min-width: 0;
  height: 46px;
  background: white;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
}
.approve-button,
.reject-button {
  min-height: 48px;
  padding: 0 19px;
}
.approve-button {
  color: white;
  background: var(--green);
}
.reject-button {
  color: var(--red);
  background: var(--red-bg);
}

@media (max-width: 820px) {
  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }
  .warranty-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .account-group span {
    display: none;
  }
  .queue-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .registry-controls {
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .registry-controls .search-field {
    grid-column: 1 / -1;
  }
  .search-field {
    width: 100%;
  }
  .registry-table {
    min-width: 0;
  }
  table,
  tbody,
  tr,
  td {
    display: block;
  }
  thead {
    display: none;
  }
  tr {
    padding: 16px 18px;
    border-top: 1px solid var(--line);
  }
  td {
    padding: 6px 0;
    border: 0;
  }
  .mobile-cell-label {
    display: block;
    margin-bottom: 4px;
    color: #8791a9;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .address-cell {
    width: auto;
    max-width: none;
  }
  td:last-child {
    padding-top: 12px;
  }
  .view-button {
    width: 100%;
  }
  .pagination {
    justify-content: center;
  }
}

@media (max-width: 540px) {
  .login-card {
    padding: 32px 24px;
    border-radius: 22px;
  }
  .topbar-inner,
  .dashboard-main {
    padding-left: 18px;
    padding-right: 18px;
  }
  .brand-group span {
    display: none;
  }
  .hero-row {
    align-items: stretch;
    flex-direction: column;
    gap: 20px;
  }
  .portal-tabs {
    width: 100%;
  }
  .portal-tab {
    flex: 1;
    padding: 0 10px;
  }
  .summary-grid {
    gap: 10px;
  }
  .registry-controls {
    grid-template-columns: 1fr;
  }
  .registry-controls .search-field {
    grid-column: auto;
  }
  .summary-card {
    min-height: 86px;
    padding: 17px;
    flex-direction: column;
    align-items: flex-start;
  }
  .summary-card strong {
    font-size: 25px;
  }
  .dialog-card {
    padding: 22px 18px;
  }
  .dialog-details {
    grid-template-columns: 1fr;
  }
  .detail-item.wide {
    grid-column: auto;
  }
  .dialog-actions {
    flex-direction: column-reverse;
  }
  .approve-button,
  .reject-button {
    width: 100%;
  }
}
