/* Interfaces simuladas: estrutura comum e as duas identidades. */

.app {
  --a-bg: var(--paper); --a-side: var(--paper-2); --a-card: #f8fbff; --a-line: var(--rule);
  --a-text: var(--ink); --a-muted: var(--ink-2); --a-faint: var(--ink-3); --a-accent: var(--seal); --a-on-accent: #ffffff;
  --a-chip: rgba(19, 35, 59, 0.06);
  display: grid; grid-template-columns: 232px minmax(0, 1fr); grid-template-rows: auto 1fr;
  min-height: clamp(580px, 72vh, 720px);
  border-radius: 18px; overflow: hidden;
  background: var(--a-bg); color: var(--a-text);
  border: 1px solid var(--a-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.5), 0 2px 6px rgba(19, 35, 59, 0.08), 0 28px 50px -14px rgba(19, 35, 59, 0.3), 0 70px 110px -50px rgba(19, 35, 59, 0.55);
}
.app--capital {
  --a-bg: var(--ledger); --a-side: #0a1310; --a-card: var(--ledger-2); --a-line: var(--ledger-line);
  --a-text: var(--ledger-text); --a-muted: var(--ledger-muted); --a-faint: #7d978c; --a-accent: var(--cap-gold); --a-on-accent: #1b150a;
  --a-chip: rgba(180, 230, 210, 0.07);
  box-shadow: inset 0 1px 0 rgba(180, 230, 210, 0.1), 0 0 0 1px rgba(180, 230, 210, 0.06), 0 30px 70px -20px rgba(0, 0, 0, 0.85);
}
.showroom__apps { display: grid; grid-template-columns: minmax(0, 1fr); }
/* Os dois painéis dividem a mesma célula: a área tem sempre a altura do maior e o que vem abaixo não pula ao alternar. */
.showroom__apps > .app { grid-area: 1 / 1; align-self: start; opacity: 1; transition: opacity .28s var(--ease); }
/* O JS aplica inert imediatamente; o CSS preserva o fade e a altura até ocultar visualmente o painel. */
.showroom__apps > .app[hidden] { display: grid !important; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .28s var(--ease), visibility 0s linear .28s; }
.app[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .app[data-entering] { animation: app-in .55s var(--ease) both; }
  @keyframes app-in { from { opacity: .4; translate: 0 14px; } }
}

/* Lateral */
.app__side { display: flex; flex-direction: column; gap: 18px; padding: 18px 12px; background: var(--a-side); border-right: 1px solid var(--a-line); min-width: 0; }
.app__product { display: flex; align-items: center; gap: 10px; padding: 4px 8px 12px; border-bottom: 1px solid var(--a-line); }
.app__product img { width: 42px; height: 42px; object-fit: contain; }
.app__product b { display: block; font: 600 20px var(--font-ui); }
.app__product small { display: block; font-size: 11px; color: var(--a-faint); letter-spacing: .1em; text-transform: uppercase; }
.app__nav { display: grid; gap: 2px; overflow-y: auto; }
.app__nav button {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 10px;
  border: 0; border-radius: 9px; background: transparent; color: var(--a-muted); text-align: left;
  font: 500 14px var(--font-ui); transition: background-color .2s, color .2s;
}
.app__nav button svg { flex: none; width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.app__nav button:hover { background: var(--a-chip); color: var(--a-text); }
.app__nav button[aria-selected="true"] { background: var(--a-card); color: var(--a-text); box-shadow: inset 3px 0 0 var(--a-accent), 0 1px 0 var(--a-line); }
.app__nav button:focus-visible { outline: 2px solid var(--a-accent); outline-offset: -2px; }
.app__nav-sep { margin: 10px 10px 4px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--a-faint); }

/* Principal */
.app__main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.app__top { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 22px; border-bottom: 1px solid var(--a-line); }
.app__title { margin: 0; font: 600 17px var(--font-ui); letter-spacing: -.01em; }
.app__demo { margin-left: auto; padding: 5px 10px; border-radius: 999px; border: 1px dashed var(--a-line); font-size: 12px; color: var(--a-faint); white-space: nowrap; }
.app__view { flex: 1; min-height: 0; overflow: visible; padding: 22px; scrollbar-width: thin; }
.app__view:focus-visible { outline: 2px solid var(--a-accent); outline-offset: -2px; }
@media (prefers-reduced-motion: no-preference) {
  .app__view[data-swap] > * { animation: view-in .35s var(--ease) both; }
  @keyframes view-in { from { opacity: 0; translate: 0 8px; } }
}

