/* 05-screens.css — Screen-specific styles: wizard, credentials, recipe, request, audit log, health report, knowledge, statement, help.
   Part of the portal stylesheet; index.html loads the parts in order (01 to 12), so the cascade is
   the same as one file. */

/* Menu badges (waiting for action) */
.nav-badge { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--brand-primary); color: #fff; font-size: 11px; font-weight: 800; text-align: center; line-height: 18px; }
.nav-badge-error { background: var(--danger); }

/* New-customer wizard */
.wizard-steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 16px; flex-wrap: wrap; counter-reset: none; }
.wizard-steps li { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--muted); font-weight: 600; }
.wizard-steps li.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.wizard-steps li.done { color: var(--ok); border-color: var(--ok-border); background: var(--ok-bg); }
.wizard-step-number { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: currentColor; }
.wizard-step-number, .wizard-step-number svg { color: var(--surface); }
.wizard-step-number { font-size: 12px; }
.wizard-steps li .wizard-step-number { background: var(--muted); }
.wizard-steps li.active .wizard-step-number { background: var(--primary); }
.wizard-steps li.done .wizard-step-number { background: var(--ok); }
.wizard-step-number svg { width: 14px; height: 14px; }
.choice-card { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; flex: 1 1 220px; }
.choice-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.choice-card input { margin-top: 2px; }
.choice-card span { display: flex; flex-direction: column; gap: 2px; }
.choices + .form-grid { margin-top: 14px; }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix span { display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--line); border-right: 0; border-radius: var(--radius) 0 0 var(--radius); background: var(--theme-bg-mid); color: var(--muted); white-space: nowrap; font-size: 14px; }
.input-prefix input { border-radius: 0 var(--radius) var(--radius) 0; min-width: 0; flex: 1; }
.summary-list { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.summary-list dt { font-weight: 600; color: var(--muted); }
.summary-list dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .summary-list { grid-template-columns: 1fr; gap: 2px; }
  .summary-list dd { margin-bottom: 8px; }
  .input-prefix { flex-direction: column; }
  .input-prefix span { border-right: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; padding: 6px 10px; }
  .input-prefix input { border-radius: 0 0 var(--radius) var(--radius); }
}
.wizard-body h2 { margin-bottom: 12px; }
.wizard-body h3 { margin: 18px 0 4px; }

/* Icon buttons at the end of a table row */
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.row-actions-stack { flex-direction: column; align-items: flex-end; gap: 0; }
.row-actions .btn-icon { width: 34px; min-height: 34px; height: 34px; padding: 0; justify-content: center; }
.row-actions .btn-icon svg { width: 16px; height: 16px; }
td:has(> .row-actions) { width: 1%; white-space: nowrap; }

/* Access per website (customer page) */
.access-matrix th:not(:first-child), .access-matrix td:not(:first-child) { min-width: 150px; }
.access-matrix td:first-child { white-space: nowrap; }
.access-select { min-width: 140px; }
.access-select.has-access { border-color: var(--ok-border); background: var(--ok-bg); color: var(--ok); font-weight: 600; }

/* Code field with proposal (customer, website, username) */
.code-input { display: flex; gap: 6px; align-items: center; }
.code-input input { flex: 1; min-width: 0; }
.code-input .btn { flex: 0 0 auto; }
.code-status { display: block; min-height: 1.2em; font-size: 12px; margin-top: 2px; }
.code-status.ok { color: var(--ok); }
.code-status.error-text { color: var(--danger); }

/* Icons inside notices stay small */
.notice > svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; }

/* Small round (i) next to a heading; opens an explanation in a pop-up */
.info-dot { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; min-height: 0; padding: 0; margin-left: 6px; border-radius: 50%; border: 1px solid var(--info-border); background: var(--info-bg); color: var(--info); cursor: pointer; vertical-align: middle; }
.info-dot:hover { border-color: var(--info); }
.info-dot svg { width: 14px; height: 14px; }
.panel-heading h2 .info-dot svg { width: 14px; height: 14px; color: var(--info); }
.info-text p { margin: 0 0 8px; max-width: 560px; }

