/* Reset simples */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-gradient: radial-gradient(circle at top, #5b41ff 0%, #1b1630 40%, #05030b 100%);
  --card-bg: rgba(13, 10, 30, 0.96);
  --accent: #f45bff;
  --accent-2: #6d5dfc;
  --accent-soft: rgba(244, 91, 255, 0.18);
  --text-main: #f5f3ff;
  --text-muted: #a6a0d0;
  --danger: #ff4b6b;
  --success: #3bd88b;
  --warning: #ffb347;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --input-bg: rgba(11, 9, 25, 0.95);
  --shadow-soft: 0 24px 60px rgba(0, 0, 0, 0.75);
  --radius-xl: 28px;
  --radius-md: 16px;
  --radius-pill: 999px;
  --transition-fast: 0.18s ease-out;
  --transition-med: 0.24s ease-out;
}

html,
body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  color: var(--text-main);
  background: var(--bg-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Container padrão para todas as páginas */
.app-shell {
  width: 100%;
  max-width: 1140px;
  min-height: 620px;
  padding: 32px 32px 40px;
  border-radius: 36px;
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 55%),
    radial-gradient(circle at bottom, rgba(0, 0, 0, 0.9), rgba(2, 1, 10, 1));
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
}

/* topo / header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 18px;
  background: radial-gradient(circle at top, #ff8df9, #7a48ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.65);
}

.brand-text-main {
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 13px;
  color: #eae2ff;
}

.brand-text-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-link {
  font-size: 13px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  color: var(--text-muted);
  text-decoration: none;
  background: transparent;
  transition: background var(--transition-fast), color var(--transition-fast),
    border-color var(--transition-fast), transform var(--transition-fast);
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  transform: translateY(-1px);
}

.nav-link-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 32px rgba(63, 43, 150, 0.7);
}

.nav-link-primary:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 16px 40px rgba(63, 43, 150, 0.85);
}

/* layout principal dashboard */
.app-main {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(260px, 1fr);
  gap: 24px;
  flex: 1;
}

/* Cards genéricos */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  padding: 20px 22px;
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(244, 91, 255, 0.14), transparent 55%);
  opacity: 0.95;
  pointer-events: none;
}

.card-inner {
  position: relative;
  z-index: 1;
}

/* Títulos */
.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

/* tabela de grupos */
.table-wrapper {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table thead {
  background: rgba(10, 7, 28, 0.96);
}

.table th,
.table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.table th {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 12px;
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* badges */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
}

.badge-success {
  background: rgba(59, 216, 139, 0.14);
  color: var(--success);
}

.badge-off {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.badge-chip {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
}

/* botões */
.btn {
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  border: none;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast),
    box-shadow var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 11px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 8px 24px rgba(68, 51, 155, 0.9);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(68, 51, 155, 1);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

/* aside / info lateral */
.stat-pill {
  border-radius: var(--radius-md);
  padding: 10px 12px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: rgba(9, 6, 28, 0.96);
  margin-bottom: 10px;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
}

.stat-value {
  font-size: 13px;
  font-weight: 500;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chip {
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
}

/* LOGIN PAGE --------------------------------------- */

.login-shell {
  width: 100%;
  max-width: 480px;
  padding: 32px 26px 36px;
  border-radius: 40px;
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.1), transparent 55%),
    radial-gradient(circle at bottom, rgba(0, 0, 0, 0.95), rgba(3, 1, 15, 1));
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: var(--shadow-soft);
}

.login-logo {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  background: radial-gradient(circle at top, #ffb3ff, #7b4cff);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.75);
}

.login-title {
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 4px;
}

.login-subtitle {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 26px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.form-input {
  width: 100%;
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--input-bg);
  color: var(--text-main);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast),
    background var(--transition-fast), transform var(--transition-fast);
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(244, 91, 255, 0.4);
  background: rgba(9, 7, 24, 0.98);
  transform: translateY(-1px);
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-bottom: 10px;
  text-align: center;
}

/* Rodapé login */
.login-footer {
  margin-top: 18px;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
}

/* Form padrão em páginas internas */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-row-inline {
  display: flex;
  gap: 12px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

input[type="checkbox"] {
  accent-color: var(--accent-2);
}

/* responsivo */
@media (max-width: 900px) {
  .app-shell {
    padding: 22px 18px 24px;
    min-height: auto;
  }

  .app-main {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 540px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .app-nav {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}
/* ===========================
   PÁGINA NOVO GRUPO
   ========================== */

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
  gap: 32px;
  margin-top: 24px;
}

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

.form-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.8);
}

.form-field input,
.form-field textarea {
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(7, 8, 25, 0.8);
  color: #fff;
  padding: 10px 16px;
  font-size: 0.9rem;
  outline: none;
  transition: border 0.2s, box-shadow 0.2s, background 0.2s;
}

.form-field textarea {
  border-radius: 16px;
  resize: vertical;
  min-height: 120px;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: #ff7af5;
  box-shadow: 0 0 0 1px rgba(255, 122, 245, 0.45);
  background: rgba(11, 13, 40, 0.95);
}

.form-help {
  margin-top: 6px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
}

.form-switches {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
}

.switch input {
  display: none;
}

.switch-indicator {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  position: relative;
  transition: background 0.2s;
}

.switch-indicator::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #fff;
  transition: transform 0.2s;
}

.switch input:checked + .switch-indicator {
  background: linear-gradient(90deg, #ff7af5, #6b8bff);
}

.switch input:checked + .switch-indicator::after {
  transform: translateX(18px);
}

.switch-label {
  opacity: 0.9;
}

.form-footer {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease,
    opacity 0.12s ease;
}

.btn-primary {
  background: linear-gradient(90deg, #ff7af5, #6b8bff);
  color: #0b0d26;
  box-shadow: 0 16px 40px rgba(117, 54, 255, 0.65);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 55px rgba(117, 54, 255, 0.8);
}

.btn-ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
}
