/*
 * Growth Partner — company Overzicht tab, UX overhaul phase 3b.
 *
 * Spec: everything below the header in docs/ux-overhaul/mockup/Bedrijf.dc.html
 * (desktop) and mockup/M-Lead.dc.html (phone). Contracts: the Company show
 * section of docs/architecture/pages.md. Markup: companies/tabs/_overzicht.
 *
 * Desktop: .gp-split — reading material LEFT (.overzicht-main), the action
 * rail RIGHT (.overzicht-rail: Vastleggen, Kwalificatie, Contacten, Taken).
 * Stacked: ONE column, banner, then the AI analysis, then the rail (CSS
 * order, no duplicated markup).
 * The rail's four card titles must be on screen without scrolling at
 * 1440x900 (test/system/company_tabs_test.rb measures it), so the rail is
 * deliberately compact.
 *
 * Phone rules at the bottom of the file. Text colours via the --gp-* tokens.
 */

/* Specificity note: ux_components.css is served AFTER this file (alphabetical),
   so a rule here that restyles a .gp-* element is scoped under .overzicht to
   win over the component's own single-class rule. */

.overzicht { display: flex; flex-direction: column; gap: 16px; }

/* ── Urgent banner (UrgentLeads.urgent_since) ── green "punch", navy text,
   navy call button. Heads the left column on desktop. */
.overzicht .overzicht-urgent { padding: 10px 14px; font-size: 0.95rem; }
.overzicht-urgent-icon { display: inline-flex; }
.overzicht-urgent-icon svg { width: 18px; height: 18px; }
.overzicht-urgent-call { flex: none; }

/* ── Columns ── */
.overzicht .overzicht-layout { gap: 20px; }
.overzicht .overzicht-main { gap: 16px; }
.overzicht .overzicht-rail { gap: 12px; }
/* Pico gives section/article their own vertical margins; the column gap owns
   the rhythm here. */
.overzicht-main > *, .overzicht-rail > * { margin: 0; }
.overzicht-analysis > turbo-frame > article { margin-top: 0; }
.overzicht-split { margin-top: 0; }

/* Card titles: <h2 class="gp-eyebrow">. Pico styles headings; restate size. */
.overzicht h2.gp-eyebrow { font-size: 0.75rem; line-height: 1.2; }
.overzicht-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.overzicht-card-head .link-btn { margin: 0; font-size: 0.85rem; }

/* ── Rail cards ── compact padding so the four titles fit above the fold. */
.overzicht-rail > .gp-card { padding: 12px 16px; gap: 8px; }

/* Vastleggen: the shared comments/_composer, markup untouched. As in the
   mock-up the Gebeld|Notitie toggle sits on the title row: the form is
   display:contents (it still submits — display does not change form
   semantics), so its children join the card's grid; everything but the
   toggle spans the full width. The textarea is shorter in the rail and still
   resizes by hand; the "@naam" tip repeats the placeholder, so it goes. */
.overzicht-rail > .overzicht-capture { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.overzicht-capture > form { display: contents; }
.overzicht-capture > form > * { grid-column: 1 / -1; margin: 0; }
.overzicht-capture > form > .comment-kind { grid-column: 2; grid-row: 1; }
.overzicht-capture textarea { min-height: 0; height: 4.75rem; }
.overzicht-capture .pipeline-comment-tip { display: none; }
.overzicht-capture .pipeline-comment-actions { justify-content: flex-end; }

/* Kwalificatie: the former one-row action bar, restacked for the rail. The
   status control on its own row; Opvolging and Planning side by side below.
   The form reset in application.css (.action-group-body form) still applies —
   without it Pico's full-width <form> puts every button on its own line. */
.overzicht-qualify .action-bar {
  flex-wrap: wrap; justify-content: flex-start; align-items: flex-start; gap: 8px 18px;
  margin: 0; padding: 0; background: none; border: 0; border-radius: 0;
}
.overzicht-qualify .action-group {
  padding: 0; flex: 0 0 auto; flex-wrap: nowrap; align-items: flex-start;
}
.overzicht-qualify .action-group:first-child { flex-basis: 100%; }
.overzicht-qualify .action-group + .action-group { border-left: 0; }
.overzicht-qualify .action-group-body { flex-wrap: wrap; min-height: 0; }

/* Contacten quick list. */
.overzicht-contact-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.overzicht-contact { display: flex; align-items: center; gap: 8px; margin: 0; list-style: none; min-width: 0; }
.overzicht-contact-who { display: flex; flex-direction: column; line-height: 1.25; }
.overzicht-contact-who strong { color: var(--gp-ink); font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overzicht-contact-who small { color: var(--gp-body); font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overzicht-empty { margin: 0; color: var(--gp-body); font-size: 0.85rem; }
.overzicht-company-phone { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 0.85rem; color: var(--gp-body); }
.overzicht-company-phone strong { color: var(--gp-ink); }
/* Contacten zoeken entry point, in the card head beside "Alle contacten". */
.overzicht-card-tools { display: flex; align-items: center; gap: 10px; flex: none; }
.overzicht-finder-form { margin: 0; display: inline-flex; }
.overzicht-finder { gap: 6px; }

/* Taken: todos/_block is a Pico <article>; restyle it as a rail card. */
.overzicht-rail > .todos-section {
  padding: 14px 16px; background: #fff; box-shadow: none;
  border: 1px solid var(--gp-line); border-radius: 14px;
}
.overzicht-rail > .todos-section .card-header { margin-bottom: 0.5rem; }
.overzicht-rail .todo-list > li { list-style: none; }
.overzicht-rail .todo-empty { padding: 0.25rem 0 0.5rem; }
.overzicht-rail .todo-composer-title { min-width: 0; flex-basis: 100%; }

/* Tijdlijn. */
.overzicht-timeline .activity-feed { margin: 0; }

/* ── Stacked (rail can no longer sit beside a readable main column) ──
   Banner, then the AI analysis (its button above Vastleggen — Zeno,
   2026-11-17: on a phone it is the first thing he reaches for), then the
   rail, then the rest of the reading material. Breakpoint = where .gp-split would
   wrap anyway (520 + 320 + gap next to the sidebar). */
@media (max-width: 1100px) {
  /* One column. The main column dissolves (display:contents — a plain,
     unlabelled div, so nothing leaves the accessibility tree) so its banner
     and the analysis can go before the rail and the rest after it. */
  .overzicht .overzicht-layout { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 16px; }
  .overzicht-layout > .gp-split-wide { display: contents; }
  .overzicht-layout > .gp-split-rail { order: -1; flex-basis: auto; }
  .overzicht-layout .overzicht-analysis { order: -2; }
  .overzicht-layout .overzicht-urgent { order: -3; }
}

/* ── Phone rules ── */
@media (max-width: 768px) {
  .overzicht .overzicht-urgent { font-size: 0.9rem; }
  .overzicht .overzicht-urgent-call { width: 100%; }
  .overzicht-contact .gp-btn { min-width: 44px; }
}
