/* Protótipo do Painel de gestão do cliente (assets/js/prototipos/painel.js).
   Usa as classes de prototipo.css; aqui só o que é novo. Prefixo pt-pn-. */
.pt-pn-shell { grid-template-columns: minmax(0, 1fr); }
.pt-pn-lead { margin-top: 2px; font-size: 12.5px; color: var(--muted); }

/* Troca de visão: escritório × cliente */
.pt-pn-switch { display: flex; gap: 4px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: #FBFBFA; }
.pt-pn-switch button {
  display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 6px 14px; border: 1px solid transparent; border-radius: 9px;
  background: none; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.pt-pn-switch button:hover { background: var(--surface-2); color: var(--ink); }
.pt-pn-switch button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.pt-app button:focus-visible, .pt-app select:focus-visible, .pt-app textarea:focus-visible, .pt-app input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Escritório */
.pt-pn-count { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--ink); }
.pt-pn-count.is-warn { color: var(--warning); }
.pt-pn-acts { display: inline-flex; gap: 6px; }
.pt-pn-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.pt-pn-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.pt-pn-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.pt-pn-list li:first-child { border-top: 0; padding-top: 0; }
.pt-pn-list li > span:first-child { min-width: 0; }
.pt-pn-list b { display: block; font-size: 13px; color: var(--ink); }
.pt-pn-list small { display: block; font-size: 11.5px; line-height: 1.4; color: var(--muted); }
.pt-pn-ok { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--success); white-space: nowrap; }
.pt-pn-q { display: flex; gap: 8px; padding: 10px 12px; margin-bottom: 8px; border-radius: 10px; background: var(--surface); font-size: 13px; color: var(--ink); }
.pt-pn-q small { display: block; margin-top: 2px; font-size: 11px; color: var(--subtle); }
.pt-pn-ia { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; font-size: 11px; font-style: normal; color: var(--ink); }
.pt-pn-ia .icon { width: 12px; height: 12px; }
.pt-field textarea { min-height: 72px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; font: inherit; font-size: 13.5px; font-weight: 400; line-height: 1.45; color: var(--ink); resize: vertical; }
.pt-pn-mt { margin-top: 12px; }

