﻿/* BSDyno partner portal surface (task-49).
   Layered on top of styles.css + assets/conversion.css; only portal-specific
   components live here. Every block is single-column-safe at 390px. */

.p-page { display: block; }
.p-shell { max-width: 1120px; margin: 0 auto; }
.p-hero {
  padding: 34px 0 8px;
}
.p-hero h1 { margin: 6px 0 10px; font-size: clamp(1.6rem, 4.6vw, 2.5rem); line-height: 1.15; }
.p-lede { max-width: 760px; color: var(--ink-2, #46506b); font-size: 1.02rem; line-height: 1.62; }

.p-kpis {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  margin: 22px 0 8px;
}
.p-kpi {
  background: #fff; border: 1px solid var(--line, #e3e6f2); border-radius: 14px;
  padding: 16px 16px 14px; min-width: 0;
  box-shadow: 0 1px 2px rgba(11, 18, 32, .04);
}
.p-kpi-label {
  font-size: .72rem; letter-spacing: .09em; text-transform: uppercase;
  color: #6a738c; font-weight: 700; margin-bottom: 6px;
}
.p-kpi-value { font-size: 1.5rem; font-weight: 800; color: #0b1220; line-height: 1.15; word-break: break-word; }
.p-kpi-note { font-size: .78rem; color: #6a738c; margin-top: 4px; }

.p-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); margin-top: 22px; }
.p-grid.p-two { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
  .p-grid.p-two { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
}

.p-card {
  background: #fff; border: 1px solid var(--line, #e3e6f2); border-radius: 16px;
  padding: 20px; min-width: 0;
}
.p-card > h2 { margin: 0 0 6px; font-size: 1.12rem; }
.p-card > h3 { margin: 18px 0 8px; font-size: .98rem; }
.p-card-head {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  justify-content: space-between; margin-bottom: 12px;
}
.p-card-head h2 { margin: 0; font-size: 1.12rem; }
.p-sub { color: #5b6479; font-size: .9rem; line-height: 1.55; margin: 0 0 14px; }
.p-muted { color: #6a738c; font-size: .86rem; }
.p-hint { color: #5b6479; font-size: .82rem; line-height: 1.5; }
.p-note {
  border-left: 3px solid var(--blue, #1b1bff); background: #f5f6ff;
  padding: 10px 12px; border-radius: 0 10px 10px 0; font-size: .86rem;
  color: #37405a; line-height: 1.55; margin: 12px 0 0;
}
.p-note.is-warn { border-left-color: #b45309; background: #fff7ed; }
.p-note.is-ok { border-left-color: #15803d; background: #f0fdf4; }

/* tables ------------------------------------------------------------------ */
.p-table-wrap {
  width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line, #e3e6f2); border-radius: 12px; background: #fff;
}
table.p-table { width: 100%; border-collapse: collapse; font-size: .87rem; }
table.p-table th, table.p-table td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid #eef0f7;
  vertical-align: top; white-space: nowrap;
}
table.p-table th {
  font-size: .7rem; letter-spacing: .07em; text-transform: uppercase;
  color: #6a738c; background: #fafbff; position: sticky; top: 0; z-index: 1;
}
table.p-table td.p-wrap, table.p-table th.p-wrap { white-space: normal; min-width: 220px; }
table.p-table tbody tr:last-child td { border-bottom: 0; }
table.p-table tbody tr:hover td { background: #fbfcff; }
table.p-table .num { text-align: right; font-variant-numeric: tabular-nums; }
table.p-table .strong { font-weight: 700; color: #0b1220; }

.p-badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .02em;
  background: #eef0f7; color: #3b445c; white-space: nowrap;
}
.p-badge.ok { background: #dcfce7; color: #166534; }
.p-badge.warn { background: #fef3c7; color: #92400e; }
.p-badge.bad { background: #fee2e2; color: #991b1b; }
.p-badge.info { background: #e0e7ff; color: #3730a3; }
.p-badge.muted { background: #f1f2f6; color: #6a738c; }

/* forms ------------------------------------------------------------------- */
.p-form { display: grid; gap: 14px; margin-top: 6px; }
.p-form .p-row { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) {
  .p-form .p-row.p-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .p-form .p-row.p-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.p-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.p-field > label { font-size: .8rem; font-weight: 700; color: #3b445c; }
.p-field > label .req { color: #b91c1c; }
.p-field input, .p-field select, .p-field textarea {
  width: 100%; box-sizing: border-box; font: inherit; font-size: .92rem;
  padding: 10px 11px; border: 1px solid #d6dbeb; border-radius: 10px;
  background: #fff; color: #0b1220; min-height: 42px;
}
.p-field textarea { min-height: 96px; resize: vertical; }
.p-field input:focus, .p-field select:focus, .p-field textarea:focus {
  outline: 2px solid rgba(27, 27, 255, .35); outline-offset: 1px; border-color: #1b1bff;
}
.p-field .p-err { font-size: .78rem; color: #b91c1c; display: none; }
.p-field.has-error .p-err { display: block; }
.p-field.has-error input, .p-field.has-error select, .p-field.has-error textarea {
  border-color: #ef4444;
}
.p-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 4px; }
.p-actions .p-hint { flex: 1 1 220px; }
.p-check { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; line-height: 1.5; }
.p-check input { width: 18px; height: 18px; margin-top: 2px; flex: 0 0 auto; }

/* states ------------------------------------------------------------------ */
.p-state {
  border-radius: 12px; padding: 12px 14px; font-size: .88rem; line-height: 1.55;
  margin: 12px 0 0; border: 1px solid #e3e6f2; background: #f8f9fd; color: #37405a;
}
.p-state.ok { border-color: #bbf7d0; background: #f0fdf4; color: #14532d; }
.p-state.err { border-color: #fecaca; background: #fef2f2; color: #7f1d1d; }
.p-state.warn { border-color: #fde68a; background: #fffbeb; color: #78350f; }
.p-state[hidden] { display: none !important; }
.p-skel { height: 14px; border-radius: 6px; background: linear-gradient(90deg, #eef0f7, #f7f8fd, #eef0f7); background-size: 200% 100%; animation: p-shimmer 1.2s linear infinite; margin: 8px 0; }
@keyframes p-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .p-skel { animation: none; } }

/* checklist --------------------------------------------------------------- */
.p-checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.p-checkitem {
  display: grid; gap: 10px; grid-template-columns: 30px minmax(0, 1fr); align-items: start;
  border: 1px solid #e3e6f2; border-radius: 12px; padding: 13px 14px; background: #fff;
}
.p-checkitem.done { background: #f7fdf9; border-color: #bbf7d0; }
.p-checkmark {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: .8rem; font-weight: 800; background: #eef0f7; color: #6a738c;
}
.p-checkitem.done .p-checkmark { background: #16a34a; color: #fff; }
.p-checkitem h3 { margin: 0 0 4px; font-size: .95rem; }
.p-checkitem p { margin: 0; font-size: .85rem; color: #5b6479; line-height: 1.5; }
.p-progress { height: 10px; border-radius: 999px; background: #eef0f7; overflow: hidden; margin: 6px 0 4px; }
.p-progress > span { display: block; height: 100%; background: linear-gradient(90deg, #1b1bff, #6d28d9); border-radius: 999px; transition: width .25s ease; }

/* timeline (RMA history) -------------------------------------------------- */
.p-timeline { list-style: none; margin: 8px 0 0; padding: 0 0 0 14px; border-left: 2px solid #e3e6f2; display: grid; gap: 8px; }
.p-timeline li { position: relative; font-size: .82rem; color: #5b6479; }
.p-timeline li::before {
  content: ""; position: absolute; left: -20px; top: 5px; width: 8px; height: 8px;
  border-radius: 50%; background: #c7cbe0;
}
.p-timeline li:first-child::before { background: #1b1bff; }

/* links / actions --------------------------------------------------------- */
.p-links { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.p-link-card {
  display: block; padding: 14px; border: 1px solid #e3e6f2; border-radius: 12px;
  background: #fff; text-decoration: none; color: inherit; min-width: 0;
}
.p-link-card:hover { border-color: #1b1bff; box-shadow: 0 2px 10px rgba(27, 27, 255, .08); }
.p-link-card b { display: block; color: #0b1220; font-size: .94rem; margin-bottom: 3px; }
.p-link-card span { color: #5b6479; font-size: .82rem; line-height: 1.45; }
.p-row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* docs (API/EDI page) ----------------------------------------------------- */
.p-doc-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); margin-top: 20px; }
@media (min-width: 980px) { .p-doc-grid { grid-template-columns: minmax(0, 240px) minmax(0, 1fr); align-items: start; } }
.p-toc { position: static; }
@media (min-width: 980px) { .p-toc { position: sticky; top: 18px; } }
.p-toc ol { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: .86rem; }
.p-toc a { color: #37405a; text-decoration: none; }
.p-toc a:hover { color: #1b1bff; text-decoration: underline; }
.p-code {
  display: block; overflow-x: auto; background: #0b1220; color: #e6e9f5;
  border-radius: 12px; padding: 14px 16px; font-size: .8rem; line-height: 1.6;
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  margin: 10px 0 0; white-space: pre;
}
.p-code .c { color: #8b95b5; }
.p-doc h2 { margin: 30px 0 8px; font-size: 1.25rem; scroll-margin-top: 12px; }
.p-doc h3 { margin: 20px 0 6px; font-size: 1rem; }
.p-doc p, .p-doc li { font-size: .92rem; line-height: 1.62; color: #37405a; }
.p-doc ul { padding-left: 20px; }
.p-doc code {
  background: #f2f4fb; border-radius: 5px; padding: 1px 5px; font-size: .85em;
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* session chip in the utility bar ---------------------------------------- */
.u-user { display: inline-flex; gap: 6px; align-items: center; font-weight: 700; color: #1b1bff; }
.u-user .p-badge { font-weight: 700; }

/* print ------------------------------------------------------------------- */
@media print {
  .utility-bar, .site-header, .site-footer, .p-actions { display: none !important; }
  .p-card { border: 1px solid #ccc; }
}

.p-list { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 7px; font-size: .91rem; color: #37405a; line-height: 1.55; }
.p-list li { padding-left: 2px; }
.field label .req, .p-field label .req { color: #b91c1c; font-weight: 800; }
.p-list b { color: #0b1220; }