/* Peças comuns */
.v-h { margin: 0 0 4px; font: 400 26px/1.15 var(--font-display); letter-spacing: -.01em; }
.app--capital .v-h { font-family: var(--font-ui); font-weight: 600; font-size: 22px; letter-spacing: -.015em; }
.v-sub { margin: 0 0 20px; color: var(--a-muted); font-size: 14px; }
.v-grid { display: grid; gap: 14px; }
.v-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.v-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.v-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { padding: 16px; border-radius: 12px; background: var(--a-card); border: 1px solid var(--a-line); min-width: 0; }
.card h3 { margin: 0 0 6px; font: 600 15px var(--font-ui); }
.card p { margin: 0; font-size: 13px; color: var(--a-muted); line-height: 1.55; }
.pick { display: grid; gap: 6px; width: 100%; text-align: left; color: inherit; font: inherit; cursor: pointer; transition: border-color .2s, transform .2s var(--ease), box-shadow .2s; }
.pick:hover { border-color: var(--a-accent); transform: translateY(-2px); }
.pick[aria-pressed="true"] { border-color: var(--a-accent); box-shadow: inset 0 0 0 1px var(--a-accent); }
.pick__ico { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--a-chip); color: var(--a-accent); }
.pick__ico svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }

.act { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--a-line); background: var(--a-card); color: var(--a-text); font: 500 13px var(--font-ui); transition: border-color .2s, background-color .2s; }
.act:hover { border-color: var(--a-accent); }
.act--primary { background: var(--a-accent); border-color: var(--a-accent); color: var(--a-on-accent); }
.act--primary:hover { filter: brightness(1.08); }
.acts { display: flex; flex-wrap: wrap; gap: 8px; }

.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--a-chip); gap: 2px; }
.seg button { min-height: 44px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--a-muted); font: 500 13px var(--font-ui); }
.seg button[aria-pressed="true"] { background: var(--a-card); color: var(--a-text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 44px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--a-line); background: transparent; color: var(--a-muted); font: 500 13px var(--font-ui); }
.chip[aria-pressed="true"] { background: var(--a-accent); border-color: var(--a-accent); color: var(--a-on-accent); }

