/* Painel do Storio (console web). Mesma marca do app, outra cara: o app é denso, com
   trilho de ícones; o painel tem barra lateral azul-noite com nomes, conteúdo
   centralizado e tipografia maior. A área de trabalho usa o tom da coluna de ícones do
   app (#121826), com os cartões um degrau acima. Teal, Sora e IBM Plex continuam. */

@font-face { font-family: 'Sora'; font-style: normal; font-weight: 600 700; font-display: swap; src: url('fonts/sora.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('fonts/plexsans.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/plexmono-400.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/plexmono-500.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/plexmono-600.woff2') format('woff2'); }

:root {
  /* área de trabalho: o tom da coluna de ícones do app (--surface de lá) */
  --bg: #121826;
  --surface: #1a2233;           /* cartões e painéis */
  --surface-2: #212b40;         /* cabeçalho de tabela, rodapé de painel, botões */
  --surface-3: #2b3650;         /* trilhos de barra, etiquetas */
  --field: #0f1522;             /* campos de formulário, afundados no cartão */
  --border: rgba(148, 163, 184, .16);
  --border-strong: rgba(148, 163, 184, .30);
  --text: #e6eaf2;
  --text-dim: #a4aec3;
  --text-faint: #7f8aa2;
  /* marca */
  --accent: #5fd4c9;            /* teal da marca: links, ícones, barras */
  --accent-strong: #8ae6dd;
  --accent-bright: #5fd4c9;
  --accent-fill: #0c8a7f;       /* fundo do botão principal, com texto branco */
  --accent-fill-hover: #0fa093;
  --accent-soft: rgba(95, 212, 201, .13);
  --accent-line: rgba(95, 212, 201, .34);
  --warn: #f0b429;
  --warn-soft: rgba(240, 180, 41, .13);
  --warn-line: rgba(240, 180, 41, .34);
  --danger: #f4677b;
  --danger-soft: rgba(240, 84, 106, .13);
  --danger-line: rgba(240, 84, 106, .38);
  --good: #4ade80;
  --good-soft: rgba(74, 222, 128, .13);
  --good-line: rgba(74, 222, 128, .32);
  /* barra lateral (azul-noite do app; #020d1f é o fundo do arquivo do logo) */
  --side-bg: #020d1f;
  --side-text: #d5ddec;
  --side-dim: #8492ae;
  --side-line: rgba(148, 163, 184, .16);
  --side-hover: rgba(255, 255, 255, .06);
  --side-width: 248px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .22);
  --shadow-hover: 0 8px 22px rgba(0, 0, 0, .34);
  --shadow-pop: 0 22px 56px rgba(0, 0, 0, .42);
  --font-display: 'Sora', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.015em; text-wrap: balance; }
.mono { font-family: var(--font-mono); font-size: 12.5px; }
.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.dev-banner {
  background: var(--warn-soft); color: var(--warn);
  border-bottom: 1px solid var(--warn-line);
  font-size: 12px; text-align: center; padding: 5px 12px; height: 29px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dev-banner a { color: var(--warn); text-decoration: underline; }

/* ---------- botões e campos ---------- */
.btn, button {
  font-family: var(--font-body); font-size: 13px; font-weight: 500; line-height: 1.3;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover, button:hover { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-soft); text-decoration: none; }
.btn.primary, button.primary { border-color: var(--accent-fill); color: #fff; background: var(--accent-fill); font-weight: 600; }
.btn.primary:hover, button.primary:hover { background: var(--accent-fill-hover); border-color: var(--accent-fill-hover); color: #fff; }
.btn.danger, button.danger { border-color: var(--danger-line); color: var(--danger); background: transparent; }
.btn.danger:hover, button.danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn.ghost, button.ghost { background: transparent; border-color: transparent; color: var(--text-dim); padding: 6px 8px; box-shadow: none; }
.btn.ghost:hover, button.ghost:hover { color: var(--accent-strong); background: var(--accent-soft); }
.btn.sm, button.sm { padding: 5px 10px; font-size: 12.5px; }
button:disabled, .btn.disabled { opacity: .5; cursor: default; pointer-events: none; }
.btn.block, button.block { width: 100%; padding: 11px 14px; font-size: 14px; }

label { display: block; font-size: 12.5px; font-weight: 500; color: var(--text-dim); margin: 16px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, .fld {
  width: 100%; font: inherit; font-size: 14px; color: var(--text);
  background: var(--field); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 9px 11px; outline: none; transition: border-color .15s, box-shadow .15s;
}
/* Campos de busca do portal (Selecionar Workspace, Buscar usuário): todos do mesmo tamanho, um pouco menores. */
input[type=search], input.combo-input { padding-top: 6px; padding-bottom: 6px; font-size: 13px; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled { color: var(--text-dim); background: var(--surface-2); border-color: var(--border); }
input::placeholder { color: var(--text-faint); }
select { appearance: none; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.hint { font-size: 12.5px; color: var(--text-faint); margin-top: 6px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form > input, .inline-form > select { width: auto; flex: 1 1 160px; }
form.inline { display: inline; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 14px; align-items: end; }
.form-actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 7px; margin: 0; padding: 6px 11px; font-size: 13px; color: var(--text);
  background: var(--field); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; }
.check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.check input { accent-color: var(--accent); margin: 0; }

/* ---------- avisos e etiquetas ---------- */
.alert { border-radius: var(--radius-md); padding: 12px 16px; font-size: 13.5px; border: 1px solid; border-left-width: 4px; }
.alert.ok { background: var(--good-soft); border-color: var(--good-line); border-left-color: var(--good); color: #b4f1cb; }
.alert.warn { background: var(--warn-soft); border-color: var(--warn-line); border-left-color: var(--warn); color: #f8d993; }
.alert.error { background: var(--danger-soft); border-color: var(--danger-line); border-left-color: var(--danger); color: #fab3be; }
.alert.info { background: var(--accent-soft); border-color: var(--accent-line); border-left-color: var(--accent); color: #bdeee9; }
.alert strong { color: var(--text); }
.alert a { color: inherit; text-decoration: underline; }
.alert .alert-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.alert .alert-actions a { text-decoration: none; }
.alert .alert-actions a.primary { color: #fff; }
.alert .alert-actions a:not(.primary) { color: var(--text); }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 20px;
  background: var(--surface-3); color: var(--text-dim); border: 1px solid var(--border); white-space: nowrap;
}
.tag.accent { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent-line); }
.tag.good { background: var(--good-soft); color: var(--good); border-color: var(--good-line); }
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.tag.danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- entrada: marca à esquerda, formulário à direita ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: clamp(300px, 36vw, 480px) 1fr; }
.dev .auth-wrap { min-height: calc(100vh - 29px); }
.auth-brand {
  background:
    radial-gradient(620px 460px at 0% 100%, rgba(95, 212, 201, .22), transparent 70%),
    var(--side-bg);
  color: var(--side-text); padding: 40px 44px 40px; display: flex; flex-direction: column; position: relative; overflow: hidden;
}
.auth-logo img { height: 46px; display: block; }
.auth-pitch { margin-top: auto; position: relative; z-index: 1; }
.auth-pitch h2 { font-size: 26px; line-height: 1.2; margin: 0 0 12px; color: #fff; }
.auth-pitch p { margin: 0; color: #fff; font-size: 14.5px; max-width: 34ch; }  /* 11/11: texto em branco */
/* O desenho da marca (barras e pontos), grande e apagado, no canto. */
.auth-mark { position: absolute; right: -90px; top: 24%; width: 280px; opacity: .07; display: grid; gap: 20px; }
.auth-mark i { display: flex; gap: 20px; align-items: center; }
.auth-mark i::before, .auth-mark i::after { content: ""; height: 50px; background: var(--accent-bright); }
.auth-mark i::before { width: 50px; border-radius: 50%; flex: none; }
.auth-mark i::after { flex: 1; }
.auth-mark i:nth-child(2) { flex-direction: row-reverse; }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; min-width: 0; }
.auth-card {
  width: 100%; max-width: 430px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px 32px 28px; box-shadow: var(--shadow-pop);
}
.auth-wrap.wide .auth-card { max-width: 760px; }
/* Entrar: sem o desenho grande do logo na coluna e com um cartão menor, mais delicado. */
.auth-wrap.center .auth-mark { display: none; }
.auth-wrap.center .auth-card { max-width: 340px; padding: 24px 24px 20px; }
.auth-wrap.center .auth-card h1 { font-size: 20px; margin-bottom: 4px; }
.auth-wrap.center .auth-card label { font-size: 12px; margin: 12px 0 5px; }
.auth-wrap.center .auth-card input { padding: 7px 10px; font-size: 13.5px; }
.auth-wrap.center .auth-card button[type=submit] { margin-top: 18px; padding: 8px; font-size: 13.5px; }
.auth-wrap.center .auth-card form.switch button { margin-top: 0; padding: 4px 9px; font-size: 12.5px; }  /* "Não é você?" na mesma linha */
.auth-wrap.center .auth-card .switch { margin-top: 16px; font-size: 12.5px; }
.auth-card h1 { font-size: 24px; margin: 0 0 8px; }
.auth-card .lead { color: var(--text-dim); margin: 0 0 8px; }
.auth-card .alert { margin: 16px 0 0; }
.auth-card button[type=submit] { width: 100%; margin-top: 22px; padding: 11px; font-size: 14px; }
.auth-card .switch { text-align: center; color: var(--text-dim); margin: 20px 0 0; font-size: 13px; }
.auth-card .btn.block { margin-top: 18px; }
.auth-card .switch.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; }
/* Entrar: o cartão fica no centro da tela inteira, por cima da coluna da marca. */
@media (min-width: 861px) {
  .auth-wrap.center .auth-brand { grid-area: 1 / 1; }
  .auth-wrap.center .auth-main { grid-area: 1 / 1 / 2 / -1; position: relative; z-index: 1; pointer-events: none; }
  .auth-wrap.center .auth-card { pointer-events: auto; }
  /* Entrar: coluna da marca mais fina. */
  .auth-wrap.center { grid-template-columns: clamp(240px, 23vw, 320px) 1fr; }
  .auth-wrap.center .auth-brand { padding: 32px 28px; }
  .auth-wrap.center .auth-logo img { height: 38px; }
  .auth-wrap.center .auth-pitch h2 { font-size: 21px; }
  .auth-wrap.center .auth-pitch p { font-size: 13.5px; }
}
.mail { border-top: 1px solid var(--border); padding: 14px 0; }
.mail pre { white-space: pre-wrap; font-family: var(--font-mono); font-size: 12.5px; color: var(--text-dim); margin: 8px 0 0; }
@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-brand { padding: 18px 20px; background: var(--side-bg); }
  .auth-logo img { height: 34px; }
  .auth-pitch, .auth-mark { display: none; }
  .auth-main { justify-content: flex-start; padding: 28px 16px 40px; }
  .auth-card { padding: 24px 20px; }
}

/* ---------- casca do painel ---------- */
.app-shell { display: grid; grid-template-columns: var(--side-width) minmax(0, 1fr); min-height: 100vh; }
.dev .app-shell { min-height: calc(100vh - 29px); }
.sidebar {
  background:
    radial-gradient(420px 320px at 0% 100%, rgba(95, 212, 201, .12), transparent 70%),
    var(--side-bg);
  color: var(--side-text); border-right: 1px solid var(--side-line);
  display: flex; flex-direction: column; gap: 18px; padding: 22px 14px 14px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.dev .sidebar { height: calc(100vh - 29px); }
.side-brand { display: block; padding: 0 8px; }
.side-brand img { height: 38px; display: block; }
.side-label { display: block; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--side-dim); margin: 0 0 6px; padding: 0 10px; }
.side-org { border: 1px solid var(--side-line); border-radius: var(--radius-md); padding: 12px 12px 11px; background: rgba(255, 255, 255, .03); display: flex; flex-direction: column; gap: 8px; }
.side-org .side-label { padding: 0; margin: 0; }
.side-org-name { font-family: var(--font-display); font-weight: 600; font-size: 14.5px; color: #fff; line-height: 1.3; overflow-wrap: anywhere; }
.side-org select { font-size: 13.5px; font-weight: 500; color: #fff; background-color: rgba(255, 255, 255, .06); border-color: var(--side-line); padding: 7px 28px 7px 10px;
  background-image: linear-gradient(45deg, transparent 50%, var(--side-dim) 50%), linear-gradient(135deg, var(--side-dim) 50%, transparent 50%); }
.side-org select:focus { border-color: var(--accent-bright); box-shadow: 0 0 0 3px rgba(95, 212, 201, .18); }
.side-status { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--side-text); }
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .18); flex-shrink: 0; }
.pill-dot.warn { background: #f0b429; box-shadow: 0 0 0 3px rgba(240, 180, 41, .18); }
.pill-dot.danger { background: #f0546a; box-shadow: 0 0 0 3px rgba(240, 84, 106, .18); }
.pill-dot.idle { background: var(--side-dim); box-shadow: 0 0 0 3px rgba(132, 146, 174, .18); }
.side-readonly { font-size: 11.5px; color: #f8d27a; background: rgba(240, 180, 41, .12); border: 1px solid rgba(240, 180, 41, .3); border-radius: 6px; padding: 3px 8px; align-self: flex-start; }

.side-menu { display: flex; flex-direction: column; gap: 2px; }
.side-menu .side-label { margin-top: 4px; }
.side-menu .side-label + .side-link { margin-top: 0; }
.side-link {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--side-text); font-size: 14px; font-weight: 500; position: relative; transition: background .15s, color .15s;
}
.side-link svg, .side-exit svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.side-link svg { color: var(--side-dim); transition: color .15s; }
.side-link:hover { background: var(--side-hover); color: #fff; text-decoration: none; }
.side-link:hover svg { color: var(--side-text); }
.side-link.active { background: rgba(95, 212, 201, .14); color: #fff; }
.side-link.active svg { color: var(--accent-bright); }
.side-link.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; background: var(--accent-bright); border-radius: 0 3px 3px 0; }
.side-link.support svg { color: #f0b429; }
.side-link.support.active { background: rgba(240, 180, 41, .14); }
.side-link.support.active::before { background: #f0b429; }
.side-sep { margin-top: 12px; }

.side-user { margin-top: auto; display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--side-line); padding-top: 12px; }
.side-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--radius-sm); color: var(--side-text); }
.side-who:hover { background: var(--side-hover); text-decoration: none; color: #fff; }
.side-who.active { background: var(--side-hover); }
.side-avatar { width: 32px; height: 32px; border-radius: 50%; background: rgba(95, 212, 201, .16); color: var(--accent-bright); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 13px; flex: none; }
.side-who-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.side-who-text strong { font-size: 13px; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-who-text small { font-size: 11.5px; color: var(--side-dim); }
.side-exit { width: 36px; height: 36px; padding: 0; border: none; background: none; color: var(--side-dim); border-radius: var(--radius-sm); box-shadow: none; flex: none; }
.side-exit:hover { background: var(--side-hover); color: #fff; border: none; }

.main { min-width: 0; }
.content { padding: 34px 40px 64px; display: flex; flex-direction: column; gap: 22px; max-width: 1180px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; padding-bottom: 2px; }
.page-head h1 { font-weight: 700; font-size: 26px; line-height: 1.2; margin: 0; }
.page-head .sub { font-size: 14px; color: var(--text-dim); margin: 6px 0 0; max-width: 72ch; }
.page-head .head-actions { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }  /* botões à esquerda, embaixo do texto */
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: 12.5px; color: var(--text-faint); margin: 0 0 6px; }
.crumbs a { color: var(--text-dim); }

/* ---------- números de destaque ---------- */
/* 4 lado a lado, depois 2 × 2, depois um por linha: nunca 3 + 1. */
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1240px) { .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .metrics-grid { grid-template-columns: minmax(0, 1fr); } }
.metric-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px 20px 16px; color: var(--text); box-shadow: var(--shadow-card); transition: border-color .15s, box-shadow .15s, transform .15s; }
a.metric-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow-hover); text-decoration: none; color: var(--text); transform: translateY(-1px); }
.metric-card .lbl { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: var(--text-faint); margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.metric-card .lbl::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--accent-bright); flex: none; }
.metric-card .val { font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.metric-card .val.text { font-size: 19px; line-height: 1.3; }
.metric-card .val.danger { color: var(--danger); }
.metric-card .foot { font-size: 12.5px; color: var(--text-faint); margin-top: 8px; }
.metric-card.warn { border-color: var(--warn-line); background: linear-gradient(180deg, var(--warn-soft), var(--surface) 70%); }
.metric-card.warn .lbl::before { background: #e0a100; }
.metric-card.err { border-color: var(--danger-line); background: linear-gradient(180deg, var(--danger-soft), var(--surface) 70%); }
.metric-card.err .lbl::before { background: var(--danger); }

.split-2 { display: grid; grid-template-columns: 1.45fr 1fr; gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 1080px) { .split-2 { grid-template-columns: 1fr; } }

/* ---------- painéis e tabelas ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; min-width: 0; box-shadow: var(--shadow-card); }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.panel-head h2, .panel-head h3 { margin: 0; font-family: var(--font-display); font-size: 15px; font-weight: 600; }
.panel-head .crumb { margin-left: auto; font-size: 12.5px; color: var(--text-faint); }
.panel-head .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.panel-body { padding: 18px 20px; }
.panel-body > :first-child { margin-top: 0; }
.panel-foot { padding: 12px 20px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-faint); background: var(--surface-2); }
.panel.danger-zone { border-color: var(--danger-line); }
.panel.danger-zone .panel-head h3 { color: var(--danger); }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); font-weight: 600; padding: 10px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
td { padding: 12px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-2); }
td .sub { display: block; font-size: 12.5px; color: var(--text-faint); }
td.actions { text-align: right; white-space: nowrap; }
td.actions form { display: inline; }
/* 13/11: o texto longo de "Liberar/Remover acesso a Pagamentos" quebra em duas linhas. */
td.actions .billing-access-btn { white-space: normal; max-width: 128px; line-height: 1.25; vertical-align: middle; }
td a { font-weight: 500; }
.table-wrap { overflow-x: auto; }
.empty { padding: 28px 20px; color: var(--text-faint); font-size: 13.5px; text-align: center; }
.empty strong { display: block; color: var(--text-dim); font-size: 14px; margin-bottom: 4px; }

/* ---------- workspaces em quadrados ---------- */
/* Janela Novo workspace: 3 passos (nome, região, cota). Sem JavaScript os passos
   aparecem um embaixo do outro; com JavaScript (.is-stepped) um por vez. */
dialog.modal.wizard { width: min(520px, calc(100vw - 32px)); margin-top: max(24px, 16vh); }  /* topo fixo: não pula entre os passos */
dialog.modal > .wizard-body { display: flex; flex-direction: column; width: 100%; }
.wizard-steps { list-style: none; margin: 12px 0 0; padding: 0; display: flex; gap: 6px; counter-reset: none; }
.wizard-steps li { flex: 1; display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-faint);
  padding-top: 8px; border-top: 2px solid var(--surface-3); transition: color .2s, border-color .2s; }
.wizard-steps li span { width: 18px; height: 18px; border-radius: 50%; display: grid; place-content: center; flex: none;
  font-size: 10.5px; font-weight: 600; background: var(--surface-3); color: var(--text-dim); transition: background .2s, color .2s; }
.wizard-steps li.active { color: var(--text); border-top-color: var(--accent); }
.wizard-steps li.active span { background: var(--accent-fill); color: #fff; }
.wizard-steps li.done { color: var(--text-dim); border-top-color: var(--accent-line); }
.wizard-steps li.done span { background: var(--accent-soft); color: var(--accent); }
.wizard-step { border: 0; margin: 0; padding: 18px 22px 20px; min-width: 0; }
.wizard-step legend { float: left; width: 100%; padding: 0; margin: 0 0 10px; font-size: 12.5px; font-weight: 500; color: var(--text-dim); }
.wizard-step legend ~ * { clear: both; }  /* todos, porque o primeiro pode estar escondido (aviso da região) */
.wizard-step > label:first-of-type { margin-top: 0; }
form:not(.is-stepped) .wizard-step + .wizard-step { border-top: 1px solid var(--border); }
.is-stepped .wizard-step { min-height: 156px; animation: step-in .22s ease; }
.wizard-step[hidden], .modal-foot [hidden] { display: none; }
@keyframes step-in { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
.field-msg { margin: 8px 0 0; font-size: 12.5px; color: var(--text-faint); min-height: 18px; }
.field-msg.err { color: var(--danger); }
.field-msg.ok { color: var(--good); }
.field-msg.ok::before { content: "✓ "; }
.field-msg.wait { color: var(--text-dim); }
input[aria-invalid="true"] { border-color: var(--danger-line); }
.region-tip { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; padding: 4px 8px; font-size: 11.5px; color: var(--text-dim);
  background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--radius-sm); }
.region-tip::before { content: "i"; flex: none; width: 12px; height: 12px; border-radius: 50%; display: grid; place-content: center;
  font-size: 8.5px; font-weight: 700; font-style: italic; background: var(--accent); color: var(--bg); }
.region-tip[hidden] { display: none; }
.region-tip strong { color: var(--accent-strong); font-weight: 600; }
.region-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.region-card { margin: 0; position: relative; display: flex; align-items: center; padding: 11px 12px 11px 34px; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--field); transition: border-color .15s, background .15s; }
.region-card:hover { border-color: var(--border-strong); }
.region-card input { position: absolute; left: 12px; top: 50%; margin: -7px 0 0; appearance: none; -webkit-appearance: none; width: 14px; height: 14px;
  border-radius: 50%; border: 1.5px solid var(--border-strong); background: var(--field); cursor: pointer; }
.region-card input:checked { border: 4px solid var(--accent); }
.region-card input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.region-card:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); }
.region-name { font-size: 14px; color: var(--text); }
.check-line { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 13.5px; color: var(--text); cursor: pointer; }
/* Controle da cota (_quota.html): caixa, barra de 100 GB a 50 TB e o valor à mão. */
.quota-control { display: flex; flex-direction: column; gap: 12px; }
.quota-pick { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; opacity: .45; transition: opacity .15s; }
.quota-control.on .quota-pick { opacity: 1; }
.quota-tip { margin-top: 16px; padding: 9px 12px; font-size: 12.5px; }
/* Some quando a cota é ativada. */
.quota-control.on ~ .quota-tip { display: none; }
.quota-slide { display: flex; align-items: center; gap: 10px; flex: 1 1 300px; min-width: 0; max-width: 460px; }
.quota-end { font-size: 11.5px; color: var(--text-faint); white-space: nowrap; font-family: var(--font-mono); }
.quota-range { --fill: 0%; -webkit-appearance: none; appearance: none; flex: 1 1 auto; min-width: 120px; height: 20px; margin: 0;
  background: transparent; cursor: pointer; }
.quota-range:disabled { cursor: default; }
.quota-range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--accent) 0 var(--fill), var(--border-strong) var(--fill) 100%); }
.quota-range::-moz-range-track { height: 4px; border-radius: 2px; background: var(--border-strong); }
.quota-range::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
.quota-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; margin-top: -6px;
  border-radius: 50%; background: var(--accent); border: 2px solid var(--bg, #121826); box-shadow: 0 0 0 1px var(--accent); }
.quota-range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--accent);
  border: 2px solid var(--bg, #121826); box-shadow: 0 0 0 1px var(--accent); }
.quota-range:focus-visible { outline: none; }
.quota-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--accent-soft), 0 0 0 1px var(--accent); }
.quota-pick .num-field input[type=text] { width: 72px; padding: 5px 8px; font-size: 13px; text-align: right; font-family: var(--font-mono); }
.quota-pick .num-field select { width: auto; min-width: 0; padding: 5px 26px 5px 8px; font-size: 13px; }
.quota-pick .num-field input:invalid { border-color: var(--danger, #e5484d); }
@media (max-width: 520px) {
  .region-grid { grid-template-columns: minmax(0, 1fr); }
  .wizard-step { padding: 16px 16px 18px; }
}
.ws-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.ws-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 12px; color: var(--text); box-shadow: var(--shadow-card); transition: border-color .15s, box-shadow .15s, transform .15s; }
.ws-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow-hover); text-decoration: none; color: var(--text); transform: translateY(-1px); }
.ws-card .ws-top { display: flex; align-items: center; gap: 12px; }
.ws-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--side-bg); color: var(--accent-bright); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ws-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ws-card .ws-name { font-family: var(--font-display); font-weight: 600; font-size: 15px; line-height: 1.3; }
.ws-card .ws-meta { font-size: 12.5px; color: var(--text-faint); }
.ws-card .ws-tags { display: flex; gap: 6px; flex-wrap: wrap; }
/* Com ou sem cota, o bloco de uso tem a mesma altura (barra + texto) e a situação fica na mesma linha. */
.ws-card .usage { min-height: 30px; justify-content: flex-end; }
.ws-card .ws-tags { margin-top: auto; }

