
:root {
  --bg: #0f172a;
  --bg2: #111827;
  --card: #1e293b;
  --card2: #243244;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --line: rgba(148, 163, 184, .16);
  --primary: #8b5cf6;
  --primary2: #7c3aed;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #38bdf8;
  --shadow: 0 18px 45px rgba(0,0,0,.28);
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(139,92,246,.22), transparent 34%),
    radial-gradient(circle at bottom right, rgba(56,189,248,.14), transparent 28%),
    var(--bg);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }

.layout {
  min-height: 100vh;
  display: block;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 278px;
  padding: 24px;
  background: rgba(17,24,39,.92);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(16px);
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 26px;
}

.logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--info));
  color: #fff;
}

.nav-label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin: 20px 0 8px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  color: #cbd5e1;
  border-radius: 13px;
  margin-bottom: 6px;
}

.nav a:hover, .nav a.active {
  background: rgba(139,92,246,.16);
  color: #fff;
}

.main {
  margin-left: 278px;
  width: calc(100vw - 278px);
  min-width: 0;
  padding: 28px;
  overflow-x: hidden;
}

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

.topbar h1 { margin: 0; font-size: 29px; }
.topbar p { margin: 7px 0 0; color: var(--muted); }

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

.btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 15px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(139,92,246,.24);
}

