:root {
  --bg: #0c1210;
  --card: #14201b;
  --line: rgba(94, 234, 160, 0.16);
  --text: #eef7f1;
  --muted: #8aa396;
  --green: #34d399;
  --green2: #10b981;
  --danger: #fb7185;
  --shadow: 0 24px 60px rgba(0,0,0,.45);
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Syne", "DM Sans", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
}
.bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 10% -10%, rgba(52,211,153,.22), transparent 55%),
    radial-gradient(ellipse 50% 40% at 90% 10%, rgba(16,185,129,.12), transparent 50%),
    linear-gradient(180deg, #0e1713, #0a0f0d 60%);
}
.hidden { display: none !important; }

/* Scroll verde */
html {
  scrollbar-width: thin;
  scrollbar-color: #34d399 rgba(10, 16, 14, .9);
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: rgba(10, 16, 14, .9);
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #34d399, #10b981);
  border-radius: 999px;
  border: 2px solid rgba(10, 16, 14, .9);
}
*::-webkit-scrollbar-thumb:hover {
  background: #5eead4;
}

.login-logo {
  display: block;
  margin: 0 auto 18px;
  max-width: min(220px, 78%);
  max-height: 96px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.top-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}
.top-logo {
  display: block;
  height: auto;
  width: auto;
  max-height: 120px;
  max-width: 320px;
  object-fit: contain;
  margin-bottom: 12px;
}
.plan-badge {
  margin: 8px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #062015;
  background: linear-gradient(135deg, var(--green), var(--green2));
  border-radius: 999px;
  padding: 5px 12px;
  line-height: 1.2;
}
.plan-badge.is-off {
  color: #fecdd3;
  background: rgba(251, 113, 133, .18);
  border: 1px solid rgba(251, 113, 133, .35);
}
.btn.is-locked {
  opacity: .55;
  cursor: not-allowed;
}
.plan-admin {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 10px 0 14px;
}
.plan-admin select {
  flex: 1 1 160px;
  margin: 0;
  padding: 8px 10px;
  font-size: .85rem;
}
h1 { margin: 0; font-family: var(--display); font-size: 1.8rem; }
h2 { margin: 0; font-family: var(--display); }
.muted { color: var(--muted); margin: 6px 0 0; }
.opt { color: var(--muted); font-weight: 400; font-size: .85em; }

#loginView {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card, .modal-card {
  width: min(440px, 100%);
  background: rgba(20,32,27,.92);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.login-card {
  text-align: left;
}
.login-card h1,
.login-card .muted {
  text-align: center;
}
.login-card .btn-login,
#loginForm .btn.primary {
  width: 100%;
  margin: 18px auto 0;
  display: flex;
  justify-content: center;
  align-items: center;
}
label {
  display: block;
  margin: 14px 0 0;
  font-size: .82rem;
  color: var(--muted);
  font-weight: 600;
}
input, textarea, select {
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(8,14,12,.75);
  color: var(--text);
  font: inherit;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(52,211,153,.15);
}
select option { background: #14201b; color: var(--text); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 12px; padding: 12px 18px;
  font: inherit; font-weight: 700; cursor: pointer;
}
.btn.primary { background: linear-gradient(135deg, var(--green), var(--green2)); color: #062015; }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn.danger { background: rgba(251,113,133,.15); color: var(--danger); border: 1px solid rgba(251,113,133,.3); }
.btn:disabled { opacity: .55; cursor: wait; }
.err { color: var(--danger); min-height: 1.2em; margin: 10px 0 0; font-size: .9rem; }
.hint { color: var(--muted); font-size: .82rem; margin: 14px 0 0; line-height: 1.45; }

.top {
  width: min(1100px, 94vw);
  margin: 0 auto;
  padding: 36px 0 18px;
  display: flex; justify-content: space-between; gap: 20px; align-items: flex-end;
  flex-wrap: wrap;
}
.top-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.dash-tabs {
  display: flex;
  gap: 8px;
  padding: 0 0 18px;
  margin: 0 auto;
  width: min(1100px, 94vw);
}
.dash-tab {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25);
  color: rgba(255,255,255,0.72);
  border-radius: 999px;
  padding: 8px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.svg.ico, .ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}