.activity { list-style: none; margin: 0; padding: 0; }
.activity li { padding: 6px 20px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-dim); }
.activity li:last-child { border-bottom: none; }
.activity strong { color: var(--text); font-weight: 500; }
.activity time { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); margin-top: 0; line-height: 1.3; }

dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 22px; margin: 0; }
dl.kv dt { color: var(--text-faint); font-size: 13px; }
dl.kv dd { margin: 0; }

.dev-panel { border: 1px dashed #d9a520; background: var(--warn-soft); border-radius: var(--radius-md); padding: 14px 16px; }
.dev-panel strong { color: var(--warn); }
.dev-panel p { margin: 4px 0 10px; color: var(--text-dim); font-size: 13px; }
.dev-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- painéis que abrem e fecham, listas simples ---------- */
details.panel > summary { list-style: none; cursor: pointer; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::after { content: "+"; margin-left: auto; color: var(--text-faint); font-size: 18px; line-height: 1; }
details.panel[open] > summary::after { content: "–"; }
details.panel:not([open]) > summary { border-bottom: none; }
select.is-none { color: var(--text-faint); }
.plain-list { list-style: none; margin: 18px 0 0; padding: 0; border-top: 1px solid var(--border); }
.plain-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.auth-card form button.block { margin-top: 18px; }
.auth-card form.authorize button + button { margin-top: 8px; }
.auth-card .qr { display: flex; justify-content: center; margin: 16px 0 10px; }
.auth-card .qr svg { width: 188px; height: 188px; background: #fff; padding: 6px; border-radius: 8px; border: 1px solid var(--border); }
.auth-card .steps { margin: 14px 0 0; padding-left: 18px; color: var(--text-dim); font-size: 13.5px; }
.auth-card .secret { color: var(--text); word-break: break-all; }
.auth-card .codes { list-style: none; margin: 16px 0 10px; padding: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); text-align: center; font-size: 14px; }
.auth-card .check { margin-top: 16px; border: none; background: none; padding-left: 0; }
.auth-card .check:has(input:checked) { background: none; }
.auth-card .check + .dim { margin: 6px 0 0; }
.auth-card form.switch button, .auth-card .plain-list button { width: auto; margin-top: 0; padding: 5px 10px; font-size: 12.5px; }
/* 12/11: Dispositivos, senha e segundo fator dentro do painel (antes, na moldura do login). */
.account-page .plain-list { margin: 0; border-top: 0; }
.account-page .plain-list li:first-child { padding-top: 0; }
.account-page .plain-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.account-page .list-note { margin: 14px 0 0; }
.account-form { max-width: 520px; }
.account-form form button[type=submit] { margin-top: 20px; }
.account-form .check { margin-top: 16px; border: none; background: none; padding-left: 0; }
.account-form .check:has(input:checked) { background: none; }
.account-form .check + .dim { margin: 6px 0 0; }
.account-form .steps { margin: 0; padding-left: 18px; color: var(--text-dim); font-size: 13.5px; }
.account-form .qr { display: flex; justify-content: flex-start; margin: 16px 0 10px; }
.account-form .qr svg { width: 188px; height: 188px; background: #fff; padding: 6px; border-radius: 8px; border: 1px solid var(--border); }
.account-form .secret { color: var(--text); word-break: break-all; }
.account-form .codes { list-style: none; margin: 0 0 12px; padding: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); text-align: center; font-size: 14px; }
.account-form .codes + .dim { margin: 0 0 16px; }
/* 11/11: escolha da organização logo depois de entrar (escolher_organizacao.html). */
.auth-card .org-pick { display: grid; gap: 8px; margin-top: 16px; }
.auth-card .org-pick button, .auth-wrap.center .auth-card .org-pick button {
  width: 100%; margin: 0; padding: 11px 14px; display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  text-align: left; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); }
.auth-card .org-pick button:hover { border-color: var(--accent); }
.auth-card .org-pick-name { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.auth-card .org-pick-meta { font-size: 12px; font-weight: 400; color: var(--text-dim); }
.auth-card .org-pick-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-faint); margin: 18px 0 0; }
.auth-card .org-invites { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.auth-card .org-invites li { padding: 11px 14px; display: flex; flex-direction: column; gap: 3px;
  border: 1px solid var(--accent); border-radius: var(--radius-sm); background: var(--surface-2); }
.auth-card .org-invite-actions { display: flex; gap: 6px; margin-top: 8px; }
.auth-card .org-invite-actions button, .auth-wrap.center .auth-card .org-invite-actions button {
  width: auto; margin: 0; padding: 5px 12px; font-size: 12.5px; }
.auth-card .org-pick-title + .org-pick { margin-top: 8px; }
.auth-card form.switch { display: flex; justify-content: center; align-items: center; gap: 6px; }

/* ---------- preços e uso ---------- */
.estimate-body { display: flex; gap: 32px; align-items: center; flex-wrap: wrap; }
.estimate-total { display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; min-width: 190px; }
.estimate-total .currency { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--text-dim); }
.estimate-total .amount { font-family: var(--font-display); font-weight: 700; font-size: 40px; color: var(--text); line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.estimate-total .per { font-size: 13px; color: var(--text-dim); }
.estimate-total .foot { flex-basis: 100%; font-size: 12.5px; color: var(--accent-strong); margin-top: 6px; font-weight: 500; }
/* Itens do valor mensal: um cartão por item (ícone, o que conta, valor e a conta em etiqueta). */
.estimate-items { flex: 1; min-width: 280px; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.est-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2); }
.est-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--side-bg); color: var(--accent-bright); display: flex; align-items: center; justify-content: center; flex: none; }
.est-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.est-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.est-label { font-size: 13.5px; font-weight: 600; color: var(--text); }
.est-detail { font-size: 12.5px; color: var(--text-faint); }
.est-price { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.est-price strong { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1; }
.est-chip { font-size: 11px; font-family: var(--font-mono); color: var(--text-dim); background: var(--surface-3); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.usage { display: flex; flex-direction: column; gap: 5px; min-width: 120px; }
.usage-bar { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.usage-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; min-width: 2px; }
.usage-bar i.warn { background: #e0a100; }
.usage-bar i.full { background: var(--danger); }
.usage.big .usage-bar { height: 10px; border-radius: 5px; }
.usage .sub { font-size: 12.5px; color: var(--text-faint); }
.usage.usage-free { align-items: center; justify-content: center; text-align: center; }
.usage-text { font-size: 13.5px; color: var(--text-dim); }
.usage-text strong, .usage .sub strong { color: var(--text); font-family: var(--font-mono); font-weight: 600; }

/* ---------- campo numérico ---------- */
.field-label { margin: 0; font-size: 12.5px; color: var(--text-dim); }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
.num-field { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.num-field input[type=number] { width: 104px; text-align: right; padding-right: 6px; }
.num-field .unit { font-size: 13px; color: var(--text-dim); }
input[type=number]::placeholder { text-align: left; }

/* ---------- central de acessos ---------- */
/* Acessos: escolhe o workspace (caixa com busca) e muda a permissão de cada usuário. */
.panel.pick-panel { overflow: visible; }  /* a lista da busca passa da borda do quadro */
.ws-pick { max-width: 340px; }
.ws-pick label { margin-top: 0; }
.ws-pick-row { display: flex; gap: 8px; align-items: center; }
.ws-pick-row > select { flex: 1; }
.combo { position: relative; flex: 1; min-width: 0; }
input.combo-input { padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.combo-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none;
  max-height: 300px; overflow-y: auto; background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-pop); }
.combo-list li { padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text); }
.combo-list li.active { background: var(--accent-soft); color: var(--accent-strong); }
.combo-list li[aria-selected="true"] { font-weight: 600; }
.combo-list li.combo-none { color: var(--text-faint); cursor: default; background: none; }
.access-list th:nth-child(2), .access-list td:nth-child(2) { width: 300px; }
/* Coluna do X (Remover acesso), no fim da linha. */
.access-list th:nth-child(3), .access-list td:nth-child(3) { width: 48px; padding-left: 0; text-align: right; }
button.remove-x { font-size: 20px; line-height: 1; width: 30px; height: 30px; padding: 0; color: var(--text-faint); }
button.remove-x:hover { color: var(--danger) !important; background: var(--danger-soft) !important; }
/* Janela Adicionar acesso (dialog): usuários sem acesso, com Leitura / Leitura e escrita. */
dialog.modal { width: min(560px, calc(100vw - 32px)); max-height: min(640px, calc(100vh - 48px)); padding: 0;
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-pop); overflow: hidden; }
dialog.modal[open] { display: flex; }
dialog.modal:not([open]) { display: none; }
dialog.modal > form { display: flex; flex-direction: column; width: 100%; max-height: inherit; min-height: 0; }
/* Convidar usuário: tela de aviso antes do convite; só uma das duas aparece. */
dialog.modal > .invite-notice { display: flex; flex-direction: column; width: 100%; }
dialog.modal > .invite-notice[hidden], dialog.modal > form[hidden] { display: none; }
dialog.modal::backdrop { background: rgba(4, 8, 18, .72); }
.modal-head { padding: 18px 22px 12px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-head .crumb { display: block; margin-top: 2px; }
/* Só a lista encolhe e rola; título, busca, colunas e botões mantêm a altura. */
.modal-head, .grant-search, .grant-cols, .modal-foot, .modal-empty { flex: none; }
.modal-empty { margin: 0; padding: 18px 22px; }
.grant-search { padding: 12px 22px 10px; }
/* Colunas e linhas na mesma grade; o cabeçalho reserva o mesmo espaço da barra de rolagem. */
.grant-cols, .grant-row { display: grid; grid-template-columns: minmax(0, 1fr) 72px 104px; align-items: center; column-gap: 8px; padding: 0 22px; }
.grant-cols { overflow-y: hidden; scrollbar-gutter: stable; padding-top: 6px; padding-bottom: 6px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: var(--surface-2); font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-faint); white-space: nowrap; }
.grant-cols span:not(:first-child) { text-align: center; }
.grant-rows { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; }
.grant-row { padding-top: 9px; padding-bottom: 9px; border-bottom: 1px solid var(--border); }
.grant-row:last-of-type { border-bottom: none; }
.grant-row[hidden] { display: none; }
.grant-row:has(input:checked) { background: var(--accent-soft); }
.grant-who { min-width: 0; font-size: 13.5px; overflow-wrap: anywhere; }
.grant-who .sub { display: block; font-size: 12px; color: var(--text-faint); }
.grant-box { display: flex; justify-content: center; }
/* Caixa de marcar pequena e quadrada. */
.grant-box input[type=checkbox], .check-line input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 14px; height: 14px; margin: 0; flex: none;
  border: 1.5px solid var(--border-strong); border-radius: 2px; background: var(--field); cursor: pointer; display: grid; place-content: center; }
