:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --accent: #00c8e8;
  --accent-contrast: #001018;
  --danger: #dc2626;
  --success: #16a34a;
  --card-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --glow: rgba(0, 200, 232, 0.22);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --running-surface: linear-gradient(145deg, #dbeafe 0%, #7dd3fc 48%, #38bdf8 100%);
  --running-text: #0c4a6e;
  --running-muted: #075985;
  --running-border: #0284c7;
  --running-glow: rgba(14, 165, 233, 0.38);
  --running-shadow: rgba(8, 47, 73, 0.22);
}

[data-theme="dark"] {
  --bg: #070d18;
  --surface: #0f1729;
  --text: #e8edf7;
  --muted: #8b9cb8;
  --border: #1a2740;
  --accent: #22d3ee;
  --accent-contrast: #031014;
  --danger: #f87171;
  --success: #4ade80;
  --card-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  --glow: rgba(34, 211, 238, 0.18);
  --running-surface: linear-gradient(145deg, #042f49 0%, #0c4a6e 42%, #155e75 100%);
  --running-text: #e0f2fe;
  --running-muted: #7dd3fc;
  --running-border: #22d3ee;
  --running-glow: rgba(34, 211, 238, 0.42);
  --running-shadow: rgba(8, 47, 73, 0.55);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  transition: background-color 0.35s var(--ease-out), color 0.35s var(--ease-out);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

header.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.75rem 1.25rem;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  animation: gp-header-in 0.55s var(--ease-out) both;
}

.site-header--auth {
  background: transparent;
  border-bottom: none;
  position: absolute;
  width: 100%;
  backdrop-filter: none;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
  text-decoration: none;
}

.brand-link:hover .brand-text {
  text-decoration: underline;
}

.brand-logo {
  border-radius: 8px;
  object-fit: contain;
}

.nav-primary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

nav a {
  margin-right: 0.75rem;
  font-weight: 500;
  color: var(--text);
  position: relative;
  transition: color 0.2s ease;
}

nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.15rem;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease-out);
}

nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

nav a:hover::after {
  transform: scaleX(1);
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.help-toc .card {
  margin: 0;
}

@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-primary {
    width: 100%;
  }
}

.admin-nav {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
}

.admin-nav a {
  margin-right: 0.2rem;
}

.help-collapsible summary {
  cursor: pointer;
  font-size: 1.05rem;
}

.help-markdown {
  white-space: pre-wrap;
  font-size: 0.88rem;
  line-height: 1.45;
  margin: 0.75rem 0 0;
  padding: 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 28rem;
  overflow: auto;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  box-shadow: var(--card-shadow);
  margin-bottom: 1rem;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), border-color 0.25s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px color-mix(in srgb, var(--glow) 40%, transparent);
}

.card h2 {
  margin-top: 0;
}

.grid {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 720px) {
  .grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Painel do dashboard: empilha cartões quando o contentor (não só o viewport) é estreito */
.dashboard-cq {
  container-type: inline-size;
  container-name: dashboard-grid;
}

@container dashboard-grid (max-width: 560px) {
  .dashboard-cq .grid.cols-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  padding: 0.45rem 0.35rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pill {
  display: inline-block;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(34, 211, 238, 0.15);
  color: var(--accent);
}

.pill.bad {
  background: rgba(220, 38, 38, 0.15);
  color: var(--danger);
}

.pill.ok {
  background: rgba(22, 163, 74, 0.15);
  color: var(--success);
}

.pill.warn {
  background: rgba(234, 179, 8, 0.18);
  color: #ca8a04;
}

[data-theme="dark"] .pill.warn {
  color: #facc15;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: none;
  border-radius: 10px;
  padding: 0.55rem 0.9rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #0ea5e9));
  color: var(--accent-contrast);
  text-decoration: none;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent);
}

.btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  text-decoration: none;
}

.btn--press,
.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn.secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  filter: none;
}

.btn-lg {
  padding: 0.75rem 1.35rem;
  font-size: 1rem;
  border-radius: 12px;
}

