/* ======================================================================
   Studio Versa · tela da designer, no visual Versa UI (ds/tokens.css + ds/components.css).
   Carrega DEPOIS de app.css: reaproveita as classes que as telas já usam e muda o jeito delas.
   ====================================================================== */
:root { --display: var(--sans); --sand: var(--accent); }
body { display: flex; background: var(--bg); color: var(--text); font: 400 14px/1.5 var(--sans); }
.shell { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; }
.main { flex: 1; min-height: 0; overflow-y: auto; height: auto; }
.page { padding: 30px clamp(18px, 3.4vw, 52px) 80px; max-width: 1240px; }
.page.wide { max-width: none; }

/* títulos */
h1 { font: 300 clamp(32px, 4vw, 48px)/1.04 var(--sans); letter-spacing: -.035em; }
h2 { font: 400 20px/1.2 var(--sans); letter-spacing: -.015em; }
h3 { font: 500 15px/1.3 var(--sans); }
h1 em, h2 em, .card .t em, h3 em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--accent-ink); letter-spacing: -.01em; }
.lbl { font: 500 11px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.head { margin-bottom: 26px; } .head .lbl { margin-bottom: 10px; }
.crumb { font: 400 12px/1 var(--mono); color: var(--muted); margin-bottom: 14px; } .crumb a:hover { color: var(--accent-ink); }
.tip { color: var(--muted); font-size: 13px; }
.saved { font: 400 11.5px var(--mono); color: var(--muted); }

/* botões */
.btn { height: 38px; 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); letter-spacing: 0; gap: 8px; }
.btn:hover { background: var(--glass); border-color: var(--text); color: var(--text); }
.btn.solid { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.solid:hover { background: var(--primary); color: var(--on-primary); filter: brightness(1.08); box-shadow: 0 0 28px -6px color-mix(in srgb, var(--primary) 70%, transparent); opacity: 1; }
.btn.small { height: 30px; padding: 0 13px; font-size: 12.5px; }
.btn.ghost { border-color: var(--line); } .btn.ghost:hover { background: var(--glass); border-color: var(--line-strong); }
.link { color: var(--accent-ink); }
input, select, textarea { background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--text); font: 400 14px/1.4 var(--sans); padding: 10px 14px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); background: var(--surface); }
input::placeholder, textarea::placeholder { color: var(--faint); }
select option { background: var(--raised); color: var(--text); }
label.f > span { font: 500 11px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
input[type=checkbox] { accent-color: var(--accent); }

/* cartões, números e listas */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); }
a.card:hover, .card.click:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.card .t { font: 400 22px/1.15 var(--sans); letter-spacing: -.02em; }
.card .m { color: var(--muted); font-size: 13px; }
.stats { gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-top: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--shadow); }
.stat b { font: 300 52px/1 var(--sans); letter-spacing: -.045em; margin: 14px 0 6px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 12.5px; } .stat .lbl { color: var(--muted); }
.list { border-top: 0; display: grid; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 4px 8px; }
.row { padding: 14px 10px; border-bottom: 1px solid var(--line); border-radius: 12px; }
.row:last-child { border-bottom: 0; } a.row:hover { background: var(--glass); } a.row:hover .t { text-decoration: none; }
.row .t { font: 500 15px/1.3 var(--sans); letter-spacing: -.01em; } .row .m { color: var(--muted); font-size: 12.5px; }
.empty { color: var(--muted); }
.sec { margin-bottom: 14px; }