.grant-box input[type=checkbox]::after, .check-line input[type=checkbox]::after { content: ""; width: 8px; height: 8px; transform: scale(0); transition: transform .1s;
  clip-path: polygon(14% 44%, 0 59%, 40% 100%, 100% 22%, 86% 8%, 39% 70%); background: #fff; }
.grant-box input[type=checkbox]:checked, .check-line input[type=checkbox]:checked { background: var(--accent-fill); border-color: var(--accent-fill); }
.grant-box input[type=checkbox]:checked::after, .check-line input[type=checkbox]:checked::after { transform: scale(1); }
.grant-box input[type=checkbox]:focus-visible, .check-line input[type=checkbox]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.grant-none { margin: 0; padding: 18px 22px; color: var(--text-faint); font-size: 13px; text-align: center; }
@media (max-width: 520px) {
  .grant-cols, .grant-row { grid-template-columns: minmax(0, 1fr) 56px 64px; padding: 0 14px; column-gap: 4px; }
  .grant-row { padding-top: 9px; padding-bottom: 9px; }
  .grant-cols { padding-top: 6px; padding-bottom: 6px; white-space: normal; line-height: 1.2; }
  .grant-search { padding: 10px 14px 8px; }
}
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 22px; border-top: 1px solid var(--border); }
.access-list td select { min-width: 190px; padding-top: 6px; padding-bottom: 6px; font-size: 13px; }
.access-list td select.is-none { color: var(--text-faint); }
.access-list td select.is-rw { border-color: var(--accent); color: var(--accent-strong); background-color: var(--accent-soft); }
.access-list .all { font-size: 13px; color: var(--accent-strong); white-space: nowrap; }
@media (max-width: 600px) {
  .access-list thead { display: none; }
  .access-list tr, .access-list td { display: block; width: auto !important; }
  .access-list td:first-child { border-bottom: none; padding-bottom: 6px; }
  .access-list td:nth-child(2) { padding-top: 0; border-bottom: none; }
  .access-list td.remove-cell { padding-top: 0; text-align: left; }
  .access-list td select { width: 100%; }
  .access-list .all { white-space: normal; }
}

