/* ============================================================
   NinePix — design system (dark + laranja) — mobile-first
   ============================================================ */

:root {
  --orange: #ff6a00;
  --orange-2: #ff8a2a;
  --orange-soft: rgba(255, 106, 0, .12);
  --bg: #080a0f;
  --bg-2: #0d1017;
  --card: #11151e;
  --card-2: #151a24;
  --line: rgba(255, 255, 255, .09);
  --text: #f7f8fa;
  --muted: #9ca4b2;
  --green: #26d97c;
  --red: #ff4d5e;
  --purple: #8b5cf6;
  --warn: #f5b544;
  --r-lg: 22px;
  --r: 16px;
  --r-sm: 10px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 85% 0%, rgba(255, 106, 0, .07), transparent 24rem),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button { font-family: inherit; }

/* ---------- Layout ---------- */
.np-container { width: min(1160px, 100% - 28px); margin-inline: auto; }

.np-main { padding: 24px 0 64px; min-height: calc(100vh - 64px); }

/* Topbar */
.np-topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: 64px;
  background: rgba(8, 10, 15, .85);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.np-topbar-inner { display: flex; align-items: center; gap: 12px; height: 64px; }

.np-brand { font-size: 22px; font-weight: 800; letter-spacing: -.8px; white-space: nowrap; }
.np-brand .pix { color: var(--orange); }

.np-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  font-size: 19px;
  cursor: pointer;
}

.np-nav { display: none; }

.np-nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}

.np-nav a:hover { color: var(--text); }
.np-nav a.active { color: var(--text); border-bottom-color: var(--orange); }

.np-topbar-right { margin-left: auto; display: flex; align-items: center; }

.np-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  max-width: 180px;
}

.np-user-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Drawer (mobile) */
.np-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 120;
  width: min(300px, 82vw);
  padding: 84px 14px 20px;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  transform: translateX(-100%);
  transition: transform .25s ease;
  overflow-y: auto;
}

.np-drawer.open { transform: none; }

.np-drawer a {
  display: block;
  padding: 13px 14px;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-weight: 600;
  font-size: 15px;
}

.np-drawer a:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.np-drawer a.active { background: var(--orange-soft); color: var(--orange); }

.np-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(0, 0, 0, .6);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.np-drawer-overlay.show { opacity: 1; pointer-events: auto; }

/* Page head */
.np-pagehead { background: var(--bg-2); border-bottom: 1px solid var(--line); }

.np-pagehead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px 0;
}

.np-pagehead h1 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.5px; }

/* ---------- Botões ---------- */
.np-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 750;
  font-size: 14px;
  cursor: pointer;
  transition: transform .2s, background .2s, box-shadow .2s;
}

.np-btn:hover { transform: translateY(-1px); }

