:root {
  --bg: #07100b;
  --bg-soft: #0b1710;
  --panel: rgba(13, 28, 18, .9);
  --panel-2: rgba(18, 37, 24, .94);
  --line: rgba(188, 255, 93, .13);
  --line-strong: rgba(188, 255, 93, .3);
  --lime: #baff45;
  --lime-2: #8eea30;
  --forest: #1e6b38;
  --text: #f5fff1;
  --muted: #97aa9c;
  --danger: #ff6a72;
  --warning: #ffcf5a;
  --success: #78f29b;
  --shadow: 0 24px 80px rgba(0, 0, 0, .32);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 0%, rgba(99, 255, 87, .13), transparent 28rem),
    radial-gradient(circle at 100% 100%, rgba(47, 118, 64, .12), transparent 34rem),
    var(--bg);
  color: var(--text);
}

button, input, select { font: inherit; }

button { cursor: pointer; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 18px;
  border-right: 1px solid var(--line);
  background: rgba(5, 13, 8, .78);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #081006;
  background: linear-gradient(145deg, var(--lime), #6dbb25);
  box-shadow: 0 0 34px rgba(186, 255, 69, .18);
}

.brand strong { display: block; font-size: 15px; }
.brand span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }

.nav {
  display: grid;
  gap: 7px;
}

.nav-item {
  text-align: left;
  border: 1px solid transparent;
  color: #b9c8bc;
  background: transparent;
  padding: 12px 14px;
  border-radius: 12px;
  transition: .18s ease;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255,255,255,.035);
}

.nav-item.active {
  color: #10190d;
  background: linear-gradient(135deg, var(--lime), #94db3c);
  font-weight: 800;
  box-shadow: 0 8px 28px rgba(186, 255, 69, .12);
}

.security-card {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.025);
}

.security-card strong,
.security-card small {
  display: block;
}

.security-card strong { font-size: 12px; }
.security-card small { color: var(--muted); font-size: 11px; margin-top: 2px; }

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 18px rgba(120, 242, 155, .65);
}

.main {
  min-width: 0;
  padding: 32px clamp(22px, 4vw, 58px) 60px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(28px, 3vw, 40px); letter-spacing: -.04em; }
h2 { margin-bottom: 0; font-size: 19px; letter-spacing: -.02em; }

.eyebrow {
  margin-bottom: 6px;
  color: var(--lime);
  font-size: 10px;
  letter-spacing: .16em;
  font-weight: 900;
}

.muted { color: var(--muted); }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pill, .status, .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.035);
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 800;
}

.status.good, .badge.good { color: var(--success); border-color: rgba(120,242,155,.25); }
.status.warn, .badge.warn { color: var(--warning); border-color: rgba(255,207,90,.25); }
.status.bad, .badge.bad { color: var(--danger); border-color: rgba(255,106,114,.25); }

.button {
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 10px 14px;
  font-weight: 800;
  transition: .16s ease;
}

.button:disabled { opacity: .45; cursor: not-allowed; }

