:root {
  --bg-void: #030508;
  --bg-hud: #070c14;
  --bg-card: rgba(7, 12, 20, 0.88);
  --cyan: #00f0ff;
  --blue: #0055ff;
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --border-hud: rgba(0, 240, 255, 0.22);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-void);
  color: var(--text-main);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  background-image:
    linear-gradient(to right, rgba(0, 240, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 240, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.admin-wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

/* Cabeçalho Fixo e Marca */
header.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 76px;
  z-index: 50;
  background: rgba(3, 5, 8, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-hud);
}

.nav-wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.brand-badge {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 6px;
  background: var(--bg-hud);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: var(--cyan);
  box-shadow: 0 0 5px rgba(0, 240, 255, 0.05);
  overflow: hidden;
  padding: 4px;
}

.brand-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-title {
  display: block;
  font-weight: 700;
  letter-spacing: 2px;
  font-size: 16px;
  color: #ffffff;
}

.brand-sub {
  display: block;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cyan);
  opacity: 0.85;
}

nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 14px;
}

nav a:hover {
  color: var(--cyan);
}

/* Botões HUD */
.btn,
.btn-hud {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  transition: 0.25s ease;
  cursor: pointer;
  border: 1px solid var(--cyan);
  background: rgba(0, 240, 255, 0.12);
  color: var(--cyan);
}

.btn:hover,
.btn-hud:hover {
  background: var(--cyan);
  color: var(--bg-void);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.4);
}

.btn-primary,
.btn-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  color: var(--bg-void);
  border: none;
  padding: 11px 20px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.3);
}

.btn-primary:hover,
.btn-save:hover {
  filter: brightness(1.1);
}

.btn-sm,
.btn-small {
  padding: 6px 10px;
  font-size: 11px;
}

.btn-danger {
  border-color: rgba(248, 113, 113, 0.6);
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
}

.btn-danger:hover {
  background: #ef4444;
  color: #ffffff;
}

/* Topbars e Painéis Administrativos */
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border: 1px solid var(--border-hud);
  border-radius: 8px;
  background: var(--bg-card);
  margin-bottom: 18px;
}

.topbar h1 {
  font-size: 20px;
  color: #ffffff;
}

.topbar p {
  font-size: 13px;
  color: var(--text-muted);
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-hud);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 18px;
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.14);
}

.panel h2 {
  font-size: 16px;
  color: var(--cyan);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.grid-main {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

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

.field {
  margin-bottom: 12px;
}

label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 5px;
}

input[type="text"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid rgba(0, 240, 255, 0.22);
  background: var(--bg-hud);
  color: #ffffff;
  font-size: 14px;
  font-family: inherit;
}

textarea {
  min-height: 76px;
  resize: vertical;
}

textarea.code-tree {
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 13px;
  min-height: 270px;
  line-height: 1.5;
}

/* Alertas */
.alert-ok {
  padding: 12px 16px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #6ee7b7;
  margin-bottom: 16px;
  font-size: 14px;
}

.alert-err {
  padding: 12px 16px;
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  margin-bottom: 16px;
  font-size: 14px;
}

/* Cartões do Gerenciador */
.trilha-card {
  border: 1px solid rgba(0, 240, 255, 0.18);
  border-left: 4px solid var(--cyan);
  border-radius: 6px;
  padding: 14px 16px;
  background: rgba(3, 5, 8, 0.6);
  margin-bottom: 12px;
}

.trilha-card.is-modulo {
  border-left-color: #3b82f6;
}

.trilha-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.trilha-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

.trilha-meta {
  font-family: monospace;
  font-size: 12px;
  color: var(--cyan);
}

.trilha-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.badge-secao {
  display: inline-block;
  font-family: monospace;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 6px;
  text-transform: uppercase;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--cyan);
}

.badge-secao.modulo {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(59, 130, 246, 0.45);
  color: #93c5fd;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.chip {
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.24);
  color: #cbd5e1;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 6px;
  border: 1px solid rgba(0, 240, 255, 0.14);
  background: rgba(3, 5, 8, 0.55);
  margin-bottom: 8px;
  font-size: 13px;
}

.link-badge {
  font-family: monospace;
  font-size: 11px;
  color: var(--cyan);
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(0, 240, 255, 0.1);
}

.help-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.logo-editor-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid rgba(0, 240, 255, 0.18);
  background: rgba(3, 5, 8, 0.6);
  margin-bottom: 14px;
}

.logo-preview {
  width: 76px;
  height: 76px;
  border-radius: 8px;
  border: 1px solid var(--border-hud);
  background: var(--bg-hud);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 6px;
  flex-shrink: 0;
}

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

.item-box {
  border: 1px solid rgba(0, 240, 255, 0.16);
  border-radius: 6px;
  padding: 14px;
  margin-bottom: 12px;
  background: rgba(3, 5, 8, 0.55);
}

.item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.sync-box {
  border: 1px solid rgba(0, 240, 255, 0.28);
  border-left: 4px solid var(--cyan);
  border-radius: 6px;
  padding: 14px;
  margin-bottom: 14px;
  background: rgba(0, 240, 255, 0.05);
  font-size: 13px;
}

.sticky-bar {
  position: sticky;
  bottom: 14px;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 8px;
  background: rgba(7, 12, 20, 0.94);
  border: 1px solid var(--cyan);
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.75);
  margin-top: 18px;
}

.hidden {
  display: none !important;
}