/* Capivara v3 — componenti aggiunti: kanban, aiuto, avvisi, griglie, contenuti */
.g-4c { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; }
@media (max-width: 1100px) { .g-4c { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .g-4c { grid-template-columns: 1fr; } }
.hq { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--line); color: var(--ink-2); font-size: 11px; font-weight: 700; cursor: help; vertical-align: 2px; margin-left: 4px; font-family: var(--sans); }
.hq:hover, .hq:focus { background: var(--ink); color: var(--surface); outline: none; }
.help-pane { position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 92vw); background: var(--surface); box-shadow: var(--shadow-lg); z-index: 60; padding: 18px 20px; overflow: auto; animation: hpin .18s ease-out; }
@keyframes hpin { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.help-pane .hp-h { display: flex; align-items: center; justify-content: space-between; font-size: 16px; margin-bottom: 8px; }
.help-pane ol { padding-left: 20px; line-height: 1.55; } .help-pane li { margin-bottom: 8px; }
.hp-ask { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.ann { margin: 0 0 4px; } .ann-i { margin: 10px 32px 0; padding: 10px 14px; border-radius: 10px; background: var(--info-soft); font-size: 13px; }
.ann-i.warning { background: var(--warn-soft); } .ann-i.critical { background: var(--bad-soft); }
/* kanban */
.kb { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.kb-col { flex: 0 0 280px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 230px); }
.kb-col.over { outline: 2px dashed var(--gold); }
.kb-h { padding: 12px 14px 10px; border-top: 4px solid #999; border-radius: var(--radius) var(--radius) 0 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.kb-h .count { font-size: 15px; } .kb-c { flex-basis: 100%; display: flex; gap: 6px; flex-wrap: wrap; }
.kb-list { padding: 4px 10px 12px; overflow-y: auto; display: grid; gap: 10px; }
.kb-card { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; cursor: pointer; box-shadow: var(--shadow); display: grid; gap: 5px; }
.kb-card:hover { border-color: var(--gold); } .kb-card.drag { opacity: .45; }
.kb-t { font-weight: 600; } .kb-s { font-size: 12.5px; color: var(--ink-2); }
.kb-m, .kb-f { display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.kb-m svg, .kb-f svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 2px; }
.kb-flag { font-size: 11px; padding: 2px 7px; border-radius: 20px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.kb-flag.bad { background: var(--bad-soft); color: var(--bad); font-weight: 600; } .kb-flag.warn { background: var(--warn-soft); color: var(--warn); }
.kb-empty { color: var(--muted); text-align: center; padding: 14px; }
.stage-bar { display: flex; gap: 0; margin: 4px 0 14px; overflow-x: auto; }
.stg { border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; cursor: pointer; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.stg:first-child { border-radius: 10px 0 0 10px; } .stg:last-child { border-radius: 0 10px 10px 0; } .stg + .stg { border-left: 0; }
.stg.on { background: var(--c); color: #fff; border-color: var(--c); font-weight: 600; }
.stg.k-won:not(.on) { color: var(--ok); } .stg.k-lost:not(.on) { color: var(--bad); }
.wiz-steps { display: flex; gap: 8px; } .wiz-steps .step { flex: 1; }
/* finanza */
.acc-row { display: flex; gap: 12px; flex-wrap: wrap; padding: 4px 16px 16px; align-items: stretch; }
.acc-row .acc { min-width: 170px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; display: grid; gap: 2px; }
.acc-row .acc.on { border-color: var(--ink); } .acc-row .acc b { font-size: 18px; }
.bars2 { display: flex; gap: 10px; align-items: flex-end; height: 180px; }
.b2 { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; font-size: 11px; color: var(--muted); }
.b2b { flex: 1; width: 100%; display: flex; gap: 3px; align-items: flex-end; justify-content: center; }
.b2b i { width: 40%; max-width: 22px; border-radius: 4px 4px 0 0; min-height: 2px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 4px 0 10px; vertical-align: -1px; }
.funnel { display: grid; gap: 10px; } .fn { display: grid; grid-template-columns: 90px 1fr 50px; gap: 10px; align-items: center; font-size: 13px; } .fn b { text-align: right; }
/* contenuti */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.mcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; }
.mcard:hover { border-color: var(--gold); } .mimg { height: 150px; background: var(--line-2) center/cover no-repeat; } .mt2 { padding: 10px 12px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; } a.chip { text-decoration: none; }
.switch { display: inline-flex; gap: 10px; align-items: center; cursor: pointer; font-weight: 600; }
.switch input { width: 40px; height: 22px; appearance: none; background: var(--line); border-radius: 20px; position: relative; cursor: pointer; transition: background .15s; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch input:checked { background: var(--ok); } .switch input:checked::after { left: 21px; }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.mg-sec { grid-column: 1 / -1; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 700; margin-top: 10px; }
.mg-i { display: flex; gap: 10px; align-items: center; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; font-weight: 500; }
.mg-i svg { width: 20px; height: 20px; color: var(--ink-2); }
.badge.soft { opacity: .75; }
@media (max-width: 760px) { .kb-col { flex-basis: 85vw; } .ann-i { margin: 10px 14px 0; } }
@media print { .help-pane, .ann { display: none; } }
/* conversa con il viaggiatore */
.chat-pane { position: fixed; top: 0; right: 0; bottom: 0; width: 400px; background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); z-index: 55; display: flex; flex-direction: column; }
body.chat-open .main { margin-right: 400px; }
.cp-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cp-ban { background: var(--info-soft); padding: 9px 14px; font-size: 12.5px; display: flex; gap: 6px; align-items: center; } .cp-ban.warn { background: var(--warn-soft); } .cp-ban svg { width: 15px; height: 15px; flex: none; }
.cp-ai { display: flex; gap: 8px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--line); font-size: 12.5px; } .cp-ai select { width: auto; }
.cp-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.bub { max-width: 86%; padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; word-wrap: break-word; }
.bub.in { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bub.out { align-self: flex-end; background: #1E2A44; color: #fff; border-bottom-right-radius: 4px; } .bub.out a { color: #cfe2ff; }
.bub.draft { background: var(--gold-soft); color: var(--ink); border: 1px dashed var(--gold); }
.bub .bt { font-size: 11px; opacity: .65; margin-top: 4px; text-align: right; } .bub .orig { font-size: 12px; opacity: .8; margin-top: 4px; } .bub .att { font-size: 12.5px; margin-top: 4px; }
.cp-ed { border-top: 1px solid var(--line); padding: 10px 12px; } .cp-ed textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; resize: vertical; font: inherit; background: var(--surface); }
.cp-pv { font-size: 12.5px; background: var(--surface-2); border-radius: 10px; padding: 0; margin-top: 6px; } .cp-pv:not(:empty) { padding: 8px 10px; }
.cp-tb { display: flex; gap: 4px; align-items: center; margin-top: 6px; } .tb { border: 0; background: transparent; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; display: inline-grid; place-items: center; color: var(--ink-2); font-size: 15px; } .tb:hover { background: var(--line-2); } .tb svg { width: 17px; height: 17px; }
.send { width: 40px; height: 40px; border-radius: 50%; border: 0; background: #2A7AB0; color: #fff; display: grid; place-items: center; cursor: pointer; } .send svg { width: 18px; height: 18px; }
.dd { position: relative; } .dd-m { display: none; position: absolute; bottom: 38px; left: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); min-width: 220px; z-index: 2; } .dd-m.on { display: block; } .dd-m a { display: block; padding: 9px 12px; cursor: pointer; font-size: 13px; } .dd-m a:hover { background: var(--line-2); }
.row-wa { width: 30px; height: 30px; margin-left: 6px; vertical-align: middle; color: #25A85A; } .row-wa svg { width: 17px; height: 17px; }
@media (max-width: 1100px) { body.chat-open .main { margin-right: 0; } }
@media (max-width: 760px) { .chat-pane { top: auto; height: 86vh; width: 100%; border-radius: 18px 18px 0 0; border-left: 0; animation: cpup .2s ease-out; } @keyframes cpup { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } } }
@media print { .chat-pane { display: none; } body.chat-open .main { margin-right: 0; } }
.card-h h3 svg, .page-head h1 svg { width: 16px; height: 16px; vertical-align: -2px; }
.card-b > .btn svg, .card-b .row .btn svg { width: 16px; height: 16px; }
@media (max-width: 520px) { .search-trigger span, .search-trigger kbd { display: none; } .search-trigger { min-width: 0; } }
/* icone in linea nelle schermate v3 (le icone non hanno dimensioni proprie) */
#view svg[viewBox="0 0 24 24"], .chat-pane svg[viewBox="0 0 24 24"], .portal svg[viewBox="0 0 24 24"], .modal svg[viewBox="0 0 24 24"] { width: 16px; height: 16px; vertical-align: -3px; flex: none; }
#view .it-ic svg { width: 18px; height: 18px; } #view .icon-btn svg, .chat-pane .icon-btn svg { width: 18px; height: 18px; } .send svg { width: 18px !important; height: 18px !important; }
#view .kb-m svg, #view .kb-f svg { width: 13px; height: 13px; }