.list { display: grid; margin: 0; padding: 0; list-style: none; border: 1px solid var(--a-line); border-radius: 12px; overflow: hidden; background: var(--a-card); }
.list > li + li { border-top: 1px solid var(--a-line); }
.row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 10px 14px; border: 0; background: transparent; color: inherit; text-align: left; font: inherit; }
button.row { cursor: pointer; transition: background-color .2s; }
button.row:hover, button.row[aria-pressed="true"] { background: var(--a-chip); }
.row__main { display: grid; min-width: 0; flex: 1; }
.row__main b { font: 500 14px var(--font-ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__main small { font-size: 12px; color: var(--a-faint); }
.row__end { margin-left: auto; text-align: right; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font: 500 12px var(--font-ui); white-space: nowrap; background: var(--a-chip); color: var(--a-muted); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--ok { color: var(--st-ok); background: rgba(79, 191, 152, 0.12); }
.badge--warn { color: var(--st-warn); background: rgba(224, 178, 90, 0.12); }
.badge--late { color: var(--st-late); background: rgba(226, 115, 95, 0.12); }
.app--docs .badge--ok { color: #1f6b4f; background: rgba(31, 107, 79, 0.1); }
.app--docs .badge--warn { color: #8a5a12; background: rgba(138, 90, 18, 0.1); }

.field { display: grid; gap: 6px; }
.field label { font: 500 12px var(--font-ui); color: var(--a-muted); }
.field input, .field select { width: 100%; min-width: 0; min-height: 44px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--a-line); background: var(--a-card); color: var(--a-text); }
.field input:focus-visible, .field select:focus-visible { outline: 2px solid var(--a-accent); outline-offset: 1px; }
.field small { font-size: 12px; color: var(--a-faint); }

.note { margin: 16px 0 0; font-size: 12px; color: var(--a-faint); }

/* ---------- DSR Docs: prévia em folha ---------- */
.doc-sheet {
  position: relative; padding: 28px 26px 30px; border-radius: 4px; background: #ffffff; color: var(--ink);
  box-shadow: 0 1px 0 var(--rule), 0 18px 36px -24px rgba(19, 35, 59, 0.35);
  font: 400 13px/1.7 var(--font-display);
  aspect-ratio: 1 / 1.25; overflow: hidden;
}
.doc-sheet h4 { margin: 0 0 14px; font: 600 14px var(--font-display); letter-spacing: .12em; text-align: center; text-transform: uppercase; }
.doc-sheet p { margin: 0 0 10px; color: var(--ink-2); }
.doc-sheet p b { color: var(--ink); }
.doc-sheet mark { background: rgba(39, 88, 184, 0.12); color: var(--ink); border-radius: 3px; padding: 0 2px; }
.doc-sheet__sign { display: grid; justify-items: center; gap: 4px; margin-top: 26px; font-size: 12px; color: var(--ink-2); }
.doc-sheet__sign i { width: 55%; height: 1px; background: var(--ink-2); }
.doc-sheet__seal { position: absolute; right: 18px; bottom: 54px; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #3566c2, var(--seal) 60%, #173a80); color: #fff; font: 700 12px var(--font-display); letter-spacing: .08em; rotate: -14deg; box-shadow: 0 6px 12px -4px rgba(23, 58, 128, .55), inset 0 0 0 3px rgba(255, 255, 255, .18); pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .doc-sheet__seal[data-drop] { animation: seal-drop .45s cubic-bezier(.16, 1, .3, 1) both; }
  .doc-sheet:has(.doc-sheet__seal[data-drop]) { animation: sheet-thud .16s ease-out .3s; }
  @keyframes seal-drop { from { opacity: 0; scale: 1.9; } 70% { opacity: 1; } }
  @keyframes sheet-thud { 40% { translate: 0 2px; } }
}
.doc-sheet__tag { position: absolute; top: 10px; right: 12px; font: 500 10px var(--font-ui); letter-spacing: .06em; color: var(--ink-3); text-transform: uppercase; }
.doc-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .95fr); gap: 20px; align-items: start; }
.steps { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.steps span { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font: 500 12px var(--font-ui); color: var(--a-faint); background: var(--a-chip); }
.steps span[data-on] { color: var(--a-on-accent); background: var(--a-accent); }
.check { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.check li { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--a-card); border: 1px solid var(--a-line); font-size: 14px; }
.check li svg { flex: none; width: 18px; height: 18px; margin-top: 2px; stroke: #1f6b4f; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.check li small { display: block; color: var(--a-faint); font-size: 12px; }

/* ---------- DSR Capital: indicadores e gráficos conceituais ---------- */
.kpi { display: grid; gap: 4px; }
.kpi small { font: 500 11px var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--a-faint); }
.kpi strong { font: 500 24px var(--font-ui); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 12px; color: var(--a-muted); }
.bars { display: grid; grid-template-columns: repeat(var(--n, 7), 1fr); align-items: end; gap: 10px; height: 150px; padding-top: 8px; }
.bars div { display: grid; gap: 6px; align-items: end; height: 100%; text-align: center; font-size: 11px; color: var(--a-faint); }
.bars i { display: block; border-radius: 6px 6px 2px 2px; background: var(--verdigris); min-height: 4px; height: var(--h); }
.bars i.alt { background: #e0b25a; }
@media (prefers-reduced-motion: no-preference) {
  .bars i { animation: grow .7s var(--ease) both; transform-origin: bottom; }
  @keyframes grow { from { transform: scaleY(.05); } }
}
.donut { --a: 56; --b: 33; width: 132px; aspect-ratio: 1; border-radius: 50%; }
.donut::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: conic-gradient(var(--st-ok) 0 calc(var(--a) * 1%), var(--st-warn) 0 calc((var(--a) + var(--b)) * 1%), var(--st-late) 0); -webkit-mask: radial-gradient(circle, transparent 54%, #000 55%); mask: radial-gradient(circle, transparent 54%, #000 55%); }
.legend { display: grid; gap: 8px; font-size: 13px; }
.legend span { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font: 500 11px var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--a-faint); padding: 0 12px 10px; }
.table td { padding: 12px; border-top: 1px solid var(--a-line); font-variant-numeric: tabular-nums; white-space: nowrap; }
.table th { white-space: nowrap; }
.table-wrap { overflow-x: auto; border: 1px solid var(--a-line); border-radius: 12px; background: var(--a-card); padding-top: 12px; }
.search { min-height: 44px; width: min(280px, 100%); padding: 0 12px; border-radius: 9px; border: 1px solid var(--a-line); background: var(--a-card); color: var(--a-text); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }

.drawer { display: grid; gap: 12px; align-content: start; }
.drawer__empty { display: grid; place-items: center; min-height: 220px; border: 1px dashed var(--a-line); border-radius: 12px; color: var(--a-faint); font-size: 13px; text-align: center; padding: 20px; }
.split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 18px; align-items: start; }

/* ---------- Responsivo ---------- */
@media (max-width: 980px) {
  .v-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc-split, .split { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: minmax(0, 1fr); height: auto; }
  .app__side { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px; border-right: 0; border-bottom: 1px solid var(--a-line); }
  .app__product { flex: none; padding: 0 6px 0 2px; border-bottom: 0; }
  .app__product img { width: 32px; height: 32px; }
  .app__product b { font-size: 17px; }
  .app__product small { font-size: 10px; }
  .app__nav { grid-column: 1 / -1; grid-row: 2; min-width: 0; display: flex; gap: 4px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
  .app__nav::-webkit-scrollbar { display: none; }
  .app__nav button { flex: 1; width: auto; justify-content: center; white-space: nowrap; }
  .app__nav button[aria-selected="true"] { box-shadow: inset 0 -2px 0 var(--a-accent); }
  .app__nav-sep { display: none; }
  .app__product { min-width: 0; }
  .app__side .app__side-foot { grid-column: 2; grid-row: 1; margin: 0; padding: 0; border: 0; }
  .app__side-foot .act { padding-inline: 10px; gap: 6px; font-size: 12px; }
  .app__side .app__more-wrap { grid-column: 1 / -1; grid-row: 3; min-width: 0; }
  .app__side .app__status { padding: 0; border: 0; background: none; }
  .app__side .app__status b, .app__side .app__avatar { display: none; }
  .app__view { max-height: none; overflow: visible; padding: 16px; }
  .app__top { padding: 10px 16px; }
}
@media (max-width: 560px) {
  .v-grid--2, .v-grid--3 { grid-template-columns: 1fr; }
  .app__demo { display: none; }
  .doc-sheet { padding: 20px 16px; font-size: 12px; }
  .doc-sheet__seal { width: 42px; height: 42px; right: 12px; bottom: 44px; font-size: 10px; }
  .doc-sheet:has(.doc-sheet__seal[data-drop]) { animation: none; }
}

/* Acabamento "nítido" (teste): linhas finas, superfícies com degradê sutil e textura de grade, como nas telas de referência. */
body { text-rendering: optimizeLegibility; -moz-osx-font-smoothing: grayscale; }
.app .card { background-image: linear-gradient(160deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 60%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 1px 2px rgba(19, 35, 59, 0.06); }
.app--capital .card { background-image: linear-gradient(160deg, rgba(180, 230, 210, 0.07), rgba(180, 230, 210, 0) 60%); box-shadow: inset 0 1px 0 rgba(180, 230, 210, 0.1), 0 1px 2px rgba(0, 0, 0, 0.35); }
.app--capital .bars i.gold { background: linear-gradient(to top, rgba(201, 166, 107, 0.25), var(--cap-gold)); }
.app__side { background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 40%); }

/* Interfaces com a mesma fonte da marca. */
.app { font-family: var(--font-ui); }

/* Teste 2: contraste e densidade mais marcados (diferença visível). */
.app { font-size: 13px; }
.app .card { border-color: color-mix(in srgb, var(--a-accent) 22%, var(--a-line)); border-radius: 10px; }
.app .kpi strong { font-size: 1.55rem; font-weight: 600; letter-spacing: -.035em; }
.app .card h3, .app .toolbar h3 { font-size: 13px; font-weight: 600; letter-spacing: -.01em; }
.app small { letter-spacing: .01em; }
.app__nav button { font-size: 13px; min-height: 44px; }
.app--capital .kpi__ico { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); }
.app--capital { box-shadow: inset 0 1px 0 rgba(180,230,210,.14), 0 0 0 1px rgba(79,191,152,.18), 0 30px 70px -20px rgba(0,0,0,.85); }

/* Tema da vitrine Docs: a folha conserva as cores de impressão. */
.app--docs[data-theme="dark"] {
  --a-bg: #101c2e; --a-side: #16253b; --a-card: #1b2d46;
  --a-line: rgba(191, 208, 232, .25); --a-text: #eef4fb;
  --a-muted: #bfd0e8; --a-faint: #a8beda; --a-accent: #8fb4f0;
  --a-on-accent: #101c2e; --a-chip: rgba(143, 180, 240, .15);
  color-scheme: dark;
}
.app--docs[data-theme="dark"] .card { background-image: none; }
.app--docs[data-theme="dark"] .conf__head small { color: var(--a-accent); }
.app--docs[data-theme="dark"] :is(.conf__ico, .conf__ready--ok, .conf__ok) {
  color: #8bd5b6; background: rgba(139, 213, 182, .08); border-color: rgba(139, 213, 182, .3);
}
.app--docs[data-theme="dark"] .conf__ready--warn {
  color: #ffd18e; background: rgba(255, 209, 142, .08); border-color: rgba(255, 209, 142, .3);
}
.app--docs[data-theme="dark"] .field .cpf-tag--ok { color: #8bd5b6; }
.app--docs[data-theme="dark"] .field .cpf-tag--warn { color: #ffb1a7; }