/* ---------- progresso da criação ---------- */
/* Tela própria: anel com a porcentagem, passos com marca e, no fim, os próximos passos. */
.create-progress { position: relative; box-sizing: border-box; width: 100%; max-width: 520px; margin: 28px auto 0; padding: 40px 36px 32px; text-align: center; overflow: hidden;
  background: var(--surface); border: 1px solid var(--accent-line); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.create-progress::before { content: ""; position: absolute; inset: -40% -20% auto; height: 360px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(95, 212, 201, .16), transparent); animation: glow 3.2s ease-in-out infinite; }
.create-progress > * { position: relative; }
.cp-ring { width: 132px; height: 132px; margin: 0 auto 20px; position: relative; }
.cp-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.cp-ring circle { fill: none; stroke-width: 7; }
.cp-ring-bg { stroke: var(--surface-3); }
.cp-ring-fg { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100;
  filter: drop-shadow(0 0 6px rgba(95, 212, 201, .45)); transition: stroke .4s; }
.cp-pct { position: absolute; inset: 0; display: grid; place-content: center; font-family: var(--font-display); font-size: 28px; font-weight: 600;
  color: var(--text); font-variant-numeric: tabular-nums; transition: opacity .25s, transform .25s; }
.cp-ring .cp-check { position: absolute; inset: 0; margin: auto; width: 54px; height: 54px; transform: scale(.4); opacity: 0;
  transition: opacity .3s, transform .4s cubic-bezier(.3, 1.6, .5, 1); }