.np-btn-primary { background: var(--orange); color: #fff; box-shadow: 0 10px 28px rgba(255, 106, 0, .2); }
.np-btn-primary:hover { background: #ff7818; }

.np-btn-ghost { background: rgba(255, 255, 255, .05); color: var(--text); border-color: var(--line); }
.np-btn-ghost:hover { background: rgba(255, 255, 255, .09); }

.np-btn-success { background: rgba(38, 217, 124, .12); color: #4fe79a; border-color: rgba(38, 217, 124, .3); }
.np-btn-success:hover { background: rgba(38, 217, 124, .2); }

.np-btn-danger { background: rgba(255, 77, 94, .12); color: #ff8b96; border-color: rgba(255, 77, 94, .3); }
.np-btn-danger:hover { background: rgba(255, 77, 94, .2); }

.np-btn-warn { background: rgba(245, 181, 68, .12); color: #f8c878; border-color: rgba(245, 181, 68, .3); }
.np-btn-warn:hover { background: rgba(245, 181, 68, .2); }

.np-btn-sm { min-height: 34px; padding: 0 12px; font-size: 12px; border-radius: 9px; }
.np-btn-block { width: 100%; }

/* ---------- Cards / grids ---------- */
.np-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }

.np-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
.np-grid-2 { display: grid; gap: 14px; grid-template-columns: 1fr; }

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

.np-panel {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px;
  transition: transform .2s, border-color .2s;
}

.np-panel:hover { transform: translateY(-2px); border-color: rgba(255, 106, 0, .4); }
.np-panel h3 { margin: 0 0 6px; font-size: 17px; }
.np-panel p { margin: 0; color: var(--muted); font-size: 13px; }

.np-empty {
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--r);
  padding: 32px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Badges ---------- */
.np-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  background: rgba(255, 255, 255, .06);
  color: var(--muted);
  white-space: nowrap;
}

.np-badge-success { background: rgba(38, 217, 124, .14); color: #4fe79a; }
.np-badge-danger { background: rgba(255, 77, 94, .14); color: #ff8b96; }
.np-badge-warn { background: rgba(245, 181, 68, .14); color: #f8c878; }
.np-badge-purple { background: rgba(139, 92, 246, .16); color: #b39df7; }
.np-badge-orange { background: var(--orange-soft); color: #ff9b55; }

/* ---------- Formulários ---------- */
.np-label { display: block; font-size: 13px; font-weight: 650; color: #c7ccd5; margin-bottom: 6px; }

.np-input, .np-select {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.np-input:focus, .np-select:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 106, 0, .15); }
.np-input::placeholder { color: #5c6472; }
.np-select option { background: var(--bg-2); }

textarea.np-input { resize: vertical; }

.np-field { margin-bottom: 16px; }
.np-error { color: var(--red); font-size: 12.5px; margin-top: 6px; }
.np-hint { color: var(--muted); font-size: 12px; margin-top: 6px; }

.np-checkbox { width: 18px; height: 18px; accent-color: var(--orange); }

.np-check-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  color: #c7ccd5;
  cursor: pointer;
}

.np-link { color: var(--orange); font-weight: 650; }
.np-link:hover { text-decoration: underline; }
.np-muted { color: var(--muted); }
.np-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---------- Seletor de vozes (leitura por IA) ---------- */
.np-vozes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 10px; }

.np-voz {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background .15s;
}

.np-voz img, .np-voz-inicial {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--muted);
  background: var(--card-2);
}

.np-voz > span:last-child {
  font-size: 12px;
  font-weight: 650;
  color: #c7ccd5;
  line-height: 1.2;
  word-break: break-word;
}

.np-voz input { position: absolute; opacity: 0; pointer-events: none; }

.np-voz:has(input:checked) { border-color: var(--orange); background: var(--orange-soft); }
.np-voz:has(input:checked) > span:last-child { color: var(--text); }

.np-voz:has(input:checked)::after {
  content: "✓";
  position: absolute;
  top: 6px;
  right: 8px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  background: var(--orange);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}

/* ---------- Alertas ---------- */
.np-alert { padding: 13px 16px; border-radius: 12px; font-size: 13.5px; margin-bottom: 16px; border: 1px solid; }
.np-alert-success { background: rgba(38, 217, 124, .1); border-color: rgba(38, 217, 124, .3); color: #4fe79a; }
.np-alert-error { background: rgba(255, 77, 94, .1); border-color: rgba(255, 77, 94, .3); color: #ff8b96; }
.np-alert-warn { background: rgba(245, 181, 68, .1); border-color: rgba(245, 181, 68, .3); color: #f8c878; }
.np-alert-info { background: rgba(139, 92, 246, .1); border-color: rgba(139, 92, 246, .3); color: #b39df7; }

/* ---------- Lista ---------- */
.np-list { display: grid; }
.np-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
}
.np-list-item:last-child { border-bottom: 0; }

/* ---------- Stats ---------- */
.np-stats { display: grid; gap: 14px; grid-template-columns: 1fr; }
.np-stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.np-stat small { color: var(--muted); font-size: 12px; }
.np-stat b { display: block; margin-top: 4px; font-size: 24px; letter-spacing: -1px; }

/* ---------- Tabs ---------- */
.np-tabs { display: flex; gap: 8px; margin-bottom: 18px; overflow-x: auto; padding-bottom: 4px; }
.np-tab {
  padding: 9px 16px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 700;
  background: rgba(255, 255, 255, .05);
  color: var(--muted);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.np-tab.active { background: var(--orange); color: #fff; border-color: transparent; }

/* ---------- Dropdown ---------- */
.np-dropdown {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
}

.np-dropdown-link {
  display: block;
  width: 100%;
  padding: 10px 16px;
  text-align: start;
  font-size: 13.5px;
  color: #c7ccd5;
}

.np-dropdown-link:hover { background: rgba(255, 255, 255, .06); color: var(--text); }

/* ---------- Auth ---------- */
.np-auth {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  background:
    radial-gradient(circle at 75% 8%, rgba(255, 106, 0, .12), transparent 26rem),
    radial-gradient(circle at 15% 85%, rgba(139, 92, 246, .07), transparent 22rem),
    var(--bg);
}

.np-logo {
  width: 46px;
  height: 46px;
  border: 3px solid var(--orange);
  border-radius: 12px 12px 12px 5px;
  display: grid;
  place-items: center;
  box-shadow: 0 0 26px rgba(255, 106, 0, .16);
}

.np-logo .dots { display: grid; grid-template-columns: repeat(3, 4px); gap: 3px; }
.np-logo .dots span { width: 4px; height: 4px; border-radius: 50%; background: var(--orange); }

.np-auth-card {
  width: 100%;
  max-width: 420px;
  margin-top: 24px;
  padding: 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .38);
}

/* ---------- Paginação ---------- */
.np-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 24px;
}

.np-pag-btn {
  min-width: 38px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .04);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.np-pag-btn:hover { border-color: var(--orange); color: var(--text); }

.np-pag-btn.current {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

.np-pag-btn.disabled { opacity: .35; pointer-events: none; }

/* ---------- Widgets OBS (admin) ---------- */
.np-wgrid {
  display: grid;
  gap: 18px;
  align-items: stretch;
}

.np-wcard {
  --wc: var(--orange);
  --wc-soft: rgba(255, 106, 0, .12);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.np-wcard::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--wc), transparent 75%);
}

.np-wcard:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, .16);
  box-shadow: 0 20px 48px rgba(0, 0, 0, .38);
}

.np-wcard-top { display: flex; align-items: center; justify-content: space-between; }

.np-wicon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--wc-soft);
  color: var(--wc);
}

.np-wtag {
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.np-wcard h3 { margin: 0; font-size: 19px; letter-spacing: -.3px; }

.np-wcard p.desc { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }

.np-wprev {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .28);
}

.np-qr-preview {
  width: 74px;
  height: 74px;
  background:
    radial-gradient(circle at 20% 20%, var(--qr) 0 2.5px, transparent 3px),
    radial-gradient(circle at 80% 20%, var(--qr) 0 2.5px, transparent 3px),
    radial-gradient(circle at 50% 50%, var(--qr) 0 2.5px, transparent 3px),
    radial-gradient(circle at 20% 80%, var(--qr) 0 2.5px, transparent 3px),
    radial-gradient(circle at 80% 80%, var(--qr) 0 2.5px, transparent 3px),
    linear-gradient(90deg, var(--qr) 0 8px, transparent 8px 66px, var(--qr) 66px 74px),
    linear-gradient(0deg, var(--qr) 0 8px, transparent 8px 66px, var(--qr) 66px 74px);
  border-radius: 8px;
  border: 4px solid var(--qr);
}

.np-wactions { margin-top: auto; display: flex; gap: 8px; padding-top: 6px; }
.np-wactions .np-btn { flex: 1; justify-content: center; }

/* Modais (dialog nativo) */
.np-dialog {
  width: min(500px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card-2);
  color: var(--text);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .55);
}

.np-dialog::backdrop { background: rgba(4, 6, 10, .72); backdrop-filter: blur(4px); }

.np-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.np-dialog-head h3 { margin: 0; font-size: 16px; }

.np-dialog-close {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.np-dialog-close:hover { color: var(--text); }

.np-dialog-body {
  display: grid;
  gap: 16px;
  padding: 20px 22px;
  max-height: 68vh;
  overflow: auto;
}

.np-dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px 20px;
  border-top: 1px solid var(--line);
}

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

.np-field > label {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
}

.np-field small { color: var(--muted); font-size: 12px; }

.np-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.np-range-val { color: var(--orange); }

.np-field input[type="range"] { width: 100%; accent-color: var(--orange); }

.np-field input[type="color"] {
  width: 100%;
  height: 42px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  cursor: pointer;
}

/* ---------- Desktop (mobile-first: expandir) ---------- */
@media (min-width: 640px) {
  .np-container { width: min(1160px, 100% - 40px); }
  .np-grid { grid-template-columns: repeat(2, 1fr); }
  .np-stats { grid-template-columns: repeat(3, 1fr); }
  .np-vozes { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 900px) {
  .np-menu-btn { display: none; }
  .np-nav { display: flex; gap: 24px; }
  .np-grid-2 { grid-template-columns: 1fr 1fr; }
  .np-wgrid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1000px) {
  .np-grid { grid-template-columns: repeat(3, 1fr); }
}