/* Credentials: result of "Testen" and the guides */
.secret-result { font-size: 13px; margin-top: 4px; max-width: 520px; }
.secret-result svg { width: 14px; height: 14px; vertical-align: -2px; }
.secret-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.help-guide { max-width: 680px; }
.help-steps { padding-left: 22px; margin: 8px 0 12px; }
.help-steps li { margin-bottom: 8px; line-height: 1.5; }
.check-info .check-icon { color: var(--warn); font-weight: 700; }

/* New portal version available: reload */
.update-banner { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--info-border); box-shadow: var(--shadow-float); color: var(--ink); max-width: calc(100vw - 32px); flex-wrap: wrap; }
.update-banner > svg { width: 18px; height: 18px; color: var(--info); flex: 0 0 auto; }

/* Project recipe: websiteai.json from the repository, read-only */
.recipe-info h3, .card > h3 { margin: 16px 0 6px; }
.recipe-repo { max-height: 340px; overflow: auto; }

/* Request: header with steps */
.request-head { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; box-shadow: var(--shadow-soft); }
.request-head-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.request-meta { margin: 0; font-size: 12px; color: var(--muted); }
.request-title { margin: 2px 0 0; font-size: 19px; }
.request-help { margin: 10px 0 0; font-size: 13px; }
.steps { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.step { border-top: 3px solid var(--line); padding-top: 6px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.step-label { font-weight: 600; font-size: 13px; }
.step-detail { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.step-done { border-top-color: var(--ok); }
.step-current { border-top-color: var(--primary); }
.step-current .step-label { color: var(--primary); }
.step-stopped { border-top-color: var(--danger); }
.step-stopped .step-label { color: var(--danger); }
.step-todo .step-label { color: var(--muted); }

/* Request: conversation as chat bubbles */
.chat { list-style: none; padding: 0; margin: 14px 0; display: flex; flex-direction: column; gap: 12px; }
.chat-row { display: flex; gap: 8px; align-items: flex-start; }
.chat-person { justify-content: flex-end; }
.chat-avatar { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; color: var(--primary); }
.chat-avatar svg { width: 16px; height: 16px; }
.chat-bubble { max-width: min(78%, 720px); border-radius: 14px; padding: 10px 14px; border: 1px solid var(--line); background: var(--surface); }
.chat-person .chat-bubble { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 20%, var(--line)); }
.chat-internal .chat-bubble { background: var(--warn-bg); border-color: var(--warn-border); }
.chat-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.chat-meta { margin-top: 6px; font-size: 11.5px; color: var(--muted); display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
@media (max-width: 640px) { .chat-bubble { max-width: 88%; } }

/* Request: what changed, and the folded timeline */
.request-changes h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 16px; }
.request-changes h2 svg { width: 18px; height: 18px; color: var(--primary); }
.changed-files { list-style: none; padding: 0; margin: 0 0 4px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.changed-files code { overflow-wrap: anywhere; }
.file-status { display: inline-block; min-width: 20px; margin-right: 8px; font-weight: 700; font-size: 12px; color: var(--info); }
.file-status-A { color: var(--ok); }
.file-status-D { color: var(--danger); }
.timeline { margin: 12px 0; font-size: 13px; }
.timeline summary { cursor: pointer; color: var(--muted); }
.timeline ol { list-style: none; padding: 8px 0 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.timeline li { display: flex; gap: 10px; color: var(--muted); }
.timeline-time { flex: 0 0 auto; min-width: 120px; }
.timeline li::before { content: "•"; flex: 0 0 auto; color: var(--muted); }
.timeline li.timeline-internal::before { color: var(--warn); }

/* Request: admin panel (runs, deployments, facts) */
.admin-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 4px 0 10px; font-size: 13px; }
.fact { display: inline-flex; align-items: center; gap: 5px; }
.fact svg { width: 14px; height: 14px; color: var(--muted); }
.ops-title { margin: 14px 0 6px; font-size: 14px; }
.ops { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.op { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; background: var(--surface); }
.op + .op { border-top: 1px solid var(--line); }
.op-icon { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--theme-bg-mid); color: var(--muted); }
.op-icon svg { width: 15px; height: 15px; }
.op-ok .op-icon { background: var(--ok-bg); color: var(--ok); }
.op-error .op-icon { background: var(--danger-bg); color: var(--danger); }
.op-busy .op-icon { background: var(--info-bg); color: var(--info); }
.op-main { min-width: 0; flex: 1; }
.op-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.op-detail { margin-top: 2px; font-size: 13px; overflow-wrap: anywhere; }
.op-error .op-detail { color: var(--danger); }
.op-meta { margin-top: 2px; font-size: 12px; color: var(--muted); }
.pill { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: var(--surface); }
.pill-ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-border); }
.pill-error { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-border); }
.pill-busy { color: var(--info); background: var(--info-bg); border-color: var(--info-border); }

