/* ============================================================================
   Support Desk Manager — v5 cockpit re-skin (dashboard-v5 rollout, Customer
   lane S6)
   ----------------------------------------------------------------------------
   FORKED from ``renewal-cockpit.css`` / ``contract-v5.css`` / ``fpa-cockpit.css``
   so Support reads as a sibling of the Renewal + Legal + Finance cockpits —
   the founder's "единый формат с другими ролями" goal. Same ``.cv5`` chrome
   vocabulary (bleed · sub-bar · seg · wrap), the Customer petrol-green accent
   (``--customer`` = #0E8A72), and the bespoke work-core is the triage INBOX
   (the reused Tailwind facets / toolbar / board partials) framed by a desk KPI
   band.

   Loaded ONLY on Support v5 pages (behind ``settings.support_v5_enabled``), so
   it can never clash with the other cockpit stylesheets — no page loads two.

   House rules honoured:
     • General Sans everywhere (inherited from base.html <html>) — NO monospace.
     • Light theme only (dark mode is founder-vetoed) — no prefers-color-scheme.
     • CSP-safe: no @import of remote fonts; zero inline handlers.
     • DELIBERATELY no blanket ``.cv5 a`` / ``.cv5 button`` / ``.cv5 svg`` resets:
       the work-core reuses the shipped Tailwind partials verbatim, and a global
       anchor/button reset would clobber their utility colours (e.g. an active
       filter pill would render dark-on-dark). Every rule below is scoped to a
       ``.cv5-*`` component class instead.
   ============================================================================ */

.cv5.cv5-cs {
  /* Surface + ink — aligned to the app palette (base.html :root) but kept
     local so the dense cockpit reads a touch cooler than the marketing pages. */
  --cv5-bg: #F4F5F8;
  --cv5-card: #FFFFFF;
  --cv5-ink: #191C22;
  --cv5-ink2: #4A515C;
  --cv5-ink3: #868D99;
  --cv5-ink4: #AEB4BF;
  --cv5-line: #E5E8EE;
  --cv5-line-strong: #D2D7E0;

  /* Customer department band + action accent (design_direction.md). */
  --cv5-accent: #0E8A72;
  --cv5-accent-ink: #0B6F5C;
  --cv5-accent-soft: #E1F3EE;
  --cv5-accent-border: #B9E0D5;

  /* Risk / status palette. */
  --cv5-rose: #C0392B;
  --cv5-rose-soft: #FBEAE8;
  --cv5-rose-border: #F1C4BF;
  --cv5-amber: #B45309;
  --cv5-amber-soft: #FBF1E1;
  --cv5-amber-border: #EDD3A6;
  --cv5-emer: #0B845A;

  color: var(--cv5-ink);
  font-size: 14px;
  line-height: 1.55;
}

.cv5-cs .cv5-tnum { font-variant-numeric: tabular-nums; }

/* Full-bleed the cockpit inside app/base.html's padded <main> so the sub-bar
   and content span edge-to-edge like the sibling cockpits. */
.cv5-cs .cv5-bleed { margin: -2rem -1.25rem 0; }
@media (min-width: 768px) { .cv5-cs .cv5-bleed { margin: -2.5rem -2rem 0; } }
.cv5-cs .cv5-wrap { max-width: 1320px; margin: 0 auto; padding: 18px 22px 60px; }

