:root {
  color-scheme: light dark;
  --page-bg: light-dark(#f5f7fa, #171c24);
  --surface: light-dark(#ffffff, #222a36);
  --text: light-dark(#192438, #edf2f8);
  --muted: light-dark(#596a7e, #b1bfd0);
  --border: light-dark(#e0e6ed, #3a4657);
  --input-border: light-dark(#c5cfdb, #64758a);
  --soft: light-dark(#f9fafc, #293342);
  --primary: light-dark(#087f78, #64d3c6);
  --on-primary: light-dark(#ffffff, #112d2a);
  --link: light-dark(#08736e, #8de1d8);
  --positive-bg: light-dark(#e5f4f0, #203f37);
  --positive-text: light-dark(#09644e, #a2e4cd);
  --positive-border: light-dark(#c9e8df, #396c5d);
  --warning-bg: light-dark(#fff5df, #41351f);
  --warning-text: light-dark(#704600, #f4d398);
  --warning-border: light-dark(#e6bd69, #887047);
  --info-bg: light-dark(#edf5f8, #233b4a);
  --info-text: light-dark(#315569, #b6d7e7);
  --info-border: light-dark(#d6e6ed, #456071);
  --error-bg: light-dark(#fff0f1, #472c34);
  --error-text: light-dark(#ac2637, #ffbdc6);
  --error-border: light-dark(#f0d2d7, #a65f6f);
  font-family:
    Segoe UI,
    system-ui,
    sans-serif;
  color: var(--text);
  background: var(--page-bg);
  font-size: 14px;
  font-synthesis: none;
}
:root[data-theme="light"] {
  color-scheme: light;
}
:root[data-theme="dark"] {
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: var(--on-primary);
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  min-height: 42px;
}
button:hover {
  filter: brightness(0.94);
}
button:disabled {
  opacity: 0.6;
  cursor: wait;
}
a {
  color: var(--link);
}
input,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--input-border);
  background: var(--surface);
  color: var(--text);
  padding: 10px;
  border-radius: 5px;
  min-height: 42px;
}
label {
  display: grid;
  gap: 7px;
  font-weight: 600;
  margin: 0 0 16px;
}
label small {
  font-weight: 400;
  color: var(--muted);
}
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
}
label.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}
h1 {
  font-size: 29px;
  letter-spacing: -0.8px;
  margin: 4px 0 10px;
}
h2 {
  font-size: 21px;
  letter-spacing: -0.3px;
  margin: 0 0 16px;
}
p {
  line-height: 1.6;
}
small {
  line-height: 1.6;
}
.muted,
small {
  color: var(--muted);
}
.mark {
  display: inline-grid;
  place-items: center;
  background: var(--primary);
  color: var(--on-primary);
  width: 37px;
  height: 37px;
  border-radius: 9px;
  font-weight: 750;
  font-size: 17px;
  flex-shrink: 0;
}
.brand {
  display: flex;
  gap: 11px;
  color: white;
  text-decoration: none;
  font-size: 20px;
  letter-spacing: -0.5px;
  padding: 28px 20px 35px;
  align-items: center;
}
.brand small {
  display: block;
  font-size: 11px;
  color: #acbbcc;
  letter-spacing: 0;
}
aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: 232px;
  background: #14263e;
  color: #d6dfe9;
  display: flex;
  flex-direction: column;
}
.nav-caption {
  font-size: 10px;
  letter-spacing: 1.5px;
  padding: 0 24px 12px;
  color: #a7b7c9;
}
nav {
  display: grid;
  gap: 5px;
  padding: 0 12px;
}
nav a {
  color: #cad5e2;
  text-decoration: none;
  padding: 12px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}
nav a .nav-icon {
  width: 24px;
  opacity: 0.8;
  font-size: 12px;
}
nav a.active {
  color: white;
  background: #24415a;
  box-shadow: inset 3px 0 #4bc2b6;
}
nav a:hover {
  background: #213750;
}
.aside-foot {
  margin: auto 20px 25px;
  font-size: 12px;
  border-top: 1px solid #304158;
  padding-top: 20px;
}
.aside-foot small {
  display: block;
  font-size: 10px;
  color: #a7b7c9;
  margin-top: 5px;
}
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #5bd2ae;
  border-radius: 50%;
  margin-right: 5px;
}
.content {
  margin-left: 232px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  min-height: 74px;
  padding: 14px 36px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
header > div {
  display: flex;
  gap: 14px;
  align-items: center;
}
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  padding: 5px 9px;
  background: var(--positive-bg);
  color: var(--positive-text);
  border: 1px solid var(--positive-border);
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
}
.badge.off {
  background: var(--soft);
  border-color: var(--border);
  color: var(--muted);
}
.badge.warn {
  color: var(--warning-text);
  background: var(--warning-bg);
  border-color: var(--warning-border);
}
.quiet {
  background: var(--surface);
  color: var(--muted);
  border-color: var(--border);
  font-size: 12px;
}
main {
  padding: 32px 36px;
  max-width: 1550px;
  min-height: calc(100vh - 130px);
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.8px;
  font-weight: 650;
  color: var(--link);
}
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 6px 0 27px;
}
.page-head p {
  margin: 0;
  color: var(--muted);
  max-width: 750px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: 24px 0;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 21px;
}
.stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.stat strong {
  font-size: 30px;
  display: block;
  margin: 13px 0 4px;
  letter-spacing: -1px;
}
.stat small {
  font-size: 11px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 22px;
}
.carrier-list-head,
.carrier-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.carrier-list-head {
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.carrier-list-head h2,
.carrier-list-head label {
  margin: 0;
}
.carrier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 20px;
}
.carrier-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.carrier-card:hover {
  border-color: var(--primary);
}
.carrier-monogram {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--info-bg);
  color: var(--info-text);
  font-size: 17px;
  font-weight: 700;
}
.carrier-card h2,
.carrier-card p {
  margin: 0;
}
.carrier-card p {
  color: var(--muted);
}
.carrier-counts {
  display: flex;
  gap: 36px;
  margin: 8px 0;
}
.carrier-counts dt {
  font-size: 12px;
  color: var(--muted);
}
.carrier-counts dd {
  margin: 4px 0 0;
  font-size: 23px;
  font-weight: 600;
}
.carrier-card-link {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  color: var(--link);
  font-weight: 600;
  margin-top: auto;
}
.carrier-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.carrier-breadcrumb a {
  text-decoration: none;
}
.carrier-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}
.carrier-tabs a {
  padding: 14px 16px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  font-weight: 600;
}
.carrier-tabs a[aria-current="page"] {
  color: var(--link);
  border-bottom-color: var(--primary);
}
.carrier-tabs a:hover {
  background: var(--soft);
}
.carrier-setup {
  padding: 0 22px;
}
.carrier-step {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 0;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.carrier-step:last-child {
  border-bottom: 0;
}
.carrier-step > span:nth-child(2) {
  flex: 1;
  min-width: 0;
}
.carrier-step strong,
.carrier-step small {
  display: block;
}
.carrier-step small {
  margin-top: 5px;
}
.carrier-step-number {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: var(--info-bg);
  color: var(--info-text);
  border-radius: 50%;
  font-weight: 600;
}
.advanced-settings {
  margin: 20px 0;
}
.advanced-settings summary {
  cursor: pointer;
  padding: 12px 0;
  color: var(--link);
  font-weight: 600;
}
.key-value dd {
  overflow-wrap: anywhere;
  min-width: 0;
}
.panel-title {
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.panel-title h2 {
  font-size: 16px;
  margin: 0;
}
.panel-body {
  padding: 22px;
}
.notice {
  padding: 15px 18px;
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  color: var(--info-text);
  border-radius: 6px;
  line-height: 1.6;
  margin: 18px 0;
}
.notice strong {
  color: var(--info-text);
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}
fieldset {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  margin: 0 0 20px;
  min-width: 0;
}
legend {
  font-weight: 600;
  padding: 0 6px;
}
th {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.7px;
  background: var(--soft);
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}
th,
td {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
}
tr:last-child td {
  border-bottom: 0;
}
td {
  max-width: 300px;
  overflow-wrap: anywhere;
}
td .quiet {
  white-space: nowrap;
  padding: 6px 10px;
  min-height: 32px;
  margin: 2px;
}
td strong {
  font-weight: 600;
}
.filter {
  max-width: 280px;
}
.empty {
  text-align: center;
  padding: 50px;
  color: var(--muted);
}
.two-col {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 22px;
}
.steps {
  display: grid;
  gap: 18px;
  margin: 0;
  padding-left: 24px;
}
.steps li {
  padding-left: 5px;
  line-height: 1.6;
}
.steps small {
  display: block;
}
.key-value {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0;
}
.key-value dt,
.key-value dd {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  margin: 0;
}
.key-value dt {
  color: var(--muted);
}
.key-value dd {
  text-align: right;
  font-weight: 600;
}
.error {
  color: var(--error-text);
}
.success {
  padding: 13px 17px;
  background: var(--positive-bg);
  color: var(--positive-text);
  border-radius: 5px;
  margin-bottom: 18px;
}
.error:not(:empty) {
  padding: 13px 17px;
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: 5px;
  margin-bottom: 18px;
}
footer {
  padding: 15px 36px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  display: flex;
  justify-content: space-between;
}
.login-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 18px;
}
.login-brand {
  text-align: center;
  margin-bottom: 28px;
}
.login-brand h1 {
  font-size: 25px;
  margin: 10px 0 2px;
}
.login-brand p {
  font-size: 12px;
  margin: 0;
  color: var(--muted);
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px;
  box-shadow: 0 8px 30px #233f5d08;
}
.login-card h2 {
  margin: 10px 0;
}
.login-card p {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 25px;
}
.login-card button {
  width: 100%;
}
.login-card small {
  display: block;
  font-size: 11px;
  margin-top: 18px;
}
.login-foot {
  font-size: 10px;
  color: var(--muted);
  margin-top: 25px;
}
dialog {
  border: 1px solid var(--border);
  border-radius: 9px;
  width: min(600px, calc(100% - 24px));
  max-height: 90vh;
  padding: 28px;
  box-shadow: 0 20px 80px #14263e30;
}
dialog::backdrop {
  background: #14263e66;
}
dialog h2 {
  margin-bottom: 10px;
}
dialog p {
  color: var(--muted);
}
dialog form {
  margin-top: 24px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
}
.form-grid .wide {
  grid-column: 1/-1;
}
.dialog-close {
  margin-top: 14px;
  width: 100%;
}
.token {
  padding: 18px;
  background: var(--info-bg);
  overflow-wrap: anywhere;
  user-select: all;
  font-family: monospace;
}
.caps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 20px;
}
.skip {
  position: absolute;
  left: 10px;
  top: -100px;
  z-index: 100;
  background: var(--surface);
  padding: 12px;
}
.skip:focus {
  top: 10px;
}
:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 1050px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .two-col {
    grid-template-columns: 1fr;
  }
  header,
  main,
  footer {
    padding-left: 24px;
    padding-right: 24px;
  }
}
@media (max-width: 700px) {
  aside {
    position: static;
    width: 100%;
  }
  .brand {
    padding: 16px 20px;
  }
  .nav-caption,
  .aside-foot {
    display: none;
  }
  nav {
    display: flex;
    overflow: auto;
    padding: 0 12px 12px;
  }
  nav a {
    white-space: nowrap;
    font-size: 12px;
    padding: 10px;
  }
  .nav-icon {
    display: none;
  }
  nav a.active {
    box-shadow: inset 0 -3px #4bc2b6;
  }
  .content {
    margin-left: 0;
  }
  header {
    min-height: 64px;
    padding: 10px 18px;
  }
  header .muted {
    display: none;
  }
  main {
    padding: 24px 18px;
  }
  .page-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  h1 {
    font-size: 25px;
  }
  .stats {
    gap: 10px;
  }
  .stat {
    padding: 16px;
  }
  .stat strong {
    font-size: 26px;
  }
  .panel-title {
    flex-wrap: wrap;
    padding: 16px;
  }
  .panel-body {
    padding: 18px;
  }
  .filter {
    max-width: none;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  th,
  td {
    padding: 13px 16px;
  }
  .key-value {
    font-size: 12px;
  }
  footer {
    padding: 16px 18px;
  }
  footer span {
    display: none;
  }
  .login-card {
    padding: 26px;
  }
  dialog {
    padding: 22px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
.notice.production {
  background: var(--warning-bg);
  color: var(--warning-text);
  border: 1px solid var(--warning-border);
  font-weight: 600;
}
input[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--error-text);
  outline-color: var(--error-text);
}
.theme-control {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 0;
  font-size: 12px;
  font-weight: 400;
}
.theme-control select {
  width: auto;
  padding: 6px;
  min-height: 36px;
}
.shipment-panel {
  margin-bottom: 0;
  overflow: hidden;
}
.shipment-table {
  min-width: 850px;
}
.shipment-table th {
  text-transform: none;
  font-size: 12px;
  letter-spacing: 0;
}
.shipment-table th,
.shipment-table td {
  padding: 16px 12px;
}
.shipment-table small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
}
.shipment-id {
  width: 110px;
  min-width: 100px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  white-space: nowrap;
}
.shipment-inspection-dialog {
  width: min(900px, calc(100% - 24px));
  background: var(--surface);
  color: var(--text);
  padding: 22px 26px;
}
.shipment-inspection-dialog h2 {
  margin-bottom: 4px;
}
.inspection-reference {
  margin: 0 0 14px;
  font-size: 12px;
}
.shipment-inspection-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
  font-size: 13px;
}
.shipment-inspection-table th,
.shipment-inspection-table td {
  padding: 8px 12px;
  text-transform: none;
  font-size: 13px;
  letter-spacing: 0;
  white-space: normal;
  vertical-align: top;
  font-weight: 400;
}
.shipment-inspection-table th:first-child {
  width: 24%;
}
.shipment-inspection-table thead th {
  font-weight: 600;
}
.inspection-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px;
}
.inspection-warning,
.inspection-diagnostic {
  font-size: 12px;
  margin: 10px 0 0;
}
.inspection-warning {
  color: var(--warning-text);
}
.inspection-diagnostic summary {
  cursor: pointer;
}
@media (max-width: 600px) {
  .shipment-inspection-dialog {
    padding: 18px 12px;
  }
  .shipment-inspection-table th,
  .shipment-inspection-table td {
    padding: 7px 5px;
    font-size: 12px;
    overflow-wrap: anywhere;
  }
  .shipment-inspection-table th:first-child {
    width: 25%;
  }
}
.shipment-tracking {
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}
.shipment-tracking:hover {
  text-decoration: underline;
}
.shipment-actions {
  display: flex;
  gap: 5px;
}
.shipment-actions .shipment-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  min-width: 32px;
  padding: 2px;
  margin: 0;
  font-size: 20px;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.shipment-action:disabled,
.shipment-pagination button:disabled {
  cursor: default;
  opacity: 0.4;
}
.shipment-pagination,
.shipment-pages {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.shipment-pagination {
  margin-top: 18px;
  font-size: 12px;
  color: var(--muted);
}
.shipment-pagination label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-weight: 400;
}
.shipment-pagination select {
  width: 70px;
  min-height: 36px;
  padding: 6px;
}
.shipment-pages button {
  padding: 7px 10px;
  min-height: 36px;
}
.shipment-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  margin-top: 20px;
}
header {
  flex-wrap: wrap;
  gap: 10px;
}
header > div {
  flex-wrap: wrap;
  gap: 10px;
}
@media (pointer: coarse) {
  .shipment-actions .shipment-action {
    min-width: 44px;
    min-height: 44px;
  }
}

/* Partner onboarding and explicit price administration. */
.api-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 0;
  list-style: none;
  margin: 22px 0;
}
.api-steps li,
.api-client-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}
.api-steps span,
.api-scope-grid small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}
.api-client-grid,
.api-scope-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.api-client-card h2 {
  overflow-wrap: anywhere;
}
.api-card-link {
  display: inline-block;
  padding: 10px 0;
  font-weight: 600;
}
.pricing-filters {
  display: grid;
  grid-template-columns: 2fr repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
#api-secret-once {
  font-family: ui-monospace, monospace;
}
#api-prod-confirm[hidden] {
  display: none;
}
@media (max-width: 1100px) {
  .pricing-filters,
  .api-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 650px) {
  .pricing-filters,
  .api-steps,
  .api-client-grid,
  .api-scope-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.shipment-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  padding: 20px;
}
.shipment-filters label {
  display: grid;
  gap: 6px;
  min-width: 140px;
  flex: 1;
}
.shipment-filters p {
  flex-basis: 100%;
  margin: 0;
}
