@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Montserrat:wght@700;900&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@300,0..1&display=swap");

/* pergamo: componentes consagrados sobre os tokens. Swiss Industrial: canto reto, superfície plana. */

/* Base */
body { font-family: var(--font-sans); color: var(--pg-text); background: var(--pg-bg); -webkit-font-smoothing: antialiased; }
.material-symbols-outlined { font-family: "Material Symbols Outlined"; font-weight: 300; font-style: normal; font-size: 20px; line-height: 1; display: inline-block; text-transform: none; letter-spacing: normal; white-space: nowrap; font-variation-settings: "FILL" 0, "wght" 300; }
.material-symbols-outlined.fill { font-variation-settings: "FILL" 1, "wght" 300; }

/* Wordmark: puramente tipográfico, minúsculo, .ai colado e em vinho */
.pg-wordmark { font-family: var(--font-display); font-weight: var(--pg-weight-bold); line-height: 1; color: var(--pg-black); text-decoration: none; white-space: nowrap; }
.pg-wordmark .ai { color: var(--pg-wine); }
.pg-wordmark.on-dark { color: var(--pg-white); }
.pg-wordmark.hero { font-size: 72px; font-weight: var(--pg-weight-black); letter-spacing: -2px; }
.pg-wordmark.large { font-size: 40px; letter-spacing: -1px; }
.pg-wordmark.medium { font-size: 24px; letter-spacing: -0.5px; }
.pg-wordmark.signature { font-size: 17px; letter-spacing: -0.4px; }
.pg-wordmark.small { font-size: 16px; letter-spacing: 0; }

/* Button */
.pg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; font-family: var(--font-sans); font-size: var(--pg-text-base); font-weight: var(--pg-weight-bold);
  border-radius: var(--pg-radius); cursor: pointer; transition: all 0.2s;
  border: 1px solid transparent; text-transform: uppercase; letter-spacing: 0.05em;
}
.pg-btn:focus-visible { outline: 2px solid var(--pg-wine); outline-offset: 2px; }
.pg-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.pg-btn.loading { color: transparent !important; position: relative; pointer-events: none; }
.pg-btn.loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid currentColor;
  border-top-color: transparent; border-radius: var(--pg-radius-full); animation: pg-spin 0.8s linear infinite;
}
@keyframes pg-spin { to { transform: rotate(360deg); } }

.pg-btn-primary { background: var(--pg-wine); color: var(--pg-white); }
.pg-btn-primary:hover:not(:disabled) { background: var(--pg-wine-dark); }
.pg-btn-primary.loading::after { border-color: var(--pg-white); border-top-color: transparent; }

.pg-btn-secondary { background: var(--pg-white); border-color: var(--pg-border); color: var(--pg-text); }
.pg-btn-secondary:hover:not(:disabled) { border-color: var(--pg-wine); color: var(--pg-wine); }
.pg-btn-secondary.loading::after { border-color: var(--pg-wine); border-top-color: transparent; }

.pg-btn-ghost { background: transparent; color: var(--pg-wine); }
.pg-btn-ghost:hover:not(:disabled) { background: var(--pg-pink); }
.pg-btn-ghost.loading::after { border-color: var(--pg-wine); border-top-color: transparent; }

/* Busca brutal: Saguão (00), Seletor de Operação (01) e busca superior */
.pg-search-brutal { width: 100%; background: var(--pg-white); border: 2px solid var(--pg-wine); border-radius: var(--pg-radius); outline: none; transition: box-shadow 0.2s; font-family: var(--font-sans); font-size: var(--pg-text-xl); font-weight: var(--pg-weight-medium); color: var(--pg-text); padding: 20px 32px; }
.pg-search-brutal:focus { box-shadow: var(--pg-focus-ring); border-color: var(--pg-wine-dark); }

/* Input */
.pg-label { display: block; font-size: var(--pg-text-xs); font-weight: var(--pg-weight-bold); text-transform: uppercase; letter-spacing: 0.12em; color: var(--pg-text2); margin-bottom: 6px; }
.pg-input { width: 100%; background: var(--pg-white); border: 1px solid var(--pg-border); border-radius: var(--pg-radius); padding: 12px 14px; font-family: var(--font-sans); font-size: var(--pg-text-base); color: var(--pg-text); outline: none; transition: border-color 0.2s; box-sizing: border-box; }
.pg-input:focus { border-color: var(--pg-wine); box-shadow: var(--pg-focus-ring); }
.pg-input[aria-invalid="true"] { border-color: var(--pg-red-text); }
.pg-input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(153,27,27,0.1); }
.pg-hint { font-size: var(--pg-text-xs); color: var(--pg-text2); margin-top: 6px; display: block; }
.pg-error { font-size: var(--pg-text-xs); color: var(--pg-red-text); font-weight: var(--pg-weight-bold); margin-top: 6px; display: block; }