.btn:hover { background: var(--primary2); }
.btn.secondary { background: var(--card2); box-shadow: none; }
.btn.danger { background: var(--danger); }
.btn.success { background: var(--success); }
.btn.link { background: transparent; padding: 0; color: #c4b5fd; box-shadow: none; }

.grid { display: grid; gap: 18px; }
.grid.cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.two { grid-template-columns: 1.05fr .95fr; }

.card {
  background: rgba(30,41,59,.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card h2, .card h3 { margin: 0 0 14px; }

.metric .label { color: var(--muted); font-size: 13px; }
.metric .value { font-size: 30px; font-weight: 850; margin-top: 7px; }
.metric .hint { color: var(--muted); font-size: 13px; margin-top: 4px; }

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(30,41,59,.68);
}

th, td {
  text-align: left;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  vertical-align: middle;
}

th {
  color: #cbd5e1;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

td { color: #e5e7eb; }

.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  background: rgba(148,163,184,.15);
  color: #cbd5e1;
}

.badge.ativo, .badge.ativa, .badge.aprovado, .badge.conectado, .badge.success {
  background: rgba(34,197,94,.14);
  color: #86efac;
}

.badge.teste, .badge.trial, .badge.pendente, .badge.aguardando_qrcode, .badge.warning {
  background: rgba(245,158,11,.14);
  color: #fcd34d;
}

.badge.inativo, .badge.bloqueado, .badge.cancelado, .badge.erro, .badge.removido, .badge.danger {
  background: rgba(239,68,68,.14);
  color: #fca5a5;
}

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

.field { display: grid; gap: 7px; }
.field label { color: #cbd5e1; font-size: 13px; font-weight: 750; }

.input, input, select, textarea {
  width: 100%;
  background: rgba(15,23,42,.75);
  color: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  outline: none;
}

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

.notice {
  display: none;
  border-radius: 14px;
  padding: 13px 14px;
  margin-bottom: 16px;
  background: rgba(56,189,248,.13);
  color: #bae6fd;
}

.notice.show { display: block; }
.notice.error { background: rgba(239,68,68,.14); color: #fecaca; }
.notice.success { background: rgba(34,197,94,.14); color: #bbf7d0; }

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

.auth-shell {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: 1fr 430px;
  gap: 24px;
}

.hero {
  min-height: 520px;
  border-radius: 28px;
  padding: 40px;
  box-shadow: var(--shadow);
  background: linear-gradient(135deg, rgba(139,92,246,.95), rgba(56,189,248,.72));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero h1 { font-size: 42px; margin: 0 0 14px; }
.hero p { font-size: 18px; color: rgba(255,255,255,.88); }

.auth-card {
  border-radius: 28px;
  padding: 30px;
  background: rgba(30,41,59,.92);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.auth-card h2 { margin: 0 0 7px; }
.muted { color: var(--muted); }

.qr-box {
  min-height: 230px;
  border-radius: var(--radius);
  padding: 18px;
  display: grid;
  place-items: center;
  background: #fff;
  color: #0f172a;
  overflow: hidden;
}

.qr-box img { max-width: 100%; max-height: 310px; }

.code {
  background: rgba(15,23,42,.78);
  border: 1px solid var(--line);
  color: #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  font-family: Consolas, monospace;
  font-size: 13px;
  white-space: pre-wrap;
  overflow: auto;
  max-height: 340px;
}

.hidden { display: none !important; }

.footer-note {
  color: var(--muted);
  font-size: 12px;
  margin-top: 20px;
}

.mobile-menu { display: none; }

@media (max-width: 1040px) {
  .grid.cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.two, .auth-shell { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
}

@media (max-width: 760px) {
  .sidebar { transform: translateX(-100%); transition: .2s; }
  .sidebar.open { transform: translateX(0); }
  .main {
	  margin-left: 0;
	  width: 100vw;
	  padding: 20px;
	  overflow-x: hidden;
	}
  .mobile-menu { display: inline-flex; margin-bottom: 14px; }
  .topbar { display: grid; }
  .grid.cards, .form.two { grid-template-columns: 1fr; }
  .usuarios-layout {
	  grid-template-columns: 1fr;
	}

	.usuarios-layout > .card:first-child {
	  width: 100%;
	}
}

.usuarios-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.usuarios-layout > .card {
  min-width: 0;
  max-width: 100%;
}

.usuarios-layout > .card:first-child {
  width: 360px;
}

.usuarios-layout > .card:last-child {
  overflow: hidden;
}

.usuarios-layout .table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.usuarios-layout table {
  width: max-content;
  min-width: 1120px;
}

.usuarios-layout th:first-child,
.usuarios-layout td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: rgba(30,41,59,.98);
}

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

  .usuarios-layout .card:first-child {
    min-width: 100%;
  }
}

.admin-crud-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.admin-crud-layout > .card {
  min-width: 0;
  max-width: 100%;
}

.admin-crud-layout > .card:first-child {
  width: 360px;
}

.admin-crud-layout > .card:last-child {
  overflow: hidden;
}

.admin-crud-layout .table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.admin-crud-layout table {
  width: max-content;
  min-width: 1050px;
}

.admin-crud-layout th:first-child,
.admin-crud-layout td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: rgba(30,41,59,.98);
}

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

  .admin-crud-layout > .card:first-child {
    width: 100%;
  }
}

/* ==========================================
   Modais CRUD - padrão SaaS
   ========================================== */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 999;
}

.modal-content {
  width: min(820px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: rgba(30, 41, 59, .98);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.modal-content.modal-lg {
  width: min(980px, 100%);
}

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

.modal-header h2 {
  margin: 0;
}

.modal .form.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.modal .field.full,
.modal .actions.full,
.modal label.full {
  grid-column: 1 / -1;
}

.list-card {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.list-card .table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.list-card table {
  width: max-content;
  min-width: 1050px;
}

.list-card th:first-child,
.list-card td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: rgba(30, 41, 59, .98);
}

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

@media (max-width: 760px) {
  .modal {
    padding: 14px;
    align-items: start;
  }

  .modal-content {
    width: 100%;
    max-height: 94vh;
    padding: 18px;
  }

  .modal .form.two {
    grid-template-columns: 1fr;
  }
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 278px;
  height: 100vh;
  padding: 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.sidebar-footer {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.user-box {
  color: #e5e7eb;
  line-height: 1.25;
}

.user-box small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.logout-link {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  width: 100%;
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.logout-link:hover {
  background: rgba(255,255,255,.15);
}

/* ==========================================
   Monitoramento de servidores
   ========================================== */

.card-header-inline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.card-header-inline h2 {
  margin: 0 0 6px;
}

.card-header-inline p {
  margin: 0;
}

.monitor-table {
  min-width: 1180px;
}

.meter {
  min-width: 120px;
}

.meter-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.meter-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(148,163,184,.16);
  overflow: hidden;
}

.meter-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--info));
}

@media (max-width: 760px) {
  .card-header-inline {
    display: grid;
  }
}

/* ==========================================
   Toggle Switch
   ========================================== */

.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    font-weight: 600;
    color: #fff;
}

.switch {
    position: relative;
    display: inline-block;
    width: 54px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: rgba(255,255,255,.15);
    transition: .25s;
    border-radius: 999px;
}

.slider:before {
    position: absolute;
    content: "";
    width: 22px;
    height: 22px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: .25s;
}

.switch input:checked + .slider {
    background: linear-gradient(
        135deg,
        #8b5cf6,
        #6d28d9
    );
}

.switch input:checked + .slider:before {
    transform: translateX(26px);
}

.switch input:focus + .slider {
    box-shadow: 0 0 0 3px rgba(139,92,246,.25);
}
/* ==========================================
   FINAL - Toggle Switch
   ========================================== */
   
.toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dialog-content {
  width: min(460px, 100%);
}


/* ==========================================
   API Keys
   ========================================== */

.api-key-box {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 14px;
  background: rgba(2, 6, 23, .45);
  border: 1px solid rgba(148, 163, 184, .16);
  overflow: hidden;
}

.api-key-box code {
  flex: 1;
  color: #dbeafe;
  font-family: Consolas, "Courier New", monospace;
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .api-key-box {
    display: grid;
  }
}

/* ==========================================
   Confirmação e-mail
   ========================================== */

.confirmacao-card {
  text-align: center;
  padding: 30px;
  margin-top: 20px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
}

.confirmacao-icone {
  width: 90px;
  height: 90px;
  margin: 0 auto 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  background: #f4f6f8;
}

.confirmacao-status {
  font-size: 22px;
  font-weight: 700;
  color: #222;
  margin-bottom: 10px;
}

.confirmacao-descricao {
  font-size: 20px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 20px;
}

.confirmacao-sucesso .confirmacao-icone {
  background: #e8fff0;
  color: #0a9b4b;
}

.confirmacao-erro .confirmacao-icone {
  background: #fff0f0;
  color: #d93025;
}



