/* Emissores Online no padrão do Design System TagPlus.
   Tokens de tagplus-site/packages/ui/v1/tokens/tokens.css. Carregado depois do bootstrap e do style.css:
   só repagina, não muda ids nem classes usados pelo emissores.js.
   Mobile first: 768px+ = desktop. */
@font-face { font-family: 'Inter'; font-weight: 300 800; font-display: swap; src: url('../fonts/inter.woff2') format('woff2'); }
:root {
  --navy: #072E6C; --navy-hover: #334F7D; --primary: #2D6EDA; --primary-hover: #6593E1; --light: #E2EDFF; --clear: #EFF4FF;
  --ink-2: #41546F; --ink-3: #5B6C85; --ink-4: #8FA0B8; --line: #E4EBF5; --line-2: #CFDCF2; --bg: #F6F9FE; --bg-2: #EDF2FA;
  --ok: #27C44C; --ok-soft: #E7F9EC; --alerta: #F7C30D; --alerta-soft: #FFF9EC; --aviso: #F98900; --erro: #B3122E; --erro-soft: #FFE5E9;
  --sombra: 0 11px 22px rgba(0, 0, 0, .07); --sombra-leve: 0 1px 2px rgba(7, 46, 108, .05); --anel: 0 0 0 3px rgba(45, 110, 218, .18);
  --foco-campo: 0 0 0 2px rgba(45, 110, 218, .30);
  --r-md: 8px; --r-xm: 16px; --r-max: 999px;
  /* semânticas (mudam no modo escuro) */
  --surface: #fff; --texto: #072E6C; --grad-topo: #fff; --topo: rgba(255, 255, 255, .92); --overlay: rgba(7, 46, 108, .55);
  --erro-borda: #F5B5C0; --falha-bg: #FFF7F8; --ok-txt: #14742F; --ok-txt2: #1E9B3C; --alerta-txt: #7A5B00; --alerta-txt2: #6B5200; --alerta-icone: #E5A800;
  /* botões: cor de fundo fixa nos dois temas (texto branco por cima) */
  --btn: #2D6EDA; --btn-hover: #6593E1; --erro-btn: #B3122E; --erro-btn-hover: #D43A52;
}
/* Modo escuro (desligado por padrão; liga pelo botão do topo e fica salvo no navegador). Derivado da paleta navy do Design System. */
html[data-tema="escuro"] {
  color-scheme: dark;
  --navy: #1F4C9E; --navy-hover: #2D63BE; --primary: #6593E1; --primary-hover: #8AAEEA; --light: #1A3566; --clear: #14294F;
  --ink-2: #B7C5DD; --ink-3: #97A9C7; --ink-4: #7389AB; --line: #22385F; --line-2: #2F4A7A; --bg: #0A1426; --bg-2: #14294F;
  --ok-soft: #0F3322; --alerta-soft: #35300F; --erro: #FF6980; --erro-soft: #3B1522;
  --sombra: 0 11px 22px rgba(0, 0, 0, .45); --sombra-leve: 0 1px 2px rgba(0, 0, 0, .45); --anel: 0 0 0 3px rgba(101, 147, 225, .30); --foco-campo: 0 0 0 2px rgba(101, 147, 225, .45);
  --surface: #101F3D; --texto: #E8EFFB; --grad-topo: #0A1426; --topo: rgba(10, 20, 38, .92); --overlay: rgba(2, 8, 20, .72);
  --erro-borda: #7A2A3C; --falha-bg: #2A1520; --ok-txt: #6EE08C; --ok-txt2: #4CD36F; --alerta-txt: #F5D56B; --alerta-txt2: #F5D56B;
}
.em-topo__logo .em-logo--escuro { display: none; }
html[data-tema="escuro"] .em-topo__logo .em-logo--claro { display: none; }
html[data-tema="escuro"] .em-topo__logo .em-logo--escuro { display: block; }
html, body { margin: 0; padding: 0; }
body.em { margin: 0; min-height: 100vh; background: linear-gradient(180deg, var(--grad-topo) 0%, var(--bg) 320px); font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: var(--texto); -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.45; }
.em h1, .em h2, .em h3, .em p { font-family: inherit; }
.em a { color: var(--primary); }
.em a:hover, .em a:focus { color: var(--primary-hover); }

