/*
 * Global operational UI styles.
 * Keep this file dependency-free: the app renders server-side Rails views and
 * should not require a frontend build pipeline for the internal back office.
 */

:root {
  --bg: #111111;
  --bg-soft: #141414;
  --surface: #1c1c1c;
  --surface-raised: #202020;
  --surface-hover: #242424;
  --border: #2a2a2a;
  --border-strong: #303030;
  --text: #f5f5f5;
  --text-muted: #b3b3b3;
  --text-soft: #858585;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --neutral: #8a8a8a;
  --focus: #e5e5e5;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --sidebar-width: 244px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(245, 245, 245, 0.035), transparent 32rem),
    linear-gradient(180deg, #181818 0%, #111111 42%, #101010 100%);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: var(--text);
  text-decoration-color: rgba(245, 245, 245, 0.34);
  text-underline-offset: 0.2em;
}

a:hover {
  color: #ffffff;
  text-decoration-color: rgba(245, 245, 245, 0.72);
}

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

.app-shell {
  display: flex;
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: clip;
}

.app-frame {
  min-width: 0;
  flex: 1;
  max-width: 100%;
  overflow-x: clip;
}

.app-navigation {
  position: sticky;
  top: 0;
  display: flex;
  width: var(--sidebar-width);
  flex-shrink: 0;
  height: 100vh;
  flex-direction: column;
  gap: 1rem;
  padding: 1.1rem;
  border-right: 1px solid var(--border);
  background: rgba(17, 17, 17, 0.96);
  overflow-y: auto;
  overflow-x: hidden;
}

.app-navigation-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.25rem 0.35rem 0.85rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.app-navigation-mark {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface-raised);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.app-navigation-links {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 0;
  overflow-y: auto;
}

.app-navigation-group {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 0;
}

.app-navigation-group-label {
  margin: 0 0 0.15rem;
  padding: 0 0.75rem;
  color: var(--text-soft);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-navigation-links a,
.app-navigation-links span {
  display: flex;
  align-items: center;
  min-height: 2.25rem;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.app-navigation-links a,
.app-navigation-links span a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-navigation-links span a {
  min-height: auto;
  min-width: 0;
  padding: 0;
  width: 100%;
}

.app-navigation-links a:hover,
.app-navigation-links span:hover {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.app-navigation-links span.is-active {
  border-color: var(--border-strong);
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: inset 3px 0 0 var(--text);
}

.app-navigation-links span.is-active a {
  color: var(--text);
}

.app-navigation-footer {
  display: grid;
  gap: 0.85rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.app-navigation-secondary {
  display: grid;
  gap: 0.35rem;
}

.app-navigation-secondary a {
  color: var(--text-soft);
  font-size: 0.78rem;
  text-decoration: none;
}

.app-navigation-secondary a:hover {
  color: var(--text-muted);
}

.app-navigation-logout,
input[type="submit"],
button,
.button,
form.button_to button {
  min-height: 2.35rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #f5f5f5;
  color: #111111;
  cursor: pointer;
  font-weight: 700;
}

.app-navigation-logout {
  width: 100%;
  background: transparent;
  color: var(--text-muted);
}

.app-navigation-logout:hover {
  border-color: #444444;
  color: var(--text);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 5.2rem;
  padding: 1rem 1.7rem;
  border-bottom: 1px solid var(--border);
  background: rgba(20, 20, 20, 0.88);
  backdrop-filter: blur(16px);
}

.app-header-kicker,
.app-user-label {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-header-title {
  margin: 0.1rem 0 0;
  color: var(--text);
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  font-weight: 760;
  letter-spacing: -0.035em;
}

.app-user {
  max-width: 18rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  text-align: right;
}

.app-user strong {
  display: block;
  overflow: hidden;
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-main {
  width: min(100%, 1280px);
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding: 1.45rem 1.7rem 2.5rem;
  overflow-x: clip;
}

.page-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.page-subtitle {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

.breadcrumbs {
  margin: 0 0 1rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  color: var(--text-soft);
  font-size: 0.86rem;
  list-style: none;
}

.breadcrumbs li + li::before {
  content: "/";
  margin-right: 0.5rem;
  color: #666666;
}

.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--text);
}

.flash {
  width: min(100% - 3.4rem, 1280px);
  margin: 1rem auto 0;
  padding: 0.82rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--surface);
}

.flash-notice {
  border-color: rgba(34, 197, 94, 0.36);
  color: #bbf7d0;
}

.flash-warning {
  border-color: rgba(245, 158, 11, 0.38);
  color: #fde68a;
}

.flash-alert {
  border-color: rgba(239, 68, 68, 0.4);
  color: #fecaca;
}

.form-errors {
  margin: 0 0 1rem;
  padding: 1rem;
  border: 1px solid rgba(239, 68, 68, 0.42);
  border-radius: var(--radius-md);
  background: rgba(239, 68, 68, 0.08);
  color: #fecaca;
}

.form-errors h2 {
  margin: 0 0 0.5rem;
  color: var(--text);
  font-size: 1rem;
}

.form-errors ul {
  margin: 0;
  padding-left: 1.25rem;
}

.section {
  margin-top: 1rem;
  padding: 1.05rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
  box-shadow: var(--shadow);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.section-header > h2,
.section-header > h3 {
  margin: 0;
}

.priority-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0 0 1rem;
}

.priority-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.priority-chip strong {
  color: var(--text);
}

.section > h2,
.section > h3 {
  margin: 0 0 0.85rem;
  color: var(--text);
  letter-spacing: -0.025em;
}

.section > h2 {
  font-size: 1.05rem;
}

.section > h3 {
  color: var(--text-muted);
  font-size: 0.95rem;
}

dl {
  display: grid;
  grid-template-columns: minmax(9rem, max-content) minmax(0, 1fr);
  gap: 0.65rem 1.1rem;
  margin: 0.5rem 0 0;
}

dt {
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

dd {
  min-width: 0;
  margin: 0;
  color: var(--text);
}

.table-scroll {
  width: 100%;
  max-width: 100%;
  margin: 0.9rem 0 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}

.table-scroll > table {
  display: table;
  margin: 0;
  border: 0;
  border-radius: 0;
  min-width: 36rem;
  overflow: visible;
}

.table-scroll > table > thead {
  display: table-header-group;
}

.table-scroll > table > tbody {
  display: table-row-group;
}

table {
  width: 100%;
  max-width: 100%;
  margin: 0.9rem 0 0;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

/* Keep wide tables inside the frame without a wrapper on every view. */
.app-main > table,
.section > table,
.section table,
.app-main section > table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.app-main > table > thead,
.app-main > table > tbody,
.section table > thead,
.section table > tbody,
.app-main section > table > thead,
.app-main section > table > tbody {
  display: table;
  width: 100%;
  min-width: 36rem;
}



th,
td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

td {
  max-width: 18rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.cell-clip {
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-actions {
  white-space: nowrap;
}

.cell-actions a,
.cell-actions form {
  display: inline-flex;
}

th {
  background: #181818;
  color: var(--text-soft);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

td {
  color: var(--text-muted);
}

tbody tr {
  transition: background 140ms ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

tr:last-child td {
  border-bottom: 0;
}

form:not(.button_to) {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.85rem;
  margin: 0.9rem 0 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(17, 17, 17, 0.42);
}

form:not(.button_to) > div {
  display: grid;
  min-width: min(100%, 14rem);
  gap: 0.35rem;
}

label {
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 760;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-height: 2.45rem;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #151515;
  color: var(--text);
  padding: 0.55rem 0.7rem;
  outline: none;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

input[type="submit"]:hover,
button:hover,
.button:hover {
  background: #ffffff;
}

form a,
td a,
p a {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  color: var(--text);
  font-weight: 700;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.65rem;
  padding: 0.18rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.status-badge-success {
  border-color: rgba(34, 197, 94, 0.36);
  background: rgba(34, 197, 94, 0.11);
  color: #86efac;
}

.status-badge-warning {
  border-color: rgba(245, 158, 11, 0.34);
  background: rgba(245, 158, 11, 0.1);
  color: #fcd34d;
}

.status-badge-danger {
  border-color: rgba(239, 68, 68, 0.36);
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
}

.status-badge-neutral {
  border-color: rgba(138, 138, 138, 0.34);
  background: rgba(138, 138, 138, 0.1);
  color: #d4d4d4;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
  background: transparent;
  border: 0;
  padding: 0;
  box-shadow: none;
}

.metric-card {
  min-height: 10rem;
  padding: 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #202020, #1b1b1b);
  box-shadow: var(--shadow);
}

.metric-value {
  margin: 0;
  color: var(--text);
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 820;
  letter-spacing: -0.06em;
  line-height: 1;
}

.metric-title {
  margin: 0.8rem 0 1rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.metric-title a {
  color: var(--text-muted);
  text-decoration: none;
}

.metric-title a:hover {
  color: var(--text);
}

.metric-link {
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 800;
}

.metric-link-muted {
  color: var(--text-soft);
}

.operational-status-list,
.available-actions {
  display: grid;
  gap: 0.65rem;
  margin: 0.5rem 0 1rem;
  padding: 0;
  list-style: none;
}

.operational-status {
  display: grid;
  gap: 0.2rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #181818;
}

.operational-status strong {
  color: var(--text);
}

.operational-status span {
  color: var(--text-muted);
}

.operational-status.is-available {
  border-color: rgba(34, 197, 94, 0.28);
}

.operational-status.is-blocked {
  border-color: var(--border);
}

.available-actions {
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

.available-actions li {
  padding: 0.65rem 0.8rem;
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: 999px;
  color: #bbf7d0;
  font-weight: 700;
}

.timeline {
  position: relative;
  display: grid;
  gap: 1rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.timeline::before {
  position: absolute;
  top: 0.6rem;
  bottom: 0.6rem;
  left: 0.48rem;
  width: 1px;
  background: var(--border-strong);
  content: "";
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 1rem minmax(0, 1fr);
  gap: 0.9rem;
}

.timeline-marker {
  z-index: 1;
  width: 0.95rem;
  height: 0.95rem;
  margin-top: 0.4rem;
  border: 2px solid var(--warning);
  border-radius: 999px;
  background: var(--bg);
}

.timeline-content {
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #181818;
}

.timeline-content h3 {
  margin: 0.15rem 0 0.55rem;
  color: var(--text);
  font-size: 0.98rem;
}

.timeline-time {
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.timeline-status,
.timeline-description {
  margin: 0.45rem 0 0;
  color: var(--text-muted);
}

.timeline-details {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.empty-state {
  margin: 0.75rem 0 0;
  color: var(--text-soft);
}

.pagination {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0 0;
  color: var(--text-muted);
}

.pagination p {
  margin: 0;
}

.pagination-link {
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 960px) {
  .app-shell {
    display: block;
    overflow-x: clip;
  }

  .app-navigation {
    position: sticky;
    z-index: 20;
    width: 100%;
    height: auto;
    max-height: none;
    padding: 0.85rem;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    overflow: visible;
  }

  .app-navigation-links {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.2rem;
  }

  .app-navigation-group {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.22rem;
  }

  .app-navigation-group-label {
    display: none;
  }

  .app-navigation-links a,
  .app-navigation-links span {
    white-space: nowrap;
  }

  .app-navigation-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.65rem;
    overflow-x: auto;
  }

  .app-navigation-secondary {
    display: flex;
    gap: 0.75rem;
    white-space: nowrap;
  }

  .app-navigation-footer form,
  .app-navigation-logout {
    width: auto;
    white-space: nowrap;
  }

  .app-header {
    position: static;
  }
}

@media (max-width: 680px) {
  .app-navigation-brand {
    padding-bottom: 0.25rem;
  }

  .app-navigation-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .app-navigation-secondary {
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }

  .app-navigation-footer form,
  .app-navigation-logout {
    width: 100%;
  }

  .app-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 1rem;
  }

  .app-user {
    max-width: 100%;
    text-align: left;
  }

  .app-main {
    padding: 1rem;
  }

  .flash {
    width: calc(100% - 2rem);
  }

  dl,
  .timeline-details {
    grid-template-columns: 1fr;
  }

  form:not(.button_to) {
    display: grid;
  }
}

/* Operational polish: queues, fulfillment, shipping options */
.page-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.page-subtitle {
  margin: 0.25rem 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.text-muted {
  color: var(--text-soft);
  font-size: 0.9em;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: end;
  margin: 1rem 0 1.25rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.filter-bar > div {
  min-width: 10rem;
}

.ops-table {
  width: 100%;
  border-collapse: collapse;
}

.aging-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  font-size: 0.85rem;
  font-weight: 600;
}

.queue-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
}

.queue-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  color: var(--text-muted);
  background: var(--surface);
}

.queue-tabs a.is-active {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.queue-count {
  min-width: 1.4rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: rgba(245, 245, 245, 0.08);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
}

.shipping-option-card {
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.shipping-option-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.shipping-option-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.shipping-option-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

.shipping-option-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.75rem 1rem;
}

.shipping-section-title {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.shipping-subsection-title {
  margin: 1.1rem 0 0.35rem;
  font-size: 0.95rem;
}

.shipping-overview-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.shipping-overview-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
}

.shipping-overview-name {
  min-width: 11rem;
  font-weight: 600;
}

.shipping-regions {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.shipping-region-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.35rem 0;
}

.shipping-hint {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  color: var(--muted, #6b7280);
}

.shipping-hint--warn {
  color: #b45309;
}

.shipping-checklist {
  margin: 0.4rem 0 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.3rem;
  font-size: 0.92rem;
}

.shipping-checklist .is-ok {
  color: #047857;
}

.shipping-checklist .is-missing {
  color: #b45309;
  font-weight: 600;
}

.shipping-checklist .is-neutral {
  color: var(--muted, #6b7280);
}

.shipping-connection-status {
  margin: 0.4rem 0 0;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--border);
  font-size: 0.92rem;
}

.shipping-connection-status--ok {
  border-color: #6ee7b7;
  background: rgba(16, 185, 129, 0.08);
}

.shipping-connection-status--pending,
.shipping-connection-status--error {
  border-color: #fcd34d;
  background: rgba(245, 158, 11, 0.08);
}

.shipping-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin: 1rem 0 1.5rem;
}

.shipping-oauth-actions {
  margin-top: 0.25rem;
}

.status-badge--ok {
  background: rgba(16, 185, 129, 0.18);
  color: #047857;
}

.status-badge--muted {
  background: rgba(107, 114, 128, 0.15);
  color: #4b5563;
}

.status-badge--warning {
  background: rgba(245, 158, 11, 0.2);
  color: #b45309;
}


.product-image-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.5rem 0;
}

.product-image-tile {
  display: grid;
  gap: 0.35rem;
  max-width: 8rem;
}

.product-image-tile img {
  width: 8rem;
  height: 10rem;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.form-row-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem 1rem;
}

.button-link {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  text-decoration: none;
  font-weight: 600;
}

/* Platform trial + onboarding */
.platform-body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, sans-serif;
}
.platform-shell {
  max-width: 40rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}
.platform-header { margin-bottom: 1.5rem; }
.platform-brand { font-weight: 700; letter-spacing: 0.04em; margin: 0; }
.platform-tagline { color: var(--text-muted); margin: 0.25rem 0 0; font-size: 0.95rem; }
.platform-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.platform-lead { color: var(--text-muted); line-height: 1.5; }
.platform-summary {
  display: grid;
  gap: 0.75rem;
  margin: 1.25rem 0;
  padding: 1rem;
  background: var(--surface-raised);
  border-radius: var(--radius-md);
}
.platform-summary dt { color: var(--text-soft); font-size: 0.75rem; text-transform: uppercase; }
.platform-summary dd { margin: 0.15rem 0 0; font-weight: 600; }
.platform-form fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 0 0 1rem;
  padding: 1rem;
}
.platform-form legend { padding: 0 0.35rem; font-weight: 600; }
.platform-form label { display: block; margin: 0.75rem 0 0.35rem; font-size: 0.9rem; }
.platform-form input[type="text"],
.platform-form input[type="password"],
.platform-form input:not([type]) {
  width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-soft);
  color: var(--text);
}
.platform-form-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.75rem; }
.slug-row { display: flex; align-items: center; gap: 0.5rem; }
.slug-row input { flex: 1; }
.slug-suffix { color: var(--text-muted); white-space: nowrap; }
.field-hint { color: var(--text-soft); font-size: 0.85rem; margin: 0.5rem 0 0; }
.platform-submit { margin-top: 0.5rem; width: 100%; }
.platform-flash .flash-alert { color: var(--danger); }
.platform-flash .flash-notice { color: var(--success); }
.trial-banner {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--warning);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
}
.onboarding-wizard { max-width: 42rem; }
.onboarding-wizard h2 { margin-top: 0; }
.onboarding-wizard h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.onboarding-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 1rem 0 1.5rem;
}
.onboarding-steps li {
  font-size: 0.8rem;
  color: var(--text-soft);
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.onboarding-steps li.is-current { color: var(--text); border-color: var(--focus); }
.onboarding-steps li.is-done { color: var(--success); }
.onboarding-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.25rem;
}
.onboarding-inline-form {
  display: inline;
  margin: 0;
}
.onboarding-config-cards {
  display: grid;
  gap: 1rem;
  margin: 1.25rem 0;
}
.onboarding-config-card {
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}
.onboarding-config-card p {
  margin: 0 0 0.9rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

/* Shared primary/secondary action buttons (onboarding + platform) */
a.btn,
button.btn,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
}
a.btn:hover {
  text-decoration: none;
}
.btn-primary,
a.btn-primary {
  background: #f5f5f5;
  color: #111111;
  border-color: #f5f5f5;
}
.btn-primary:hover,
a.btn-primary:hover {
  background: #ffffff;
  color: #111111;
}
.btn-secondary,
a.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover,
a.btn-secondary:hover {
  background: var(--surface-hover);
  color: #ffffff;
}