/* ── Cockpit sub-bar (role + collapsed tab row) ──────────────────────────── */
.cv5-cs .cv5-sub { background: #fff; border-bottom: 1px solid var(--cv5-line); }
.cv5-cs .cv5-sub-in {
  max-width: 1320px; margin: 0 auto; padding: 0 22px;
  display: flex; align-items: center; gap: 2px; flex-wrap: wrap;
}
.cv5-cs .cv5-role {
  font-size: 12px; font-weight: 700; color: var(--cv5-accent-ink);
  padding-right: 14px; margin-right: 6px; border-right: 1px solid var(--cv5-line);
  display: flex; align-items: center; gap: 7px; white-space: nowrap;
}
.cv5-cs .cv5-role .b { width: 8px; height: 8px; border-radius: 2px; background: var(--cv5-accent); }
.cv5-cs .cv5-tab {
  font-size: 13.5px; font-weight: 600; color: var(--cv5-ink3);
  padding: 12px 13px; border-bottom: 2px solid transparent; margin-bottom: -1px;
  white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.cv5-cs .cv5-tab:hover { color: var(--cv5-ink); }
.cv5-cs .cv5-tab.on { color: var(--cv5-accent-ink); border-bottom-color: var(--cv5-accent); }
.cv5-cs .cv5-tab-util { margin-left: auto; color: var(--cv5-ink3); }
.cv5-cs .cv5-tab-badge {
  font-size: 10.5px; font-weight: 700; line-height: 1; border-radius: 999px;
  padding: 3px 7px; background: var(--cv5-accent-soft); color: var(--cv5-accent-ink);
  border: 1px solid var(--cv5-accent-border); font-variant-numeric: tabular-nums;
}

/* ── Trust segmented sub-control (the only nested level) ──────────────────── */
.cv5-cs .cv5-seg { display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 18px; }
.cv5-cs .cv5-seg a {
  font-size: 12.5px; font-weight: 600; color: var(--cv5-ink3); text-decoration: none;
  padding: 7px 15px; border: 1px solid var(--cv5-line-strong); border-right: none; white-space: nowrap;
}
.cv5-cs .cv5-seg a:first-child { border-radius: 7px 0 0 7px; }
.cv5-cs .cv5-seg a:last-child { border-right: 1px solid var(--cv5-line-strong); border-radius: 0 7px 7px 0; }
.cv5-cs .cv5-seg a:hover { color: var(--cv5-ink); }
.cv5-cs .cv5-seg a.on { background: var(--cv5-accent); color: #fff; border-color: var(--cv5-accent); }

/* ── Panel title ─────────────────────────────────────────────────────────── */
.cv5-cs .cv5-ptitle { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 2px 0 14px; flex-wrap: wrap; }
.cv5-cs .cv5-ptitle h1 { font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.cv5-cs .cv5-ptitle p { font-size: 12.5px; color: var(--cv5-ink3); margin-top: 4px; max-width: 640px; }

/* ── Desk KPI band ───────────────────────────────────────────────────────── */
.cv5-cs .cv5-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.cv5-cs .cv5-kpi { background: #fff; border: 1px solid var(--cv5-line); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.cv5-cs .cv5-kpi.risk { border-left: 3px solid var(--cv5-rose); }
.cv5-cs .cv5-kpi .l { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--cv5-ink3); font-weight: 700; display: flex; align-items: center; gap: 5px; }
.cv5-cs .cv5-kpi .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 7px; font-variant-numeric: tabular-nums; line-height: 1.05; }
.cv5-cs .cv5-kpi .v.abst { color: var(--cv5-ink4); font-weight: 600; font-size: 15px; letter-spacing: 0; }
.cv5-cs .cv5-kpi.risk .v { color: var(--cv5-rose); }
.cv5-cs .cv5-kpi .s { font-size: 11.5px; color: var(--cv5-ink3); margin-top: 5px; line-height: 1.4; }

/* Glossary term — dotted underline + CSS-only tooltip (hover / focus), no JS. */
.cv5-cs .cv5-gl { position: relative; border-bottom: 1px dotted var(--cv5-ink3); cursor: help; }
.cv5-cs .cv5-gl:focus { outline: none; }
.cv5-cs .cv5-gl .cv5-tip {
  position: absolute; bottom: calc(100% + 8px); left: 0;
  width: max-content; max-width: 240px; background: var(--cv5-ink); color: #fff;
  font-size: 11.5px; line-height: 1.5; font-weight: 400; text-transform: none; letter-spacing: 0;
  padding: 8px 11px; border-radius: 8px; box-shadow: 0 10px 28px -12px rgba(0,0,0,.55);
  opacity: 0; visibility: hidden; transition: opacity .12s, visibility .12s; z-index: 40; text-align: left; pointer-events: none;
}
.cv5-cs .cv5-gl:hover .cv5-tip, .cv5-cs .cv5-gl:focus .cv5-tip, .cv5-cs .cv5-gl:focus-within .cv5-tip { opacity: 1; visibility: visible; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .cv5-cs .cv5-kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .cv5-cs .cv5-kpis { grid-template-columns: 1fr; }
}

/* ── Pill-button contrast restore ────────────────────────────────────────────
   The header note above assumed "no page loads two" cockpit sheets — but the
   dashboard-v5 shell loads contract-v5.css on EVERY app page, and it ships
   blanket ``.cv5 a`` / ``.cv5 button`` resets (``color: inherit``,
   ``background: none``). Those (0,1,1) rules outrank Tailwind's single-class
   ``.text-paper`` / ``.bg-ink`` (0,1,0) on the reused inbox partials, so the
   solid "Review" / active-filter pills render dark-on-dark (invisible label).
   Re-assert the two utilities those pills rely on, scoped to this cockpit so it
   can never touch a sibling — ``.cv5-cs a.text-paper`` (0,2,1) beats the global
   reset (0,1,1). ``#141310`` == Tailwind ``ink``, ``#fff`` == ``paper``. */
.cv5-cs a.text-paper,
.cv5-cs button.text-paper,
.cv5-cs a.text-white,
.cv5-cs button.text-white { color: #fff; }
.cv5-cs a.bg-ink,
.cv5-cs button.bg-ink { background-color: #141310; }