/* Cliente */
.pt-pn-aviso { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 12px; padding: 9px 12px; border-radius: 10px; background: var(--warning-bg); font-size: 12.5px; color: var(--warning); }
.pt-pn-meter { position: relative; display: block; height: 6px; margin: 5px 0 3px; border-radius: 3px; background: var(--surface-2); }
.pt-pn-meter i { display: block; width: var(--w); height: 100%; border-radius: 3px; background: var(--muted); }
.pt-pn-meter i.is-ok { background: var(--ink); }
.pt-pn-meter em { position: absolute; top: -3px; left: var(--m); width: 2px; height: 12px; background: var(--ink); }
.pt-pn-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 10px; }
.pt-pn-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pt-pn-sub { display: flex; align-items: center; gap: 6px; margin: 18px 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

.pt-pn-tabs { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 8px; padding: 3px; border-radius: 10px; background: var(--surface); }
.pt-pn-tabs button { flex: 1; min-height: 30px; padding: 4px 10px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.pt-pn-tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.pt-pn-dica { margin-left: auto; color: var(--subtle); }
.pt-legend .pt-pn-lg { width: 10px; height: 10px; border-radius: 3px; background: var(--ink); }
.pt-pn-lg.is-meta { height: 0; border-top: 2px dashed var(--muted); border-radius: 0; background: none; }
.pt-pn-lg.is-line { height: 3px; border-radius: 2px; }
.pt-pn-lg.s0 { background: var(--ink); }
.pt-pn-lg.s1 { background: var(--muted); }
.pt-pn-lg.s2 { background: var(--line-strong); }

/* Gráficos SVG */
.pt-ch { display: block; width: 100%; height: auto; }
.pt-ch-base { stroke: var(--line-strong); stroke-width: 1; }
.pt-ch-zero { stroke: var(--danger); stroke-width: 1; stroke-dasharray: 3 3; }
.pt-ch-bar { fill: var(--line-strong); transition: fill .15s; }
.pt-ch-bar.is-sel { fill: var(--ink); }
.pt-ch-bar.is-parc { fill-opacity: .55; }
.pt-ch-bar.s0 { fill: var(--muted); }
.pt-ch-bar.s1 { fill: #A8A29E; }
.pt-ch-bar.s2 { fill: var(--line-strong); }
.pt-ch-bar.is-sel.s0 { fill: var(--ink); }
.pt-ch-bar.is-sel.s1 { fill: var(--muted); }
.pt-ch-bar.is-sel.s2 { fill: #A8A29E; }
.pt-ch-meta { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 3; }
.pt-ch-line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.pt-ch-line.is-parc { stroke-dasharray: 4 3; stroke: var(--muted); }
.pt-ch-area { fill: var(--surface-2); }
.pt-ch-pt { fill: #fff; stroke: var(--ink); stroke-width: 2; }
.pt-ch-pt.is-sel { fill: var(--ink); }
.pt-ch-pt.is-neg { stroke: var(--danger); }
.pt-ch-pt.is-neg.is-sel { fill: var(--danger); }
.pt-ch-val { font-size: 11.5px; font-weight: 700; fill: var(--ink); }
.pt-ch-mes { font-size: 10.5px; fill: var(--subtle); }
.pt-ch-mes.is-sel { font-weight: 700; fill: var(--ink); }
.pt-ch-hit { fill: transparent; cursor: pointer; }
.pt-ch-hit:hover { fill: rgba(10, 10, 10, .04); }
.pt-ch--mini { margin-top: 8px; }

.pt-pn-nota { display: flex; gap: 10px; margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.pt-pn-nota > div { min-width: 0; }
.pt-pn-nota b { display: block; font-size: 13px; color: var(--ink); }
.pt-pn-nota small { display: block; font-size: 11.5px; color: var(--muted); }
.pt-pn-nota p { margin: 6px 0 8px; font-size: 13px; line-height: 1.5; color: var(--text); }

.pt-pn-dre { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.pt-pn-dre th, .pt-pn-dre td { padding: 6px 0; border-top: 1px solid var(--line); font-weight: 400; text-align: left; color: var(--muted); }
.pt-pn-dre td { text-align: right; white-space: nowrap; color: var(--text); }
.pt-pn-dre td + td { width: 58px; color: var(--subtle); }
.pt-pn-dre tr:first-child th, .pt-pn-dre tr:first-child td { border-top: 0; }
.pt-pn-dre .is-tot th, .pt-pn-dre .is-tot td:first-of-type, .pt-pn-dre .is-sub th, .pt-pn-dre .is-sub td:first-of-type { font-weight: 600; color: var(--ink); }
.pt-pn-dre .is-res th, .pt-pn-dre .is-res td { padding-top: 9px; border-top: 2px solid var(--ink); font-size: 13.5px; font-weight: 700; color: var(--ink); }
.pt-pn-dre .is-neg td { color: var(--danger); }
.pt-panel > .pt-muted { margin-top: 8px; }

.pt-pn-conta { padding: 8px 10px; }
.pt-pn-conta b { font-size: 13px; }
.pt-pn-tot { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.pt-pn-tot b { color: var(--ink); }
.pt-pn-alerta { display: flex; gap: 6px; align-items: flex-start; margin-top: 8px; font-size: 12px; line-height: 1.4; }
.pt-pn-alerta.is-danger { color: var(--danger); }
.pt-pn-alerta.is-ok { color: var(--success); }
.pt-pn-imp { display: grid; justify-items: end; gap: 2px; white-space: nowrap; }
.pt-pn-st { padding: 0 7px; border-radius: var(--pill); font-size: 10.5px; font-style: normal; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.pt-pn-st.is-ok { background: var(--success-bg); color: var(--success); }
.pt-pn-st.is-danger { background: var(--danger-bg); color: var(--danger); }
.pt-pn-fluxo { display: grid; gap: 0; margin: 0; }
.pt-pn-fluxo div { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
.pt-pn-fluxo div:first-child { border-top: 0; padding-top: 0; }
.pt-pn-fluxo dt { color: var(--muted); }
.pt-pn-fluxo dd { margin: 0; font-weight: 600; color: var(--ink); white-space: nowrap; }
.pt-pn-fluxo .is-res { border-top: 2px solid var(--ink); }
.pt-pn-fluxo .is-res dt { font-weight: 600; color: var(--ink); }
.pt-pn-fluxo .is-neg dd { color: var(--danger); }

/* Perguntar ao contador */
.pt-pn-chat { width: min(400px, 100%); }
.pt-pn-msgs { display: grid; gap: 8px; max-height: 280px; overflow-y: auto; margin-bottom: 10px; padding: 10px; border-radius: 12px; background: var(--surface); }
.pt-pn-msg { max-width: 88%; padding: 8px 11px; border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.pt-pn-msg small { display: block; font-size: 10.5px; font-weight: 600; color: var(--subtle); }
.pt-drawer .pt-pn-msg p { margin-top: 2px; font-size: 13px; line-height: 1.45; color: var(--text); }
.pt-pn-msg.is-cliente { justify-self: end; background: var(--ink); }
.pt-pn-msg.is-cliente small { color: rgba(255, 255, 255, .6); }
.pt-drawer .pt-pn-msg.is-cliente p { color: #fff; }
.pt-pn-msg.is-contador { border: 1px solid var(--ink); }
.pt-pn-msg.is-typing p { font-style: italic; color: var(--subtle); }
.pt-pn-sug { margin-bottom: 10px; }
.pt-pn-sug button { text-align: left; }

@media (max-width: 860px) {
  .pt-pn-grid, .pt-pn-grid2, .pt-pn-grid3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .pt-pn-switch { padding: 8px; }
  .pt-pn-switch button { flex: 1; justify-content: center; padding: 6px 8px; font-size: 12.5px; }
  .pt-tools .pt-select { width: 100%; }
  .pt-tools .pt-select select { flex: 1; }
  .pt-head__tools, .pt-head__tools .pt-btn { width: 100%; justify-content: center; }
  .pt-pn-dica { display: none; }
  .pt-pn-tabs { flex-wrap: nowrap; }
  .pt-pn-tabs button { padding: 4px 4px; font-size: 12px; }
  .pt-bar-top .pt-dots { display: none; }
  .pt-bar-top b { min-width: 0; line-height: 1.35; }
  .pt-kpi b { font-size: 16px; }
}
.pt-ch-val { paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
