/* Trade Partner Portal — no-login partner view (#/trade/<token>) */

body.trade-portal-active {
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(11, 61, 74, 0.18), transparent 60%),
    radial-gradient(900px 420px at 100% 0%, rgba(63, 82, 99, 0.12), transparent 55%),
    linear-gradient(180deg, #f3f7f9 0%, #e7eef3 100%);
  min-height: 100vh;
}

body.trade-portal-active .app-header.trade-portal-header {
  position: sticky;
  top: 0;
  z-index: 5;
}

body.trade-portal-active .app-header .header-actions,
body.trade-portal-active .app-header .header-menu,
body.trade-portal-active #header-menu-panel,
body.trade-portal-active #app-top-chrome,
body.trade-portal-active .dev-workspace-nav,
body.trade-portal-active .beta-nav {
  display: none !important;
}

.trade-portal-root {
  width: min(720px, calc(100% - 1.5rem));
  margin: 0 auto 2.5rem;
  padding: 0.75rem 0 2rem;
}

.trade-portal-shell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.trade-portal-hero,
.trade-portal-card,
.trade-portal-item {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(197, 208, 218, 0.9);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  box-shadow: 0 10px 30px rgba(15, 35, 45, 0.06);
}

[data-theme="dark"] body.trade-portal-active {
  background:
    radial-gradient(1000px 480px at 0% 0%, rgba(80, 140, 160, 0.18), transparent 55%),
    linear-gradient(180deg, #0a141a 0%, #101c24 100%);
}

[data-theme="dark"] .trade-portal-hero,
[data-theme="dark"] .trade-portal-card,
[data-theme="dark"] .trade-portal-item {
  background: rgba(18, 28, 36, 0.92);
  border-color: rgba(70, 90, 105, 0.7);
}

.trade-portal-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #5b6b79);
  font-weight: 700;
}

.trade-portal-hero h2,
.trade-portal-message h2,
.trade-portal-item h3 {
  margin: 0;
  font-family: "Bricolage Grotesque", "Manrope", sans-serif;
  font-weight: 700;
  color: var(--text, #24303a);
}

.trade-portal-address,
.trade-portal-trade,
.trade-portal-hint,
.trade-portal-muted,
.trade-portal-desc {
  margin: 0.45rem 0 0;
  color: var(--text-muted, #5b6b79);
  line-height: 1.4;
}

.trade-portal-trade strong {
  color: var(--text, #24303a);
}

.trade-portal-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.trade-portal-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.trade-portal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.trade-portal-item .status-badge,
.trade-portal-item .priority-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.28rem 0.5rem;
  border-radius: 3px;
  line-height: 1.2;
}

.trade-portal-item .status-open { background: #f7ecec; color: #a13d3d; }
.trade-portal-item .status-in-progress { background: #fff3e0; color: #8a5a00; }
.trade-portal-item .status-ready-for-review { background: #e3ebf1; color: #3f5263; }
.trade-portal-item .status-complete { background: #e8f5e9; color: #2e6b3e; }
.trade-portal-item .status-deferred,
.trade-portal-item .status-n-a { background: #f4f7f9; color: #5b6b79; border: 1px solid #c5d0da; }
.trade-portal-item .priority-low { background: #f4f7f9; color: #5b6b79; border: 1px solid #c5d0da; }
.trade-portal-item .priority-medium { background: #e3ebf1; color: #3f5263; }
.trade-portal-item .priority-high { background: #fff3e0; color: #8a5a00; }
.trade-portal-item .priority-critical { background: #f7ecec; color: #a13d3d; }

.trade-portal-notes-block {
  margin-top: 0.75rem;
}

.trade-portal-notes-block h4 {
  margin: 0 0 0.25rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #5b6b79);
}

.trade-portal-notes {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Manrope", sans-serif;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text, #24303a);
  background: rgba(244, 247, 249, 0.7);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
}

.trade-portal-photos-block {
  margin-top: 0.75rem;
}

.trade-portal-photos-block h4 {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #5b6b79);
}

.trade-portal-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.trade-portal-photo {
  margin: 0;
  width: 5.5rem;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border, #c5d0da);
  background: var(--surface, #fff);
}

.trade-portal-photo img {
  display: block;
  width: 5.5rem;
  height: 5.5rem;
  object-fit: cover;
}

.trade-portal-photo figcaption {
  padding: 0.25rem 0.35rem;
  font-size: 0.62rem;
  line-height: 1.25;
  color: var(--text-muted, #5b6b79);
  max-height: 2.4rem;
  overflow: hidden;
}

.trade-portal-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.trade-portal-file-btn {
  cursor: pointer;
}

.trade-portal-photo-missing {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted, #5b6b79);
  font-style: italic;
}

.trade-portal-actions {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border, #c5d0da);
}

.trade-portal-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--text-muted, #5b6b79);
}

.trade-portal-field select,
.trade-portal-field textarea {
  border: 1px solid var(--border, #c5d0da);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  font: inherit;
  color: var(--text, #24303a);
  background: var(--surface, #fff);
}

.trade-portal-field textarea {
  min-height: 4rem;
  resize: vertical;
}

.trade-portal-item-status {
  margin: 0;
  font-size: 0.82rem;
  color: #2e6b3e;
}

.trade-portal-item-status.is-error {
  color: var(--danger, #a13d3d);
}

.trade-portal-message p {
  margin: 0.55rem 0 0;
  color: var(--text-muted, #5b6b79);
  line-height: 1.45;
}

@media (max-width: 640px) {
  .trade-portal-root {
    width: calc(100% - 1rem);
  }

  .trade-portal-item-head {
    flex-direction: column;
  }

  .trade-portal-badges {
    justify-content: flex-start;
  }
}