.button.primary {
  color: #0b1308;
  background: linear-gradient(135deg, var(--lime), #83d934);
}

.button.secondary {
  color: var(--text);
  background: rgba(255,255,255,.045);
  border-color: var(--line);
}

.button.warning {
  color: #241800;
  background: linear-gradient(135deg, #ffe889, var(--warning));
}

.button:hover:not(:disabled) { transform: translateY(-1px); }

.view { display: none; }
.view.active { display: block; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat-card, .panel {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(16,35,22,.88), rgba(8,20,13,.92));
  box-shadow: var(--shadow);
}

.stat-card {
  min-height: 132px;
  padding: 20px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-card span,
.stat-card small {
  color: var(--muted);
  font-size: 12px;
}

.stat-card strong {
  font-size: 30px;
  letter-spacing: -.04em;
}

.two-column {
  display: grid;
  grid-template-columns: 1.12fr .88fr;
  gap: 16px;
  margin-bottom: 16px;
}

.panel {
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 16px;
}

.panel-head, .section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.panel-head { margin-bottom: 18px; }

.section-head {
  align-items: end;
  margin-bottom: 16px;
}

.section-head p:last-child { margin-bottom: 0; }

.details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0;
}

.details div {
  padding: 11px 0;
  border-bottom: 1px solid rgba(255,255,255,.045);
}

.details dt {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
}

.details dd {
  margin: 0;
  font-size: 12px;
  word-break: break-word;
}

.danger-zone {
  margin-top: 18px;
  border: 1px solid rgba(255,207,90,.18);
  background: rgba(255,207,90,.045);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.danger-zone p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.worker-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.metric {
  padding: 13px;
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 13px;
  background: rgba(255,255,255,.022);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 5px;
}

.metric strong { font-size: 14px; }

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.input {
  width: 100%;
  color: var(--text);
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 10px;
  padding: 10px 11px;
  outline: none;
}

.input:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(186,255,69,.06);
}

.select { min-width: 170px; }
option { background: #0c1911; }

.table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable;
  border: 1px solid rgba(255,255,255,.045);
  border-radius: 13px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 930px;
}

th, td {
  text-align: left;
  padding: 11px 8px;
  border-bottom: 1px solid rgba(255,255,255,.045);
  font-size: 10.5px;
  vertical-align: middle;
}

table th:last-child,
table td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #0b1710;
  box-shadow: -12px 0 18px rgba(5,13,8,.48);
}

table th:last-child {
  z-index: 3;
  background: #0d1b12;
}

th {
  color: #829187;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: rgba(0,0,0,.12);
}

tr:last-child td { border-bottom: 0; }

.token-cell {
  display: flex;
  align-items: center;
  gap: 9px;
}

.token-logo {
  width: 31px;
  height: 31px;
  border-radius: 10px;
  object-fit: cover;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.07);
}

.token-logo-fallback {
  width: 31px;
  height: 31px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #0c1609;
  font-weight: 900;
  background: var(--lime);
}

.token-cell strong,
.token-cell small {
  display: block;
}

.token-cell small {
  color: var(--muted);
  margin-top: 2px;
  max-width: 118px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  min-width: 116px;
  white-space: nowrap;
}

.mini-button {
  color: var(--text);
  background: rgba(255,255,255,.045);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 10px;
}

.cards-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.partner-card {
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 14px;
  padding: 15px;
  background: rgba(255,255,255,.025);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.partner-card p {
  color: var(--muted);
  font-size: 11px;
  margin: 4px 0 0;
}

.health-item {
  padding: 12px;
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 12px;
  margin-bottom: 8px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.health-item:last-child { margin-bottom: 0; }

.health-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.audit-list {
  display: grid;
  gap: 8px;
}

.audit-item {
  display: grid;
  grid-template-columns: 145px 170px 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 12px;
  padding: 12px;
}

.audit-item code {
  color: var(--lime);
  font-size: 10px;
}

.audit-item small { color: var(--muted); }

.dialog {
  width: min(760px, calc(100vw - 28px));
  border: 0;
  padding: 0;
  border-radius: 18px;
  color: var(--text);
  background: transparent;
}

.dialog::backdrop {
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(8px);
}

.dialog-card {
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 20px;
  background: #0b1710;
  box-shadow: 0 30px 100px rgba(0,0,0,.6);
}

.dialog-card.compact {
  max-width: 520px;
  margin: auto;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.icon-button {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
  font-size: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field.full { grid-column: 1 / -1; }

.field span {
  color: #aab7ad;
  font-size: 10px;
  font-weight: 800;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

.file-input {
  padding: 8px;
}

.file-input::file-selector-button {
  margin-right: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px 10px;
  color: #0c1609;
  background: var(--lime);
  font-weight: 900;
  cursor: pointer;
}

.logo-preview {
  grid-column: 1 / -1;
  min-height: 88px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 13px;
  background: rgba(255,255,255,.022);
}

.logo-preview-image {
  width: 62px;
  height: 62px;
  flex: 0 0 62px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.2);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
}

.logo-preview-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-preview strong,
.logo-preview small {
  display: block;
}

.logo-preview small {
  color: var(--muted);
  margin-top: 4px;
  word-break: break-word;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 18px;
}

.market-card { max-width: 900px; margin: auto; }

.market-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0,1fr));
  gap: 9px;
  margin-bottom: 14px;
}

.chart-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.intervals {
  display: flex;
  gap: 5px;
}

.intervals button {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.035);
  color: var(--muted);
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 10px;
}

