/* ======================================================================
   VERSA UI · componentes (prefixo v-). Dependem de tokens.css.
   ====================================================================== */
.v-ui, .v-ui * { box-sizing: border-box; }
.v-ui { font: 400 14px/1.5 var(--sans); color: var(--text); -webkit-font-smoothing: antialiased; }

/* texto */
.v-h1 { font: 300 clamp(34px, 4.4vw, 52px)/1.04 var(--sans); letter-spacing: -.035em; margin: 0; }
.v-h2 { font: 400 20px/1.2 var(--sans); letter-spacing: -.015em; margin: 0; }
.v-h3 { font: 500 14px/1.3 var(--sans); margin: 0; }
.v-serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
.v-meta { font: 400 11.5px/1.3 var(--mono); letter-spacing: .02em; color: var(--muted); }
.v-label { font: 500 11px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.v-muted { color: var(--muted); }
.v-num { font: 300 56px/1 var(--sans); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.v-num.md { font-size: 36px; } .v-num.sm { font-size: 24px; }
.v-num .dim { color: var(--faint); }
.v-kbd { font: 500 11px/1 var(--mono); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; padding: 3px 6px; color: var(--muted); background: var(--glass); }

/* botões */
.v-btn { --h: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h); padding: 0 18px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: transparent; color: var(--text); font: 500 13.5px/1 var(--sans); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .12s, box-shadow .2s; }
.v-btn:hover { background: var(--glass); border-color: var(--text); }
.v-btn:active { transform: translateY(1px); }
.v-btn:disabled, .v-btn[disabled] { opacity: .4; pointer-events: none; }
.v-btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.v-btn.primary:hover { filter: brightness(1.08); box-shadow: 0 0 28px -6px color-mix(in srgb, var(--primary) 70%, transparent); background: var(--primary); }
.v-btn.ghost { border-color: transparent; color: var(--muted); } .v-btn.ghost:hover { color: var(--text); background: var(--glass); border-color: transparent; }
.v-btn.sm { --h: 30px; padding: 0 13px; font-size: 12.5px; }
.v-btn.lg { --h: 46px; padding: 0 26px; font-size: 14.5px; }
.v-btn.icon { width: var(--h); padding: 0; }
.v-btn.block { width: 100%; }
.v-btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); } .v-btn.danger:hover { background: var(--bad-soft); border-color: var(--bad); }

/* pílulas, filtros e estados */
.v-chip { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 13px; border-radius: var(--r-pill); border: 1px solid var(--line); background: transparent; color: var(--muted); font: 500 13px/1 var(--sans); cursor: pointer; white-space: nowrap; transition: .15s; }
.v-chip:hover { color: var(--text); border-color: var(--line-strong); }
.v-chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.v-chip .n { font: 400 11px/1 var(--mono); padding: 3px 7px; border-radius: var(--r-pill); background: var(--glass); color: var(--muted); border: 1px solid var(--line); }
.v-chip.on .n { background: color-mix(in srgb, var(--bg) 18%, transparent); color: var(--bg); border-color: transparent; }
.v-tag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-pill); font: 500 11.5px/1 var(--sans); border: 1px solid var(--line); color: var(--muted); background: var(--glass); white-space: nowrap; }
.v-tag.ok { color: var(--ok); background: var(--ok-soft); border-color: transparent; } .v-tag.warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.v-tag.bad { color: var(--bad); background: var(--bad-soft); border-color: transparent; } .v-tag.accent { color: var(--accent-ink); background: var(--accent-soft); border-color: transparent; }
.v-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; display: inline-block; }
.v-dot.live { background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: v-pulse 1.8s var(--ease) infinite; }
.v-dot.ok { background: var(--ok); } .v-dot.warn { background: var(--warn); } .v-dot.bad { background: var(--bad); } .v-dot.wait { background: var(--warn); animation: v-pulse 1.4s var(--ease) infinite; }
@keyframes v-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 0%, var(--accent)); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.v-live { display: inline-flex; align-items: center; gap: 9px; height: 34px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); font: 400 12px/1 var(--mono); color: var(--muted); }
.v-live b { color: var(--text); font-weight: 500; }

