/* Oktoneo Ship Station — chrome aligné sur ops e-commerce (tokens.css). */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; max-width: 100%; overflow-x: clip; }
[hidden] { display: none !important; }

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  font-size: var(--font-base);
  line-height: 1.4;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header Ship ── */
.hdr {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 10px 20px;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.hdr-left { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.hdr-logo { display: flex; align-items: center; gap: 12px; }
.hdr-logo .brand-oktoneo {
  height: 36px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  display: block;
}
.hdr-logo .brand-sep {
  width: 1px;
  height: 26px;
  background: var(--border);
}
.hdr-logo .product-name {
  font-family: var(--font-logo);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brand-navy);
  letter-spacing: -0.01em;
  line-height: 1;
}

.nav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  padding: 5px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 2px rgba(16, 37, 58, 0.04);
}
.nav-item,
.nav-tab {
  appearance: none;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  font-weight: 600;
  font-family: inherit;
  color: var(--muted);
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 40px;
  line-height: 1.2;
  text-decoration: none;
}
.nav-item:hover,
.nav-tab:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--bg2) 70%, transparent);
}
.nav-item.active,
.nav-tab.active {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: var(--shadow-sm);
}
.nav-item:focus-visible,
.nav-tab:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.badge,
.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: var(--font-xs);
  font-weight: 700;
  background: color-mix(in srgb, var(--blue) 14%, var(--bg2));
  color: var(--blue-dim);
}
.nav-item.active .badge,
.nav-tab.active .tab-count {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.badge.warn {
  background: color-mix(in srgb, var(--orange) 18%, var(--bg2));
  color: var(--orange);
}

.hdr-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}
.account-chip {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  max-width: 220px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg2);
  box-shadow: var(--shadow-sm);
  line-height: 1.2;
}
.account-chip strong {
  font-size: var(--font-sm);
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-chip span {
  font-size: var(--font-xs);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-chip code {
  font-family: ui-monospace, monospace;
  font-size: 0.7rem;
}

/* ── Shell ── */
.shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  flex: 1;
  min-height: 0;
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    display: flex;
    flex-wrap: wrap;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    max-height: none;
  }
  .side-item { width: auto; flex: 1 1 auto; }
  .hdr { flex-wrap: wrap; }
  .nav-tabs { order: 3; flex: 1 1 100%; }
}

.sidebar {
  background: var(--bg3);
  border-right: 1px solid var(--border);
  padding: 12px 8px;
  overflow: auto;
}
.side-h {
  font-size: var(--font-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 8px 10px 6px;
}
.side-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  font-size: var(--font-sm);
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 2px;
}
.side-item:hover {
  background: color-mix(in srgb, var(--blue) 8%, var(--bg2));
  color: var(--blue-dim);
}
.side-item:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.workspace {
  padding: 16px 20px 32px;
  background: var(--bg);
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}
.saisie-form,
.saisie-form fieldset.block,
.saisie-grid,
.right-col,
.panel {
  min-width: 0;
  max-width: 100%;
}
.view-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}
.view-head h1 {
  margin: 0;
  font-size: var(--font-xl);
  font-weight: 700;
  color: var(--brand-navy);
  letter-spacing: -0.02em;
}
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: var(--font-sm); }

.panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.panel h2 {
  margin: 0 0 10px;
  font-size: var(--font-md);
  font-weight: 700;
  color: var(--text);
}

.home-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
}
@media (max-width: 900px) {
  .home-grid { grid-template-columns: 1fr; }
}

.id-table {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 6px 12px;
  margin: 0;
}
.id-table dt { color: var(--muted); font-size: var(--font-sm); font-weight: 600; }
.id-table dd { margin: 0; font-weight: 600; }

.inline-search { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-search input { flex: 1; min-width: 160px; }

/* Formulaire saisie */
.saisie-form fieldset.block {
  border: 1px solid var(--border);
  background: var(--bg2);
  border-radius: var(--radius-lg);
  margin: 0 0 12px;
  padding: 12px 14px 14px;
  box-shadow: var(--shadow-sm);
}
.saisie-form legend {
  padding: 2px 8px;
  font-size: var(--font-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--blue-dim);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.saisie-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}
.check-inline {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  color: var(--text) !important;
  margin-right: 12px;
  font-weight: 600 !important;
}
.check-inline input { width: auto; }

input, select, textarea, button { font: inherit; }
input, select, textarea {
  color: var(--text);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 12px;
  min-height: var(--ctrl-h);
  box-shadow: var(--shadow-sm);
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-glow);
}

