/* Minimal functional styling for the shared business-wing app.js shell.
   Placeholder pending Astra's own design pass -- structural/usable, not polished. */
:root { --accent: #ffcead; --accent-dark: #27190f; --bg: #0c0e12; --surface: #14171c; --line: #262b33; --text: #eef1f4; --muted: #93999f; }
* { box-sizing: border-box; }
/* Blanket safety net, checked at the top on purpose: several rules below set an explicit `display`
   on elements app.js also toggles via the `hidden` attribute (load-more, the signup org-name label,
   discard-confirm, ...) -- any author-level `display` beats the UA's own `[hidden]{display:none}`
   regardless of source order, so without this override those elements render even while "hidden"
   (caught live 2026-09-22: the load-more button stayed visible with zero more records to load,
   nextCursor was correctly null the whole time -- a CSS bug, not a backend/pagination one). One
   `!important` here is simpler and more robust than chasing every individual selector that sets
   `display`, including ones added later. */
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--accent); }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; color: var(--muted); margin: 0 0 6px; }
.fine { font-size: 12px; color: var(--muted); }
.button { display: inline-block; border-radius: 8px; padding: 10px 18px; font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 14px; }
.button.primary { background: var(--accent); color: var(--accent-dark); border-color: var(--accent); }
.button.secondary { background: transparent; }
.text-link, .quiet-link { background: none; border: 0; color: var(--accent); cursor: pointer; text-decoration: underline; font-size: 14px; }

.site-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.header-actions { display: flex; align-items: center; gap: 16px; }
.family summary { cursor: pointer; color: var(--muted); list-style: none; }
.family nav { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }

.discovery { max-width: 1000px; margin: 0 auto; padding: 40px 24px 80px; }
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 40px; line-height: 1.15; margin: 0 0 16px; }
.hero h1 em { color: var(--accent); font-style: normal; }
.lead { color: var(--muted); font-size: 16px; }
.actions { display: flex; gap: 16px; align-items: center; margin: 20px 0 10px; }
.hero-object { position: relative; aspect-ratio: 1; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.object-number { font-size: 48px; font-weight: 800; color: var(--accent); }
.object-mongoose { width: 48px; height: 48px; }
.object-caption { color: var(--muted); font-size: 13px; }
.object-chip { display: none; }
.orbit-one, .orbit-two, .object-grid { display: none; }

.benefits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 64px 0; }
.benefits article h2 { font-size: 18px; margin: 8px 0; }
.benefits article p { color: var(--muted); margin: 0; }