/* cartões */
.v-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--pad); box-shadow: var(--shadow); }
.v-card.flat { box-shadow: none; } .v-card.pad0 { padding: 0; } .v-card.sm { padding: 14px; border-radius: var(--r-md); }
.v-card.glass { background: var(--glass); backdrop-filter: blur(22px) saturate(140%); -webkit-backdrop-filter: blur(22px) saturate(140%); }
.v-card.hl { border-color: var(--accent-line); box-shadow: var(--glow); }
.v-card.bad { border-color: color-mix(in srgb, var(--bad) 40%, transparent); background: linear-gradient(180deg, var(--bad-soft), transparent 70%), var(--surface); }
.v-card.click { cursor: pointer; transition: border-color .15s, transform .15s var(--ease); } .v-card.click:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.v-card.inverse { background: #151514; color: #f3f2ed; border-color: transparent; } :root[data-theme="dark"] .v-card.inverse { background: var(--raised); }
.v-stat { display: grid; gap: 10px; }
.v-spark { display: flex; align-items: flex-end; gap: 3px; height: 44px; } .v-spark i { flex: 1; background: var(--line-strong); border-radius: 2px; min-width: 3px; } .v-spark i.hi { background: var(--accent); }

/* campos */
.v-input, .v-select, .v-textarea { font: 400 14px/1.4 var(--sans); color: var(--text); background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-sm); height: 40px; padding: 0 14px; width: 100%; outline: none; transition: border-color .15s, background .15s; }
.v-textarea { height: auto; padding: 11px 14px; min-height: 88px; resize: vertical; }
.v-input:focus, .v-select:focus, .v-textarea:focus { border-color: var(--accent); background: var(--surface); }
.v-input::placeholder { color: var(--faint); }
.v-search { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 8px 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--glass); color: var(--muted); font-size: 13.5px; cursor: text; }
.v-search:hover { border-color: var(--line-strong); } .v-search > span:first-child { flex: 1; text-align: left; }
.v-toggle { width: 40px; height: 24px; border-radius: var(--r-pill); background: var(--line-strong); border: 0; position: relative; cursor: pointer; transition: background .2s; padding: 0; }
.v-toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text); transition: transform .2s var(--ease); }
.v-toggle.on { background: var(--accent); } .v-toggle.on::after { transform: translateX(16px); background: var(--on-accent); }
.v-progress { height: 36px; border-radius: var(--r-pill); background: var(--glass); border: 1px solid var(--line); overflow: hidden; position: relative; }
.v-progress i { position: absolute; inset: 0 auto 0 0; background: var(--accent-soft); border-right: 1px solid var(--accent-line); border-radius: inherit; }
.v-progress b { position: relative; display: inline-flex; align-items: center; height: 100%; padding: 0 14px; font: 500 12px/1 var(--mono); color: var(--accent-ink); }

/* abas de projeto (com estado) */
.v-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px; scrollbar-width: none; } .v-tabs::-webkit-scrollbar { display: none; }
.v-tab { display: inline-flex; align-items: center; gap: 9px; height: 36px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid transparent; background: transparent; color: var(--muted); font: 500 13px/1 var(--sans); cursor: pointer; white-space: nowrap; }
.v-tab:hover { color: var(--text); background: var(--glass); }
.v-tab.on { color: var(--text); background: var(--surface-2); border-color: var(--line); }
.v-tab .x { opacity: 0; font-size: 14px; margin-left: 2px; color: var(--muted); } .v-tab:hover .x { opacity: 1; }

