/* Observability Hub — identidade visual alinhada ao legado (hub-layout.css) */

:root {
  --bg: #070b14;
  --surface: #0d1526;
  --surface2: #111d35;
  --border: #1e2f52;
  --accent: #00d4ff;
  --accent2: #7c3aed;
  --accent3: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --text: #e2e8f0;
  --muted: #64748b;
  --mono: Arial, Helvetica, sans-serif;
  --sans: Arial, Helvetica, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,212,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: .45;
}

.orb-1 { width: 600px; height: 600px; background: #00d4ff22; top: -200px; left: -150px; }
.orb-2 { width: 500px; height: 500px; background: #7c3aed1a; bottom: -100px; right: -100px; }
.orb-3 { width: 300px; height: 300px; background: #10b98118; top: 40%; left: 55%; }

.shell {
  position: relative;
  z-index: 1;
  max-width: 2200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 clamp(20px, 3vw, 48px) 80px;
}

/* ── Header / brand ── */

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
  flex-wrap: wrap;
}

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

.brand-logo-rike {
  width: 110px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.brand-text h1,
h1 {
  margin: 0;
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.05;
  text-align: left;
}

.brand-text p {
  margin: 2px 0 0;
  color: var(--accent);
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.header-side {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-meta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: .72rem;
  line-height: 1.7;
  text-align: right;
}

.header-meta span { color: var(--accent); }

.header-actions,
.hub-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-user {
  color: var(--muted);
  font-family: var(--mono);
  font-size: .72rem;
}

main.hub-main { padding-top: 8px; }

/* ── Login ── */

.login-page {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 18px 60px rgba(0,0,0,.35);
}

.login-card .brand {
  margin-bottom: 24px;
}

.login-card h2 {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
}

.login-card input {
  margin-bottom: 10px;
}

.login-lead {
  margin: 0 0 20px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .75rem;
  line-height: 1.5;
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 14px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .72rem;
  cursor: pointer;
}

.login-remember input {
  width: auto;
  margin: 0;
}

.inline-links {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: .72rem;
}

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

.inline-links a:hover { text-decoration: underline; }

/* ── Cards ── */

.card {
  min-width: 0;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  color: var(--text);
  font-family: var(--sans);
  font-size: .86rem;
  line-height: 1.55;
}

.card + .card { margin-top: 20px; }

.card-title,
.card h2 {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: .98rem;
  font-weight: 800;
}

.card-lead {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .75rem;
  line-height: 1.5;
}

.page-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.page-toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.muted {
  color: var(--muted);
  font-family: var(--mono);
  font-size: .75rem;
}

/* ── Links (evita roxo/azul padrão do navegador) ── */

.shell a:not(.btn):not(.shortcut-card) {
  color: var(--accent);
  text-decoration: none;
}

.shell a:not(.btn):not(.shortcut-card):hover {
  color: #7dd3fc;
  text-decoration: underline;
}

.alert a,
.card a:not(.btn) {
  color: var(--accent);
  font-weight: 600;
}

.alert a:hover,
.card a:not(.btn):hover {
  color: #7dd3fc;
}

/* ── Buttons ── */

.btn,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 14px;
  background: var(--surface2);
  color: var(--text);
  font-family: var(--mono);
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s;
}

.btn:hover,
button:hover {
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 0 18px rgba(0,212,255,.18);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #22d3ee 0%, #0891b2 100%);
  border-color: rgba(34, 211, 238, 0.55);
  color: #f8fafc;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(15, 23, 42, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #67e8f9 0%, #06b6d4 100%);
  border-color: #a5f3fc;
  color: #ffffff;
  box-shadow: 0 0 24px rgba(0,212,255,.35);
  text-decoration: none;
}

.btn-primary:disabled,
.btn-primary[disabled] {
  background: #164e63;
  border-color: #155e75;
  color: #cbd5e1;
  opacity: 1;
  cursor: not-allowed;
  box-shadow: none;
  text-shadow: none;
}

.btn-nav.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 212, 255, 0.08);
  box-shadow: 0 0 18px rgba(0,212,255,.12);
}

.btn-nav.active:hover {
  color: #7dd3fc;
  border-color: #7dd3fc;
}

.hub-nav .btn {
  white-space: nowrap;
}

.btn-danger {
  background: rgba(239,68,68,.12);
  border-color: rgba(239,68,68,.35);
  color: #fecaca;
}

.btn-block { width: 100%; }

.btn:disabled,
button:disabled {
  opacity: .45;
  cursor: not-allowed;
  box-shadow: none;
}

.inline-form { display: inline; }

/* ── Forms ── */

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

label {
  display: block;
  margin-bottom: 6px;
  font-size: .75rem;
  color: var(--muted);
  font-family: var(--mono);
  letter-spacing: .04em;
}

.field-hint {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .68rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: .8rem;
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: .85;
}

input:focus,
select:focus,
textarea:focus { border-color: var(--accent); }

textarea {
  font-family: var(--mono);
  resize: vertical;
  min-height: 100px;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkbox-group label,
.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-family: var(--mono);
  font-size: .75rem;
  cursor: pointer;
}

.checkbox-inline input,
.checkbox-group input {
  width: auto;
  margin: 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

/* ── Tables ── */

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: .72rem;
}

th,
td {
  padding: 9px 10px;
  border: 1px solid var(--border);
  color: var(--text);
  text-align: left;
  vertical-align: middle;
}

th {
  background: var(--surface2);
  color: var(--muted);
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}

tbody tr:hover { background: rgba(17,29,53,.65); }

.table-cell-wrap {
  max-width: 220px;
  word-break: break-all;
}

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

/* ── Alerts ── */

.alert {
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-family: var(--mono);
  font-size: .75rem;
  line-height: 1.45;
}

.alert ul {
  margin: 0;
  padding-left: 18px;
}

.alert-success {
  background: rgba(16,185,129,.08);
  border: 1px solid rgba(16,185,129,.35);
  color: #d1fae5;
}

.alert-error {
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.28);
  color: #fecaca;
}