/* Select */
.pg-select { appearance: none; background: var(--pg-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E") no-repeat right 14px center; padding-right: 40px; }

/* Badge */
.pg-badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: var(--pg-radius-chip); font-size: var(--pg-text-sm); font-weight: var(--pg-weight-bold); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.pg-badge-neutral { background: var(--pg-bg-thead); color: var(--pg-text2); border: 1px solid var(--pg-border); }
.pg-badge-active { background: var(--pg-green); color: var(--pg-green-text); }
.pg-badge-error { background: var(--pg-red); color: var(--pg-red-text); }
.pg-badge-warning { background: var(--pg-yellow); color: var(--pg-yellow-text); }
.pg-badge-matriz { background: var(--pg-wine); color: var(--pg-white); }

/* Card */
.pg-card { background: var(--pg-white); border: 1px solid var(--pg-border); border-radius: var(--pg-radius); padding: 24px; }

/* Table */
.pg-table { width: 100%; border-collapse: collapse; background: var(--pg-white); }
.pg-table thead { background: var(--pg-bg-thead); }
.pg-table th { text-align: left; padding: 14px 16px; font-size: var(--pg-text-sm); font-weight: var(--pg-weight-black); text-transform: uppercase; letter-spacing: 0.05em; color: var(--pg-text2); border-bottom: 2px solid var(--pg-border); }
.pg-table td { padding: 16px; border-bottom: 1px solid var(--pg-border); font-size: var(--pg-text-base); font-variant-numeric: tabular-nums; }
.pg-table tbody tr:hover { background: var(--pg-row-hover); }
.pg-star { cursor: pointer; color: var(--pg-border); transition: color 0.2s; }
.pg-star.active { color: var(--pg-star); font-variation-settings: "FILL" 1, "wght" 300; }
.pg-star:hover { color: var(--pg-star); }

/* Toast: plano, sem sombra; a faixa esquerda carrega o estado */
.pg-toast { background: var(--pg-white); border: 1px solid var(--pg-border); border-left: 4px solid var(--pg-border); padding: 14px 16px; display: flex; align-items: flex-start; gap: 12px; border-radius: var(--pg-radius); }
.pg-toast.info { border-left-color: var(--pg-text2); }
.pg-toast.success { border-left-color: var(--pg-green-text); }
.pg-toast.error { border-left-color: var(--pg-red-text); }
.pg-toast-action { background: none; border: none; padding: 0; margin-top: 8px; font-size: var(--pg-text-sm); font-weight: var(--pg-weight-bold); color: var(--pg-wine); cursor: pointer; text-transform: uppercase; }
.pg-toast-action:hover { text-decoration: underline; }

/* Modal: escurecimento sólido, sem desfoque; única sombra do sistema */
.pg-modal-overlay { position: fixed; inset: 0; background: var(--pg-overlay); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 24px; }
.pg-modal { background: var(--pg-white); width: 100%; max-width: var(--modal-max-width); box-shadow: var(--pg-shadow-overlay); border-radius: var(--pg-radius); overflow: hidden; }
.pg-modal-header { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--pg-border); }
.pg-modal-stamp { font-family: var(--font-display); font-weight: var(--pg-weight-bold); font-size: 16px; color: var(--pg-black); padding-right: 14px; border-right: 1px solid var(--pg-border); }
.pg-modal-stamp .ai { color: var(--pg-wine); }
.pg-modal-title { flex: 1; font-size: var(--pg-text-sm); font-weight: var(--pg-weight-black); text-transform: uppercase; letter-spacing: 0.1em; display: flex; align-items: center; gap: 8px; }
.pg-modal-body { padding: 22px; font-size: var(--pg-text-base); line-height: 1.5; }
.pg-modal-actions { display: flex; justify-content: flex-end; gap: 12px; padding: 16px 22px; border-top: 1px solid var(--pg-border); background: var(--pg-bg); }

/* Skeleton: barra reta, pulsa de 1 a 0,4 */
.pg-sk { background: var(--pg-border); border-radius: var(--pg-radius); animation: pg-pulse 1.4s ease-in-out infinite; }
@keyframes pg-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@media (prefers-reduced-motion: reduce) { .pg-sk, .pg-btn.loading::after { animation: none; } }

/* Tabs */
.pg-tabs { display: flex; border-bottom: 1px solid var(--pg-border); gap: 24px; }
.pg-tab { padding: 12px 0; font-size: var(--pg-text-sm); font-weight: var(--pg-weight-bold); color: var(--pg-text2); cursor: pointer; border-bottom: 2px solid transparent; text-transform: uppercase; letter-spacing: 0.05em; background: none; border-top: 0; border-left: 0; border-right: 0; }
.pg-tab.active { color: var(--pg-wine); border-bottom-color: var(--pg-wine); }
.pg-tab:hover:not(.active) { color: var(--pg-text); }

/* Item do i.r.ia radar */
.pg-story { background: var(--pg-pink); border: 1px solid var(--pg-wine-light); color: var(--pg-wine); padding: 10px 16px; font-weight: var(--pg-weight-bold); font-size: var(--pg-text-sm); text-transform: uppercase; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; border-radius: var(--pg-radius); white-space: nowrap; }
.pg-story:hover { background: var(--pg-wine); color: var(--pg-white); }
.pg-radar { display: flex; align-items: center; gap: 16px; height: var(--regua-radar); padding: 0 20px; background: var(--pg-bg); border-bottom: 1px solid var(--pg-border); overflow-x: auto; }
.pg-radar-label { font-size: var(--pg-text-xs); font-weight: var(--pg-weight-black); text-transform: uppercase; letter-spacing: 0.12em; color: var(--pg-wine); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

/* Seletor de Operação */
.pg-op-selector { display: inline-flex; flex-direction: column; padding: 4px 12px; border-left: 2px solid var(--pg-wine); }
.pg-op-label { font-size: var(--pg-text-xs); font-weight: var(--pg-weight-bold); text-transform: uppercase; letter-spacing: 0.2em; color: var(--pg-text2); margin-bottom: 2px; }
.pg-op-value { font-size: var(--pg-text-base); font-weight: var(--pg-weight-black); color: var(--pg-text); }

/* aRotina (painel de ações da rotina) */
.pg-arotina { display: flex; flex-direction: column; width: var(--arotina-width); background: var(--pg-white); border-right: 1px solid var(--pg-border); flex-shrink: 0; }
.pg-arotina-header { padding: 16px 20px; border-bottom: 1px solid var(--pg-border); background: var(--pg-bg); }
.pg-arotina-section { padding: 20px; border-bottom: 1px solid var(--pg-border); }
.pg-arotina-title { font-size: var(--pg-text-xs); font-weight: var(--pg-weight-black); text-transform: uppercase; letter-spacing: 0.12em; color: var(--pg-text2); margin-bottom: 12px; display: block; }
.pg-arotina-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: var(--pg-radius); font-family: var(--font-sans); font-size: var(--pg-text-sm); font-weight: var(--pg-weight-bold); color: var(--pg-text2); cursor: pointer; transition: all 0.2s; text-align: left; }
.pg-arotina-item:hover:not(:disabled) { background: var(--pg-bg); color: var(--pg-text); }
.pg-arotina-item.active { background: var(--pg-pink); color: var(--pg-wine); }
.pg-arotina-item:disabled { opacity: 0.5; cursor: not-allowed; }

/* Rodapé de Frame */
.pg-frame-footer { display: flex; justify-content: space-between; align-items: center; padding: 16px 32px; background: var(--pg-white); border-top: 1px solid var(--pg-border); position: absolute; bottom: 0; left: 0; right: 0; z-index: 20; }

/* Carimbo de build: só na tela de entrada */
.pg-build { font-size: 10px; font-weight: var(--pg-weight-medium); color: var(--pg-text2); font-variant-numeric: tabular-nums; }

/* ===================================================================
   Componentes acrescentados em 04/10/2026, extraídos das telas de referência
   =================================================================== */

/* IconButton e Avatar: barra superior */
.pg-icon-btn { width: 44px; height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--pg-white); border: 1px solid var(--pg-border); border-radius: var(--pg-radius); color: var(--pg-text); cursor: pointer; transition: all 0.2s; }
.pg-icon-btn:hover { border-color: var(--pg-wine); color: var(--pg-wine); }
.pg-icon-btn:focus-visible { outline: 2px solid var(--pg-wine); outline-offset: 2px; }
.pg-icon-btn.on { border-color: var(--pg-wine); color: var(--pg-wine); background: var(--pg-pink); }
.pg-icon-btn.sm { width: 32px; height: 32px; }
.pg-avatar { width: 44px; height: 44px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--pg-wine); color: var(--pg-white); font-size: var(--pg-text-sm); font-weight: var(--pg-weight-bold); border-radius: var(--pg-radius); }