.cp-check path { fill: none; stroke: var(--good); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.cp-title { margin: 0; font-size: 22px; overflow-wrap: anywhere; }
.cp-sub { margin: 6px 0 22px; color: var(--text-dim); font-size: 14px; }
.cp-when-done { display: none; }
.cp-steps { list-style: none; margin: 0 auto; padding: 0; max-width: 340px; text-align: left; display: flex; flex-direction: column; }
.cp-steps li { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: 14px; color: var(--text-faint); transition: color .3s; }
.cp-steps li:not(:last-child)::after { content: ""; position: absolute; left: 8px; top: 27px; bottom: -9px; width: 2px; background: var(--surface-3); transition: background .3s; }
.cp-dot { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-content: center; transition: background .3s, border-color .3s; }
.cp-steps li.active { color: var(--text); }
.cp-steps li.active .cp-dot { border-color: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
.cp-steps li.active .cp-dot::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.cp-steps li.done { color: var(--text-dim); }
.cp-steps li.done::after { background: var(--accent-line); }
.cp-steps li.done .cp-dot { background: var(--accent-fill); border-color: var(--accent-fill); }
.cp-steps li.done .cp-dot::after { content: ""; width: 8px; height: 8px; background: #fff; clip-path: polygon(14% 44%, 0 59%, 40% 100%, 100% 22%, 86% 8%, 39% 70%); }
.cp-actions { display: none; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
/* Pronto */
.create-progress.is-done { border-color: var(--good-line); }
.create-progress.is-done::before { background: radial-gradient(closest-side, rgba(74, 222, 128, .14), transparent); animation: none; }
.create-progress.is-done .cp-ring-fg { stroke: var(--good); filter: drop-shadow(0 0 6px rgba(74, 222, 128, .45)); }
.create-progress.is-done .cp-pct { opacity: 0; transform: scale(.7); }
.create-progress.is-done .cp-check { opacity: 1; transform: scale(1); }
.create-progress.is-done .cp-when-busy { display: none; }
.create-progress.is-done .cp-when-done { display: inline; }
.create-progress.is-done .cp-steps li.done .cp-dot { background: var(--good); border-color: var(--good); }
.create-progress.is-done .cp-steps li.done::after { background: var(--good-line); }
.create-progress.is-done .cp-actions { display: flex; animation: step-in .3s ease; }
@keyframes glow { 0%, 100% { opacity: .7; } 50% { opacity: 1; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(95, 212, 201, .30); } 50% { box-shadow: 0 0 0 5px rgba(95, 212, 201, .12); } }
@media (max-width: 600px) { .create-progress { margin-top: 12px; padding: 30px 18px 24px; } .cp-actions .btn { flex: 1 1 100%; } }
@media (prefers-reduced-motion: reduce) { .create-progress::before, .cp-steps li.active .cp-dot, .is-stepped .wizard-step { animation: none; } * { transition: none !important; } }

/* Janela Convidar: papel em dois cartões; no passo 2, a lista de workspaces com busca
   (mesma grade da janela Adicionar acesso), só a lista rola. */
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choice-grid .region-card { flex-direction: column; align-items: flex-start; gap: 2px; }
.choice-grid .region-card input { top: 14px; margin-top: 0; }
.choice-note { font-size: 11.5px; color: var(--text-faint); line-height: 1.35; }
.wizard-step.wizard-list { padding: 0; }
.wizard-step .invite-email { padding: 6px 10px; font-size: 13px; }
.wizard-step .invite-email-msg { min-height: 0; margin-top: 6px; }
.wizard-step .invite-email-msg:empty { display: none; }
.wizard-step .invite-role-label { margin-top: 12px; }
.invite-hint { margin: 12px 0 0; }
/* Usuários: busca de pessoas no cabeçalho da lista e papel menor em cada linha. */
.count-badge { display: inline-grid; place-content: center; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 10px;
  font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-dim); background: var(--surface-3); }
.people-search input { width: 220px; }
select.role-select { width: 124px; min-width: 0; flex: 0 0 auto; padding: 4px 26px 4px 8px; font-size: 12.5px; }
/* Dono: mesma largura do seletor das outras linhas, com o nome no centro. */
.tag.role-tag { width: 124px; justify-content: center; box-sizing: border-box; padding-top: 4px; padding-bottom: 4px; }
#people-rows tr.grant-none td, #access-rows tr.grant-none td, #ws-access-rows tr.grant-none td { text-align: center; color: var(--text-faint); font-size: 13px; padding: 18px; }
@media (max-width: 600px) { .people-search, .people-search input { width: 100%; } }
.wizard-list .grant-search { padding-top: 14px; }
.wizard-list .grant-rows { max-height: min(320px, calc(100vh - 340px)); }
@media (max-width: 520px) { .choice-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- telas estreitas: a barra lateral vira faixa no topo ---------- */
@media (max-width: 900px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar, .dev .sidebar { position: sticky; top: 0; z-index: 10; height: auto; overflow: visible; padding: 10px 16px 8px; gap: 8px; background: var(--side-bg); border-right: none; border-bottom: 1px solid var(--side-line);
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "brand org user" "menu menu menu"; align-items: center; }
  .side-brand { grid-area: brand; padding: 0; }
  .side-brand img { height: 28px; }
  .side-org { grid-area: org; border: none; background: none; padding: 0; flex-direction: row; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
  .side-org .side-label, .side-readonly { display: none; }
  .side-org form, .side-org-name { min-width: 0; max-width: 220px; }
  .side-org-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
  .side-status { white-space: nowrap; font-size: 0; gap: 0; }   /* só o ponto colorido */
  .side-user { grid-area: user; margin: 0; border: none; padding: 0; }
  .side-who-text { display: none; }
  .side-who { padding: 2px; flex: none; }
  .side-menu { grid-area: menu; flex-direction: row; overflow-x: auto; gap: 4px; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
  .side-menu::-webkit-scrollbar { display: none; }
  .side-menu .side-label { display: none; }
  .side-link { padding: 7px 11px; font-size: 13px; white-space: nowrap; gap: 7px; }
  .side-link svg { width: 16px; height: 16px; }
  .side-link.active::before { display: none; }
  .content { padding: 22px 16px 48px; gap: 18px; }
  .page-head h1 { font-size: 22px; }
  th, td, .activity li { padding-left: 14px; padding-right: 14px; }
  .panel-head, .panel-body, .panel-foot { padding-left: 14px; padding-right: 14px; }
  .estimate-total .amount { font-size: 34px; }
}

/* Workspace (11/11): acesso por usuário menor, até 6 usuários à vista e Excluir em janela. */
select.access-select { width: 150px; min-width: 0; flex: 0 0 auto; padding: 4px 26px 4px 8px; font-size: 12.5px; }
/* Quadros com data-max-rows: N linhas à vista, o resto rola (altura medida no site.js). */
[data-max-rows] { overflow-y: auto; position: relative; }  /* relative: os rótulos .sr-only das linhas roladas não esticam a página */
[data-max-rows] thead th { position: sticky; top: 0; z-index: 1; }
.ws-delete { margin: 4px 0 24px; }
.modal-body { padding: 16px 22px 18px; }
.modal-body p { margin: 0 0 10px; }
.modal-body input[type=text] { width: 100%; }
dialog.modal.confirm-modal { width: min(420px, calc(100vw - 32px)); }
#confirmar .modal-body p { margin: 0; line-height: 1.5; overflow-wrap: anywhere; }

/* Workspaces: busca e modo de exibição (quadrados ou lista). */
.ws-toolbar { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; flex-wrap: wrap; }
.ws-toolbar .ws-search { width: 220px; }
.view-toggle { display: flex; gap: 4px; margin-left: auto; }
.view-toggle button { width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--text-faint); }
.view-toggle button[aria-pressed="true"] { color: var(--accent-bright); border-color: var(--accent-line); background: var(--surface-2); }
.view-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.ws-card[hidden] { display: none; }
/* Setas de ordenar nos títulos das colunas (table[data-sortable]). */
.sort-btn { all: unset; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; }
.sort-btn:hover { color: var(--text); }
.sort-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.sort-arrow { display: inline-flex; width: 14px; justify-content: center; }
.sort-arrow::after { content: "↕"; font-size: 14px; line-height: 1; font-weight: 600; opacity: .5; }
th[aria-sort="ascending"] .sort-arrow::after { content: "↑"; opacity: 1; color: var(--accent-strong); }
th[aria-sort="descending"] .sort-arrow::after { content: "↓"; opacity: 1; color: var(--accent-strong); }
th[aria-sort="ascending"] .sort-btn, th[aria-sort="descending"] .sort-btn { color: var(--text); }
.sort-btn[data-dir="asc"] .sort-arrow::after { content: "↑"; opacity: 1; color: var(--accent-strong); }
.sort-btn[data-dir="desc"] .sort-arrow::after { content: "↓"; opacity: 1; color: var(--accent-strong); }
/* Página Workspaces: ordenar os cartões, ao lado da busca. */
.card-sort { display: flex; align-items: center; gap: 16px; margin-left: 10px; font-size: 13px; color: var(--text-dim); }
.card-sort .sort-btn[data-dir] { color: var(--text); }
/* Usuários: número de workspaces abre a janela com os acessos da pessoa. */
.ws-count-link { font-family: var(--font-mono); font-weight: 600; color: var(--accent-strong); }
.ws-count-link:hover { color: var(--accent-bright); text-decoration: underline; }
dialog.user-ws-modal[open] { flex-direction: column; }
.user-ws-modal .modal-head { width: 100%; }
.user-ws-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 22px; border-bottom: 1px solid var(--border); }
.user-ws-row:last-child { border-bottom: none; }
.user-ws-row.has-access { background: var(--accent-soft); }
.user-ws-row select.access-select { width: 160px; }
.user-ws-row select.is-rw { border-color: var(--accent); color: var(--accent-strong); }
/* Usuário suspenso: linha apagada e etiqueta ao lado do nome. */
tr.is-suspended td:first-child, tr.is-suspended td:nth-child(3) { opacity: .55; }
.suspended-tag { margin-left: 6px; font-size: 11px; padding: 1px 7px; vertical-align: 1px; }
/* Cartão Total (página Workspaces): fixo, sem link nem hover. */
.ws-card.ws-total { border-color: var(--accent-line); }
.ws-card.ws-total:hover { box-shadow: var(--shadow-card); transform: none; }
.ws-card.ws-total .usage strong { color: var(--text); font-family: var(--font-mono); font-weight: 600; }
.ws-grid .grant-none { grid-column: 1 / -1; }
.ws-grid.is-list { grid-template-columns: 1fr; gap: 8px; }
.ws-grid.is-list .ws-card { flex-direction: row; align-items: center; gap: 18px; padding: 10px 16px; }
.ws-grid.is-list .ws-top { flex: 1; min-width: 0; }
.ws-grid.is-list .ws-icon { width: 30px; height: 30px; border-radius: 8px; }
.ws-grid.is-list .usage { width: 220px; min-height: 0; }
.ws-grid.is-list .ws-tags { margin-top: 0; width: 150px; justify-content: flex-end; }
@media (max-width: 600px) {
  .ws-toolbar .ws-search { width: auto; flex: 1; }
  .ws-grid.is-list .usage, .ws-grid.is-list .ws-tags { display: none; }
}

/* Cartão do workspace: o nome cobre o cartão (link esticado); Medir Uso fica clicável por cima. */
.ws-card { position: relative; }
.ws-card .ws-card-link { display: block; color: var(--text); text-decoration: none; }
.ws-card .ws-card-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.ws-card .ws-card-link:focus-visible { outline: none; }
.ws-card:has(.ws-card-link:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.ws-card .ws-tags { align-items: center; }
.ws-measure { position: relative; z-index: 1; margin: 0 0 0 auto; }
.ws-measure button { padding: 3px 10px; font-size: 12px; }
.ws-grid.is-list .ws-tags { width: auto; min-width: 150px; }
/* Página do workspace: campo da cota menor. */
.quota-form { display: flex; align-items: center; gap: 12px 22px; flex-wrap: wrap; }
.quota-form .quota-control { flex-direction: row; align-items: center; gap: 22px; flex: 0 1 auto; flex-wrap: wrap; }
.quota-form .quota-pick { flex-wrap: nowrap; }
.quota-form .quota-slide { flex: 0 1 380px; width: 380px; }

/* Páginas que cabem na tela (fit-page, padrão de todas as páginas do app):
   a página tem a altura da janela e quem rola são as listas por dentro dos quadros. */
.content.fit-page { height: 100vh; padding-top: 26px; padding-bottom: 16px; }
/* Listas que rolam: linhas um pouco mais baixas para caberem as linhas combinadas. */
[data-max-rows] td { padding-top: 8px; padding-bottom: 8px; }
[data-max-rows] .activity li { padding-top: 3px; padding-bottom: 3px; }
.content.fit-page > * { flex: none; }
/* Só encolhem os quadros que têm lista para rolar; os de formulário ficam inteiros. */
.content.fit-page > .panel:has(> .table-wrap, > [data-max-rows]) { flex: 0 1 auto; min-height: 140px; display: flex; flex-direction: column; }
.content.fit-page .panel > * { flex: none; }
.content.fit-page .panel > .table-wrap, .content.fit-page .panel > [data-max-rows] { flex: 0 1 auto; min-height: 0; overflow-y: auto; position: relative; }
.content.fit-page > .ws-grid { flex: 0 1 auto; min-height: 0; overflow-y: auto; align-content: start; padding: 2px 4px 4px 2px; margin: -2px -4px -4px -2px; }
.content.fit-page > .split-2 { flex: 0 1 auto; min-height: 140px; grid-template-rows: minmax(0, 1fr); }
.content.fit-page > .split-2 > .panel { max-height: 100%; display: flex; flex-direction: column; }
/* Página do workspace: mais compacta para caber 5 linhas de acesso. */
.content.fit-page.fit-tight { padding-top: 18px; padding-bottom: 16px; gap: 10px; }
.content.fit-page.fit-tight > .ws-delete { margin-bottom: 0; }
.access-panel td { padding-top: 8px; padding-bottom: 8px; }
/* Com a busca no título, o cabeçalho do quadro fica na mesma altura de antes. */
.access-panel .panel-head { padding-top: 9px; padding-bottom: 9px; }
@media (max-width: 1080px) { .content.fit-page > .split-2 { grid-template-rows: none; overflow-y: auto; } }
@media (max-width: 900px) { .content.fit-page { height: auto; } .content.fit-page > * { flex: none !important; } }

/* Aviso informativo com "!" (Pagamento: Storio não armazena dados de cartão). */
.info-note { display: flex; align-items: center; gap: 8px; margin: 16px 0 0; font-size: 12.5px; color: var(--text-dim); }
.info-icon { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 1.5px solid var(--accent-line); color: var(--accent-bright);
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; line-height: 1; }

/* Pagamento: Assinatura e Política de Valores com a mesma largura e a mesma altura. */
.split-2.split-even { grid-template-columns: 1fr 1fr; align-items: stretch; }
.content.fit-page > .split-2.split-even { flex: none; }  /* não encolhe: quem rola é a lista de cobranças */
.split-2.split-even > .panel { display: flex; flex-direction: column; }
.split-2.split-even > .panel > .panel-body { flex: 1 1 auto; display: flex; flex-direction: column; }
.split-2.split-even .info-note { margin-top: auto; padding-top: 16px; }  /* aviso do cartão no pé do quadro */
@media (max-width: 1080px) { .split-2.split-even { grid-template-columns: 1fr; } }

/* Painel: linha Total no fim da tabela de workspaces (fica presa embaixo quando a lista rola). */
tfoot .total-row td { position: sticky; bottom: 0; background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: none;
  font-weight: 600; color: var(--text); padding-top: 10px; padding-bottom: 10px; }

/* Calculadora de valores (página Pagamento). */
dialog.modal.calc-modal { width: min(500px, calc(100vw - 32px)); }
.calc-inputs { display: flex; gap: 28px; flex-wrap: wrap; align-items: flex-end; }
.calc-field > label { display: block; margin: 0 0 6px; font-size: 12px; color: var(--text-dim); }
.calc-field input[type=text], .calc-field input[type=number] { width: 96px; padding: 6px 8px; font-size: 13.5px;
  text-align: right; font-family: var(--font-mono); }
.calc-field select { width: auto; min-width: 0; padding: 6px 26px 6px 8px; font-size: 13.5px; }
.calc-msg:empty { display: none; }
.calc-table { width: 100%; margin-top: 18px; border-collapse: collapse; }
.calc-table td { padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; color: var(--text); vertical-align: top; }
.calc-table td .sub { display: block; margin-top: 2px; font-size: 12px; color: var(--text-dim); }
.calc-table td.num { text-align: right; font-family: var(--font-mono); white-space: nowrap; }
.calc-table tfoot td { border-bottom: 0; padding-top: 14px; font-weight: 600; font-size: 14.5px; }
.calc-table tfoot td.num { color: var(--accent); font-size: 20px; }
/* Valor digitado inválido: o resultado anterior fica apagado até corrigir. */
form.is-invalid .calc-table { opacity: .35; }


/* ------------------------------------------------ Termos de Uso (11/11) */
.terms-page { min-height: 100vh; background: var(--bg); }
.terms-top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px clamp(16px, 4vw, 40px); background: var(--side-bg); border-bottom: 1px solid var(--border); }
.terms-top img { height: 30px; display: block; }
.terms-doc { max-width: 760px; margin: 0 auto; padding: 40px 16px 80px; color: var(--text); font-size: 14.5px; line-height: 1.65; }
.terms-doc h1 { font-size: 30px; margin: 0 0 6px; }
.terms-meta { margin: 0 0 28px; color: var(--text-dim); font-size: 13px; }
.terms-doc section { margin-top: 26px; }
.terms-doc h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .02em; margin: 0 0 10px; color: var(--accent); }
.terms-doc p { margin: 0 0 10px; }
.terms-doc ul { margin: 0 0 12px; padding-left: 22px; }
.terms-doc li { margin-bottom: 6px; }
.terms-doc b { color: #fff; font-weight: 600; }
.terms-parties { padding: 18px 20px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.terms-parties p:last-child { margin-bottom: 0; }
.terms-lang-note { padding: 12px 16px; margin-bottom: 18px !important; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 6px; font-size: 13.5px; color: var(--text-dim); }
.terms-table { border-collapse: collapse; margin: 4px 0 14px; min-width: min(100%, 380px); }
.terms-table th, .terms-table td { text-align: left; padding: 7px 14px 7px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.terms-table th { color: var(--text-dim); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
/* Cadastro: caixa de aceite dos termos */
.terms-accept { display: flex; align-items: flex-start; gap: 10px; margin: 18px 0 4px; font-size: 13.5px; color: var(--text); cursor: pointer; }
.terms-accept input { margin-top: 2px; flex: none; width: 16px; height: 16px; accent-color: var(--accent-fill); }
.terms-doc ul.terms-items { list-style: none; padding-left: 0; }

/* 12/11: administração do suporte. */
.admin-content { display: flex; flex-direction: column; gap: 18px; }
.metric-card.attention { border-color: var(--warn-line); }
.metric-card.attention .lbl::before { background: var(--warn); }
.metric-card .val.small-val { font-size: 16px; word-break: break-all; }
.danger-text { color: var(--danger); }
.side-back { align-self: flex-start; margin-top: 4px; }
.attention-panel { border-color: var(--warn-line); }
.attention-list { list-style: none; margin: 0; padding: 0; }
.attention-list li + li { border-top: 1px solid var(--border); }
.attention-list a { display: flex; align-items: baseline; gap: 10px; padding: 11px 20px; color: var(--text); flex-wrap: wrap; }
.attention-list a:hover { background: var(--accent-soft); text-decoration: none; }
.attention-list .dim { font-size: 13px; }
.admin-toolbar { gap: 12px; }
.admin-toolbar input[type=search] { width: 260px; max-width: 100%; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12.5px; padding: 5px 11px; border-radius: 999px; }
.chip .count { color: var(--text-faint); margin-left: 3px; }
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.org-table tbody tr[data-href] { cursor: pointer; }
.org-table tbody tr[data-href]:hover td { background: var(--accent-soft); }
.org-table .row-link { color: var(--text); font-weight: 600; }
.org-table td .sub { max-width: 46ch; }
.org-table td.org-enter { width: 1%; text-align: right; white-space: nowrap; }
.org-table td.org-enter form { margin: 0; }
th.num, td.num { text-align: right; }


/* Moldura simples (ajuda_simples.html): largura do conteúdo. */
.content.help-content { max-width: 1080px; }
.help-topic .panel-body > h3 { font-size: 14.5px; font-weight: 600; margin: 28px 0 0; }
.help-topic ul, .help-topic ol { margin-bottom: 0; padding-left: 20px; }
.help-topic li + li { margin-top: 6px; }
.help-topic code { font-family: var(--font-mono); font-size: 12.5px; background: var(--surface-2); border-radius: 5px; padding: 1px 5px; }
.help-steps { counter-reset: step; list-style: none; padding-left: 0 !important; }
.help-steps > li { counter-increment: step; position: relative; padding-left: 34px; }
.help-steps > li::before { content: counter(step); position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent); font-size: 12px; font-weight: 600; display: grid; place-items: center; line-height: 1; }
.help-terms { margin-top: 16px !important; }
.help-shot { margin: 16px 0 4px; }
.help-shot a { display: block; border: 1px solid var(--border-strong); border-radius: var(--radius-md); overflow: hidden; background: var(--bg); box-shadow: 0 6px 22px rgba(0, 0, 0, .28); }
.help-shot a:hover { border-color: var(--accent-line); }
.help-shot img { display: block; width: 100%; height: auto; }
.help-shot figcaption { font-size: 12.5px; color: var(--text-faint); margin-top: 8px; }
.help-table { font-size: 13.5px; }
.help-table td { vertical-align: top; }
.help-table td.mono, .help-table th { white-space: nowrap; }
.help-timeline { list-style: none; padding-left: 0 !important; display: flex; flex-direction: column; gap: 8px; }
.help-timeline li { display: grid; grid-template-columns: 190px 1fr; gap: 12px; align-items: start; }
.help-timeline li + li { margin-top: 0; }
.help-timeline .tag { justify-self: start; }
.help-pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.help-none { color: var(--text-dim); }
/* Item Ajuda do menu: embaixo, logo acima da conta. */
.side-help { margin-top: auto; }
.side-help + .side-user { margin-top: 0; }
/* 13/11: o seletor de idioma fica entre a Ajuda e o usuário; os três juntos, embaixo. */
.side-lang + .side-user { margin-top: 0; }
/* Ajuda do usuário comum: sem o menu do painel, só o logo e Voltar. */
.help-simple-bar { display: flex; align-items: center; justify-content: space-between; padding: 14px 40px; background: var(--side-bg); border-bottom: 1px solid var(--side-line); }
.help-simple-bar .side-brand { padding: 0; }
.help-simple-bar img { height: 26px; width: auto; }
@media (max-width: 600px) {
  .help-search { width: 100%; }
  .help-timeline li { grid-template-columns: 1fr; gap: 4px; }
  .help-topic .panel-body { padding: 18px; }
}

/* 12/11: seletor de idioma (templates/_idioma.html). Texto pequeno, o idioma atual em destaque. */
.lang-switch { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12.5px; color: var(--text-faint); }
.lang-switch button { background: none; border: 0; padding: 2px 4px; margin: 0; width: auto; min-height: 0; font: inherit; color: var(--text-dim); cursor: pointer; border-radius: 4px; box-shadow: none; }
.lang-switch button:hover:not([disabled]) { color: var(--accent); text-decoration: underline; }
.lang-switch button[aria-current] { color: var(--text); font-weight: 600; cursor: default; opacity: 1; }
.lang-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.auth-lang { margin-top: 24px; pointer-events: auto; }
.side-lang { justify-content: flex-start; padding: 4px 12px 10px; color: var(--side-dim); }
.side-lang button { color: var(--side-dim); }
.side-lang button[aria-current] { color: var(--side-text); }
.bar-lang { margin-left: auto; margin-right: 12px; }

/* 13/11: a coluna da barra lateral vai até o fim da página. A barra é fixa (sticky) e
   ocupa a altura da janela; em páginas longas, a captura da página inteira, a impressão
   e o PDF da tela mostravam o fundo da página abaixo dela. */
@media (min-width: 901px) {
  .app-shell {
    background: linear-gradient(90deg, var(--side-bg) calc(var(--side-width) - 1px),
                                var(--side-line) calc(var(--side-width) - 1px) var(--side-width),
                                transparent var(--side-width));
  }
}

/* 13/11: na faixa do topo (telas estreitas), a Ajuda tinha a mesma área do menu e ficava
   por cima de "Painel". Agora: menu e Ajuda na mesma linha, idioma na linha de baixo. */
@media (max-width: 900px) {
  .sidebar, .dev .sidebar { grid-template-areas: "brand org user" "menu menu help" "lang lang lang"; }
  .side-help { grid-area: help; margin: 0 0 0 6px; padding: 0 0 2px 6px; overflow: visible; border-left: 1px solid var(--side-line); }
  .side-help + .side-user { margin: 0; }
  .side-lang { grid-area: lang; padding: 0 2px; justify-content: flex-start; }
}

/* 13/11: na faixa do topo (telas estreitas), Download do App e Ajuda só com o ícone,
   para não esconder o nome da organização; o nome continua para leitores de tela. */
@media (max-width: 900px) {
  .side-help .side-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .side-help .side-link { padding-left: 9px; padding-right: 9px; }
}

/* ------------------------------------------------------- tour do primeiro acesso (13/11) */
.tour { position: fixed; inset: 0; z-index: 1000; }
.tour-shade { position: absolute; inset: 0; background: rgba(2, 8, 20, .72); opacity: 0; transition: opacity .2s; }
.tour.shade-on .tour-shade { opacity: 1; }
/* O destaque escurece todo o resto com uma sombra enorme em volta do item. */
.tour-ring { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(2, 8, 20, .72), 0 0 0 2px var(--accent);
  pointer-events: none; transition: left .25s, top .25s, width .25s, height .25s; }
.tour-card { position: fixed; width: min(340px, calc(100vw - 24px)); background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius-md); padding: 18px 18px 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45); transition: left .25s, top .25s; }
.tour-card.center { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: min(460px, calc(100vw - 32px)); padding: 26px 26px 18px; text-align: center; }
.tour-card.center .tour-text { font-size: 19px; font-weight: 400; line-height: 1.45; }
.tour-card.center .tour-actions { justify-content: center; }
.tour-step { margin: 0 0 6px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); }
.tour-text { margin: 0 0 16px; font-size: 15px; line-height: 1.5; }
.tour-actions { display: flex; gap: 8px; justify-content: flex-end; }
.tour-actions button { width: auto; margin: 0; }
body.tour-open { overflow: hidden; }
/* O botão Tour do menu tem a cara dos links do menu. */
button.side-link { width: 100%; background: none; border: 0; box-shadow: none; text-align: left; justify-content: flex-start;
  font: inherit; font-size: 14px; font-weight: 500; color: var(--side-text); padding: 9px 10px; cursor: pointer; margin: 0; min-height: 0; }
@media (prefers-reduced-motion: reduce) { .tour-ring, .tour-card, .tour-shade { transition: none; } }