/* ── Badges / subnav ── */

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: .68rem;
  margin-right: 4px;
}

.badge-ok { border-color: #10b981; color: #6ee7b7; }
.badge-muted { color: var(--muted); }
.badge-pending { border-color: #f59e0b; color: #fcd34d; }
.badge-running { border-color: #00d4ff; color: #7dd3fc; }
.badge-valid,
.badge-success { border-color: #10b981; color: #6ee7b7; }
.badge-invalid,
.badge-failed { border-color: var(--danger); color: #fecaca; }
.badge-cancelled { color: var(--muted); }

.subnav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.subnav a {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .72rem;
}

.subnav a.active,
.subnav a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.subnav-context {
  margin: 0 0 20px;
  font-family: var(--mono);
  font-size: .72rem;
}

/* ── Filters / detail ── */

.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.info-box {
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  font-family: var(--mono);
  font-size: .75rem;
  line-height: 1.5;
}

.detail-list {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px 16px;
  margin: 0;
  font-family: var(--mono);
  font-size: .75rem;
}

.detail-list dt {
  margin: 0;
  color: var(--muted);
}

.detail-list dd { margin: 0; }

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.detail-header .card-title { margin: 0; }

.status-badge-lg {
  font-size: .85rem;
  padding: 4px 12px;
}

.output-block {
  margin: 8px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--text);
  background: transparent;
  border: none;
  padding: 0;
}

code {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--accent);
}

.form-spaced { margin-top: 20px; }

.form-footer {
  margin-top: 24px;
}

.form-danger-zone {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.form-group-flush { margin-bottom: 0; }

.filter-actions { align-self: end; }

.stack-sm { margin-top: 8px; }
.stack-md { margin-top: 16px; }
.stack-lg { margin-top: 20px; }
.stack-xl { margin-top: 24px; }

.mb-lg { margin-bottom: 20px; }

.roles-heading {
  display: block;
  margin-bottom: 8px;
}

.validate-hint { margin-left: 8px; }

.table-spaced-top { margin-top: 20px; }

/* ── Pagination ── */

.pagination {
  margin-top: 20px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--mono);
  font-size: .72rem;
}

.pagination a:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.pagination .active {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Dashboard shortcuts ── */

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.shortcut-card {
  display: block;
  padding: 16px 18px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: border-color .2s, transform .2s;
}

.shortcut-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}

.shortcut-card strong {
  display: block;
  color: var(--accent);
  font-size: .9rem;
  margin-bottom: 6px;
}

.shortcut-card span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: .68rem;
  line-height: 1.45;
}

/* ── Resumo de licenças (paridade dashboard legado) ── */

.license-summary {
  margin-top: 28px;
}

.page-title {
  margin: 0 0 8px;
  font-size: 1.4rem;
  font-weight: 800;
}

.data-execucao {
  margin: 0 0 24px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .74rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 18px;
}

.section-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.section-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.section-tag {
  color: var(--muted);
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .08em;
}

.license-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 18px;
  align-items: stretch;
}

.license-card {
  overflow: hidden;
  transition: border-color .25s, transform .2s, box-shadow .25s;
}

.license-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}

.license-card.vermelho { border-color: rgba(239,68,68,.8); }
.license-card.amarelo { border-color: rgba(245,158,11,.9); }

.license-empty-card {
  margin-top: 8px;
}

.titulo {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: .98rem;
  font-weight: 800;
}

.vigencia {
  margin-bottom: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .75rem;
}

.tenant {
  margin-bottom: 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .75rem;
}

.tenant-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

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

.tenant-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tenant-chip svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.license-table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: .72rem;
}

.license-table th,
.license-table td {
  padding: 9px 10px;
  border: 1px solid var(--border);
  text-align: center;
  vertical-align: middle;
}

.license-table th {
  background: var(--surface2);
  color: var(--muted);
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.license-table td:first-child,
.license-table th:first-child {
  text-align: left;
}

.license-metric-colored {
  color: var(--metric-color, var(--text));
}

.license-metric-colored[data-metric-color="gold"],
.license-metric-colored[data-metric-color="#ffc107"] {
  color: #fcd34d;
}

.license-metric-colored[data-metric-color="#f44336"] {
  color: #fca5a5;
}

.license-metric-colored[data-metric-color="#4DA6FF"],
.license-metric-colored[data-metric-color="#4da6ff"] {
  color: #7dd3fc;
}