/* Popover: base de tudo que flutua ancorado num botão */
.pg-pop-anchor { position: relative; display: inline-block; }
.pg-popover { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; background: var(--pg-white); border: 1px solid var(--pg-border); border-radius: var(--pg-radius); box-shadow: var(--pg-shadow-overlay); }
.pg-popover[hidden] { display: none; }

/* RowMenu: verbos do CRUD na linha da tabela */
.pg-row-menu { width: 160px; padding: 4px 0; }
.pg-row-menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 16px; font-family: var(--font-sans); font-size: var(--pg-text-base); font-weight: var(--pg-weight-bold); color: var(--pg-text); cursor: pointer; }
.pg-row-menu button:hover { background: var(--pg-bg); }
.pg-row-menu button.danger { color: var(--pg-red-text); }
.pg-row-menu hr { border: 0; border-top: 1px solid var(--pg-border); margin: 4px 0; }

/* ColumnManager: mostrar/ocultar e reordenar colunas */
.pg-col-manager { width: 256px; padding: var(--space-4); }
.pg-col-manager-title { display: block; padding-bottom: var(--space-2); margin-bottom: var(--space-3); border-bottom: 1px solid var(--pg-border); font-size: var(--pg-text-sm); font-weight: var(--pg-weight-bold); }
.pg-col-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pg-col-list li { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; background: var(--pg-bg); border: 1px solid var(--pg-border); font-size: var(--pg-text-sm); font-weight: var(--pg-weight-bold); }
.pg-col-list label { display: flex; align-items: center; gap: var(--space-2); cursor: pointer; }
.pg-col-move { display: flex; flex-direction: column; }
.pg-col-move button { background: none; border: 0; padding: 0; height: 12px; color: var(--pg-text2); cursor: pointer; display: flex; align-items: center; }
.pg-col-move button:hover:not(:disabled) { color: var(--pg-wine); }
.pg-col-move button:disabled { opacity: 0.3; cursor: default; }
.pg-col-move .material-symbols-outlined { font-size: 14px; }