/* pílulas de estado */
.pill { height: 24px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: var(--r-pill); font: 500 11.5px/1 var(--sans); letter-spacing: 0; text-transform: none; border: 1px solid var(--line); color: var(--muted); background: var(--glass); }
.pill.em-aprovacao { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.pill.aprovada, .pill.aceita, .pill.assinado, .pill.publicada { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.pill.enviada, .pill.enviado { color: var(--accent-ink); background: var(--accent-soft); border-color: transparent; }
.pill.atrasado, .pill.recusada { color: var(--bad); background: var(--bad-soft); border-color: transparent; }
.pill.jp { font-size: 11.5px; }

/* abas e filtros */
.tabs { gap: 6px; border-bottom: 0; margin-bottom: 24px; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; width: fit-content; max-width: 100%; }
.tabs button { padding: 0 14px; height: 34px; border-radius: 10px; border: 1px solid transparent; margin: 0; font: 500 13px/1 var(--sans); color: var(--muted); }
.tabs button:hover { color: var(--text); background: var(--glass); }
.tabs button.on { color: var(--text); background: var(--surface-2); border-color: var(--line); }
.tabs sup { font: 400 10.5px var(--mono); margin-left: 6px; color: var(--faint); vertical-align: baseline; }
.filters button { height: 30px; border-radius: var(--r-pill); font-size: 12.5px; } .filters button.on { background: var(--text); color: var(--bg); }
.seg { border-radius: var(--r-pill); background: var(--glass); } .seg button { font-size: 12.5px; } .seg button.on { background: var(--text); color: var(--bg); }

/* materiais */
.drop { border-radius: var(--r-lg); background: var(--glass); border-color: var(--line-strong); }
.file { border-radius: var(--r-md); background: var(--surface); } .file .th { background-color: var(--surface-2); font-family: var(--mono); font-size: 13px; }

/* editor Claude + prévia */
.ws-left { background: var(--bg); } .ws-bar { border-bottom: 1px solid var(--line); }
.ws-bar .tt { font: 500 16px/1.2 var(--sans); letter-spacing: -.015em; } .ws-bar .tt small { font: 500 10px var(--mono); letter-spacing: .1em; color: var(--muted); }
.ws-tabs button { font-weight: 500; } .ws-tabs button.on { border-bottom-color: var(--accent); }
.ws-right { background: var(--surface-2); } .pv-bar { background: var(--bg); border-bottom: 1px solid var(--line); }
.pv-stage { background: var(--surface-2); } .pv-frame { border-radius: 14px; }
.com { border-radius: var(--r-md); background: var(--surface); } .com .n { background: var(--accent); color: var(--on-accent); }
.cform .f { gap: 6px; }

/* documentos */
.paper { background: #fbf9f4; color: #141311; border-radius: 10px; }
.paper h1, .paper h2, .paper .pd-tot td { font-family: "Bodoni Moda", Georgia, serif; font-weight: 400; letter-spacing: -.02em; }
.paper .lbl { color: #5f5a4e; font-family: var(--sans); } .paper em { color: inherit; font-family: inherit; }
.md-edit { font: 13px/1.6 var(--mono); }
.sec-d, .bloco, .orc-l, .jp-step { border-radius: var(--r-md); }
.orc-tot span b { font: 300 32px/1.1 var(--sans); letter-spacing: -.04em; }
.jp-step.atual { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-line), 0 0 30px -12px var(--accent); }
.bf-linkbox { border-radius: var(--r-lg); background: var(--surface); }
dialog { border-radius: var(--r-lg); background: var(--raised); border: 1px solid var(--line-strong); box-shadow: 0 40px 90px -20px rgba(0,0,0,.7); }
dialog::backdrop { background: var(--overlay); backdrop-filter: blur(6px); }
dialog h2 { font: 400 22px var(--sans); }

/* casca: trilho + topo */
.v-rail { flex: none; height: 100%; overflow: visible; z-index: 30; }
.v-rail .mark { text-decoration: none; }
.v-ri.soon { opacity: .35; pointer-events: none; }
.v-topbar { flex: none; background: var(--bg); position: relative; z-index: 20; }
.v-topbar .v-search { width: 240px; margin-left: auto; font-family: var(--sans); } .v-search > span:first-child { flex: 1; text-align: left; }
#conn { cursor: pointer; } #conn .v-dot { background: var(--bad); } #conn.ok .v-dot { background: var(--ok); }
.live-wrap { position: relative; } #livePill { cursor: pointer; }
.live-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 340px; max-width: calc(100vw - 24px); background: var(--raised); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: 0 30px 70px -20px rgba(0,0,0,.7); padding: 10px; display: grid; gap: 8px; z-index: 60; }
.live-menu .v-empty { padding: 22px 10px; }
.cmd-bg { position: fixed; inset: 0; z-index: 200; background: var(--overlay); backdrop-filter: blur(8px); display: grid; align-items: start; justify-items: center; padding: 14vh 14px 14px; }
.cmd-bg[hidden] { display: none; }
@media (max-width: 900px) {
  body { flex-direction: column-reverse; }
  .v-rail { width: 100%; height: 62px; flex-direction: row; justify-content: space-around; align-items: center; border-right: 0; border-top: 1px solid var(--line); padding: 4px 6px; flex: none; }
  .v-rail .mark, .v-rail .grow, .v-rail .desk { display: none; }
  .v-ri[data-tip]:hover::after { display: none; }
  .v-topbar { padding: 0 12px; } .v-topbar .v-crumb i, .v-topbar .v-crumb .v-hide { display: none; } .v-topbar .v-search { width: auto; } .v-topbar .v-search .v-lbl, .v-topbar .v-search .v-kbd { display: none; }
  .shell { height: auto; flex: 1; min-height: 0; }
}

/* ===== barra lateral com os projetos ===== */
.sb { width: 264px; flex: none; height: 100%; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--bg); padding: 14px 10px 10px; gap: 4px; overflow: hidden; transition: width .18s var(--ease); z-index: 30; position: relative; }
.sb.mini { width: var(--rail); padding-left: 12px; padding-right: 12px; }
.sb-head { display: flex; align-items: center; gap: 10px; padding: 0 4px 12px; }
.sb-head .mark { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--text); color: var(--bg); font: 600 17px/1 var(--sans); letter-spacing: -.04em; text-decoration: none; }
.sb-brand { font: 600 15px var(--sans); letter-spacing: -.03em; flex: 1; white-space: nowrap; }
.sb-tog { width: 30px; height: 30px; border-radius: 9px; border: 1px solid transparent; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; transform: rotate(180deg); } .sb-tog:hover { background: var(--glass); color: var(--text); }
.sb.mini .sb-tog { transform: none; position: absolute; left: 19px; bottom: 120px; }
.sb-it, .sb-p, .sb-ch { display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 11px; border-radius: 12px; color: var(--muted); text-decoration: none; font: 500 13.5px/1 var(--sans); border: 1px solid transparent; background: none; cursor: pointer; width: 100%; text-align: left; white-space: nowrap; }
.sb-it:hover, .sb-p:hover, .sb-ch:hover { color: var(--text); background: var(--glass); }
.sb-it.on { color: var(--accent-ink); background: var(--accent-soft); border-color: var(--accent-line); }
.sb-it.soon { opacity: .35; pointer-events: none; } .sb-it svg { flex: none; }
.sb-l { overflow: hidden; text-overflow: ellipsis; flex: 1; }
.sb-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 11px 4px; font: 500 10.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); } .sb-h button { width: 24px; height: 24px; border-radius: 8px; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; } .sb-h button:hover { background: var(--glass); color: var(--text); }
.sb-tree { flex: 1; min-height: 0; overflow-y: auto; display: grid; gap: 1px; align-content: start; padding-bottom: 8px; scrollbar-width: thin; }
.sb-p { height: 34px; font-weight: 400; } .sb-p.on { color: var(--text); background: var(--surface-2); border-color: var(--line); }
.sb-p.add { color: var(--faint); font-size: 12.5px; padding-left: 36px; }
.sb-c .sb-pgs { display: none; padding-left: 14px; margin-left: 17px; border-left: 1px solid var(--line); } .sb-c.open .sb-pgs { display: grid; }
.sb-ch { height: 36px; } .sb-ch .chev { width: 12px; color: var(--faint); transition: transform .15s; font-size: 14px; flex: none; } .sb-c.open .sb-ch .chev { transform: rotate(90deg); }
.sb-c.here > .sb-ch { color: var(--text); background: var(--surface-2); border-color: var(--line); } .sb-c.cur > .sb-ch { color: var(--text); }
.sb-n { font: 400 11px var(--mono); color: var(--faint); }
.sb-foot { display: grid; gap: 2px; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.sb.mini .sb-l, .sb.mini .sb-h, .sb.mini .sb-tree, .sb.mini .sb-brand { display: none; } .sb.mini .sb-it { justify-content: center; padding: 0; } .sb.mini .sb-head { justify-content: center; padding-bottom: 14px; }
.sb.mini .sb-nav { display: grid; gap: 2px; } .sb.mini .sb-tree { display: block; flex: 1; }
.sb .v-dot { flex: none; } .v-dot.bad { background: var(--bad); } .v-dot.ok { background: var(--ok); }

/* ===== bancada: arquivos + código + prévia ===== */
.main { position: relative; }
.wsx { height: 100%; }
.wb { display: grid; grid-template-columns: 252px minmax(0, 1fr); height: 100%; min-height: 0; background: var(--bg); }
.wb.ex-off { grid-template-columns: 0 minmax(0, 1fr); } .wb.ex-off .wb-ex { display: none; } .wb.solo { grid-template-columns: minmax(0, 1fr); } .wb.solo .wb-ex, .wb.solo .wb-tabs { display: none; }
.wb-ex { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); }
.wb-exh { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 4px 14px; } .wb-exh b { font: 500 11px/1 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.wb-btns { display: flex; flex-wrap: wrap; justify-content: flex-end; max-width: 150px; } .wb-btns button { width: 24px; height: 24px; border: 0; border-radius: 7px; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; } .wb-btns button:hover { background: var(--glass); color: var(--text); }
.wb-path { font: 400 10.5px/1.4 var(--mono); color: var(--faint); padding: 0 14px 8px; word-break: break-all; border-bottom: 1px solid var(--line); max-height: 54px; overflow: hidden; }
.wb-tree { flex: 1; overflow: auto; padding: 6px 0 20px; outline: none; font-size: 13px; }
.wb-it { display: flex; align-items: center; gap: 6px; height: 26px; padding-right: 10px; cursor: pointer; color: var(--muted); white-space: nowrap; } .wb-it:hover { background: var(--glass); color: var(--text); } .wb-it.sel { background: var(--accent-soft); color: var(--text); }
.wb-it .chev { width: 12px; font-size: 13px; color: var(--faint); flex: none; transition: transform .12s; } .wb-it .chev.o { transform: rotate(90deg); } .wb-it .nm { overflow: hidden; text-overflow: ellipsis; } .wb-it.root .nm { font-weight: 500; color: var(--text); } .wb-it svg { flex: none; } .wb-it .fi { display: grid; }
.wb-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.wb-tabs { display: flex; align-items: stretch; gap: 0; border-bottom: 1px solid var(--line); background: var(--surface); overflow-x: auto; flex: none; min-height: 38px; scrollbar-width: none; }
.wb-tab { display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; height: 38px; border: 0; border-right: 1px solid var(--line); border-bottom: 2px solid transparent; background: none; color: var(--muted); font: 500 12.5px/1 var(--sans); cursor: pointer; white-space: nowrap; } .wb-tab:hover { color: var(--text); background: var(--glass); }
.wb-tab.on { background: var(--bg); color: var(--text); border-bottom-color: var(--accent); } .wb-tab.ic { border: 0; padding: 0 12px; }
.wb-tab .x { opacity: .4; font-size: 15px; line-height: 1; padding: 2px 4px; border-radius: 5px; } .wb-tab:hover .x, .wb-tab.on .x { opacity: 1; } .wb-tab .x:hover { background: var(--line); }
.wb-tab .dirty { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.wb-pane { flex: 1; min-height: 0; position: relative; }
.wb-fixed, .wb-code, .wb-other { position: absolute; inset: 0; } .wb-fixed[hidden], .wb-code[hidden], .wb-other[hidden] { display: none; }
.wb-ta { width: 100%; height: 100%; border: 0; border-radius: 0; background: #0c0c0b; color: var(--text); font: 13px/1.6 var(--mono); padding: 14px; resize: none; outline: none; }
.wb-img { height: 100%; display: grid; place-content: center; gap: 12px; justify-items: center; background: var(--surface-2); padding: 24px; } .wb-img img { max-width: 100%; max-height: 72vh; border-radius: 10px; background: repeating-conic-gradient(#8883 0 25%, transparent 0 50%) 50% / 18px 18px; }
.arq { height: calc(100vh - 340px); min-height: 460px; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }

/* prévia dentro da bancada */
.pvx { height: 100%; display: flex; flex-direction: column; min-width: 0; background: var(--surface-2); }
.pvx .pv-bar { align-items: center; gap: 8px; padding: 8px 14px; flex-wrap: wrap; } .pvx .tt { font: 500 14px/1.15 var(--sans); letter-spacing: -.01em; margin-right: 6px; } .pvx .tt small { display: block; font: 500 9.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pv-main { flex: 1; min-height: 0; position: relative; display: flex; } .pv-main .pv-stage { flex: 1; min-width: 0; }
.cdrawer { position: absolute; top: 0; right: 0; bottom: 0; width: 340px; max-width: 92%; background: var(--surface); border-left: 1px solid var(--line); display: flex; flex-direction: column; z-index: 6; box-shadow: -20px 0 50px -30px rgba(0,0,0,.6); } .cdrawer[hidden] { display: none; }
.cd-h { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); } .cdrawer .coms { position: static; flex: 1; overflow-y: auto; padding: 14px; }
#cbtn.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }

/* ===== chat do Claude flutuante ===== */
#dock { position: fixed; right: 20px; bottom: 20px; z-index: 80; }
#dock[hidden] { display: none; }
.dk { width: 320px; border-radius: 20px; border: 1px solid var(--line-strong); background: var(--raised); box-shadow: 0 30px 80px -24px rgba(0,0,0,.85); overflow: hidden; display: flex; flex-direction: column; transition: width .2s var(--ease), height .2s var(--ease); }
#dock.open .dk { width: min(440px, calc(100vw - 24px)); height: min(78vh, 700px); }
.dk-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; flex: none; } .dk-head:hover { background: var(--glass); }
.dk-tt { flex: 1; min-width: 0; display: grid; gap: 2px; } .dk-tt b { font: 500 13.5px/1.2 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk-acts { display: none; gap: 2px; } #dock.open .dk-acts { display: flex; } .dk-acts button { width: 28px; height: 28px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; } .dk-acts button:hover { background: var(--glass); color: var(--text); }
.dk-chev { color: var(--muted); display: grid; transform: rotate(-90deg); transition: transform .2s; } #dock.open .dk-chev { transform: rotate(90deg); }
.dk-body { flex: 1; min-height: 0; border-top: 1px solid var(--line); } .dk-body iframe { width: 100%; height: 100%; border: 0; background: var(--bg); }
#dock:not(.open) .dk-body { height: 0; flex: none; border: 0; overflow: hidden; }
#dock.busy .dk { border-color: var(--accent-line); box-shadow: var(--glow); } #dock.ask .dk { border-color: color-mix(in srgb, var(--warn) 55%, transparent); }

@media (max-width: 900px) {
  .sb { width: 100%; height: 62px; flex-direction: row; align-items: center; border-right: 0; border-top: 1px solid var(--line); padding: 4px 8px; overflow-x: auto; }
  .sb .sb-head, .sb .sb-h, .sb .sb-tree, .sb .sb-foot, .sb .sb-l { display: none; } .sb-nav { display: flex; width: 100%; justify-content: space-around; } .sb-it { width: 46px; padding: 0; justify-content: center; } .sb.mini .sb-tog { display: none; }
  .wb { grid-template-columns: minmax(0, 1fr); } .wb .wb-ex { display: none; } #dock { right: 10px; bottom: 74px; } .dk { width: 260px; }
  body { flex-direction: column-reverse; }
}

.sb-h.sb-l { flex: none; }
