* {
  box-sizing: border-box;
}

:root {
  --bg: #0f172a;
  --bg-soft: #111827;
  --card: #ffffff;
  --card-soft: #f8fafc;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #f59e0b;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.24), transparent 35%),
    linear-gradient(135deg, #0f172a 0%, #111827 45%, #1e293b 100%);
  color: var(--text);
  min-height: 100vh;
}

.app {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  width: 280px;
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  padding: 28px 22px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
}

.logo-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #22c55e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
}

.logo-title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
}

.logo-subtitle {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
}

.menu {
  display: grid;
  gap: 8px;
}

.menu-item {
  padding: 13px 14px;
  border-radius: 12px;
  color: #cbd5e1;
  font-size: 14px;
  cursor: default;
}

.menu-item.active {
  background: rgba(37, 99, 235, 0.18);
  color: #ffffff;
  border: 1px solid rgba(96, 165, 250, 0.25);
}

.menu-label {
  margin-top: 30px;
  margin-bottom: 10px;
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.sidebar-footer {
  margin-top: 40px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.5;
}

.main {
  flex: 1;
  padding: 32px;
  overflow: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 26px;
  color: #ffffff;
}

.topbar h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.03em;
}

.topbar p {
  margin: 6px 0 0;
  color: #cbd5e1;
  font-size: 14px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(22, 163, 74, 0.15);
  color: #dcfce7;
  border: 1px solid rgba(34, 197, 94, 0.35);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.status-dot {
  width: 9px;
  height: 9px;
  background: #22c55e;
  border-radius: 999px;
}

.grid {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.card {
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.45);
  overflow: hidden;
}

.card-header {
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.card-header h2 {
  margin: 0;
  font-size: 18px;
}

.card-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.card-body {
  padding: 22px 24px;
}

.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #334155;
  margin-bottom: 7px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 13px;
  font-size: 14px;
  outline: none;
  background: #ffffff;
  transition: 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

textarea {
  resize: vertical;
  min-height: 260px;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.45;
}

#resultado {
  min-height: 500px;
  background: #0b1120;
  color: #dbeafe;
  border-color: #1e293b;
  font-size: 13px;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

button {
  border: none;
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.15s ease;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  flex: 1;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: #e2e8f0;
  color: #0f172a;
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.alert {
  margin-top: 16px;
  padding: 13px 14px;
  border-radius: 12px;
  font-size: 13px;
  display: none;
}

.alert.show {
  display: block;
}

.alert.info {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.alert.success {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.alert.error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric {
  background: var(--card-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}

.result-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 1100px) {
  .app {
    display: block;
  }

  .sidebar {
    width: 100%;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .main {
    padding: 18px;
  }

  .topbar {
    display: block;
  }

  .status-pill {
    margin-top: 14px;
  }

  .metrics {
    grid-template-columns: 1fr;
  }
}
.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.32), transparent 35%),
    linear-gradient(135deg, #0f172a 0%, #111827 50%, #1e293b 100%);
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.login-logo h1 {
  margin: 0;
  font-size: 26px;
}

.login-logo p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 14px;
}

.full {
  width: 100%;
}

.menu-item {
  border: none;
  text-align: left;
  width: 100%;
  background: transparent;
}

.menu-item.static {
  cursor: default;
}

.btn-sair {
  width: 100%;
  background: rgba(220, 38, 38, 0.16);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.25);
}

.section {
  display: none;
}

.active-section {
  display: block;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  text-align: left;
}

th {
  background: #f8fafc;
  color: #334155;
  font-weight: 800;
}

.status-ativo {
  color: #15803d;
  font-weight: 800;
}

.status-bloqueado {
  color: #b91c1c;
  font-weight: 800;
}

.btn-small {
  padding: 8px 10px;
  font-size: 12px;
  border-radius: 9px;
}

.btn-block {
  background: #fee2e2;
  color: #b91c1c;
}

.btn-unblock {
  background: #dcfce7;
  color: #15803d;
}

.muted {
  color: #64748b;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .admin-form {
    grid-template-columns: 1fr;
  }
}