/* Topo */
.em-topo { position: sticky; top: 0; z-index: 50; background: var(--topo); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); box-shadow: var(--sombra-leve); }
.em-topo__in { display: flex; align-items: center; gap: 16px; height: 64px; max-width: 1440px; margin: 0 auto; padding: 0 16px; }
.em-topo__logo { display: flex; align-items: center; height: 24px; flex: none; }
.em-topo__logo img { display: block; height: 24px; width: auto; }
.em-topo__tag { padding: 4px 12px; border-radius: var(--r-max); background: var(--light); color: var(--primary); font-size: 12px; font-weight: 600; white-space: nowrap; }
.em-topo__nav { margin-left: auto; display: flex; gap: 8px; }
.em-topo__nav a { display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: var(--r-max); color: var(--texto); font-size: 13px; font-weight: 600; text-decoration: none; transition: background 180ms; }
.em-topo__nav a:hover, .em-topo__nav a:focus-visible { background: var(--light); color: var(--primary); outline: none; }
.em-topo__nav a.is-ativo { background: var(--navy); color: #fff; }

/* Página */
.em-main { max-width: 1440px; margin: 0 auto; padding: 24px 16px 96px; }
.em-titulo { display: flex; flex-direction: column; gap: 6px; margin: 0 0 24px; }
.em-titulo h1 { margin: 0; font-size: 24px; line-height: 1.3; letter-spacing: -.01em; font-weight: 300; color: var(--texto); text-align: left; }
.em-titulo h1 b { font-weight: 700; }
.em-titulo p { margin: 0; font-size: 13px; color: var(--ink-3); }
.em-grade { display: grid; gap: 16px; grid-template-columns: 1fr; margin-bottom: 24px; }
.em-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xm); box-shadow: var(--sombra-leve); padding: 20px; }
.em-card__titulo { margin: 0 0 14px; font-size: 14px; font-weight: 700; color: var(--texto); }

/* Medidores (Google Charts) */

/* Indicadores */
.em .mCards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 20px; }
.em .mCard { width: auto; margin: 0; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: var(--r-xm); background: var(--clear); display: block; transition: box-shadow 180ms, border-color 180ms; }
.em .mCard--action:hover { border-color: var(--primary); box-shadow: var(--anel); }
.em .mCard__content { align-items: flex-start; }
.em .mCard__title { margin: 0; font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: none; letter-spacing: 0; }
.em .mCard__total { margin: 4px 0 0; font-size: 28px; line-height: 1.1; font-weight: 700; color: var(--texto); }
.em .mCard.bg-danger { background: var(--erro-soft); border-color: var(--erro); }
.em .mCard.bg-danger .mCard__total { color: var(--erro); }
.em .mCard.bg-warning { background: var(--alerta-soft); border-color: var(--alerta); }