/* Audit log: filters, days and readable rows */
.audit-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.audit-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; min-height: 0; }
.chip svg { width: 14px; height: 14px; color: var(--muted); }
.chip:hover { border-color: var(--primary); }
.chip-active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.chip-active svg { color: var(--primary); }
.chip-count { font-size: 11.5px; color: var(--muted); }
.audit-warning { display: inline-flex; align-items: center; gap: 5px; margin-left: 6px; font-size: 13px; color: var(--danger); }
.audit-warning svg { width: 15px; height: 15px; }
.audit-search { max-width: 280px; }
.audit-day h3 { margin: 18px 0 6px; font-size: 13px; text-transform: capitalize; color: var(--muted); }
.audit-list { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.audit-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: 14px; }
.audit-row + .audit-row { border-top: 1px solid var(--line); }
.audit-icon { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--theme-bg-mid); color: var(--muted); }
.audit-icon svg { width: 15px; height: 15px; }
.audit-auth .audit-icon { background: var(--info-bg); color: var(--info); }
.audit-requests .audit-icon { background: var(--primary-soft); color: var(--primary); }
.audit-customers .audit-icon { background: var(--ok-bg); color: var(--ok); }
.audit-users .audit-icon { background: var(--warn-bg); color: var(--warn); }
.audit-settings .audit-icon { background: var(--theme-bg-mid); color: var(--ink); }
.audit-problem .audit-icon { background: var(--danger-bg); color: var(--danger); }
.audit-problem .audit-text { color: var(--danger); }
.audit-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.audit-meta { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; font-size: 12px; color: var(--muted); }
.audit-ip { font-size: 11px; }
.auth-forgot { justify-self: center; }

