:root {
  --bg: #0F1117;
  --surface: #1A1D27;
  --surface2: #242836;
  --border: #2E3347;
  --accent: #9d63cfcc;
  --accent2: #FF6B6B;
  --green: #00C48C;
  --yellow: #FFB800;
  --text: #E8EAED;
  --text2: #8B90A0;
  --text3: #545869;
  --radius: 12px;
  --radius-sm: 8px;
}

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

/* Page fade-in — opacity only (no transform) so position:fixed children keep viewport anchor */
@keyframes nx-fadein { from { opacity:0; } to { opacity:1; } }
.nx-page-body { animation: nx-fadein .22s ease both; }

/* Top loader bar */
#nx-loader {
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px; z-index: 99999;
  background: linear-gradient(90deg, var(--nx-verde,#2DFF19) 0%, rgba(45,255,25,.4) 50%, var(--nx-verde,#2DFF19) 100%);
  background-size: 200% 100%;
  display: none;
  animation: nx-loader-shimmer 1s linear infinite;
}
@keyframes nx-loader-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.nx-page-body {
  flex: 1;
}

/* NAV */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-wrap: wrap;
}

.nav-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-brand span { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  color: var(--text2);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all .15s;
}

.nav-links a:hover { color: var(--text); background: var(--surface2); }

.nav-user {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  color: var(--text3);
  font-size: 13px;
}

/* Hamburguer — escondido em desktop */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text2);
  border-radius: 2px;
  transition: all .2s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 640px) {
  nav {
    height: auto;
    padding: 12px 20px;
    gap: 0;
  }

  .nav-hamburger { display: flex; }

  .nav-links {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: 10px 0 6px;
    gap: 2px;
  }

  .nav-links.open { display: flex; }

  .nav-links a {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
  }

  .nav-user {
    width: 100%;
    padding: 8px 12px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
  }

  .nav-links form { width: 100%; }
  .nav-links form .btn { width: 100%; text-align: center; margin-top: 4px; }

  /* NxModal — botões empilhados pra caber labels longos (ex: "Excluir permanentemente") */
  .nx-modal-actions {
    display: flex !important; flex-direction: column-reverse; gap: 10px !important;
  }
  .nx-modal-actions .btn {
    width: 100%; box-sizing: border-box; white-space: normal !important;
    padding: 12px 8px !important; line-height: 1.25;
  }
}

/* LAYOUT */
.container { max-width: 900px; margin: 0 auto; padding: 40px 24px; }
.container-wide { max-width: 1200px; margin: 0 auto; padding: 40px 24px; }

/* FLASH MESSAGES */
.flash-list { list-style: none; margin-bottom: 24px; display: flex; flex-direction: column; gap: 8px; }

.flash {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.flash.erro { background: rgba(255,107,107,.12); border: 1px solid rgba(255,107,107,.3); color: #FF9A9A; }
.flash.ok { background: rgba(0,196,140,.12); border: 1px solid rgba(0,196,140,.3); color: #4DFFCA; }
.flash.aviso { background: rgba(255,184,0,.12); border: 1px solid rgba(255,184,0,.3); color: #FFD55C; }

/* CARDS */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

/* FORM */
.form-group { margin-bottom: 20px; }

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
}

input, select, textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  padding: 10px 14px;
  transition: border-color .15s;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
}

select option { background: var(--surface2); }

.hint { font-size: 12px; color: var(--text3); margin-top: 5px; }

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all .15s;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #00000069; }
.btn-green { background: var(--green); color: #000; }
.btn-green:hover { background: #00ad7d; }
.btn-ghost { background: transparent; color: var(--text2); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--text3); }
.btn-danger { background: rgba(255,107,107,.15); color: var(--accent2); border: 1px solid rgba(255,107,107,.25); }
.btn-danger:hover { background: rgba(255,107,107,.25); }

/* BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}

.badge-accent { background: rgba(108,99,255,.2); color: var(--accent); }
.badge-green { background: rgba(0,196,140,.15); color: var(--green); }
.badge-yellow { background: rgba(255,184,0,.15); color: var(--yellow); }
.badge-red { background: rgba(255,107,107,.15); color: var(--accent2); }
.badge-blue { background: rgba(88,166,255,.15); color: #58a6ff; }

/* AVATAR */
.avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; background: var(--accent); color: #fff; flex-shrink: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-lg { width: 72px; height: 72px; font-size: 26px; }

/* STAT CARDS */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 32px; }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.stat-label { font-size: 12px; color: var(--text3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.stat-value { font-family: 'Space Grotesk', sans-serif; font-size: 32px; font-weight: 700; color: var(--text); }
.stat-sub { font-size: 12px; color: var(--text2); margin-top: 4px; }

/* TABLE */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }

table { width: 100%; border-collapse: collapse; }

thead tr { background: var(--surface2); }

th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}

td { padding: 12px 16px; font-size: 14px; color: var(--text); border-top: 1px solid var(--border); }

tr:hover td { background: rgba(255,255,255,.02); }

/* PROGRESS BAR */
.progress-wrap { background: var(--surface2); border-radius: 100px; height: 8px; overflow: hidden; margin-top: 8px; }
.progress-bar { height: 100%; border-radius: 100px; background: var(--accent); transition: width .4s ease; }
.progress-bar.green { background: var(--green); }
.progress-bar.yellow { background: var(--yellow); }
.progress-bar.red { background: var(--accent2); }

/* CODE */
.code-block {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-family: 'Space Mono', 'Courier New', monospace;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .1em;
  text-align: center;
}

/* DIVIDER */
hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* GRID */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .two-col { grid-template-columns: 1fr; } }

/* HEADING */
h1, h2, h3 { font-family: 'Space Grotesk', sans-serif; }
h1 { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
h2 { font-size: 20px; font-weight: 700; margin-bottom: 16px; }
h3 { font-size: 16px; font-weight: 600; margin-bottom: 12px; }

.subtitle { color: var(--text2); font-size: 15px; margin-bottom: 32px; }

/* CHECKBOX */
.check-row { display: flex; align-items: flex-start; gap: 12px; }
.check-row input[type=checkbox] { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; accent-color: var(--accent); }
.check-row label { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 400; color: var(--text2); }

/* COPY BTN */
.copy-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 12px;
  font-size: 13px; color: var(--text2); cursor: pointer;
  transition: all .15s;
}
.copy-btn:hover { color: var(--text); border-color: var(--accent); }

/* FOOTER */
footer {
  text-align: center;
  padding: 32px;
  color: var(--text3);
  font-size: 13px;
  border-top: 1px solid var(--border);
  margin-top: 60px;
}