/* Formulários e botões */
.em .em-acao { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.em .em-acao:last-child { margin-bottom: 0; }
.em .form-control { display: block; width: 100%; height: 48px; padding: 0 22px; border-radius: var(--r-max); background: var(--surface); border: 1px solid var(--line-2); color: var(--texto); font-family: inherit; font-size: 15px; font-weight: 500; box-shadow: none; transition: border-color 180ms, box-shadow 180ms; }
.em .form-control::placeholder { color: var(--ink-4); font-weight: 400; }
.em .form-control:focus { border-color: var(--primary); box-shadow: var(--foco-campo); outline: none; }
.em .em-botoes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.em .em-botoes > .btn, .em .em-botoes > .btn-group { width: 100%; float: none; }
.em .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 18px; border: 1px solid transparent; border-radius: var(--r-max); font-family: inherit; font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; box-shadow: none; text-shadow: none; transition: background 180ms, color 180ms, border-color 180ms; width: 100%; margin: 0; }
.em .btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; box-shadow: none; }
.em .btn-primary { background: var(--btn); border-color: var(--btn); color: #fff; }
.em .btn-primary:hover, .em .btn-primary:focus { background: var(--btn-hover); border-color: var(--btn-hover); color: #fff; }
.em .btn-default { background: var(--surface); border-color: var(--line-2); color: var(--texto); }
.em .btn-default:hover, .em .btn-default:focus, .em .open > .btn-default.dropdown-toggle { background: var(--light); border-color: var(--primary); color: var(--primary); }
.em .btn-warning { background: var(--alerta-soft); border-color: var(--alerta); color: var(--alerta-txt); }
.em .btn-warning:hover, .em .btn-warning:focus { background: var(--alerta); border-color: var(--alerta); color: #072E6C; }
.em .btn-danger { background: var(--erro-btn); border-color: var(--erro-btn); color: #fff; }
.em .btn-danger:hover, .em .btn-danger:focus { background: var(--erro-btn-hover); border-color: var(--erro-btn-hover); color: #fff; }
.em .btn.actionDisable { background: var(--navy); border-color: var(--navy); }
.em .btn.actionDisable:hover, .em .btn.actionDisable:focus { background: var(--navy-hover); border-color: var(--navy-hover); }
.em .btn-group { display: block; position: relative; }
.em .dropdown-menu { background: var(--surface); min-width: 100%; margin-top: 6px; padding: 6px; border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sombra); font-size: 14px; }
.em .dropdown-menu > li > a { padding: 9px 12px; border-radius: 6px; color: var(--texto); font-weight: 500; }
.em .dropdown-menu > li > a:hover { background: var(--light); color: var(--primary); }
.em textarea.em-copia { display: block; flex: 1 1 auto; min-width: 0; width: 100%; height: 40px; margin: 0; padding: 10px 16px; border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--surface); color: var(--ink-3); font: 12px/1.4 ui-monospace, Menlo, monospace; resize: vertical; }

/* Servidores */
.em .em-servidores { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; margin: 0; }
.em .em-servidores .mytable { margin: 0; min-width: 0; width: auto; float: none; padding: 0; }
.em .em-servidores table { width: 100%; margin: 0; border: 1px solid var(--line); border-radius: var(--r-xm); border-collapse: separate; border-spacing: 0; overflow: hidden; background: var(--surface); box-shadow: var(--sombra-leve); }
.em .em-servidores table > thead > tr > th, .em .em-servidores table > tbody > tr > td, .em .em-servidores table > tfoot > tr > td { padding: 9px 14px; border: 0; border-top: 1px solid var(--line-2); border-top-color: var(--line); color: var(--texto); font-size: 13px; background: var(--surface); }
.em .em-servidores table > thead > tr > th { border-top: 0; padding: 14px; font-weight: 600; }
.em .em-servidores table > thead > tr.success > th { background: var(--ok-soft); }
.em .em-servidores table > thead > tr.danger > th { background: var(--erro-soft); }
.em .em-servidores table > thead > tr > th small { margin-top: 4px; font-size: 11px; font-weight: 500; line-height: 1.4; color: var(--ink-3) !important; }
.em .nameServer { font-size: 15px; font-weight: 700; color: var(--texto); }
.em .em-servidores table > tbody > tr:hover > td { background: var(--clear); }
.em .em-servidores table > tbody > tr.danger > td { background: var(--erro-soft); }
.em .em-servidores table > tbody > tr.warning > td { background: var(--alerta-soft); }
.em .em-servidores table > tbody > tr.showIgnore > td { background: var(--bg); }
.em .em-servidores table > tfoot > tr > td { background: var(--bg); color: var(--ink-2); font-size: 12px; }
.em .event { margin: 0 8px; padding: 6px; border-radius: 6px; }
.em .event:hover { background: var(--light); }
.em .text-success { color: var(--ok-txt2); }
.em .text-danger { color: var(--erro); }

/* Carregando */
#loader { background: var(--overlay); backdrop-filter: blur(2px); font-family: 'Inter', sans-serif; }
#loader p { color: #fff; font-weight: 600; }

/* Rodapé */
.em-rodape { border-top: 1px solid var(--line); background: var(--surface); }
.em-rodape p { max-width: 1440px; margin: 0 auto; padding: 18px 16px; color: var(--ink-4); font-size: 12.5px; text-align: center; }

/* Tabelas das páginas de pastas */
.em .em-lista { display: grid; gap: 16px; grid-template-columns: 1fr; }

@media (min-width: 640px) {
  .em .em-servidores { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .em .mCards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
  .em-topo__in { padding: 0 32px; }
  .em-main { padding: 32px 32px 96px; }
  .em-titulo { flex-direction: row; align-items: baseline; justify-content: space-between; gap: 16px; }
  .em-titulo h1 { font-size: 30px; }
  .em-grade { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .em .em-botoes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .em .em-botoes--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .em .em-servidores { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .em .em-servidores { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1400px) {
  .em .em-servidores { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .em * { transition: none !important; } }

/* Barra de atalhos (antes eram botões flutuantes) */
.em .em-barra { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.em .em-barra form { display: none; }
.em .em-atalho { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: var(--r-max); background: var(--surface); color: var(--texto); font: 600 13px/1 'Inter', sans-serif; text-decoration: none; cursor: pointer; transition: background 180ms, border-color 180ms, color 180ms; }
.em .em-atalho:hover, .em .em-atalho:focus-visible { background: var(--light); border-color: var(--primary); color: var(--primary); outline: none; text-decoration: none; }
.em .em-atalho .glyphicon { color: var(--primary); font-size: 14px; top: 0; }
@media (max-width: 639px) { .em .em-atalho { flex: 1 1 calc(50% - 4px); justify-content: center; padding: 0 10px; } }
@media (min-width: 640px) { .em .mCards { grid-template-columns: 1.6fr 1fr 1fr 1fr; } .em .mCards .mCard:first-child .mCard__total { font-size: 20px; } }

/* ===== Topo com usuário e navegação que rola no mobile ===== */
.em-topo__in { flex-wrap: wrap; height: auto; min-height: 64px; row-gap: 0; }
.em-topo__user { display: flex; align-items: center; gap: 12px; margin-left: 8px; }
.em-topo__nome { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.em-topo__sair { display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--r-max); color: var(--texto); font-size: 13px; font-weight: 600; text-decoration: none; transition: background 180ms, border-color 180ms; }
.em-topo__sair:hover, .em-topo__sair:focus-visible { background: var(--light); border-color: var(--primary); color: var(--primary); outline: none; text-decoration: none; }
@media (max-width: 767px) {
  .em-topo__in { padding-top: 10px; padding-bottom: 8px; }
  .em-topo__user { margin-left: auto; }
  .em-topo__nav { order: 5; flex: 1 0 100%; margin-left: 0; margin-top: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; scrollbar-width: none; }
  .em-topo__nav::-webkit-scrollbar { display: none; }
  .em-topo__nav a { flex: none; }
  .em-topo__tag { display: none; }
}

/* ===== Dropdown "Ações": wrapper próprio (o Bootstrap marca .open no pai do botão) ===== */
.em .em-dropdown { position: relative; width: 100%; }
.em .em-dropdown > .btn { width: 100%; }
.em .em-dropdown .dropdown-menu { left: 0; right: auto; width: max-content; min-width: 100%; max-width: calc(100vw - 48px); z-index: 1000; max-height: 60vh; overflow-y: auto; }
.em .em-dropdown .dropdown-menu > li > a { white-space: nowrap; }

/* ===== Avisos (toast) ===== */
#em-toasts { position: fixed; z-index: 2000; top: 76px; right: 16px; left: 16px; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.em-toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; width: 100%; max-width: 420px; padding: 14px 14px 14px 16px; border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--r-xm); background: var(--surface); box-shadow: var(--sombra); color: var(--texto); font: 400 14px/1.45 'Inter', sans-serif; animation: em-toast-entra 220ms ease-out; }
.em-toast.is-saindo { opacity: 0; transform: translateY(-6px); transition: opacity 200ms, transform 200ms; }
.em-toast__icone { flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 700; }
.em-toast__corpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.em-toast__corpo strong { font-weight: 700; }
.em-toast__corpo span { color: var(--ink-2); }
.em-toast__fechar { flex: none; border: 0; background: none; color: var(--ink-4); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 2px; }
.em-toast__fechar:hover { color: var(--texto); }
.em-toast--sucesso { border-left-color: var(--ok); } .em-toast--sucesso .em-toast__icone { background: var(--ok); }
.em-toast--erro { border-left-color: var(--erro); } .em-toast--erro .em-toast__icone { background: var(--erro); }
.em-toast--aviso { border-left-color: var(--alerta); } .em-toast--aviso .em-toast__icone { background: var(--alerta-icone); }
.em-toast--info { border-left-color: var(--primary); } .em-toast--info .em-toast__icone { background: var(--primary); }
@keyframes em-toast-entra { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (min-width: 768px) { #em-toasts { left: auto; right: 32px; } }

/* ===== Carregamento ===== */
.em-barra-carga { position: fixed; z-index: 3000; top: 0; left: 0; height: 3px; width: 0; background: var(--primary); box-shadow: 0 0 8px rgba(45, 110, 218, .6); opacity: 0; pointer-events: none; }
.em-barra-carga.is-ativa { opacity: 1; animation: em-carga 12s cubic-bezier(.1, .6, .2, 1) forwards; }
@keyframes em-carga { from { width: 0; } to { width: 92%; } }
#loader { z-index: 2500; }
#loader p { position: fixed; top: 50%; left: 50%; width: auto; max-width: calc(100vw - 32px); transform: translate(-50%, -50%); margin: 0; white-space: nowrap; padding: 18px 28px; border-radius: var(--r-xm); background: var(--surface); color: var(--texto) !important; box-shadow: var(--sombra); font-size: 15px; }
#loader p::before { content: ''; display: inline-block; width: 16px; height: 16px; margin-right: 12px; vertical-align: -3px; border: 2px solid var(--light); border-top-color: var(--primary); border-radius: 50%; animation: em-gira 700ms linear infinite; }
@keyframes em-gira { to { transform: rotate(360deg); } }

/* ===== Login ===== */
.em-login { flex: 1 0 auto; display: flex; align-items: flex-start; justify-content: center; padding: 32px 16px 56px; }
.em-login__card { width: 100%; max-width: 440px; padding: 28px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xm); box-shadow: var(--sombra); display: flex; flex-direction: column; gap: 16px; }
.em-login__card h1 { margin: 0; font-size: 26px; font-weight: 300; color: var(--texto); text-align: left; }
.em-login__card h1 b { font-weight: 700; }
.em-login__texto { margin: -6px 0 0; font-size: 14px; color: var(--ink-3); }
@media (min-width: 768px) { .em-login { align-items: center; } .em-login__card { padding: 36px 36px; } }

/* ===== Campos, alertas, selos ===== */
.em .em-campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.em .em-campo > label, .em .em-campo > .em-rotulo { margin: 0; font-size: 13px; font-weight: 600; color: var(--texto); }
.em .em-campo > label span { font-weight: 400; color: var(--ink-4); }
.em .em-alerta { padding: 12px 14px; border-radius: var(--r-md); font-size: 14px; }
.em .em-alerta--erro { background: var(--erro-soft); color: var(--erro); border: 1px solid var(--erro-borda); }
.em .em-btn-auto { width: auto; align-self: flex-start; padding: 0 28px; }
.em .em-selo { display: inline-block; padding: 3px 10px; border-radius: var(--r-max); background: var(--light); color: var(--primary); font-size: 12px; font-weight: 600; white-space: nowrap; }
.em .em-selo--erro { background: var(--erro-soft); color: var(--erro); }

/* ===== Usuários ===== */
.em .em-permissoes { margin-bottom: 16px; }
.em .em-permissoes ul { margin: 0 0 10px; padding-left: 18px; color: var(--ink-2); }
.em .em-permissoes li { margin-bottom: 4px; }
.em .em-permissoes p { margin: 0; color: var(--ink-3); font-size: 13px; }
.em .em-form-usuario { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.em .em-form-usuario.is-inativo { opacity: .7; background: var(--bg); }
.em .em-form-linha { display: grid; grid-template-columns: 1fr; gap: 12px; }
.em .em-checks { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.em .em-check { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 8px 14px; border: 1px solid var(--line-2); border-radius: var(--r-max); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--texto); cursor: pointer; }
.em .em-check input { margin: 0; accent-color: var(--primary); width: 16px; height: 16px; }
.em .em-check:has(input:checked) { background: var(--light); border-color: var(--primary); color: var(--primary); }
.em .em-form-rodape { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.em .em-form-rodape small { color: var(--ink-4); font-size: 12px; }
@media (min-width: 768px) { .em .em-form-linha { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ===== Log ===== */
.em .em-filtros { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 16px; }
.em .em-filtros .btn { width: 100%; }
@media (min-width: 768px) { .em .em-filtros { grid-template-columns: 1fr 1fr 1.4fr auto; } .em .em-filtros .btn { width: auto; padding: 0 28px; } }
.em .em-tabela-rolagem { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xm); box-shadow: var(--sombra-leve); }
.em table.em-tabela { width: 100%; margin: 0; }
.em .em-tabela th { padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); background: var(--bg); color: var(--ink-3); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.em .em-tabela td { padding: 11px 14px; border: 0; border-top: 1px solid var(--line); color: var(--texto); font-size: 13px; vertical-align: top; overflow-wrap: anywhere; }
.em .em-tabela tr.is-falha td { background: var(--falha-bg); }
.em .em-tabela .em-vazio { padding: 28px; text-align: center; color: var(--ink-4); }
.em .em-paginacao { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; font-size: 13px; color: var(--ink-3); }
@media (max-width: 639px) {
  .em .em-tabela thead { display: none; }
  .em .em-tabela, .em .em-tabela tbody, .em .em-tabela tr, .em .em-tabela td { display: block; width: 100%; }
  .em .em-tabela tr { padding: 10px 0; border-top: 1px solid var(--line); }
  .em .em-tabela td { border: 0; padding: 3px 14px; }
  .em .em-tabela td::before { content: attr(data-rotulo) ': '; font-weight: 700; color: var(--ink-4); }
}
.em .em-aviso { max-width: 520px; margin: 40px auto; }

/* ===== Administração de usuários (mesmo modelo do /admin da Instalação) ===== */
.em .em-topo__form { display: inline; margin: 0; }
.em .em-topo__sair { background: var(--surface); cursor: pointer; font-family: inherit; }
.em a.em-topo__nome { color: var(--ink-2); text-decoration: none; }
.em a.em-topo__nome:hover { color: var(--primary); text-decoration: underline; }
.em .em-alerta--aviso { background: var(--alerta-soft); color: var(--alerta-txt2); border: 1px solid var(--alerta); margin-bottom: 16px; }
.em .em-alerta--erro { margin-bottom: 16px; }
.em .em-selo--ok { background: var(--ok-soft); color: var(--ok-txt); }
.em .em-selo--cinza { background: var(--bg-2); color: var(--ink-3); }
.em .em-dica { color: var(--ink-4); font-size: 12px; line-height: 1.4; }
.em code { padding: 2px 6px; border-radius: 6px; background: var(--clear); color: var(--texto); font-size: 12px; }
.em code.em-chave { display: inline-block; margin: 4px 0; padding: 8px 12px; font-size: 15px; letter-spacing: .08em; word-break: break-all; }
.em .em-acoes-pagina { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.em .em-acoes-pagina a:not(.btn):not(.em-atalho) { font-weight: 600; }
.em .em-marcas { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 4px; }
.em .em-marca { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--surface); font-weight: 400; cursor: pointer; }
.em .em-marca input { margin: 3px 0 0; accent-color: var(--primary); flex: none; width: 16px; height: 16px; }
.em .em-marca span { font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.em .em-marca b { color: var(--texto); }
.em .em-marca:has(input:checked) { background: var(--clear); border-color: var(--primary); }
.em .em-conta { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.em .em-form-usuario form { margin: 0; }
.em .em-login__voltar { align-self: center; font-size: 13px; font-weight: 600; }
@media (min-width: 768px) { .em .em-marcas { grid-template-columns: repeat(2, minmax(0, 1fr)); } .em .em-conta { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ===== Confirmação / pergunta (modal) ===== */
.em-modal { position: fixed; inset: 0; z-index: 4000; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--overlay); backdrop-filter: blur(2px); animation: em-modal-fundo 160ms ease-out; }
.em-modal__caixa { width: 100%; max-width: 440px; padding: 24px; background: var(--surface); border-radius: var(--r-xm); box-shadow: 0 22px 44px rgba(7, 46, 108, .28); font-family: 'Inter', sans-serif; color: var(--texto); animation: em-modal-caixa 200ms ease-out; display: flex; flex-direction: column; gap: 14px; }
.em-modal__titulo { margin: 0; font-size: 20px; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; color: var(--texto); }
.em-modal__texto { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink-2); overflow-wrap: anywhere; }
.em-modal__acoes { display: flex; flex-direction: column-reverse; gap: 10px; margin-top: 6px; }
.em-modal__acoes .btn { width: 100%; }
.em-modal__caixa--largo { max-width: 720px; max-height: calc(100vh - 32px); }
.em-modal__conteudo { margin: 0; padding: 14px; overflow: auto; flex: 1 1 auto; min-height: 0; max-height: 60vh; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-xm); font-size: 13px; line-height: 1.5; color: var(--texto); white-space: pre-wrap; overflow-wrap: anywhere; }
.em .em-ver-mais { display: inline; max-width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.em .em-ver-mais code { cursor: pointer; }
.em .em-ver-mais:hover code, .em .em-ver-mais:focus-visible code { background: var(--light); }
.em .em-ver-mais__mais { margin-left: 6px; font-size: 12px; font-weight: 600; color: var(--primary); white-space: nowrap; }
body.em-modal-aberto { overflow: hidden; }
@media (min-width: 480px) { .em-modal__acoes { flex-direction: row; justify-content: flex-end; } .em-modal__acoes .btn { width: auto; padding: 0 26px; } }
@keyframes em-modal-fundo { from { opacity: 0; } to { opacity: 1; } }
@keyframes em-modal-caixa { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }


/* ===== Medidores de ocupação dos servidores (SVG no servidor, sem biblioteca) ===== */
.em .em-medidores-card .em-card__titulo { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.em .em-medidores { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 768px) { .em .em-medidores { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.em .em-medidor { appearance: none; -webkit-appearance: none; position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 0; padding: 12px 8px 12px; border: 1px solid var(--line); border-radius: var(--r-xm); background: var(--surface); color: var(--texto); font-family: inherit; text-align: center; cursor: pointer; transition: border-color 180ms, box-shadow 180ms, transform 180ms; }
.em .em-medidor:hover, .em .em-medidor:focus-visible { border-color: var(--primary); box-shadow: var(--anel); outline: none; transform: translateY(-1px); }
.em .em-medidor__arco { position: relative; display: block; width: 100%; max-width: 128px; }
.em .em-medidor__svg { display: block; width: 100%; height: auto; }
.em .em-medidor__trilho { stroke: var(--line); stroke-width: 12; }
.em .em-medidor__valor { stroke: var(--primary); stroke-width: 12; animation: em-medidor-entra 800ms cubic-bezier(.2, .7, .2, 1) both; }
.em .em-medidor__numero { position: absolute; left: 0; right: 0; bottom: 2px; font-size: 26px; line-height: 1; font-weight: 700; letter-spacing: -.02em; }
.em .em-medidor__capacidade { font-size: 12px; color: var(--ink-3); }
.em .em-medidor__nome { margin-top: 4px; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.em .em-medidor__aviso { margin-top: 2px; padding: 2px 8px; border-radius: var(--r-max); background: var(--erro-soft); color: var(--erro); font-size: 11px; font-weight: 700; }
.em .em-medidor--alerta .em-medidor__valor { stroke: var(--alerta); }
.em .em-medidor--critico .em-medidor__valor { stroke: var(--erro); }
.em .em-medidor--critico .em-medidor__numero { color: var(--erro); }
.em .em-medidor--sem-sinal { background: var(--bg); }
.em .em-medidor--sem-sinal .em-medidor__arco { opacity: .55; }
.em .em-vazio-bloco { grid-column: 1 / -1; margin: 0; padding: 28px 8px; text-align: center; color: var(--ink-4); }
.em .em-legenda { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 14px; font-size: 12px; color: var(--ink-3); }
.em .em-legenda__ponto { display: inline-block; width: 10px; height: 10px; margin-left: 8px; border-radius: 50%; }
.em .em-legenda__ponto:first-child { margin-left: 0; }
.em .em-legenda__ponto--ok { background: var(--primary); }
.em .em-legenda__ponto--alerta { background: var(--alerta); }
.em .em-legenda__ponto--critico { background: var(--erro); }
@keyframes em-medidor-entra { from { stroke-dasharray: 0 100; } }
@media (prefers-reduced-motion: reduce) { .em .em-medidor__valor { animation: none; } }
@media (max-width: 479px) { .em .em-medidores { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ===== Cartões dos servidores recolhíveis (fechados por padrão) ===== */
.em .em-barra--lista { align-items: center; margin: 0 0 12px; }
.em .em-barra__titulo { margin-right: auto; font-size: 16px; font-weight: 700; color: var(--texto); }
.em .em-barra__titulo .em-dica { font-weight: 400; font-size: 14px; }
.em .em-colapso { appearance: none; -webkit-appearance: none; display: flex; align-items: center; gap: 8px; width: 100%; margin: 10px 0 0; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: var(--r-max); background: var(--surface); color: var(--texto); font-family: inherit; font-size: 12.5px; text-align: left; cursor: pointer; transition: background 180ms, border-color 180ms; }
.em .em-colapso:hover, .em .em-colapso:focus-visible { background: var(--light); border-color: var(--primary); outline: none; }
.em .em-colapso__rotulo { font-weight: 700; }
.em .em-colapso__chips { flex: 1; min-width: 0; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.em .em-colapso__chips b { color: var(--texto); }
.em .em-colapso__seta { flex: none; width: 8px; height: 8px; margin-right: 4px; border-right: 2px solid var(--primary); border-bottom: 2px solid var(--primary); transform: rotate(45deg) translateY(-2px); transition: transform 180ms; }
.em .mytable.is-aberto .em-colapso__seta { transform: rotate(-135deg) translate(-2px, -2px); }
.em .mytable--colapso:not(.is-aberto) table > tbody, .em .mytable--colapso:not(.is-aberto) table > tfoot { display: none; }
.em .em-servidores table > thead > tr > th { font-weight: 400; }
.em .em-colapso__off { color: var(--erro); }
@media (max-width: 639px) { .em .em-barra--lista .em-barra__titulo { flex: 1 0 100%; margin-right: 0; } }

/* ===== Pastas: cabeçalho de cada pasta em destaque ===== */
.em .em-servidores--pastas table > thead > tr > th { display: flex; align-items: center; justify-content: flex-start; gap: 8px; padding: 5px 12px; line-height: 1.2; background: var(--navy); color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .01em; }
.em .em-servidores--pastas { grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 700px) { .em .em-servidores--pastas { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .em .em-servidores--pastas { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .em .em-servidores--pastas { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.em .em-servidores--pastas table > tbody > tr > td { padding: 5px 14px; font-size: 12.5px; line-height: 1.35; }
.em .em-servidores--pastas table > tbody > tr:nth-child(even) > td { background: var(--bg); }
.em .em-servidores--pastas table > tbody > tr:hover > td { background: var(--light); }
.em .em-pasta__nome { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.em .em-pasta__qtd { flex: none; min-width: 22px; padding: 1px 8px; line-height: 1.4; border-radius: var(--r-max); background: rgba(255, 255, 255, .18); color: #fff; font-size: 12px; font-weight: 700; text-align: center; }
.em .em-servidores--pastas table > tbody > tr.em-pasta__vazia > td { color: var(--ink-4); font-style: italic; }

/* ===== Resumo da busca por cliente ===== */
.em .em-pesquisa-resumo { margin: 8px 0 0; padding: 8px 12px; background: var(--light); border-radius: var(--r-md); color: var(--texto); font-size: 13px; line-height: 1.5; }
.em .em-pesquisa-resumo[hidden] { display: none; }
.em .em-pesquisa-resumo a { font-weight: 700; color: var(--primary); }

/* ===== Botão de tema (claro/escuro) ===== */
.em .em-tema { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; margin-left: 8px; padding: 0; border: 1px solid var(--line-2); border-radius: var(--r-max); background: var(--surface); color: var(--texto); cursor: pointer; transition: background 180ms, border-color 180ms, color 180ms; }
.em .em-tema:hover, .em .em-tema:focus-visible { background: var(--light); border-color: var(--primary); color: var(--primary); outline: none; }
.em .em-tema--solo { margin-left: auto; }
.em .em-tema svg { width: 18px; height: 18px; display: block; }
.em .em-tema .em-tema__ir-claro { display: none; }
html[data-tema="escuro"] .em .em-tema .em-tema__ir-escuro { display: none; }
html[data-tema="escuro"] .em .em-tema .em-tema__ir-claro { display: block; }

/* ===== Olho para ver a senha ===== */
.em .em-senha { position: relative; display: block; }
.em .em-senha .form-control { padding-right: 52px; }
.em .em-senha__olho { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: var(--r-max); background: transparent; color: var(--ink-3); cursor: pointer; transition: background 180ms, color 180ms; }
.em .em-senha__olho:hover, .em .em-senha__olho:focus-visible { background: var(--light); color: var(--primary); outline: none; }
.em .em-senha__olho svg { width: 20px; height: 20px; display: block; }
.em .em-senha__olho .em-senha__fechado { display: none; }
.em .em-senha.is-visivel .em-senha__olho .em-senha__aberto { display: none; }
.em .em-senha.is-visivel .em-senha__olho .em-senha__fechado { display: block; }

/* Formulário de uma linha (botão Apagar na lista de usuários) */
.em .em-inline { display: inline; margin: 0; }
.em .em-link-perigo { display: inline; height: auto; width: auto; margin: 0; padding: 0 0 0 10px; border: 0; background: none; font: inherit; font-weight: 500; color: var(--erro); cursor: pointer; }
.em .em-link-perigo:hover, .em .em-link-perigo:focus { color: var(--erro-btn-hover); text-decoration: underline; }
.em .em-link-perigo:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.em .em-copia-painel { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 20px; }
.em .em-copia-painel[hidden] { display: none; }
@media (max-width: 639px) { .em .em-copia-painel { flex-direction: column; align-items: stretch; } }
.em .em-atalho.is-girando .glyphicon { animation: em-gira .8s linear infinite; }
@media (prefers-reduced-motion: reduce) { .em .em-atalho.is-girando .glyphicon { animation: none; } }