.dash-tab .ico { width: 15px; height: 15px; }
.overview-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(20,32,27,.88);
}
.stat-card.is-off .stat-icon {
  color: var(--danger);
  background: rgba(251,113,133,.12);
  border-color: rgba(251,113,133,.28);
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: rgba(52,211,153,.12);
  border: 1px solid rgba(52,211,153,.22);
  flex-shrink: 0;
}
.stat-icon svg { width: 24px; height: 24px; }
.stat-body { display: grid; gap: 2px; min-width: 0; }
.stat-body strong {
  font-family: var(--display);
  font-size: 1.55rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.stat-body span {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
}
.empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: rgba(52,211,153,.1);
  border: 1px solid var(--line);
}
.kpi { position: relative; }
.kpi-icon {
  color: var(--green);
  margin-bottom: 8px;
}
.kpi-icon .ico { width: 20px; height: 20px; }
.panel-foot {
  width: min(1100px, 94vw);
  margin: 8px auto 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .85;
}
.panel-foot .ico { width: 14px; height: 14px; color: var(--green); }
.security-foot {
  margin: 18px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: .75rem;
}
.security-foot strong { color: var(--green); font-weight: 700; }

.ns-menu {
  position: fixed;
  z-index: 9999;
  min-width: 180px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(14, 22, 18, .96);
  box-shadow: 0 18px 40px rgba(0,0,0,.55);
  backdrop-filter: blur(10px);
}
.ns-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: .9rem;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
}
.ns-item:hover {
  background: rgba(52,211,153,.12);
  color: var(--green);
}
.ns-brand {
  margin-top: 4px;
  padding: 8px 12px 6px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--green);
  opacity: .9;
}
.dash-tab.is-active {
  background: #fff;
  color: #111;
  border-color: #fff;
}
.tab-panel.hidden { display: none !important; }

main { width: min(1100px, 94vw); margin: 0 auto 48px; }
.empty {
  border: 1px dashed var(--line);
  border-radius: 20px;
  padding: 48px 24px;
  text-align: center;
  background: rgba(20,32,27,.5);
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.card {
  background: rgba(20,32,27,.88);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  display: grid;
  gap: 12px;
  animation: up .35s ease both;
}
@keyframes up { from { opacity: 0; transform: translateY(8px);} to { opacity:1; transform:none;} }
.card-top { display: flex; gap: 14px; align-items: center; }
.card-top img, .icon-ph {
  width: 64px; height: 64px; border-radius: 16px; object-fit: cover;
  background: #0a100e; border: 1px solid var(--line);
  flex-shrink: 0;
}
.card-top h3 { margin: 0; font-size: 1.05rem; }
.card-top p { margin: 4px 0 0; color: var(--muted); font-size: .82rem; }
.meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.meta span {
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-size: .85rem;
  color: var(--muted);
  font-weight: 500;
}
.check.hidden { display: none !important; }
.check input { width: auto; margin: 0; }
.overview {
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(20,32,27,.75);
  padding: 18px;
}
.overview-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.overview-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.kpi {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  background: rgba(8,14,12,.55);
}
.kpi strong { display: block; font-size: 1.6rem; font-family: var(--display); }
.kpi span { color: var(--muted); font-size: .82rem; }
.overview-users { display: grid; gap: 14px; }
.user-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: rgba(8,14,12,.4);
}
.user-card header {
  display: flex; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; margin-bottom: 10px;
}
.user-card h3 { margin: 0; font-size: 1rem; }
.user-card header span { color: var(--muted); font-size: .82rem; }
.user-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.user-card li {
  display: grid; gap: 8px;
  padding-top: 10px; border-top: 1px solid var(--line);
}
.user-card li:first-child { border-top: none; padding-top: 0; }
.user-card em { color: var(--muted); font-style: normal; margin-left: 8px; font-size: .8rem; }
.ov-link { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ov-link input {
  flex: 1; min-width: 180px; margin: 0;
  font-size: .75rem; color: var(--green);
}
.muted-li { color: var(--muted); border: none !important; padding: 0 !important; }

.link-box {
  display: flex; gap: 8px; align-items: center;
  background: rgba(8,14,12,.7);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
}
.link-box input {
  margin: 0; border: none; background: transparent; padding: 0;
  font-size: .78rem; color: var(--green);
}
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.modal {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0,0,0,.62);
  display: grid; place-items: center;
  padding: 20px;
}
.modal-card { width: min(560px, 100%); max-height: 92vh; overflow: auto; }
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.x {
  border: none; background: transparent; color: var(--muted);
  font-size: 1.2rem; cursor: pointer;
}
.modal-actions {
  display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px;
}