/* Composer: templates, earlier files and planning */
.template-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.template-fields:empty { display: none; }
.template-fields { margin-bottom: 10px; }
.composer-media { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.composer-media > * { flex: 1 1 280px; }
.media-library { display: grid; gap: 6px; justify-items: start; }
.composer-schedule { margin-top: 10px; }
.composer-schedule summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--primary); font-weight: 650; }
.composer-schedule summary svg { width: 16px; height: 16px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; max-height: 60vh; overflow: auto; }
.media-tile { position: relative; display: grid; gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.media-tile:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.media-tile input { position: absolute; top: 10px; left: 10px; }
.media-tile img, .media-tile-icon { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: var(--theme-bg-mid); display: grid; place-items: center; }
.media-tile-name { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-tile-date { font-size: 11px; color: var(--muted); }

/* Request: planning line and before/after */
.request-plan { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 12px; border-radius: var(--radius); background: var(--info-bg); color: var(--info); font-size: 14px; }
.request-plan svg { width: 16px; height: 16px; }
.request-plan .btn { margin-left: auto; }
.compare-toolbar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; margin-bottom: 12px; }
.compare-page h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 14px 0 8px; }
.compare-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.compare-single { display: grid; }
.compare-shot { margin: 0; display: grid; gap: 4px; }
.compare-shot figcaption { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.compare-shot a { display: block; max-height: 640px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #ffffff; }
.compare-shot img { display: block; width: 100%; height: auto; }
@media (max-width: 720px) { .compare-pair { grid-template-columns: 1fr; } }

/* Health report */
.health-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.health-head p { margin: 2px 0 0; }
.health-score { flex: 0 0 auto; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 800; border: 3px solid currentColor; }
.score-good { color: var(--ok); background: var(--ok-bg); }
.score-fair { color: var(--warn); background: var(--warn-bg); }
.score-poor { color: var(--danger); background: var(--danger-bg); }
.health-issues { list-style: none; padding: 0; margin: 0 0 12px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.health-issue { display: flex; align-items: flex-start; gap: 8px; padding: 8px 12px; font-size: 14px; }
.health-issue + .health-issue { border-top: 1px solid var(--line); }
.health-issue input { margin-top: 3px; }
.health-spacer { width: 13px; flex: 0 0 auto; }
.health-icon svg { width: 16px; height: 16px; margin-top: 2px; }
.health-error .health-icon { color: var(--danger); }
.health-warning .health-icon { color: var(--warn); }
.health-info .health-icon { color: var(--info); }
.health-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.health-detail { display: block; font-size: 12px; color: var(--muted); }
.health-outside { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; font-weight: 650; color: var(--info); }
.health-outside svg { width: 14px; height: 14px; }

/* Project knowledge */
.knowledge { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.knowledge-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.knowledge-suggested { border-style: dashed; background: var(--info-bg); }
.knowledge-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* Template editor */
.template-field-rows { display: grid; gap: 6px; }
.template-field-row { display: grid; grid-template-columns: 1fr 1.6fr 1fr auto auto; gap: 6px; align-items: center; }
@media (max-width: 720px) { .template-field-row { grid-template-columns: 1fr 1fr; } }

/* Monthly statement (printable) */
.statement { max-width: 900px; }
.statement-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.statement-logo { height: auto; max-width: 240px; }
.statement-to { margin-bottom: 18px; line-height: 1.5; }
.statement-totals { margin: 18px 0 8px auto; min-width: 320px; border-collapse: collapse; }
.statement-totals td { padding: 4px 8px; }
.statement-totals td:last-child { text-align: right; white-space: nowrap; }
.statement-sum td { border-top: 1px solid var(--line); font-weight: 700; }
@media print {
  .sidebar, .topbar, .page-actions, #toasts, .update-banner, .mobile-appbar, .mobile-nav-scrim, .skip-link { display: none !important; }
  body { background: #ffffff !important; }
  main, #app, .view { margin: 0 !important; padding: 0 !important; }
  .panel, .statement { border: none !important; box-shadow: none !important; }
}

/* In-app help: button in the top bar and a slide-over panel on the right */
.help-button[hidden] { display: none; }
.help-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 90; width: min(460px, 100vw); display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line); box-shadow: -18px 0 40px rgba(17, 20, 24, 0.14); }
.help-panel[hidden] { display: none; }
.help-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.help-bar-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--primary); }
.help-bar-title svg { width: 18px; height: 18px; }
.help-body { flex: 1; overflow-y: auto; padding: 16px 20px 32px; line-height: 1.55; }
.help-body h2 { font-size: 20px; margin: 0 0 6px; }
.help-intro { color: var(--muted); margin: 0 0 14px; }
.help-section { margin-top: 18px; }
.help-section h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 0 0 6px; }
.help-section p { margin: 6px 0; }
.help-list, .help-steps { margin: 6px 0; padding-left: 20px; }
.help-steps li, .help-list li { margin: 3px 0; }
.help-terms { margin: 8px 0; display: grid; gap: 6px; }
.help-terms div { display: grid; grid-template-columns: minmax(110px, 34%) 1fr; gap: 10px; }
.help-terms dt { font-weight: 700; }
.help-terms dd { margin: 0; }
.help-note { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: var(--radius); background: var(--info-bg); color: var(--info); }
.help-note svg { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 3px; }
.help-figure { margin: 10px 0; }
.help-figure img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #ffffff; }
.help-figure figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }
.help-admin { padding: 10px 12px; border: 1px dashed var(--line); border-radius: var(--radius); }
@media (max-width: 720px) {
  .help-button span { display: none; }
  .help-terms div { grid-template-columns: 1fr; gap: 0; }
}
@media print { .help-panel, .help-button { display: none !important; } }

/* ===== 0.10: experience ===== */
:root {
  --surface-2: #f7f8f9;
  --chart-1: #b01c28;
  --chart-grid: #eceef1;
  --chart-text: var(--muted);
  --skeleton: #eceef1;
  --skeleton-shine: #f6f7f8;
}