.journey ol { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.journey li h3 { margin: 0 0 6px; }
.journey li p { color: var(--muted); margin: 0; }

.closing { text-align: center; margin: 64px 0; }
.closing h2 { font-size: 28px; }
footer { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; padding-top: 24px; border-top: 1px solid var(--line); }

.auth-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; max-width: 900px; margin: 40px auto; padding: 0 24px; align-items: center; }
.auth-story img { margin-top: 16px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.auth-form input { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; color: var(--text); font-size: 14px; }
.form-error { color: #f3b6a7; font-size: 13px; margin: 0; min-height: 1em; }
.form-error:empty { display: none; }

.service-state { max-width: 480px; margin: 80px auto; text-align: center; }

.workspace { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { border-right: 1px solid var(--line); padding: 20px 16px; display: flex; flex-direction: column; gap: 16px; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item { text-align: left; background: none; border: 0; color: var(--muted); padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.nav-item.active { background: var(--surface); color: var(--text); }
.sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted); }

.workspace-main { padding: 24px 32px; overflow-y: auto; }
.workspace-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.workspace-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.workspace-heading h1 { margin: 0 0 4px; }
.workspace-heading p { color: var(--muted); margin: 0; }

.summary-row { display: flex; gap: 16px; margin-bottom: 20px; }
.summary-row article { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; flex: 1; }
.summary-row span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; }
.summary-row strong { font-size: 22px; }
.summary-row small { display: block; color: var(--muted); font-size: 11px; }

.list-toolbar { display: flex; gap: 10px; margin-bottom: 16px; }
.list-toolbar input, .list-toolbar select { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; color: var(--text); }
.list-toolbar input { flex: 1; }

.record-list { display: flex; flex-direction: column; gap: 8px; }
.record-card { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; text-align: left; cursor: pointer; color: var(--text); width: 100%; }
.record-mark { width: 28px; height: 28px; border-radius: 6px; background: var(--accent); color: var(--accent-dark); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11px; flex-shrink: 0; }
.record-main { flex: 1; }
.record-title { display: block; font-weight: 600; margin-bottom: 4px; }
.record-details { display: flex; gap: 16px; flex-wrap: wrap; }
.record-details small { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.stage { font-size: 11px; padding: 4px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.record-arrow { color: var(--muted); }

.empty-state { text-align: center; padding: 60px 20px; background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; }
.empty-symbol { width: 40px; height: 40px; border-radius: 10px; background: var(--accent); color: var(--accent-dark); display: flex; align-items: center; justify-content: center; font-weight: 700; margin: 0 auto 12px; }
.loading { text-align: center; color: var(--muted); padding: 40px; }

.workspace-note { display: flex; gap: 12px; margin-top: 24px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.note-marker { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-dark); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.workspace-note p { color: var(--muted); margin: 4px 0 0; font-size: 13px; }

.editor-dialog { border: 1px solid var(--line); border-radius: 16px; background: var(--bg); color: var(--text); padding: 0; width: min(560px, 92vw); max-height: 88vh; }
.editor-dialog::backdrop { background: #000a; }
.editor-heading { display: flex; justify-content: space-between; align-items: flex-start; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.close-button { background: none; border: 0; color: var(--muted); font-size: 20px; cursor: pointer; }
.editor-fields { display: grid; gap: 14px; padding: 20px 24px; }
.editor-fields label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.editor-fields label.wide { grid-column: 1 / -1; }
.editor-fields input, .editor-fields select, .editor-fields textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; color: var(--text); font: inherit; }
.editor-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); }
.stage-editor { display: flex; align-items: center; gap: 10px; padding: 0 24px 16px; }
.discard-confirm { padding: 12px 24px; background: #2a1a17; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 18px; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; z-index: 999; }
.toast.shown { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 780px) {
  .hero, .auth-layout, .benefits, .journey ol { grid-template-columns: 1fr; }
  .workspace { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar nav { flex-direction: row; }
  .sidebar-bottom { display: none; }
}

/* --- Read-only server panels in the record editor --- */
.record-panel { margin: 0 24px 16px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.record-panel h3 { margin: 0 0 8px; font-size: 16px; }
.record-panel .fine { margin: 6px 0 0; }
.panel-scroll { overflow-x: auto; margin: 4px 0; }
.record-panel table { border-collapse: collapse; width: 100%; font-size: 13px; }
.record-panel th, .record-panel td { text-align: left; vertical-align: top; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.record-panel th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.record-panel td:first-child { white-space: nowrap; }
.editor-fields input:disabled { opacity: .75; cursor: not-allowed; }
.editor-dialog { width: min(780px, 94vw); }
/* Wide tables scroll inside the panel instead of crushing their last column. */
.record-panel table { min-width: 760px; }
.record-panel td:last-child { min-width: 220px; }
.record-panel td:nth-child(2) { min-width: 150px; }
.stage-editor select { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font: inherit; min-width: 0; max-width: 100%; }
.stage-editor { flex-wrap: wrap; }
/* Headline's second half on its own line; the mongoose icon PNGs have opaque white corners (same fix as the six ventures). */
.hero h1 em, .auth-story h2 em { display: block; }
.brand img, .object-mongoose, .auth-story img { border-radius: 19%; }
/* Panel actions (e.g. retailer links) and the shown-once link field. */
.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.panel-result p { margin: 10px 0 4px; }
.link-field { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.link-field input { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: 13px/1.4 ui-monospace, monospace; width: 100%; }
/* --- Retailer portal (/portal.html) --- */
.portal-main { max-width: 1040px; margin: 0 auto; padding: 32px 16px 64px; }
.portal-main h1 { font-size: clamp(26px, 4vw, 38px); margin: 4px 0 6px; }
.portal-terms { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; white-space: pre-wrap; }
.portal-notice { min-height: 1.4em; color: var(--accent); }
.portal-table { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 14px; }
.portal-table th, .portal-table td { text-align: left; vertical-align: top; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.portal-table th { color: var(--muted); font-weight: 600; }
.portal-table input { width: 96px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px; font: inherit; }
.portal-line-error { display: block; font-size: 12px; margin-top: 4px; }
.portal-order { display: grid; gap: 12px; max-width: 460px; margin-top: 18px; }
.portal-order label { display: grid; gap: 4px; color: var(--muted); font-size: 13px; }
.portal-order input, .portal-order textarea { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font: inherit; }
.portal-orders { margin-top: 36px; }
.portal-orders li { margin: 6px 0; }

/* Current additions: heading actions, sidebar tools, the CSV import preview. */
/* Current's panels are 4-5 narrow columns: let them fit the dialog instead of Wholesale's 760px minimum. */
.record-panel table { min-width: 0; }
.record-panel td:last-child, .record-panel td:nth-child(2) { min-width: 0; }
.record-panel td:first-child { white-space: normal; }
.import-form { padding: 20px 24px; }
.import-form label { font-size: 13px; color: var(--muted); }
.import-form input, .import-form textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; color: var(--text); font: inherit; }
.import-form textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.import-result { padding: 0 24px 20px; }
.import-result table { border-collapse: collapse; width: 100%; font-size: 13px; min-width: 640px; }
.import-result th, .import-result td { text-align: left; vertical-align: top; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.import-result th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.heading-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.tool-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.nav-item.tool { font-size: 13px; color: var(--muted); }
.nav-item.tool:hover { color: var(--text); }
.import-form { display: grid; gap: 12px; }
.import-form label { display: grid; gap: 4px; }
.import-summary { margin: 12px 0 4px; }
.import-result table tr.import-invalid td { color: #ffb4a8; }
.import-result table tr.import-unchanged td { color: var(--muted); }
.import-done { font-weight: 600; }

/* Tender: the read-only share view and panel links. */
.shared-view { max-width: 46rem; margin: 0 auto; padding: 32px 16px 64px; }
.shared-view h1 { font-size: 30px; margin: 4px 0 8px; }
.shared-view h2 { margin-top: 32px; padding-bottom: 6px; border-bottom: 1px solid var(--line); font-size: 19px; }
.shared-view h3 { font-size: 16px; margin: 20px 0 4px; }
.shared-req p { margin: 6px 0; }
.shared-ev { font-size: 14px; color: var(--muted); }
.panel-link a { font-weight: 600; }

/* Relay: panel actions that collect a few fields first. */
.action-with-fields { display: grid; gap: 8px; width: 100%; }
.action-fields { display: grid; gap: 8px; }
.action-fields label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.action-fields input, .action-fields textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; color: var(--text); font: inherit; }