/* Panel: bloco com cabeçalho cinza */
.pg-panel { background: var(--pg-white); border: 1px solid var(--pg-border); border-radius: var(--pg-radius); }
.pg-panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-4) var(--space-6); background: var(--pg-bg-thead); border-bottom: 1px solid var(--pg-border); }
.pg-panel-title { margin: 0; font-size: var(--pg-text-lg); font-weight: var(--pg-weight-black); }
.pg-panel-sub { margin: 4px 0 0; font-size: var(--pg-text-sm); color: var(--pg-text2); }
.pg-panel-body { padding: var(--space-6); }

/* EmptyState */
.pg-empty { padding: 48px var(--space-6); display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-2); }
.pg-empty > .material-symbols-outlined { font-size: 36px; color: var(--pg-text2); }
.pg-empty-title { margin: 0; font-size: var(--pg-text-xl); font-weight: var(--pg-weight-black); letter-spacing: -0.025em; }
.pg-empty-text { margin: 0; max-width: 440px; font-size: var(--pg-text-base); color: var(--pg-text2); line-height: 1.5; }
.pg-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-4); margin-top: var(--space-4); }

/* Dropzone: área quadrada tracejada; vinho ao passar, arrastar ou focar */
.pg-dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: var(--space-2); padding: 48px var(--space-6); background: var(--pg-white); border: 2px dashed var(--pg-border); border-radius: var(--pg-radius); cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.pg-dropzone:hover, .pg-dropzone.drag { border-color: var(--pg-wine); background: var(--pg-pink); }
.pg-dropzone:focus-within { border-color: var(--pg-wine); box-shadow: var(--pg-focus-ring); }
.pg-dropzone > .material-symbols-outlined { font-size: 32px; color: var(--pg-wine); margin-bottom: var(--space-3); }
.pg-dropzone-title { margin: 0; font-size: var(--pg-text-lg); font-weight: var(--pg-weight-black); }
.pg-dropzone-hint { margin: 0; max-width: 300px; font-size: var(--pg-text-sm); color: var(--pg-text2); line-height: 1.5; }
.pg-dropzone-file { margin: 0; font-size: var(--pg-text-sm); font-weight: var(--pg-weight-bold); color: var(--pg-wine); }
.pg-dropzone-file[hidden] { display: none; }
.pg-dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