.reverse-drops {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
@media (max-width: 700px) {
  .reverse-drops { grid-template-columns: 1fr; }
}
.drop-zone {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2, transparent);
  cursor: pointer;
  min-width: 0;
}
.drop-zone:hover { border-color: var(--blue); }
.drop-title { font-weight: 600; }
.drop-hint { font-size: 0.85rem; color: var(--muted, #666); }
.drop-zone input[type="file"] { font-size: 0.85rem; }
.rev-fit { border-left: 3px solid var(--blue); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; white-space: pre-wrap; }

.row, .row2, .row3, .transport-row { display: grid; gap: 8px; }
.row { grid-template-columns: 1fr auto; align-items: end; }
.row2 { grid-template-columns: 1fr 1fr; }
.row3 { grid-template-columns: repeat(3, 1fr); }
.transport-row {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.grow { flex: 1; min-width: 0; }
.transport-row > label,
.row2 > label,
.row3 > label,
.row > label {
  min-width: 0;
}
@media (max-width: 1100px) {
  .transport-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .row2, .row3, .transport-row { grid-template-columns: 1fr; }
}

.saisie-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 12px;
}
@media (max-width: 980px) {
  .saisie-grid { grid-template-columns: 1fr; }
}
.right-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.inner {
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--bg3);
}

.um-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.um-list { display: flex; flex-direction: column; gap: 6px; }
.um-row {
  display: grid;
  grid-template-columns: minmax(0, 7rem) minmax(0, 7rem) minmax(0, 5.5rem) minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  padding: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-width: 0;
}
.um-row > * { min-width: 0; max-width: 100%; }
@media (max-width: 860px) {
  .um-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .um-row { grid-template-columns: 1fr; }
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 16px;
}

.btn {
  height: var(--ctrl-h);
  min-height: var(--ctrl-h);
  padding: 0 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg2);
  font: inherit;
  font-weight: 650;
  font-size: var(--font-md);
  cursor: pointer;
  color: var(--text);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.btn:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--blue) 35%, var(--border));
  background: var(--bg3);
}
.btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px var(--blue-glow);
}
.btn.primary,
.btn-primary {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}
.btn.primary:hover:not(:disabled),
.btn-primary:hover:not(:disabled) {
  background: var(--blue-dim);
  border-color: var(--blue-dim);
}
.btn.danger,
.btn-danger {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 30%, var(--border));
  background: var(--bg2);
}
.btn.danger:hover:not(:disabled) {
  background: color-mix(in srgb, var(--red) 8%, var(--bg2));
}
.btn.ghost,
.btn-ghost {
  background: var(--bg2);
  box-shadow: none;
}
.linkish {
  border: 0;
  background: none;
  color: var(--blue-dim);
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.list { display: flex; flex-direction: column; gap: 8px; }
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.card:hover {
  border-color: color-mix(in srgb, var(--blue) 45%, var(--border));
  box-shadow: var(--shadow-md);
}
.meta { color: var(--muted); font-size: var(--font-sm); }
.state-void { color: var(--red); text-decoration: line-through; }
.detail { margin-top: 12px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.offers table, .data {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-sm);
}
.offers th, .offers td,
.data th, .data td {
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}
.offers th, .data th {
  color: var(--muted);
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg3);
}
.offers tr.best { background: color-mix(in srgb, var(--blue) 8%, var(--bg2)); }

.mono {
  font-family: ui-monospace, monospace;
  font-size: var(--font-xs);
  white-space: pre-wrap;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  max-height: 220px;
  overflow: auto;
}
.um-mini { margin: 6px 0; padding-left: 1.1rem; font-size: var(--font-sm); }
.eod-docs { margin: 8px 0 0; }
.eod-docs a { color: var(--blue-dim); font-weight: 650; }