.login-wrap {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: min(400px, 100%);
}

label {
  display: block;
  font-size: 0.85rem;
  margin: 0.35rem 0 0.2rem;
  color: var(--muted);
}

input,
select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

select {
  cursor: pointer;
}

.stack > * + * {
  margin-top: 0.65rem;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.small {
  font-size: 0.82rem;
}

.mono {
  font-family: ui-monospace, monospace;
  font-size: 0.85em;
}

.code-tag {
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  background: var(--bg);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.btn-block {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 0.75rem;
  text-decoration: none;
}

/* —— Dashboard profissional —— */
.dashboard-hero {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.08) 0%, transparent 55%);
  border: 1px solid var(--border);
}

.dashboard-hero-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.dashboard-hero-actions {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  min-width: 11rem;
}

.dashboard-sync-btn.is-loading {
  opacity: 0.75;
  cursor: wait;
}

.hero-sub-small {
  margin-top: 0.25rem;
  font-size: 0.82rem;
}

.sync-hint,
.sync-status {
  margin: 0;
  max-width: 14rem;
}

.sync-status {
  color: var(--accent);
  font-weight: 600;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 0.35rem;
}

.dashboard-title {
  margin: 0 0 0.5rem;
  font-size: 1.65rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.hero-sub {
  margin: 0 0 0.75rem;
  max-width: 42rem;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.kpi-grid {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  box-shadow: var(--card-shadow);
}

.kpi-tip {
  grid-column: 1 / -1;
}

@media (min-width: 768px) {
  .kpi-tip {
    grid-column: span 2;
  }
}

.kpi-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.kpi-value {
  display: block;
  font-size: 1.55rem;
  font-weight: 800;
  margin: 0.25rem 0;
  letter-spacing: -0.03em;
}

.kpi-hint {
  font-size: 0.8rem;
  color: var(--muted);
}

.kpi-tip-text {
  margin: 0.5rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

.charts-grid {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
  container-type: inline-size;
  container-name: charts-area;
}

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

  .chart-card-wide {
    grid-column: 1 / -1;
  }
}

@container charts-area (max-width: 640px) {
  .chart-canvas-wrap {
    min-height: 220px;
  }
}

.chart-card {
  margin-bottom: 0;
}

.chart-title {
  margin: 0;
  font-size: 1.05rem;
}

.chart-sub {
  margin: 0.35rem 0 0.75rem;
}

.chart-canvas-wrap {
  position: relative;
  min-height: 200px;
}

.chart-tall {
  min-height: 260px;
}

.chart-small {
  max-width: 420px;
  min-height: 140px;
}

.project-cards-grid {
  margin-bottom: 0;
}

.project-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.project-card-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.project-name {
  margin: 0;
  font-size: 1.08rem;
}

.vendor-badge {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.vendor-badge.gitlab {
  background: rgba(252, 109, 38, 0.18);
  color: #c63d15;
}

.vendor-badge.github {
  background: rgba(110, 118, 129, 0.2);
  color: var(--text);
}

.pipeline-line {
  margin: 0.65rem 0 0.25rem;
}

.commit-line {
  margin: 0 0 0.25rem;
}

.empty-state {
  grid-column: 1 / -1;
}

/* —— Dashboard: foco em execução e 48h —— */
.focus-section {
  margin-bottom: 1.25rem;
}

.focus-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.focus-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.focus-sub {
  margin: 0.25rem 0 0;
  font-size: 0.88rem;
}

.focus-count {
  flex-shrink: 0;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
}

.focus-count.running {
  color: var(--accent);
  background: rgba(34, 211, 238, 0.15);
}

.focus-count.recent {
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.15);
}

.activity-grid {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .activity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.activity-card {
  margin-bottom: 0;
}

.activity-card--running,
.project-card--running {
  background: var(--running-surface);
  border: 2px solid var(--running-border);
  color: var(--running-text);
  box-shadow: 0 0 0 3px var(--running-glow), 0 14px 36px var(--running-shadow);
}

.activity-card--running:hover,
.project-card--running:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 0 4px var(--running-glow), 0 18px 44px var(--running-shadow);
}

.activity-card--running .muted,
.project-card--running .muted {
  color: var(--running-muted);
}

.activity-card--running .activity-time {
  color: var(--running-border);
  font-weight: 700;
}

.activity-card--running .activity-card-title,
.project-card--running .project-name {
  color: var(--running-text);
}

.activity-card--running .commit-detail,
.activity-card--running .failure-detail {
  border-top-color: color-mix(in srgb, var(--running-border) 35%, transparent);
}

.activity-card--running .commit-label,
.activity-card--running .commit-author-line strong {
  color: var(--running-muted);
}

.activity-card--running .btn.secondary,
.project-card--running .btn.secondary {
  background: color-mix(in srgb, var(--running-text) 8%, #ffffff 92%);
  border-color: var(--running-border);
  color: var(--running-text);
}

[data-theme="dark"] .activity-card--running .btn.secondary,
[data-theme="dark"] .project-card--running .btn.secondary {
  background: color-mix(in srgb, var(--running-border) 18%, #0f1729 82%);
}

.activity-card--running .pill.running,
.project-card--running .pill.running {
  background: color-mix(in srgb, var(--running-border) 28%, transparent);
  color: var(--running-text);
  font-weight: 700;
}

[data-theme="dark"] .activity-card--running .pill.running,
[data-theme="dark"] .project-card--running .pill.running {
  color: var(--running-text);
}

.activity-card--recent {
  border-color: rgba(167, 139, 250, 0.35);
}

.activity-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.activity-card-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.activity-card-title {
  margin: 0;
  font-size: 1.08rem;
}

.activity-meta {
  margin: 0.35rem 0 0;
}

.activity-time {
  color: var(--accent);
  font-weight: 600;
}

.pipeline-running-dot {
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.5);
  animation: pulse-dot 1.8s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.45);
  }

  50% {
    transform: scale(1.15);
    box-shadow: 0 0 0 6px rgba(34, 211, 238, 0);
  }
}

.pill.running {
  background: rgba(34, 211, 238, 0.18);
  color: var(--accent);
  animation: pulse-pill 2.4s ease-in-out infinite;
}

.pill.recent {
  background: rgba(167, 139, 250, 0.18);
  color: #7c3aed;
}

.pill.small-pill {
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
}

@keyframes pulse-pill {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.72;
  }
}

