/* Painel 7Mail — tema claro/escuro. Cores da identidade Seven (vermelho da logo, carvão). */
:root {
  --bg: #f6f6f7; --surface: #ffffff; --surface-2: #f4f4f5; --input: #ffffff;
  --border: #e4e4e7; --border-strong: #c9c9cf; --text: #18181b; --muted: #5b5b66;
  --link: #b81d27; --danger: #b81d27; --accent: #c8202b; --accent-hover: #a51a23; --accent-soft: #fbe9ea;
  --ok-bg: #e5f5ec; --ok-fg: #1a6b43; --off-bg: #fbe9ea; --off-fg: #a51a23;
  --info-bg: #eef4fd; --info-border: #c9dbf5; --warn-bg: #fff6e5; --warn-border: #f2d9a6;
  --chip-bg: #eaf0fc; --chip-fg: #1e4fa8; --chip-ext-bg: #fff1d6; --chip-ext-fg: #8a5200;
  --bar: #2f6fdb; --bar-high: #b86a00; --track: #ededf0; --avatar: #f0f0f2;
  --side: #17171a; --side-text: #d4d4d8; --side-active: #2a1416;
  --radius: 14px; --font: Inter, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f11; --surface: #18181b; --surface-2: #222226; --input: #111113;
    --border: #2a2a2f; --border-strong: #45454d; --text: #f4f4f5; --muted: #a1a1aa;
    --link: #ff7a81; --danger: #ff7a81; --accent: #d52a35; --accent-hover: #e0444e; --accent-soft: #3a1517;
    --ok-bg: #12301f; --ok-fg: #5bd69a; --off-bg: #3a1517; --off-fg: #ff8f95;
    --info-bg: #14202e; --info-border: #24405f; --warn-bg: #2b2110; --warn-border: #5a4316;
    --chip-bg: #222833; --chip-fg: #b9ccf5; --chip-ext-bg: #2e2410; --chip-ext-fg: #f5c46b;
    --bar: #5b8def; --bar-high: #f2a33a; --track: #2e2e33; --avatar: #2e2e33;
    --side: #111113; --side-active: #2a1416;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0f11; --surface: #18181b; --surface-2: #222226; --input: #111113;
  --border: #2a2a2f; --border-strong: #45454d; --text: #f4f4f5; --muted: #a1a1aa;
  --link: #ff7a81; --danger: #ff7a81; --accent: #d52a35; --accent-hover: #e0444e; --accent-soft: #3a1517;
  --ok-bg: #12301f; --ok-fg: #5bd69a; --off-bg: #3a1517; --off-fg: #ff8f95;
  --info-bg: #14202e; --info-border: #24405f; --warn-bg: #2b2110; --warn-border: #5a4316;
  --chip-bg: #222833; --chip-fg: #b9ccf5; --chip-ext-bg: #2e2410; --chip-ext-fg: #f5c46b;
  --bar: #5b8def; --bar-high: #f2a33a; --track: #2e2e33; --avatar: #2e2e33;
  --side: #111113; --side-active: #2a1416;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
a { color: var(--link); }
:focus-visible { outline: 3px solid #e0444e; outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1 { margin: 0; font-size: 28px; line-height: 1.2; }
h2 { margin: 0; font-size: 20px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* layout */
.app { min-height: 100vh; display: flex; flex-wrap: wrap; }
.side { flex: 1 1 232px; max-width: 100%; padding: 24px 16px; background: var(--side); color: var(--side-text); display: flex; flex-direction: column; gap: 28px; }
.marca { display: flex; align-items: center; gap: 12px; padding: 0 8px; color: #fff; text-decoration: none; }
.marca strong { font-size: 22px; letter-spacing: .5px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--side-text); text-decoration: none; }
.nav a:hover { background: #222226; color: #fff; }
.nav a[aria-current="page"] { background: var(--side-active); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 #e0444e; }
.quem { margin-top: auto; padding: 14px 12px; border-radius: 12px; background: #222226; display: flex; flex-direction: column; gap: 8px; }
.quem strong { color: #fff; font-size: 14px; }
.quem span { font-size: 12px; color: #b4b4bc; }
.quem .links { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.quem a, .quem button.link { color: #e4e4e7; font-size: 13px; }
.conteudo { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }
.topo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 32px; border-bottom: 1px solid var(--border); background: var(--surface); }
.topo form { display: flex; align-items: center; gap: 10px; }
main { width: 100%; max-width: 1120px; padding: 32px; display: flex; flex-direction: column; gap: 24px; }
.cabecalho { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }
.cabecalho > div { display: flex; flex-direction: column; gap: 6px; }

/* componentes */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--muted); }
.btn.primario { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primario:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.pequeno { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 8px; font-weight: 500; }
.btn.perigo { color: var(--danger); border-color: transparent; background: transparent; font-weight: 600; }
.btn.icone { width: 44px; padding: 0; }
button.link { background: none; border: none; padding: 0; font: inherit; text-decoration: underline; cursor: pointer; }
.cartao { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.stat span:first-child { font-size: 13px; color: var(--muted); }
.stat strong { font-size: 28px; line-height: 1.2; }
.stat strong small { font-size: 15px; font-weight: 500; color: var(--muted); }
.aviso { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--info-border); background: var(--info-bg); }
.aviso.atencao { border-color: var(--warn-border); background: var(--warn-bg); }
.aviso.erro { border-color: var(--off-fg); background: var(--off-bg); color: var(--text); }
.aviso.ok { border-color: transparent; background: var(--ok-bg); color: var(--ok-fg); font-weight: 500; }
.aviso svg { flex: none; margin-top: 2px; }
.tabela { overflow-x: auto; position: relative; }
table { width: 100%; min-width: 720px; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; padding: 14px 20px; border-bottom: 1px solid var(--border); }
td { padding: 14px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
td.acoes { text-align: right; white-space: nowrap; }
td.acoes > * { margin-left: 6px; }
.pessoa { display: flex; align-items: center; gap: 12px; }
.avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--avatar); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.pessoa div { display: flex; flex-direction: column; }
.pessoa small { color: var(--muted); font-size: 12px; }
.barra { height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; min-width: 120px; }
.barra i { display: block; height: 8px; border-radius: 4px; background: var(--bar); }
.barra i.alto { background: var(--bar-high); }
/* larguras da barra em passos de 5% (o CSP não permite estilo inline) */
.p0{width:0}.p5{width:5%}.p10{width:10%}.p15{width:15%}.p20{width:20%}.p25{width:25%}.p30{width:30%}.p35{width:35%}.p40{width:40%}.p45{width:45%}.p50{width:50%}.p55{width:55%}.p60{width:60%}.p65{width:65%}.p70{width:70%}.p75{width:75%}.p80{width:80%}.p85{width:85%}.p90{width:90%}.p95{width:95%}.p100{width:100%}
.selo { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--ok-bg); color: var(--ok-fg); }
.selo.off { background: var(--off-bg); color: var(--off-fg); }
.selo.info { background: var(--chip-bg); color: var(--chip-fg); }
.selo.alerta { background: var(--chip-ext-bg); color: var(--chip-ext-fg); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: 999px; background: var(--chip-bg); color: var(--chip-fg); font-size: 13px; font-weight: 500; }
.chip.externo { background: var(--chip-ext-bg); color: var(--chip-ext-fg); }
.chip form { display: inline; }
.chip button { width: 26px; height: 26px; border-radius: 50%; border: none; background: transparent; color: inherit; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.chip button:hover { background: rgba(0, 0, 0, .08); }
.linha-alias { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.linha-alias:last-child { border-bottom: none; }
.linha-alias > strong { min-width: 220px; }

/* formulários */
.form { display: flex; flex-direction: column; gap: 18px; padding: 24px; max-width: 560px; }
.form.largo { max-width: none; }
.campo { display: flex; flex-direction: column; gap: 8px; }
.campo label, .rotulo { font-size: 14px; font-weight: 600; }
.campo .dica { font-size: 13px; color: var(--muted); font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=search], select, .entrada {
  height: 46px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--input); color: var(--text); font: inherit; width: 100%;
}
.composto { display: flex; align-items: stretch; height: 46px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--input); overflow: hidden; }
.composto input, .composto select { border: none; height: auto; border-radius: 0; }
.composto span, .composto select { background: var(--surface-2); color: var(--muted); display: flex; align-items: center; padding: 0 12px; border-left: 1px solid var(--border); white-space: nowrap; }
.composto select { width: auto; color: var(--text); }
.linha { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.linha > .campo { flex: 1 1 240px; }
.botoes { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.codigo { font-size: 26px; letter-spacing: 8px; text-align: center; font-weight: 600; height: 56px !important; }

/* login */
.login { min-height: 100vh; display: flex; flex-wrap: wrap; }
.login .lado { flex: 1 1 420px; min-height: 340px; padding: 56px 64px; background: #17171a; color: #f4f4f5; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; position: relative; overflow: hidden; }
.login .lado h1 { font-size: 40px; line-height: 1.1; max-width: 440px; font-weight: 600; }
.login .lado p { color: #c4c4cc; max-width: 440px; }
.login .marca .sub { color: #f07a80; font-size: 13px; font-weight: 400; }
.login .lado .texto { margin-top: 16px; }
.login .caixa .nota { padding-top: 18px; border-top: 1px solid var(--border); }
.login .lado .fundo { position: absolute; right: -120px; bottom: -110px; opacity: .08; }
.login .lado .rodape { font-size: 13px; color: #a1a1aa; }
.login .form-lado { flex: 1 1 460px; padding: 40px 24px; display: flex; align-items: center; justify-content: center; position: relative; }
.login .caixa { width: 100%; max-width: 420px; padding: 36px 32px; display: flex; flex-direction: column; gap: 22px; }
.login .tema-btn { position: absolute; top: 24px; right: 24px; }
.qr { background: #fff; border-radius: 12px; padding: 8px; align-self: center; line-height: 0; }
.qr svg { width: 200px; height: 200px; }
.segredo { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; letter-spacing: 1px; word-break: break-all; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }

/* tema: ícones do botão */
.tema-btn .lua { display: inline; } .tema-btn .sol { display: none; }
:root[data-theme="dark"] .tema-btn .lua { display: none; } :root[data-theme="dark"] .tema-btn .sol { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tema-btn .lua { display: none; }
  :root:not([data-theme="light"]) .tema-btn .sol { display: inline; }
}

@media (max-width: 700px) {
  main { padding: 20px 16px; }
  .topo { padding: 12px 16px; }
  .login .lado { padding: 32px 24px; min-height: auto; }
  .login .lado h1 { font-size: 30px; }
}

[hidden] { display: none !important; }
.campo-lista { display: flex; flex-direction: column; gap: 22px; }
.icone-destaque { width: 48px; height: 48px; border-radius: 12px; background: var(--accent-soft); color: var(--link); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 8px; }
section.form h2 + p { margin-top: -10px; }
