/* EloBicho: grafite + destaque laranja/amarelo. Carregado após admin.css. */
:root {
  --eb-grafite: #1d2024;
  --eb-grafite-claro: #292d32;
  --eb-borda: #3b4148;
  --eb-texto: #f3f4f6;
  --eb-suave: #b9c0c8;
  --eb-laranja: #f47a20;
  --eb-amarelo: #ffd15c;
  --eb-destaque: linear-gradient(105deg, #ef781e 0%, #f7a322 53%, #ffcf52 100%);
}

body.login {
  color: var(--eb-texto);
  background:
    radial-gradient(900px 550px at 0% 0%, rgba(71, 80, 91, .28), transparent 68%),
    radial-gradient(760px 480px at 100% 100%, rgba(147, 87, 33, .13), transparent 70%),
    linear-gradient(135deg, #111316, #1b1e22 65%, #141619);
}
body.login:before {
  opacity: .22;
  background-image: linear-gradient(rgba(255,255,255,.09) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.09) 1px, transparent 1px);
}
body.login .login-card {
  background: linear-gradient(150deg, #2c3035 0%, #22262a 52%, #1c2024 100%);
  border: 1px solid #454a50;
  box-shadow: 0 28px 75px rgba(0,0,0,.42), inset 0 1px rgba(255,255,255,.055);
}
body.login .login-card:before { background: var(--eb-destaque); }
body.login .brand {
  color: #ffc45a;
  background: var(--eb-destaque);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
body.login .brand small {
  color: #ffc45a;
  background: none;
  -webkit-text-fill-color: #ffc45a;
}
body.login .login-card h1 { color: var(--eb-texto); }
body.login .login-card h1:after { color: var(--eb-suave); }
body.login .login-card label { color: #e3e5e8; }
body.login .login-card input:not([type="checkbox"]) {
  background: #16191d;
  border: 1px solid #474d54;
  color: #fff;
}
body.login .login-card input:not([type="checkbox"]):focus {
  background: #1a1e22;
  border-color: #ffc052;
  box-shadow: 0 0 0 4px rgba(247, 163, 34, .18);
}
body.login .login-card input[type="checkbox"] { accent-color: #f7a322; }
body.login .login-card button {
  background: var(--eb-destaque);
  color: #211605;
  box-shadow: 0 9px 20px rgba(239, 120, 30, .24);
  font-weight: 800;
}
body.login .login-card button:hover { filter: brightness(1.07); box-shadow: 0 12px 25px rgba(239,120,30,.32); }

/* Painel: superfícies grafite, textos legíveis e acentos quentes. */
.admin-shell { background: #15181b; color: var(--eb-texto); }
.admin-shell .sidebar { background: linear-gradient(180deg, #181b1e, #111315); border-right: 1px solid #34393f; }
.admin-shell .sidebar .admin-brand { background: #1b1e21; color: var(--eb-texto); }
.admin-shell .sidebar .admin-brand > span,
.admin-shell .side-brand > b { background: var(--eb-destaque); color: #211605; }
.admin-shell .sidebar nav a { color: #dce0e4; }
.admin-shell .sidebar nav a:hover,
.admin-shell .sidebar nav a.active { background: #34302a; color: #ffd15c; box-shadow: inset 3px 0 #f7a322; }
.admin-shell .topbar { background: #22262a; border-color: var(--eb-borda); color: var(--eb-texto); }
.admin-shell .topbar small { color: var(--eb-suave); }
.admin-shell .workspace,
.admin-shell .admin-content { background: #15181b; color: var(--eb-texto); }
.admin-shell .admin-content > section,
.admin-shell .admin-content .card,
.admin-shell .admin-grid-3 > section,
.admin-shell .metrics article,
.admin-shell .reference-page,
.admin-shell .reference-form,
.admin-shell .reference-filter,
.admin-shell .lottery-edit-card {
  background: linear-gradient(145deg, #292d32, #202428) !important;
  color: var(--eb-texto) !important;
  border-color: var(--eb-borda) !important;
  box-shadow: 0 10px 28px rgba(0,0,0,.18);
}
.admin-shell h1, .admin-shell h2, .admin-shell h3,
.admin-shell label, .admin-shell .metrics strong,
.admin-shell .reference-page label { color: var(--eb-texto) !important; }
.admin-shell p, .admin-shell small, .admin-shell .hint,
.admin-shell .section-lead { color: var(--eb-suave); }
.admin-shell .admin-content > section > h1,
.admin-shell .reference-page > h1 { background: #30343a !important; border-bottom: 2px solid #f3a52f !important; }
.admin-shell .mini-list span,
.admin-shell .report-bar,
.admin-shell .inline,
.admin-shell .lowered-list span { background: #30353a; color: var(--eb-texto); border-color: var(--eb-borda); }
.admin-shell input:not([type="checkbox"]),
.admin-shell select,
.admin-shell textarea,
.admin-shell .reference-page input,
.admin-shell .reference-page select,
.admin-shell .reference-page textarea {
  background: #171a1e !important;
  color: #fff !important;
  border-color: #4b5259 !important;
}
.admin-shell input:focus, .admin-shell select:focus, .admin-shell textarea:focus {
  border-color: #f7a322 !important;
  box-shadow: 0 0 0 3px rgba(247,163,34,.18) !important;
}
.admin-shell input[type="checkbox"] { accent-color: #f7a322; }
.admin-shell input::placeholder, .admin-shell textarea::placeholder { color: #aeb6be; }
.admin-shell table, .admin-shell .reference-page table { background: #25292d !important; color: var(--eb-texto) !important; }
.admin-shell th, .admin-shell .reference-page th { background: #373c41 !important; color: #f8e7c6 !important; border-color: #4b5157 !important; }
.admin-shell td, .admin-shell .reference-page td { color: #e9edf0 !important; border-color: #3d444b !important; }
.admin-shell table tr:nth-child(even) td,
.admin-shell .reference-page tr:nth-child(even) td { background: #2c3136 !important; }
.admin-shell table tr:hover td { background: #383f45 !important; }
.admin-shell button:not(.danger):not(.logout),
.admin-shell .button:not(.danger),
.admin-shell .green,
.admin-shell .admin-content .action-link,
.admin-shell .reference-page .green {
  background: var(--eb-destaque) !important;
  color: #211605 !important;
  border-color: transparent !important;
  font-weight: 800;
  box-shadow: 0 7px 16px rgba(239,120,30,.17);
}
.admin-shell button:not(.danger):not(.logout):hover,
.admin-shell .button:not(.danger):hover { filter: brightness(1.07); }
.admin-shell a:not(.action-link):not(.button) { color: #ffc45a; }
.admin-shell .sidebar a { color: #dce0e4 !important; }
.admin-shell .sidebar a.active, .admin-shell .sidebar a:hover { color: #ffd15c !important; }
.admin-shell .flash.success { background: #3d3320; border-color: #9a6b24; color: #ffdc91; }
.admin-shell .flash.error { background: #48272a; border-color: #9d434b; color: #ffd5d8; }
.admin-shell .logout, .admin-shell .danger { background: #a93840 !important; color: #fff !important; }
@media (max-width: 700px) {
  body.login .login-card { padding: 30px 24px; }
  .admin-shell .admin-content { padding: 18px 14px 40px; }
}

/* Correções de navegação e espaçamento solicitadas. */
.admin-shell .theme-toggle,
.admin-shell #themeToggle,
.admin-shell [data-theme-toggle] { display: none !important; }
.admin-shell .admin-theme-switch {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin: 0 12px 0 0;
  padding: 8px 13px;
  border: 1px solid #626970 !important;
  border-radius: 9px !important;
  background: #353a3f !important;
  color: #ffe0a1 !important;
  box-shadow: none !important;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.admin-shell .admin-theme-switch:hover { background: #444b51 !important; }
.admin-shell .sidebar {
  width: 250px;
  overflow-x: hidden;
  overflow-y: auto;
}
.admin-shell .workspace { margin-left: 250px; min-width: 0; }
.admin-shell .sidebar .admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 82px;
  padding: 16px;
  border-bottom: 1px solid #383d43;
}
.admin-shell .sidebar .admin-brand > span {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 800;
}
.admin-shell .sidebar .admin-brand > div { min-width: 0; }
.admin-shell .sidebar .admin-brand strong,
.admin-shell .sidebar .admin-brand small { display: block; white-space: normal; }
.admin-shell .sidebar .admin-brand small { color: #bfc5cb; font-size: 10px; letter-spacing: 1.2px; }
.admin-shell .sidebar nav {
  position: static;
  display: block;
  height: auto;
  padding: 12px 8px 28px;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}
.admin-shell .sidebar nav p {
  margin: 18px 10px 8px;
  color: #aab1b8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.1px;
}
.admin-shell .sidebar nav a {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  gap: 10px;
  margin: 2px 0;
  padding: 11px 12px;
  border-radius: 8px;
  white-space: normal;
  line-height: 1.3;
}
.admin-shell .sidebar nav a img { flex: 0 0 18px; width: 18px; height: 18px; object-fit: contain; }
.admin-shell .admin-content > h2,
.admin-shell .admin-content .metrics + h2 {
  margin: 30px 0 15px !important;
  line-height: 1.4;
}
.admin-shell .admin-content h2 + .card { margin-top: 0; }
.admin-shell .badge.green {
  background: var(--eb-destaque) !important;
  color: #211605 !important;
  border: 0 !important;
  font-weight: 800;
  padding: 5px 9px;
}
@media (max-width: 900px) {
  .admin-shell .sidebar { transform: translateX(-100%); }
  .sidebar-open .admin-shell .sidebar { transform: translateX(0); }
  .admin-shell .workspace { margin-left: 0; }
}

/* Modo claro alternável: painel e cards claros, sidebar grafite. */
html[data-admin-theme="light"] .admin-shell {
  background: #f3f5f7;
  color: #1c2935;
}
html[data-admin-theme="light"] .admin-shell .workspace,
html[data-admin-theme="light"] .admin-shell .admin-content { background: #f3f5f7; color: #1c2935; }
html[data-admin-theme="light"] .admin-shell .topbar {
  background: #fff;
  color: #1c2935;
  border-color: #d9dee4;
}
html[data-admin-theme="light"] .admin-shell .topbar small,
html[data-admin-theme="light"] .admin-shell p,
html[data-admin-theme="light"] .admin-shell small,
html[data-admin-theme="light"] .admin-shell .hint,
html[data-admin-theme="light"] .admin-shell .section-lead { color: #63717e; }
html[data-admin-theme="light"] .admin-shell .admin-content > section,
html[data-admin-theme="light"] .admin-shell .admin-content .card,
html[data-admin-theme="light"] .admin-shell .admin-grid-3 > section,
html[data-admin-theme="light"] .admin-shell .metrics article,
html[data-admin-theme="light"] .admin-shell .reference-page,
html[data-admin-theme="light"] .admin-shell .reference-form,
html[data-admin-theme="light"] .admin-shell .reference-filter,
html[data-admin-theme="light"] .admin-shell .lottery-edit-card {
  background: linear-gradient(145deg, #fff, #f8f9fb) !important;
  color: #1c2935 !important;
  border-color: #d9dee4 !important;
  box-shadow: 0 8px 24px rgba(20,35,50,.07);
}
html[data-admin-theme="light"] .admin-shell h1,
html[data-admin-theme="light"] .admin-shell h2,
html[data-admin-theme="light"] .admin-shell h3,
html[data-admin-theme="light"] .admin-shell label,
html[data-admin-theme="light"] .admin-shell .metrics strong,
html[data-admin-theme="light"] .admin-shell .reference-page label { color: #1c2935 !important; }
html[data-admin-theme="light"] .admin-shell .admin-content > section > h1,
html[data-admin-theme="light"] .admin-shell .reference-page > h1 {
  background: #f1f3f5 !important;
  color: #1c2935 !important;
}
html[data-admin-theme="light"] .admin-shell .mini-list span,
html[data-admin-theme="light"] .admin-shell .report-bar,
html[data-admin-theme="light"] .admin-shell .inline,
html[data-admin-theme="light"] .admin-shell .lowered-list span {
  background: #f1f3f5;
  color: #1c2935;
  border-color: #d9dee4;
}
html[data-admin-theme="light"] .admin-shell input:not([type="checkbox"]),
html[data-admin-theme="light"] .admin-shell select,
html[data-admin-theme="light"] .admin-shell textarea,
html[data-admin-theme="light"] .admin-shell .reference-page input,
html[data-admin-theme="light"] .admin-shell .reference-page select,
html[data-admin-theme="light"] .admin-shell .reference-page textarea {
  background: #fff !important;
  color: #1c2935 !important;
  border-color: #cbd3db !important;
}
html[data-admin-theme="light"] .admin-shell input::placeholder,
html[data-admin-theme="light"] .admin-shell textarea::placeholder { color: #768390; }
html[data-admin-theme="light"] .admin-shell table,
html[data-admin-theme="light"] .admin-shell .reference-page table { background: #fff !important; color: #1c2935 !important; }
html[data-admin-theme="light"] .admin-shell th,
html[data-admin-theme="light"] .admin-shell .reference-page th {
  background: #e9edf1 !important;
  color: #33404b !important;
  border-color: #d7dde4 !important;
}
html[data-admin-theme="light"] .admin-shell td,
html[data-admin-theme="light"] .admin-shell .reference-page td {
  color: #26343f !important;
  border-color: #dfe4e9 !important;
}
html[data-admin-theme="light"] .admin-shell table tr:nth-child(even) td,
html[data-admin-theme="light"] .admin-shell .reference-page tr:nth-child(even) td { background: #f7f9fa !important; }
html[data-admin-theme="light"] .admin-shell table tr:hover td { background: #fff3df !important; }
html[data-admin-theme="light"] .admin-shell .admin-theme-switch {
  background: #fff !important;
  color: #7a3f0a !important;
  border-color: #e1b66d !important;
}
html[data-admin-theme="light"] .admin-shell .admin-theme-switch:hover { background: #fff5e5 !important; }
html[data-admin-theme="light"] .admin-shell a:not(.action-link):not(.button):not(.sidebar a) { color: #a6530a; }
@media (max-width: 540px) {
  .admin-shell .admin-theme-switch { padding: 7px 9px; font-size: 11px; margin-right: 7px; }
}

/* Respiro e hierarquia dos indicadores do dashboard. */
.admin-shell .admin-content .metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin: 12px 0 30px;
}
.admin-shell .admin-content .metrics article {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  min-height: 168px;
  padding: 23px 24px;
  border: 1px solid #41474d !important;
  border-radius: 16px;
  overflow: hidden;
}
.admin-shell .admin-content .metrics article::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  width: auto;
  height: 3px;
  border-radius: 0;
  background: var(--eb-destaque);
}
.admin-shell .admin-content .metrics article::after { display: none; }
.admin-shell .admin-content .metrics small {
  margin: 0;
  color: #b9c0c8;
  font-size: 11px;
  letter-spacing: .8px;
  line-height: 1.4;
}
.admin-shell .admin-content .metrics strong {
  margin: 0;
  font-size: clamp(23px, 2vw, 31px);
  line-height: 1.12;
  letter-spacing: -.5px;
  color: #fff !important;
}
.admin-shell .admin-content .metrics span {
  display: block;
  margin-top: auto;
  color: #bdc4cb;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.admin-shell .admin-content .metrics .metric-health {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: .1px;
}
.admin-shell .admin-content .metrics .metric-health::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(255,255,255,.1);
}
.admin-shell .admin-content .metrics .metric-health.is-online {
  background: rgba(247,163,34,.16);
  color: #ffd16c !important;
  border: 1px solid rgba(247,163,34,.38);
}
.admin-shell .admin-content .metrics .metric-health.is-offline {
  background: rgba(224,94,97,.14);
  color: #ffb1b3 !important;
  border: 1px solid rgba(224,94,97,.35);
}
.admin-shell .admin-content .metrics .metric-sync time {
  display: block;
  margin-top: 3px;
  color: #f4f5f6;
  font-weight: 650;
}
.admin-shell .admin-content .metrics + h2 {
  margin: 0 0 16px !important;
  padding-top: 3px;
}
html[data-admin-theme="light"] .admin-shell .admin-content .metrics article {
  border-color: #dbe1e7 !important;
}
html[data-admin-theme="light"] .admin-shell .admin-content .metrics small,
html[data-admin-theme="light"] .admin-shell .admin-content .metrics span { color: #667480; }
html[data-admin-theme="light"] .admin-shell .admin-content .metrics strong { color: #1e2a35 !important; }
html[data-admin-theme="light"] .admin-shell .admin-content .metrics .metric-health.is-online { color: #8a4a07 !important; }
html[data-admin-theme="light"] .admin-shell .admin-content .metrics .metric-health.is-offline { color: #a72f38 !important; }
html[data-admin-theme="light"] .admin-shell .admin-content .metrics .metric-sync time { color: #24333f; }
@media (max-width: 1200px) {
  .admin-shell .admin-content .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 650px) {
  .admin-shell .admin-content .metrics { grid-template-columns: 1fr; gap: 12px; }
  .admin-shell .admin-content .metrics article { min-height: 145px; }
}

/* Abas: não herdar o estilo de botão de ação nem clarear ao clicar. */
.admin-shell .tabs,
.admin-shell .lowered-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0 10px;
  border-bottom: 1px solid #454b51;
  background: transparent;
}
.admin-shell .tabs button:not(.danger):not(.logout),
.admin-shell .lowered-tabs button:not(.danger):not(.logout) {
  min-height: 40px;
  margin: 0;
  padding: 9px 15px;
  border: 1px solid #4b5259 !important;
  border-radius: 9px !important;
  background: #30353a !important;
  color: #e7eaed !important;
  box-shadow: none !important;
  transform: none !important;
  transition: background-color .15s, border-color .15s, color .15s;
}
.admin-shell .tabs button.active:not(.danger):not(.logout),
.admin-shell .lowered-tabs button.active:not(.danger):not(.logout) {
  background: var(--eb-destaque) !important;
  color: #211605 !important;
  border-color: transparent !important;
}
.admin-shell .tabs button:focus-visible,
.admin-shell .lowered-tabs button:focus-visible,
.admin-shell .sidebar nav a:focus-visible {
  outline: 3px solid #ffc45a;
  outline-offset: 2px;
}
.admin-shell .sidebar nav a { transition: background-color .12s, color .12s; }
html[data-admin-theme="light"] .admin-shell .tabs,
html[data-admin-theme="light"] .admin-shell .lowered-tabs { border-color: #d9dee4; }
html[data-admin-theme="light"] .admin-shell .tabs button:not(.danger):not(.logout),
html[data-admin-theme="light"] .admin-shell .lowered-tabs button:not(.danger):not(.logout) {
  background: #fff !important;
  color: #25323d !important;
  border-color: #cdd5dd !important;
}
html[data-admin-theme="light"] .admin-shell .tabs button.active:not(.danger):not(.logout),
html[data-admin-theme="light"] .admin-shell .lowered-tabs button.active:not(.danger):not(.logout) {
  background: var(--eb-destaque) !important;
  color: #211605 !important;
  border-color: transparent !important;
}

/* Ações do cabeçalho na mesma linha e no mesmo eixo vertical. */
.admin-shell .topbar { align-items: center; }
.admin-shell .topbar > form {
  display: flex;
  align-items: center;
  align-self: center;
  margin: 0;
  padding: 0;
}
.admin-shell .topbar .admin-theme-switch,
.admin-shell .topbar .logout {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  align-self: center;
  height: 40px;
  min-height: 40px;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 1;
  vertical-align: middle;
}
.admin-shell .topbar .admin-theme-switch { margin-right: 10px !important; }
.admin-shell .topbar .logout { margin-left: 0 !important; }