/* Spinner avulso */
.pg-spinner { display: inline-block; width: 16px; height: 16px; box-sizing: border-box; border: 2px solid var(--pg-bg-thead); border-top-color: var(--pg-wine); border-radius: var(--pg-radius-full); animation: pg-spin 0.8s linear infinite; }
.pg-spinner.lg { width: 48px; height: 48px; border-width: 4px; }
.pg-spin { animation: pg-spin 1s linear infinite; }
@media (prefers-reduced-motion: reduce) { .pg-spinner, .pg-spin { animation: none; } }

/* Checkbox, Radio e Textarea */
.pg-check { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--pg-text-base); color: var(--pg-text); cursor: pointer; }
.pg-check input { appearance: none; -webkit-appearance: none; margin: 0; width: 16px; height: 16px; flex-shrink: 0; background: var(--pg-white); border: 1px solid var(--pg-text2); border-radius: var(--pg-radius); cursor: pointer; transition: background 0.2s, border-color 0.2s; }
.pg-check input[type="radio"] { border-radius: var(--pg-radius-full); }
.pg-check input:checked { background-color: var(--pg-wine); border-color: var(--pg-wine); }
.pg-check input[type="checkbox"]:checked { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.2 4.8 9 10 3.2' fill='none' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: center; }
.pg-check input[type="radio"]:checked { box-shadow: inset 0 0 0 3px var(--pg-white); }
.pg-check input:focus-visible { outline: 2px solid var(--pg-wine); outline-offset: 2px; }
.pg-check input:disabled { opacity: 0.5; cursor: not-allowed; }
.pg-textarea { min-height: 96px; resize: vertical; line-height: 1.5; font-family: var(--font-sans); }

/* Extensões de Badge, Table, Toast e Modal */
.pg-badge .material-symbols-outlined { font-size: 14px; margin-right: 6px; }
.pg-table tbody tr.is-active, .pg-table tbody tr.is-active:hover { background: var(--pg-pink); }
.pg-table tbody tr.is-error, .pg-table tbody tr.is-error:hover { background: var(--pg-red); }
.pg-table tbody tr.is-error td { color: var(--pg-red-text); }
.pg-table tbody tr.is-muted td { color: var(--pg-text2); }
.pg-strike { text-decoration: line-through; }
.pg-table .r { text-align: right; }
.pg-table .c { text-align: center; }
.pg-table-foot { display: flex; flex-wrap: wrap; gap: var(--space-3); padding: var(--space-4) var(--space-6); background: var(--pg-bg-thead); border-top: 1px solid var(--pg-border); font-size: var(--pg-text-xs); font-weight: var(--pg-weight-bold); text-transform: uppercase; letter-spacing: 0.1em; color: var(--pg-text2); }
.pg-toast-main { flex: 1; min-width: 0; }
.pg-toast-title { margin: 0 0 4px; font-size: var(--pg-text-xs); font-weight: var(--pg-weight-black); text-transform: uppercase; letter-spacing: 0.12em; }
.pg-toast-text { margin: 0; font-size: var(--pg-text-sm); color: var(--pg-text2); line-height: 1.5; }
.pg-toast-close { background: none; border: 0; padding: 2px; color: var(--pg-text2); cursor: pointer; }
.pg-toast-close:hover { color: var(--pg-text); }
.pg-toast-stack { position: fixed; right: var(--space-8); bottom: var(--space-8); z-index: 60; width: 384px; display: flex; flex-direction: column; gap: var(--space-4); }
.pg-toast-stack .pg-toast[hidden] { display: none; }
.pg-modal-close { margin-left: auto; background: none; border: 0; padding: 4px; color: var(--pg-text2); cursor: pointer; }
.pg-modal-close:hover { color: var(--pg-text); }
.pg-modal-overlay[hidden] { display: none; }

/* IriaDrawer: painel flutuante do i.r.ia (decisão C2), sobrepõe sem empurrar o grid */
.pg-iria { position: absolute; top: var(--space-3); right: 0; bottom: 0; width: 380px; display: flex; flex-direction: column; background: var(--pg-white); border: 1px solid var(--pg-border); border-radius: var(--pg-radius); box-shadow: var(--pg-shadow-overlay); z-index: 30; }
.pg-iria[hidden] { display: none; }
.pg-iria-head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--pg-border); background: var(--pg-bg); }
.pg-iria-mark { width: 32px; height: 32px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--pg-wine); color: var(--pg-white); }
.pg-iria-name { font-size: var(--pg-text-sm); font-weight: var(--pg-weight-black); text-transform: uppercase; letter-spacing: 0.05em; }
.pg-iria-name b { color: var(--pg-wine); }
.pg-iria-sub { font-size: var(--pg-text-xs); color: var(--pg-text2); }
.pg-iria-body { flex: 1; overflow-y: auto; padding: var(--space-5); background: var(--pg-bg); display: flex; flex-direction: column; gap: var(--space-4); }
.pg-iria-msg { margin: 0; background: var(--pg-white); border: 1px solid var(--pg-border); padding: var(--space-4); font-size: var(--pg-text-base); line-height: 1.5; }
.pg-iria-msg.me { align-self: flex-end; max-width: 85%; background: var(--pg-pink); border-color: var(--pg-wine-light); }
.pg-iria-msg ul { margin: 6px 0 0; padding-left: 18px; }
.pg-iria-foot { padding: var(--space-4); border-top: 1px solid var(--pg-border); display: flex; gap: var(--space-2); }
.pg-iria-foot .pg-btn { padding: 0 14px; }