.commit-detail {
  margin: 0.55rem 0 0.35rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
}

.commit-label {
  display: inline-block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
  margin-right: 0.35rem;
}

.commit-sha {
  font-size: 0.82rem;
}

.commit-author-line {
  margin: 0.25rem 0 0;
}

.commit-message {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.activity-link {
  margin-top: 0.65rem;
}

.project-card--recent {
  border-color: rgba(167, 139, 250, 0.3);
}

.commit-preview,
.commit-message-preview {
  margin: 0.2rem 0;
}

.failure-detail {
  margin: 0.55rem 0 0;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
}

.failure-label {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--danger);
  font-weight: 700;
}

.failure-summary {
  margin: 0;
  padding: 0.55rem 0.65rem;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: 8px;
  font-size: 0.78rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 12rem;
  overflow: auto;
}

.failure-summary--compact {
  margin-top: 0.35rem;
  max-height: 5rem;
  font-size: 0.72rem;
}

.failure-summary--table {
  max-height: 8rem;
  font-size: 0.7rem;
}

.activity-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.activity-actions .activity-link {
  margin-top: 0;
  flex: 1;
  min-width: 8rem;
}

.small-link {
  margin-left: 0.35rem;
  font-size: 0.78rem;
}

.history-table-card {
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
}

.history-table th,
.history-table td {
  padding: 0.45rem 0.55rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.section-label {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 650;
}

.meta-dl {
  margin: 0;
  display: grid;
  gap: 0.5rem 1rem;
  grid-template-columns: minmax(5rem, auto) 1fr;
}

.meta-dl dt {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.meta-dl dd {
  margin: 0;
}

.log-body,
.log-json {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  padding: 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.88rem;
  max-height: 28rem;
  overflow: auto;
}

.log-json {
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
}

.logs-filter-grid {
  align-items: end;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .logs-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .logs-filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.logs-filter-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.log-snippet {
  white-space: pre-wrap;
  max-width: min(36rem, 100%);
  font-size: 0.86rem;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.5rem;
  margin-bottom: 0.75rem;
}

.tab-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}

.tab-btn.is-active {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: transparent;
}

.tab-panel[hidden] {
  display: none !important;
}

/* —— Tema: toggle sol / lua —— */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.25s var(--ease-out), border-color 0.2s ease, background 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: rotate(-8deg) scale(1.05);
}

.theme-toggle--pulse {
  animation: gp-theme-pulse 0.42s var(--ease-out);
}

.theme-icon {
  display: block;
}

.theme-icon[hidden] {
  display: none;
}

/* —— Animações globais —— */
@keyframes gp-fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gp-header-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gp-theme-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

@keyframes gp-orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(12px, -18px) scale(1.05); }
}