.field-block { margin-top: 16px; }
.field-label {
  display: block;
  font-size: .82rem;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}
.dropzone {
  position: relative;
  border: 1.5px dashed rgba(52,211,153,.35);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(52,211,153,.06), rgba(8,14,12,.55));
  padding: 18px 14px;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .15s;
  overflow: hidden;
}
.dropzone:hover,
.dropzone.is-drag {
  border-color: var(--green);
  background: linear-gradient(180deg, rgba(52,211,153,.14), rgba(8,14,12,.65));
}
.dropzone.is-drag {
  transform: scale(1.01);
  box-shadow: 0 0 0 3px rgba(52,211,153,.12);
}
.dropzone.has-file {
  border-style: solid;
  border-color: rgba(52,211,153,.45);
}
.dropzone-inner {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 6px;
  pointer-events: none;
}
.dropzone-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: rgba(52,211,153,.12);
  margin-bottom: 4px;
}
.dropzone-inner strong {
  font-size: .95rem;
  color: var(--text);
  font-weight: 700;
}
.dropzone-inner em {
  font-style: normal;
  color: var(--muted);
  font-size: .78rem;
}
.dropzone-file {
  margin-top: 6px;
  font-size: .78rem;
  color: var(--green);
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 8px;
}
.dropzone-preview {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}
.dropzone-preview img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #0a100e;
}
.dropzone-preview--grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
  justify-items: center;
}
.dropzone-preview--grid img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
}
.dropzone--apk .dropzone-icon {
  background: rgba(52,211,153,.16);
}

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #0f1c17; border: 1px solid var(--green);
  color: var(--text); padding: 12px 18px; border-radius: 999px;
  z-index: 50; box-shadow: var(--shadow);
}
@media (max-width: 640px) {
  h1 { font-size: 1.25rem; text-align: center; width: 100%; }
  .muted { text-align: center; width: 100%; }
  .top {
    padding-top: 20px;
    flex-direction: column;
    align-items: center;
    gap: 14px;
  }
  .top-brand {
    width: 100%;
    align-items: center;
    text-align: center;
  }
  .top-logo {
    margin: 0 auto 12px;
    height: auto;
    max-height: 108px;
    max-width: min(280px, 78vw);
    width: auto;
  }
  .plan-badge {
    align-self: center;
  }
  .top-actions {
    width: 100%;
    justify-content: center;
    gap: 8px;
  }
  .top-actions .btn {
    flex: 0 1 auto;
    padding: 7px 11px;
    font-size: .74rem;
    border-radius: 10px;
    white-space: nowrap;
  }
  .top-actions .btn.primary {
    flex: 1 1 auto;
    max-width: 168px;
  }
  .top-actions .btn.ghost {
    flex: 0 0 auto;
    min-width: 64px;
  }
  .login-logo {
    max-width: min(240px, 78%);
    max-height: 110px;
  }
  .login-card { padding: 24px 18px; }
  .btn-login { width: 100% !important; }
  .modal { padding: 12px; align-items: flex-end; }
  .modal-card { width: 100%; max-height: 90vh; border-radius: 18px 18px 12px 12px; }
  .dropzone { padding: 16px 12px; }
  .dropzone-inner strong { font-size: .88rem; }
  .ov-link { flex-direction: column; align-items: stretch; }
  .ov-link .btn, .ov-link a { width: 100%; }
  .empty .btn { padding: 10px 14px; font-size: .85rem; }
}