/* trilho e barra superior */
.v-rail { width: var(--rail); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 0; border-right: 1px solid var(--line); background: var(--bg); }
.v-rail .mark { width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 14px; border-radius: 12px; background: var(--text); color: var(--bg); font: 600 17px/1 var(--sans); letter-spacing: -.04em; }
.v-ri { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: var(--muted); border: 1px solid transparent; background: none; cursor: pointer; position: relative; text-decoration: none; transition: .15s; }
.v-ri:hover { color: var(--text); background: var(--glass); } .v-ri.on { color: var(--accent-ink); background: var(--accent-soft); border-color: var(--accent-line); }
.v-ri svg { width: 20px; height: 20px; }
.v-ri[data-tip]:hover::after { content: attr(data-tip); position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%); background: var(--raised); color: var(--text); border: 1px solid var(--line-strong); border-radius: 8px; padding: 5px 10px; font: 500 12px/1.2 var(--sans); white-space: nowrap; z-index: 50; pointer-events: none; }
.v-topbar { height: var(--topbar); display: flex; align-items: center; gap: 14px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.v-crumb { display: flex; align-items: center; gap: 8px; font: 400 12.5px/1 var(--mono); color: var(--muted); } .v-crumb b { color: var(--text); font-weight: 500; } .v-crumb i { font-style: normal; color: var(--faint); }
.v-bell { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; }
.v-bell em { position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--bad); color: #fff; font: 600 10px/17px var(--sans); font-style: normal; text-align: center; }
.v-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--raised); border: 1px solid var(--line-strong); font: 500 12px/1 var(--sans); color: var(--text); flex: none; }

/* listas, tabelas, acordeão */
.v-list { display: grid; }
.v-row { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.v-row:last-child { border-bottom: 0; } a.v-row:hover .v-h3 { text-decoration: underline; text-underline-offset: 4px; }
.v-table { width: 100%; border-collapse: collapse; font-size: 13.5px; } .v-table th { text-align: left; font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.v-table td { padding: 13px 12px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; } .v-table tr:last-child td { border-bottom: 0; } .v-table .hot { color: var(--warn); }
.v-acc { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.v-acc + .v-acc { margin-top: 8px; }
.v-acc > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; font-weight: 500; } .v-acc > summary::-webkit-details-marker { display: none; }
.v-acc > summary::after { content: "⌄"; margin-left: auto; color: var(--muted); transition: transform .2s; } .v-acc[open] > summary::after { transform: rotate(180deg); }
.v-acc .body { padding: 0 16px 16px; display: grid; gap: 12px; }

/* IA e execuções */
.v-suggest { display: grid; gap: 12px; padding: 16px 18px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--raised); box-shadow: var(--shadow); }
.v-suggest .who { display: flex; align-items: center; gap: 8px; font-weight: 500; } .v-suggest .who svg { color: var(--accent-ink); width: 16px; height: 16px; }
.v-run { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: border-color .15s; } .v-run:hover { border-color: var(--line-strong); }
.v-run .t { font-weight: 500; font-size: 13.5px; } .v-run .s { font: 400 11.5px/1.3 var(--mono); color: var(--muted); }
.v-run.wait { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: linear-gradient(180deg, var(--warn-soft), transparent), var(--surface); }
.v-cmd { width: min(620px, 100%); border-radius: var(--r-lg); border: 1px solid var(--line-strong); background: var(--raised); box-shadow: 0 40px 90px -20px rgba(0,0,0,.8); overflow: hidden; }
.v-cmd .in { display: flex; align-items: center; gap: 12px; padding: 0 18px; height: 56px; border-bottom: 1px solid var(--line); color: var(--muted); } .v-cmd input { flex: 1; background: none; border: 0; outline: none; color: var(--text); font: 400 16px var(--sans); }
.v-cmd .list { max-height: 52vh; overflow-y: auto; padding: 8px; }
.v-cmd .g { font: 500 10.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); padding: 12px 10px 6px; }
.v-cmd .it { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); cursor: pointer; color: var(--text); text-decoration: none; font-size: 14px; } .v-cmd .it .v-meta { margin-left: auto; }
.v-cmd .it.on, .v-cmd .it:hover { background: var(--glass); outline: 1px solid var(--line); }
.v-empty { display: grid; place-items: center; gap: 10px; text-align: center; padding: 48px 20px; color: var(--muted); }
.v-skel { border-radius: 8px; background: linear-gradient(90deg, var(--glass), var(--line), var(--glass)); background-size: 200% 100%; animation: v-sh 1.4s linear infinite; } @keyframes v-sh { to { background-position: -200% 0; } }