@keyframes gp-grid-drift {
  from { background-position: 0 0; }
  to { background-position: 48px 48px; }
}

@keyframes gp-shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

[data-animate] {
  opacity: 0;
}

body.is-loaded [data-animate] {
  animation: gp-fade-up 0.65s var(--ease-out) both;
  animation-delay: var(--stagger, 0s);
}

body.is-loaded .page-inner > .gp-stagger {
  animation: gp-fade-up 0.55s var(--ease-out) both;
  animation-delay: var(--stagger, 0s);
}

body.motion-reduced *,
body.motion-reduced *::before,
body.motion-reduced *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

.page-auth .page-main {
  max-width: none;
  margin: 0;
  padding: 0;
}

.page-auth .page-inner {
  max-width: none;
}

/* —— Login profissional —— */
.auth-scene {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem 1.25rem 2rem;
  overflow: hidden;
}

.auth-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  animation: gp-orb-float 14s ease-in-out infinite;
}

.auth-orb--1 {
  width: 420px;
  height: 420px;
  top: -8%;
  left: -6%;
  background: radial-gradient(circle, var(--accent), transparent 70%);
}

.auth-orb--2 {
  width: 360px;
  height: 360px;
  bottom: -10%;
  right: -4%;
  background: radial-gradient(circle, #6366f1, transparent 70%);
  animation-delay: -4s;
  animation-duration: 18s;
}

.auth-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, var(--border) 55%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--border) 55%, transparent) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
  animation: gp-grid-drift 24s linear infinite;
  opacity: 0.35;
}

.auth-layout {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2rem;
  width: min(1040px, 100%);
}

@media (max-width: 899px) {
  .auth-layout {
    text-align: center;
  }

  .auth-tagline {
    margin-left: auto;
    margin-right: auto;
  }

  .auth-features {
    justify-items: center;
    max-width: 20rem;
    margin: 0 auto;
  }

  .auth-form-panel {
    width: min(420px, 100%);
    margin: 0 auto;
  }
}

@media (min-width: 900px) {
  .auth-layout {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: 3rem;
  }
}

.auth-showcase-inner {
  padding: 0.5rem 0;
}

.auth-logo-wrap {
  position: relative;
  width: 4.5rem;
  height: 4.5rem;
  margin-bottom: 1.25rem;
}

.auth-logo {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 16px;
  object-fit: contain;
  box-shadow: 0 12px 32px var(--glow);
}

.auth-logo-fallback {
  display: none;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 16px;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.35rem;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  color: var(--accent-contrast);
}

.auth-logo[style*="display: none"] + .auth-logo-fallback,
.auth-logo:not([src]) + .auth-logo-fallback {
  display: flex;
}