.intervals button.active {
  color: #10180e;
  background: var(--lime);
  border-color: var(--lime);
  font-weight: 900;
}

.chart {
  height: 300px;
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 14px;
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px),
    rgba(0,0,0,.16);
  background-size: 100% 25%, 12.5% 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.chart svg { width: 100%; height: 100%; }

.message {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.035);
  font-size: 12px;
}

.message.good { border-color: rgba(120,242,155,.25); color: var(--success); }
.message.bad { border-color: rgba(255,106,114,.25); color: #ff9da2; }
.hidden { display: none !important; }

.empty {
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
}

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .two-column { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    width: auto;
    height: auto;
    padding: 16px;
  }
  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .security-card { margin-top: 0; }
  .main { padding: 22px 14px 50px; }
  .topbar, .section-head { align-items: flex-start; flex-direction: column; }
  .stats-grid, .market-stats { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
}


/* 4P.24E.1G — autenticação administrativa */

.auth-user-pill {
  gap: 8px;
}

.auth-user-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 14px rgba(120,242,155,.65);
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.auth-shell {
  width: min(100%, 560px);
}

.auth-card {
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  padding: clamp(22px, 5vw, 34px);
  background:
    linear-gradient(
      145deg,
      rgba(15, 34, 21, .96),
      rgba(6, 17, 10, .98)
    );
  box-shadow:
    0 34px 120px rgba(0,0,0,.55),
    0 0 0 1px rgba(186,255,69,.02);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 28px;
}

.auth-brand h1 {
  font-size: 29px;
  margin: 0 0 4px;
}

.auth-brand p:last-child {
  margin: 0;
}

.auth-section {
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.auth-section-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.auth-section-head h2 {
  margin-bottom: 5px;
}

.auth-section-head p {
  margin: 0;
  font-size: 12px;
}

.auth-lock {
  color: var(--warning);
  font-size: 14px;
  line-height: 1.4;
}

.auth-lock.good {
  color: var(--success);
}

.auth-form {
  display: grid;
  gap: 13px;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
}

.auth-note {
  border: 1px solid rgba(186,255,69,.1);
  border-radius: 11px;
  padding: 11px 12px;
  color: var(--muted);
  background: rgba(255,255,255,.025);
  font-size: 11px;
  line-height: 1.55;
}

.warning-note {
  margin-top: 14px;
  border-color: rgba(255,207,90,.2);
  color: #d4c49b;
}

.totp-steps {
  display: grid;
  gap: 11px;
  margin-bottom: 17px;
}

.totp-steps > p {
  margin: 0;
  color: #c7d4ca;
  font-size: 12px;
  line-height: 1.6;
}

.secret-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(0,0,0,.14);
}

.secret-box > span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 7px;
}

.secret-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.secret-row code {
  flex: 1;
  color: var(--lime);
  word-break: break-all;
  font-size: 13px;
  letter-spacing: .08em;
}

.auth-code {
  text-align: center;
  font-size: 20px;
  letter-spacing: .25em;
}

.recovery-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.recovery-grid code {
  display: block;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--lime);
  background: rgba(0,0,0,.18);
  text-align: center;
  font-size: 11px;
}

.auth-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 17px;
}

.auth-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 18px;
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 540px) {
  .recovery-grid {
    grid-template-columns: 1fr;
  }

  .auth-actions {
    flex-direction: column;
  }

  .auth-actions .button {
    width: 100%;
  }
}