/* Kpi: indicadores numa faixa única com hairlines */
.pg-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); border: 1px solid var(--pg-border); background: var(--pg-white); }
.pg-kpi { padding: var(--space-6); border-right: 1px solid var(--pg-border); display: flex; flex-direction: column; gap: var(--space-2); min-height: 132px; box-sizing: border-box; }
.pg-kpi:last-child { border-right: 0; }
.pg-kpi-label { font-size: var(--pg-text-xs); font-weight: var(--pg-weight-black); text-transform: uppercase; letter-spacing: 0.12em; color: var(--pg-text2); display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.pg-kpi-value { font-size: var(--pg-text-3xl); font-weight: var(--pg-weight-black); letter-spacing: -0.025em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pg-kpi-sub { font-size: var(--pg-text-sm); color: var(--pg-text2); }
.pg-kpi.attention { box-shadow: inset 0 0 0 2px var(--pg-wine); }
.pg-kpi.attention .pg-kpi-label, .pg-kpi.attention .pg-kpi-value { color: var(--pg-wine); }
.pg-kpi.failed { background: var(--pg-red); }
.pg-kpi.failed .pg-kpi-label { color: var(--pg-red-text); }
.pg-kpi-fail { font-size: var(--pg-text-lg); font-weight: var(--pg-weight-bold); color: var(--pg-red-text); }

/* ChoiceCard: opção em cartão com rádio escondido */
.pg-choices { display: flex; flex-direction: column; gap: var(--space-3); margin: 0; padding: 0; border: 0; min-width: 0; }
.pg-choices.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0; border: 1px solid var(--pg-border); }
.pg-choice { position: relative; display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--pg-white); border: 1px solid var(--pg-border); border-radius: var(--pg-radius); cursor: pointer; transition: border-color 0.2s, color 0.2s; }
.pg-choices.row .pg-choice { border: 0; border-right: 1px solid var(--pg-border); align-items: flex-start; padding: var(--space-5); }
.pg-choices.row .pg-choice:last-child { border-right: 0; }
.pg-choice:hover { color: var(--pg-wine); }
.pg-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.pg-choice > .material-symbols-outlined { font-size: 24px; color: var(--pg-text2); flex-shrink: 0; }
.pg-choice-name { display: block; font-size: var(--pg-text-sm); font-weight: var(--pg-weight-black); }
.pg-choice-desc { display: block; margin-top: 2px; font-size: var(--pg-text-xs); color: var(--pg-text2); line-height: 1.45; }
.pg-choice:has(input:checked) { background: var(--pg-pink); outline: 2px solid var(--pg-wine); outline-offset: -2px; color: var(--pg-wine); }
.pg-choice:has(input:checked) > .material-symbols-outlined { color: var(--pg-wine); }
.pg-choice:has(input:focus-visible) { outline: 2px solid var(--pg-wine); outline-offset: 2px; }