.auth-headline {
  margin: 0 0 0.75rem;
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.auth-tagline {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 28rem;
  line-height: 1.55;
}

.auth-features {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.auth-features li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-features li::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  flex-shrink: 0;
}

.brand-link--text-only .brand-text {
  font-size: 1.15rem;
}

.login-card-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1.1rem;
}

.login-card-logo {
  width: 4rem;
  height: 4rem;
  border-radius: 14px;
  object-fit: contain;
  box-shadow: 0 10px 28px var(--glow);
}

.login-card-logo-fallback {
  display: none;
  width: 4rem;
  height: 4rem;
  border-radius: 14px;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  color: var(--accent-contrast);
}

.auth-card {
  margin-bottom: 0;
  border-radius: 18px;
  padding: 1.75rem 1.85rem;
  backdrop-filter: blur(8px);
  text-align: center;
}

.auth-card .login-form,
.auth-card .field-group {
  text-align: left;
}

.auth-card:hover {
  transform: translateY(-4px);
}

.login-title {
  margin: 0.35rem 0 0.5rem;
  font-size: 1.55rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.login-sub {
  margin: 0 0 1.25rem;
}

.login-form .field-group + .field-group {
  margin-top: 0.85rem;
}

.login-submit {
  margin-top: 0.35rem;
}

.login-footer {
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: 0.86rem;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.field-label-row label {
  margin: 0;
}

.link-btn {
  border: none;
  background: none;
  padding: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.link-btn:hover {
  text-decoration: underline;
  opacity: 0.9;
}

.login-back-wrap {
  margin: 0.85rem 0 0;
  text-align: center;
}

.login-flash {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.45;
  text-align: left;
  animation: gp-fade-up 0.45s var(--ease-out) both;
}

.login-flash--ok {
  background: color-mix(in srgb, var(--success) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--success) 35%, transparent);
  color: var(--success);
}

.login-flash--warn {
  background: color-mix(in srgb, #eab308 14%, transparent);
  border: 1px solid color-mix(in srgb, #eab308 35%, transparent);
  color: #ca8a04;
}

[data-theme="dark"] .login-flash--warn {
  color: #facc15;
}

#forgot-panel[hidden],
#login-panel[hidden] {
  display: none !important;
}

/* —— Suporte / Resolve Tickets —— */
.support-hero {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%);
}

.support-title {
  margin: 0.25rem 0 0.65rem;
  font-size: 1.55rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.support-lead {
  margin: 0;
  max-width: 40rem;
}

.support-actions {
  padding: 1.5rem 1.65rem;
}

.support-cta-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
}

.support-cta {
  min-width: min(100%, 22rem);
}

.support-cta svg {
  flex-shrink: 0;
}

.support-link-hint {
  margin: 0;
  word-break: break-all;
}

.support-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.25rem 0;
}

.config-form .config-section + .config-section {
  margin-top: 1rem;
}

.config-fields {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
}

.config-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.config-hint {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
}

.config-input {
  width: 100%;
}

.config-check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
}

.config-readonly {
  display: grid;
  gap: 0.65rem 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  margin: 0;
}

.config-readonly > div {
  display: grid;
  gap: 0.15rem;
}

.config-readonly dt {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.config-readonly dd {
  margin: 0;
  font-family: ui-monospace, monospace;
  font-size: 0.88rem;
}

/* Modal (admin webhooks, etc.) */
.modal[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
  border: none;
  cursor: pointer;
}

[data-theme="dark"] .modal-backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(44rem, 100%);
  max-height: min(85vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius, 0.65rem);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.1rem 0.65rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
}

.modal-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.modal-close {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: 0.35rem;
}

.modal-close:hover,
.modal-close:focus-visible {
  color: var(--text);
  background: rgba(148, 163, 184, 0.15);
}

.modal-body {
  padding: 0.85rem 1.1rem;
  overflow: auto;
  flex: 1 1 auto;
}

.modal-json {
  margin: 0;
  padding: 0.85rem;
  border-radius: 0.45rem;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 0.75rem 1.1rem 1rem;
  border-top: 1px solid var(--border);
}

.btn.compact {
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
