/* ===================================================================
   Hermes Virtual Office — Styles (adattato da globals.css originale)
   =================================================================== */

:root {
  --bg: #0f1418;
  --panel: #131b21ee;
  --line: #26333d;
  --text: #dfe7ec;
  --muted: #8fa2ae;
  --green: #46c08a;
  --amber: #f0b556;
  --red: #e5726f;
  --z-side: 15;
  --z-topbar: 20;
  --z-sheet: 45;
  --z-full: 50;
  --z-dialog: 55;
  --z-banner: 70;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
}

code, pre, kbd { font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace; }

/* ============================================================ TOP BAR */
.vp-topbar {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: var(--z-topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #0b1015f2, #0b1015cc 70%, transparent);
  backdrop-filter: blur(6px);
}
.vp-logo { font-weight: 700; letter-spacing: 0.02em; background: linear-gradient(90deg, #7be3b0, #6fb8e8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.vp-topbar-status { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.vp-topbar-nav { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.vp-topbar-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.vp-topbar-view { display: flex; align-items: center; }

/* ============================================================ BUTTONS */
.vp-btn {
  background: var(--green); color: #08130d; border: 0; border-radius: 8px;
  padding: 7px 12px; font-weight: 650; font-size: 13px; cursor: pointer;
  transition: opacity .12s, background .12s;
}
.vp-btn:disabled { opacity: 0.42; cursor: not-allowed; }
.vp-btn:hover:not(:disabled) { opacity: 0.9; }
.vp-btn-ghost { background: #18222a; color: var(--text); border: 1px solid var(--line); }
.vp-btn-warn { background: var(--red); color: #1b0908; }
.vp-btn-danger { background: #6b2020; border-color: #b04a4a; color: #ffe0e0; }
.vp-btn-armed { background: #6b2020 !important; border-color: #b04a4a !important; color: #ffe0e0 !important; }

.vp-seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.vp-seg button { background: #141c22; color: var(--muted); border: 0; padding: 7px 12px; cursor: pointer; font: inherit; font-size: 12.5px; }
.vp-seg button.on { background: var(--green); color: #08130d; font-weight: 650; }

.vp-x { background: transparent; border: 0; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 4px; }
.vp-x:hover { color: var(--text); }

/* ============================================================ STAGE */
.vp-stage { position: absolute; inset: 0; }
#officeCanvas, #spriteCanvas { width: 100%; height: 100%; display: block; }

/* ============================================================ PANELS */
.vp-panel {
  position: absolute;
  top: 58px;
  bottom: 12px;
  width: min(420px, 40vw);
  z-index: var(--z-side);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  overflow: hidden;
}
.vp-panel.left-0 { left: 12px; }
.vp-panel.right-0 { right: 12px; }
.vp-panel.wide { width: min(880px, calc(100vw - 24px)); }
/* Il pannello Provider deve restare utilizzabile sopra la toolbar 3D (z-index 100) */
#panelProvider { z-index: 110; }
.vp-panel-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.vp-panel-head h2 { margin: 0; font-size: 13px; font-weight: 650; flex: 1; }
.vp-pad { padding: 12px; overflow-y: auto; flex: 1; }

/* ============================================================ FORM INPUTS */
.vp-input, textarea, select {
  background: #0f161b; border: 1px solid #34424c; border-radius: 8px;
  color: var(--text); font: inherit; font-size: 13px; padding: 8px 9px;
  width: 100%; box-sizing: border-box;
}
.vp-input:focus, textarea:focus, select:focus { outline: none; border-color: #3c5a4a; }
textarea { min-height: calc(2lh + 18px); resize: vertical; }

.vp-sub { font-size: 10px; letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase; }
.vp-muted { color: var(--muted); font-size: 12.5px; }
.vp-err { color: var(--red); font-size: 12.5px; }
.vp-warn { color: var(--amber); }
.vp-note { background: #1b2a22; border: 1px solid #2f5340; border-radius: 8px; padding: 8px 10px; font-size: 12.5px; }

/* ============================================================ AGENT ROWS */
.agent-row {
  display: flex; flex-direction: column; gap: 7px;
  padding: 8px 9px; border-radius: 7px;
  border: 1px solid #2f4a5a88; background: #16232bcc;
}
.agent-row.off { opacity: 0.72; }
.agent-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.agent-meta b { font: 600 12px/1.2 ui-sans-serif, system-ui, sans-serif; color: #e8f6f0; }
.agent-meta i { font: 400 10px/1.2 ui-monospace, monospace; color: #7f9dad; font-style: normal; }
.agent-model { display: flex; align-items: center; gap: 6px; }
.agent-model .vp-input { flex: 1 1 auto; min-width: 0; font-size: 11px; padding: 5px 7px; }

/* ============================================================ TASK CARDS */
.task-card {
  background: #17222b; border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 9px; cursor: pointer; transition: border-color .12s;
}
.task-card:hover { border-color: #3c5a4a; }
.task-title { font-size: 12.5px; line-height: 1.35; }
.task-meta {
  display: flex; justify-content: space-between; align-items: center;
  gap: 6px; margin-top: 6px; font-size: 10.5px; color: var(--muted);
}
.vp-chip {
  background: #1f2f28; border-radius: 6px; padding: 2px 6px; color: #9fd8bb;
  font-size: 9px; text-transform: uppercase;
}
.vp-chip-status-todo { border-left: 3px solid #87949e; }
.vp-chip-status-triage { border-left: 3px solid #6fb8e8; }
.vp-chip-status-ready { border-left: 3px solid #58d2f0; }
.vp-chip-status-scheduled { border-left: 3px solid #a8d8ea; }
.vp-chip-status-running { border-left: 3px solid #46c08a; }
.vp-chip-status-review { border-left: 3px solid #f0b556; }
.vp-chip-status-blocked { border-left: 3px solid #e5726f; }
.vp-chip-status-done { border-left: 3px solid #87949e; }
.vp-chip-status-archived { border-left: 3px solid #5a5f66; opacity: 0.6; }
.vp-chip.status-ok { background: #1d2f3d; color: #46c08a; border-left: 3px solid #46c08a; }
.vp-chip.status-error { background: #2d1b1b; color: #ff9a9a; border-left: 3px solid #ff6b6b; }
.vp-chip.status-pending { background: #2d2a1b; color: #f0b556; border-left: 3px solid #f0b556; }
/* Provider valido ma bloccato per credito esaurito: non e' un errore
   tecnico, serve una ricarica (colore ambra distinto dal rosso errori). */
.vp-chip.status-credit { background: #33291b; color: #ffc978; border-left: 3px solid #e8a33d; }
.vp-errtext.status-credit { color: #ffc978; }
/* Provider bloccato da un'impostazione del provider (es. modalita' ZDR di
   BazaarLink): serve un intervento nelle impostazioni, non denaro. */
.vp-chip.status-blocked { background: #2b2333; color: #cbb0ff; border-left: 3px solid #9b6dff; }
.vp-errtext.status-blocked { color: #cbb0ff; }
/* Badge chiave in modalita' zero-data-retention */
.vp-badge.zdr { background: #2b2333; color: #cbb0ff; border: 1px solid #6f4fb0; margin-left: 4px; }
.vp-btn-ghost.danger { background: #2d1b1b; border-color: #b04a4a; color: #ffe0e0; }
.vp-btn-ghost.danger:hover { background: #3a2222; border-color: #ff6b6b; }

/* ============================================================ PROVIDER PANEL */
.vp-provider-summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 12px; margin-bottom: 12px;
  background: #111a21; border: 1px solid #26333d; border-radius: 8px;
}
.vp-chip-free { background: #17301f; color: #7be3b0; border-left: 3px solid #46c08a; }
/* ── Categorie provider ───────────────────────────────────────── */
.vp-cat-filters {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px;
}
.vp-cat-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 20px; cursor: pointer;
  background: #111a21; border: 1px solid #26333d; color: #9db2bf;
  font: inherit; font-size: 11.5px; line-height: 1.3;
  font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
  transition: background .15s, border-color .15s, color .15s;
}
.vp-cat-chip:hover { border-color: #3c5a4a; color: #cfe3ea; }
.vp-cat-chip.active {
  background: #16302a; border-color: #46c08a; color: #9ff0c8;
}
.vp-cat-n {
  font-family: 'JetBrains Mono', Consolas, monospace; font-size: 10px;
  background: #0d1419; border: 1px solid #26333d; border-radius: 10px;
  padding: 0 6px; color: #7be3b0;
}
.vp-cat-chip.active .vp-cat-n { border-color: #46c08a; }
.vp-prov-search {
  width: 100%; margin-bottom: 10px;
  background: #0b1218; border: 1px solid #26333d; border-radius: 8px;
  padding: 8px 10px; color: var(--text); font: inherit; font-size: 12.5px;
}
.vp-prov-search:focus { outline: none; border-color: #3c5a4a; }
.vp-cat-group + .vp-cat-group .vp-cat-head td { border-top: 2px solid #26333d; }
.vp-cat-head td {
  position: sticky; top: 31px; z-index: 1;
  background: #0f171d; border-bottom: 1px solid #26333d;
  padding: 9px 10px !important;
}
.vp-cat-title {
  font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
  color: #cfe3ea; text-transform: uppercase;
}
.vp-cat-meta {
  margin-left: 10px; font-size: 10.5px; color: #5a7a8a;
  font-family: 'JetBrains Mono', Consolas, monospace;
}
.vp-cat-actions { float: right; white-space: nowrap; }
.vp-cat-actions .vp-btn { margin-left: 4px; padding: 3px 7px; font-size: 11px; line-height: 1; }
.vp-table-wrap {
  overflow-x: auto; border: 1px solid #26333d; border-radius: 8px;
  background: #0d1419; margin-bottom: 16px;
}
.vp-provider-table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 820px; table-layout: fixed; }
.vp-provider-table th {
  position: sticky; top: 0; z-index: 2;
  text-align: left; padding: 9px 8px; font-size: 10px; letter-spacing: .06em;
  text-transform: uppercase; color: #7be3b0;
  background: #121b22; border-bottom: 2px solid #26333d; white-space: nowrap;
}
.vp-provider-table th:nth-child(1) { width: 145px; }
.vp-provider-table th:nth-child(2) { width: 215px; }
.vp-provider-table th:nth-child(3) { width: 100px; }
.vp-provider-table th:nth-child(4) { width: 140px; }
.vp-provider-table th:nth-child(5) { width: 100px; }
.vp-provider-table th:nth-child(6) { width: 152px; }
.vp-provider-table td { padding: 8px; border-bottom: 1px solid #1c262e; vertical-align: top; color: #c8d8e0; }
.vp-provider-table tr:hover td { background: #121b22; }
.vp-provider-table small { color: #5a7a8a; font-size: 10px; }
.vp-endpoint { font-family: 'JetBrains Mono', Consolas, monospace; font-size: 10.5px; word-break: break-all; color: #8fa2ae; }
.vp-keycell { font-family: 'JetBrains Mono', Consolas, monospace; font-size: 10.5px; word-break: break-all; }
.vp-errtext {
  color: #ff9a9a !important; display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
  max-width: 220px; word-break: break-word; margin-top: 3px;
}
.vp-actions { white-space: nowrap; }
.vp-actions .vp-btn { margin: 0 2px 0 0; padding: 4px 6px; font-size: 12px; line-height: 1; }
.vp-badge {
  display: inline-block; font-size: 8px; text-transform: uppercase; letter-spacing: .08em;
  padding: 1px 5px; border-radius: 8px; margin-left: 4px; vertical-align: middle;
}
.vp-badge.preset { background: #17301f; color: #46c08a; }
.vp-badge.custom { background: #33291a; color: #f0b556; }
.vp-freebox {
  margin-bottom: 10px; padding: 10px 12px;
  background: #111a21; border: 1px solid #26333d; border-radius: 8px;
}
.vp-freebox strong { color: #7be3b0; }
.vp-freebox small { color: #5a7a8a; margin-left: 6px; }
.vp-chips { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 5px; }
.vp-chips .vp-chip { font-size: 10px; }
.vp-provider-form {
  margin-top: 16px; padding: 14px;
  border: 1px solid #26333d; border-radius: 8px; background: #111a21;
}
.vp-provider-form h4 { margin: 0 0 12px; color: #7be3b0; font-size: 13px; }
.vp-form-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px;
}
.vp-form-grid label { display: block; font-size: 10px; color: #5a7a8a; margin-bottom: 4px; }
.vp-form-grid input, .vp-form-grid select {
  width: 100%; padding: 7px 8px; font-size: 12px;
  background: #0d1419; border: 1px solid #26333d; border-radius: 4px; color: #c8d8e0;
}
.vp-form-grid input:focus, .vp-form-grid select:focus { outline: none; border-color: #46c08a; }
.vp-form-actions { margin-top: 12px; text-align: right; }
@media (max-width: 640px) {
  .vp-form-grid { grid-template-columns: 1fr; }
  .vp-panel.wide { width: min(420px, calc(100vw - 18px)); }
  .vp-provider-table { min-width: 520px; }
  .vp-provider-table th:nth-child(3), .vp-provider-table td:nth-child(3) { display: none; }
}

/* ============================================================ KANBAN 2D */
.vp-k2d { display: flex; flex-direction: column; height: 100%; overflow-x: auto; }
.vp-k2d-grid {
  display: grid; grid-template-columns: repeat(7, minmax(280px, 1fr));
  gap: 12px; padding: 12px; min-width: 1050px; align-items: start;
}
.vp-col {
  background: #121b22; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px; min-height: 260px; display: flex; flex-direction: column;
}
.vp-col-head { display: flex; justify-content: space-between; font-size: 10px; letter-spacing: 0.12em; color: var(--muted); padding: 2px 4px 8px; }
.vp-count { color: var(--text); font-weight: 700; }
.vp-empty { color: #43535e; font-size: 12px; text-align: center; padding: 12px 0; flex: 1; }

/* ============================================================ KANBAN FULL (MODAL) */
.vp-full { position: fixed; inset: 0; z-index: var(--z-full); display: flex; align-items: center; justify-content: center; padding: 16px; }
.vp-full-card { display: flex; flex-direction: column; min-height: 0; overflow: hidden; outline: none; }
.vp-full-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; }
.vp-full-title { flex: 1; min-width: 0; }
.vp-full-title h2 { margin: 0; }
.vp-full-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.vp-full-x { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0; color: inherit; cursor: pointer; }
.vp-full-vp { width: min(768px, 100%); max-height: 88vh; background: #101820; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 60px #000a; }
.vp-full-vp.tall { height: min(88vh, 860px); }
.vp-full-vp > .vp-full-head { padding: 10px 12px 10px 16px; }
.vp-full-vp .vp-full-x { color: var(--muted); margin: -8px -6px -8px 0; }
.vp-full-vp > .vp-full-body.vp-pad { padding: 16px; }

.vp-board-title { font: 700 15px/1 ui-sans-serif, system-ui, sans-serif; letter-spacing: 0.18em; color: #cdeedd; text-shadow: 0 0 12px #34d39988; white-space: nowrap; }
.vp-board-col { font: 700 10px/1 ui-monospace, monospace; letter-spacing: 0.14em; color: #8fd8b6; background: #0d2b2088; border: 1px solid #2c6b5188; border-radius: 6px; padding: 3px 7px; white-space: nowrap; }
.vp-kanban-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.vp-kanban-search { background: #0b1218; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; color: var(--text); font: inherit; min-width: 220px; }
.vp-board-kanban { overflow-x: auto; padding-bottom: 6px; }

.vp-board-cards { position: relative; width: 0 !important; height: 0 !important; overflow: visible; }
.vp-board-cols { pointer-events: none; display: flex; flex-direction: column; gap: 5px; }
.vp-board-colheads, .vp-board-cols-row { display: flex; gap: 6px; align-items: flex-start; }
.vp-board-colheads > .vp-board-col { flex: 1 1 0; min-width: 0; text-align: center; }
.vp-board-cards-col {
  flex: 1 1 0; min-width: 0; max-height: 210px; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; gap: 4px; padding-right: 2px; pointer-events: auto;
  scrollbar-width: thin;
}
.vp-board-cards-col::-webkit-scrollbar { width: 5px; }
.vp-board-cards-col::-webkit-scrollbar-thumb { background: #3f8f74; border-radius: 3px; }
.vp-board-card {
  font: 500 10px/1.25 ui-sans-serif, system-ui, sans-serif; text-align: left; color: #e8f6f0;
  background: #15495ce6; border: 1px solid #2f7f9cab; border-left: 3px solid #5fd0a6;
  border-radius: 4px; padding: 3px 5px; cursor: pointer; flex: 0 0 auto;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.vp-board-card:hover { background: #1d6883f2; border-color: #8fe8c6; }
.vp-board-card[data-status='done'] { border-left-color: #87949e; }
.vp-board-card[data-status='review'] { border-left-color: #f0b556; }
.vp-board-card[data-status='blocked'] { border-left-color: #e5726f; }
.vp-board-card[data-status='running'] { border-left-color: #58d2f0; }
.vp-board-card[data-status='archived'] { opacity: 0.58; border-left-color: #87949e; }
.vp-board-empty { font-size: 9px; color: #4d7f6f; text-align: center; padding: 3px 0; }

/* ============================================================ MEETING */
.vp-meeting-row {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; text-align: left; padding: 8px 10px; border-radius: 7px;
  border: 1px solid #2f4a5a88; background: #16232bcc; cursor: pointer;
  transition: background .12s, border-color .12s;
}
.vp-meeting-row:hover { background: #1e3542ee; border-color: #4b7f9a; }
.vp-meeting-row.on { border-color: #44c08a; }
.vp-meeting-row b { font: 600 12px/1.3 ui-sans-serif, system-ui, sans-serif; color: #e8f6f0; }
.vp-meeting-row i { font: 400 10px/1.3 ui-monospace, monospace; color: #7f9dad; font-style: normal; }
.vp-live { color: #44c08a; animation: vp-pulse 1.4s ease-in-out infinite; }
@keyframes vp-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ============================================================ CRON */
.vp-cron-card { display: flex; flex-direction: column; gap: 4px; padding: 9px 10px; border-radius: 8px; border: 1px solid #2f4a5a88; background: #16232bcc; }
.vp-cron-card.on { border-color: #2c6b5188; }
.vp-cron-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vp-cron-top b { font: 600 12px/1.2 ui-sans-serif, system-ui, sans-serif; color: #e8f6f0; }
.vp-cron-state { font: 700 9px/1 ui-monospace, monospace; letter-spacing: 0.06em; padding: 2px 5px; border-radius: 4px; text-transform: uppercase; }
.vp-cron-state.on { color: #8fe8c6; background: #10302866; border: 1px solid #2c6b51; }
.vp-cron-state.off { color: #9fb0bd; background: #1b2a3366; border: 1px solid #35485a; }
.vp-cron-sched { font: 500 11px/1.2 ui-monospace, monospace; font-style: normal; color: #7ab8ff; }
.vp-cron-meta { display: flex; flex-wrap: wrap; gap: 8px; font: 400 10px/1.2 ui-monospace, monospace; color: #7f9dad; }
.vp-cron-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.vp-cron-actions .vp-btn { font-size: 10px; padding: 4px 8px; }
.vp-cron-run { display: flex; align-items: center; gap: 8px; font: 400 10px/1.2 ui-monospace, monospace; color: #7f9dad; padding: 3px 2px; }

/* ============================================================ CHAT */
.vp-chat .vp-chat-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.vp-chat-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.vp-chat-back { background: none; border: none; color: #9fd8bb; cursor: pointer; font-size: 17px; line-height: 1; padding: 0 2px; }
.vp-chat-head-name { display: flex; flex-direction: column; min-width: 0; }
.vp-chat-head-name b { font-size: 13px; }
.vp-chat-head-name i { font-size: 10px; color: var(--muted); font-style: normal; }
.vp-chat-av { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 600 12px/1 ui-sans-serif, system-ui, sans-serif; color: #eaf2f7; }
.vp-chat-row { display: flex; align-items: center; gap: 10px; padding: 9px 8px; width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid #1b2731; cursor: pointer; }
.vp-chat-row:hover:not(:disabled) { background: #16222b; }
.vp-chat-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.vp-chat-row-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.vp-chat-row-top b { font-size: 12.5px; color: #d6e8de; }
.vp-chat-row-top i { font-size: 9.5px; color: #5f7a8a; font-style: normal; }
.vp-chat-row-sub { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-chat-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 4px 2px; background-image: radial-gradient(#1a242c 1px, transparent 1px); background-size: 14px 14px; border-radius: 8px; }
.vp-chat-empty { margin: auto; text-align: center; font-size: 12px; color: #b9cbd6; line-height: 1.6; padding: 20px 12px; }
.vp-msg { max-width: 84%; border-radius: 12px; padding: 7px 10px; font: 400 12px/1.45 ui-sans-serif, system-ui, sans-serif; overflow-wrap: anywhere; white-space: pre-wrap; }
.vp-msg.user { align-self: flex-end; background: #1f5c46; color: #eafaf1; border-bottom-right-radius: 3px; }
.vp-msg.assistant { align-self: flex-start; background: #1d2b35; color: #d3e2ec; border-bottom-left-radius: 3px; }
.vp-msg-time { font: 400 9px/1 ui-monospace, monospace; color: #7f97a6; margin-top: 4px; text-align: right; }
.vp-typing { display: flex; gap: 4px; align-items: center; height: 12px; }
.vp-typing span { width: 5px; height: 5px; border-radius: 50%; background: #6d8ea3; animation: vp-blink 1.2s infinite ease-in-out; }
.vp-typing span:nth-child(2) { animation-delay: 0.2s; }
.vp-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes vp-blink { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }
.vp-chat-input { display: flex; gap: 6px; align-items: flex-end; border-top: 1px solid #23313c; padding-top: 8px; }
.vp-chat-input textarea { flex: 1; resize: none; max-height: 120px; }
.vp-chat-send { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer; background: #2f7f5f; color: #eafaf1; font-size: 14px; }
.vp-chat-send:disabled { background: #26343d; color: #5f7a8a; cursor: default; }

/* ============================================================ MODALS */
.vp-modal-backdrop {
  position: fixed; inset: 0; z-index: var(--z-dialog); background: #05080ac9;
  display: grid; place-items: center; padding: 20px;
}
.vp-modal {
  width: min(560px, 92vw); background: #101820; border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; padding: 16px 18px;
}
.vp-modal h3 { margin: 0 0 4px; font-size: 15px; }
.vp-modal .vp-sub { margin: 0 0 12px; }
.vp-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.vp-field { display: block; margin: 10px 0; }
.vp-field span { display: block; font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.vp-field input { width: 100%; background: #0b1218; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; color: var(--text); font: inherit; }
.vp-field input:focus { outline: none; border-color: #3c5a4a; }
/* Checkbox (classificazione AI): l'input non deve occupare tutta la riga */
.vp-field .vp-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.vp-field .vp-check input[type='checkbox'] { width: 16px; height: 16px; flex: 0 0 auto; accent-color: #46c08a; cursor: pointer; }
.vp-field .vp-check span { display: inline; margin: 0; text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--text); }
.vp-field .vp-check.is-off span { color: var(--muted); }
.vp-error { color: #e8705f; font-size: 12px; margin: 6px 0 0; }

/* ============================================================ BANNER */
.vp-banner {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(46px + env(safe-area-inset-bottom)); z-index: var(--z-banner);
  pointer-events: none; background: #3a1c1b; border: 1px solid #6d3a37;
  border-radius: 9px; padding: 8px 14px; font-size: 12.5px; max-width: 80vw;
}

/* ============================================================ DOTS */
.vp-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.vp-dot.ok { background: var(--green); box-shadow: 0 0 8px var(--green); }
.vp-dot.bad { background: var(--red); box-shadow: 0 0 8px var(--red); }
.vp-dot.warn { background: #8a8f98; box-shadow: 0 0 8px #8a8f98; }

/* ============================================================ SPRITE OFFICE */
.vp-sprite-hud { position: sticky; top: 58px; z-index: 4; display: flex; gap: 12px; align-items: center; width: max-content; max-width: calc(100% - 24px); margin: 10px auto 8px; padding: 6px 10px; color: #e8dfc4; background: #25343b; border: 2px solid #62736a; font: 700 11px ui-monospace, monospace; image-rendering: pixelated; }
.pixel-office { image-rendering: pixelated; margin: 0 auto 24px; border: 4px solid #596b61; box-shadow: 0 8px 0 #10191e; max-width: calc(100% - 8px); height: auto; }

/* ============================================================ RESPONSIVE */
@media (max-width: 1180px) {
  .vp-topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'brand view' 'nav nav'; row-gap: 6px; background: #0b1015f2; }
  .vp-topbar-brand { grid-area: brand; min-width: 0; }
  .vp-topbar-view { grid-area: view; }
  .vp-topbar-nav { grid-area: nav; flex-wrap: wrap; margin-left: 0; }
  .vp-topbar-status { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .vp-stage { top: var(--vp-topbar-h, 96px); }
  .vp-panel { top: calc(var(--vp-topbar-h, 96px) + 8px); width: min(420px, calc(50vw - 18px)); }
}

@media (max-width: 720px) {
  .vp-topbar { padding: max(7px, env(safe-area-inset-top)) max(9px, env(safe-area-inset-right)) 7px max(9px, env(safe-area-inset-left)); column-gap: 8px; }
  .vp-topbar-brand { flex-wrap: wrap; column-gap: 8px; row-gap: 0; }
  .vp-topbar-status { flex-basis: 100%; font-size: 11px; }
  .vp-topbar-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * max(9px, env(safe-area-inset-right))) 0 calc(-1 * max(9px, env(safe-area-inset-left))); padding: 0 28px 0 max(9px, env(safe-area-inset-left)); -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
  .vp-topbar-nav::-webkit-scrollbar { display: none; }
  .vp-topbar .vp-btn, .vp-topbar .vp-seg button { min-height: 40px; flex: 0 0 auto; white-space: nowrap; padding: 0 11px; }
  
  .vp-panel, .vp-panel.left-0, .vp-panel.right-0 { position: fixed; inset: 0; width: auto; z-index: var(--z-sheet); border: 0; border-radius: 0; background: #101820; padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
  .vp-panel > .vp-panel-head { padding-top: max(10px, env(safe-area-inset-top)); }
  .vp-x { min-width: 44px; min-height: 44px; }
  .vp-panel-head .vp-x { margin: -8px -6px -8px 0; }
  
  .vp-full { padding: 0; align-items: stretch; top: var(--vp-vvtop, 0px); bottom: auto; height: var(--vp-vvh, 100dvh); }
  .vp-full > .vp-full-card { width: 100%; max-width: none; height: 100%; max-height: none; border: 0; border-radius: 0; box-shadow: none; padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
  .vp-full-vp > .vp-full-head { padding-top: max(10px, env(safe-area-inset-top)); }
  .vp-full-vp > .vp-full-body.vp-pad { padding: 12px; }
  
  .vp-k2d { scroll-snap-type: x mandatory; scroll-padding-inline: 12px; }
  .vp-k2d-grid { min-width: 0; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: min(84vw, 320px); }
  .vp-k2d-grid > .vp-col { scroll-snap-align: start; }
  
  .vp-banner { max-width: calc(100vw - 24px); width: max-content; bottom: calc(72px + env(safe-area-inset-bottom)); }
  
  @media (pointer: coarse) { :root :is(input:not([type='checkbox']):not([type='radio']), textarea, select) { font-size: 16px !important; } }
}

/* ============================================================ ACTION ITEMS */
.vp-action { border: 1px solid #23313c; border-radius: 8px; padding: 7px 8px; background: #131c23; display: flex; flex-direction: column; gap: 6px; }
.vp-action.on { border-color: #2f5a45; background: #14211b; }
.vp-action-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-left: 22px; }
.vp-input-sm { font-size: 10.5px !important; padding: 3px 6px !important; max-width: 150px; }
.vp-chip-meeting { background: #1d2f3d; color: #8fc4e8; }
.vp-chip-cron { background: #33291a; color: #e0bd7a; }
.vp-chip-agent { background: #2a2337; color: #c0a8e8; }
.vp-chip-warn { background: #3a2a18; color: #e8b978; }

/* ============================================================ COLLAPSE */
.vp-collapse { display: flex; flex-direction: column; gap: 5px; }
.vp-collapse-head { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line); background: #12191fcc; cursor: pointer; transition: background .12s, border-color .12s; }
.vp-collapse-head:hover { background: #1a242b; border-color: #3b5568; }
.vp-collapse-head.open { border-color: #2c6b51; }
.vp-collapse-caret { font-size: 9px; color: #7f9dad; width: 9px; }
.vp-collapse-label { font: 700 10px/1 ui-monospace, monospace; letter-spacing: 0.12em; color: #8fd8b6; text-transform: uppercase; }
.vp-collapse-count { font: 500 9px/1 ui-monospace, monospace; color: #7f9dad; background: #1b2a3366; border-radius: 999px; padding: 2px 6px; }
.vp-collapse-hint { margin-left: auto; font: 400 9px/1 ui-sans-serif, system-ui, sans-serif; color: #5f7a8a; }
.vp-pre-block { overflow-wrap: anywhere; word-break: normal; max-height: 380px; }

/* ============================================================ SCROLLBAR */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #0a0f13; }
::-webkit-scrollbar-thumb { background: #2f4a5a; border-radius: 4px; border: 2px solid #0a0f13; }
::-webkit-scrollbar-thumb:hover { background: #3c5a4a; }

/* ============================================================ UTILITY */
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }

/* Division colors for badges */
.div-exec { color: #e5726f; }
.div-tech { color: #46c08a; }
.div-growth { color: #f0b556; }
.div-content { color: #6fb8e8; }

/* Status badges */
.status-idle { background: #1f2f28; color: #9fd8bb; }
.status-working { background: #1d2f3d; color: #8fe8c6; }
.status-meeting { background: #2a2337; color: #c0a8e8; }
.status-review { background: #33291a; color: #e0bd7a; }
.status-blocked { background: #3a1c1b; color: #ff9c9c; }
.status-done { background: #1f2f28; color: #87949e; }