/* DescriptionList: rótulo e valor de leitura */
.pg-dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6) var(--space-8); }
.pg-dl dt { font-size: var(--pg-text-xs); font-weight: var(--pg-weight-bold); text-transform: uppercase; letter-spacing: 0.12em; color: var(--pg-text2); margin-bottom: 6px; }
.pg-dl dd { margin: 0; font-size: var(--pg-text-base); font-weight: var(--pg-weight-medium); font-variant-numeric: tabular-nums; }
.pg-dl.rows { display: block; border: 1px solid var(--pg-border); background: var(--pg-bg); }
.pg-dl.rows > div { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--pg-border); }
.pg-dl.rows > div:last-child { border-bottom: 0; }
.pg-dl.rows dt { margin: 0; }
.pg-dl.rows dd { font-weight: var(--pg-weight-black); }

/* StatusDot: ponto de estado, sempre ao lado de uma palavra */
.pg-dot { display: inline-block; width: 8px; height: 8px; flex-shrink: 0; border-radius: var(--pg-radius-full); background: var(--pg-border); vertical-align: middle; }
.pg-dot.ok { background: var(--pg-green-text); }
.pg-dot.warn { background: var(--pg-yellow-text); }
.pg-dot.error { background: var(--pg-red-text); }
.pg-dot.active { background: var(--pg-wine); }
.pg-dot.pulse { animation: pg-pulse 1.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .pg-dot.pulse { animation: none; } }

/* Timeline: histórico vertical, etapa atual em vinho */
.pg-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pg-timeline li { position: relative; padding: 2px 0 var(--space-6) var(--space-5); border-left: 2px solid var(--pg-border); }
.pg-timeline li:last-child { padding-bottom: 2px; }
.pg-timeline li::before { content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: var(--pg-radius-full); background: var(--pg-border); }
.pg-timeline li.current { border-left-color: var(--pg-wine); }
.pg-timeline li.current::before { background: var(--pg-wine); }
.pg-timeline-when { display: block; margin-bottom: 4px; font-size: var(--pg-text-xs); font-weight: var(--pg-weight-bold); color: var(--pg-text2); font-variant-numeric: tabular-nums; }
.pg-timeline-what { font-size: var(--pg-text-base); font-weight: var(--pg-weight-medium); color: var(--pg-text2); }
.pg-timeline li.current .pg-timeline-what { font-weight: var(--pg-weight-bold); color: var(--pg-text); }

/* Stepper: etapas de um processo em faixa única */
.pg-stepper { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(120px, 1fr); overflow-x: auto; border: 1px solid var(--pg-border); background: var(--pg-white); }
.pg-step { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-2); padding: var(--space-6) var(--space-4); border-right: 1px solid var(--pg-border); }
.pg-step:last-child { border-right: 0; }
.pg-step > .material-symbols-outlined { font-size: 28px; }
.pg-step-name { font-size: var(--pg-text-xs); font-weight: var(--pg-weight-black); text-transform: uppercase; letter-spacing: 0.12em; }
.pg-step-state { font-size: var(--pg-text-sm); font-weight: var(--pg-weight-bold); }
.pg-step.done { background: var(--pg-green); }
.pg-step.done > .material-symbols-outlined, .pg-step.done .pg-step-state { color: var(--pg-green-text); }
.pg-step.active { outline: 2px solid var(--pg-wine); outline-offset: -2px; }
.pg-step.active > .material-symbols-outlined, .pg-step.active .pg-step-state { color: var(--pg-wine); }
.pg-step.pending { background: var(--pg-bg); }
.pg-step.pending > .material-symbols-outlined, .pg-step.pending .pg-step-name, .pg-step.pending .pg-step-state { color: var(--pg-text2); }
.pg-step .pg-dot { position: absolute; top: var(--space-3); right: var(--space-3); width: 10px; height: 10px; }
