/* ════════════════════════════════════════════════════════════════
   Fonte de Canais — Design System
   Conceito: "Central de Transmissão" — sidebar navy, canvas claro,
   verde-sinal para status ativo (referência: luz de transmissão ao vivo).
   ════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --ink: #0F1B2D;
  --ink-soft: #16243A;
  --canvas: #F7F8FA;
  --surface: #FFFFFF;
  --border: #E5E8EE;
  --text: #1F2937;
  --text-muted: #6B7280;

  --signal-green: #16C172;
  --signal-green-soft: #E5F9EF;
  --signal-amber: #F2A93B;
  --signal-amber-soft: #FDF3E2;
  --signal-red: #E5484D;
  --signal-red-soft: #FDECEC;

  --accent: #2F6FED;
  --accent-soft: #EAF1FF;
  --accent-hover: #2558C4;

  --radius: 10px;
  --radius-sm: 6px;

  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;

  --sidebar-width: 240px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 12px;
}

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

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

code { font-family: var(--font-mono); background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }

/* ── Acessibilidade: foco visível sempre ── */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ════════════════════════════════════════════════════════════════
   SIDEBAR (substitui o navbar superior)
   ════════════════════════════════════════════════════════════════ */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--ink);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.navbar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 20px 14px;
}

.navbar-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  padding: 6px 10px 22px;
  display: block;
}
.navbar-brand:hover { text-decoration: none; opacity: 0.9; }

.navbar-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  position: absolute;
  top: 16px;
  right: 14px;
}

.navbar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.navbar-nav li a,
.navbar-nav li .link-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #B8C2D4;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
}

.navbar-nav li a:hover,
.navbar-nav li .link-btn:hover {
  background: var(--ink-soft);
  color: #fff;
  text-decoration: none;
}

.navbar-nav li:last-child {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--ink-soft);
}

/* ════════════════════════════════════════════════════════════════
   LAYOUT PRINCIPAL
   ════════════════════════════════════════════════════════════════ */

.page-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  padding: 28px 32px;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--ink);
  padding: 16px 24px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(15, 27, 45, 0.12);
}

.admin-topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: #fff;
}
.admin-topbar-brand:hover { text-decoration: none; opacity: 0.85; }

.admin-topbar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 14px;
  color: #B8C2D4;
}

.container { max-width: 1100px; margin: 0 auto; }

@media (max-width: 880px) {
  .navbar {
    position: static;
    width: 100%;
    height: auto;
  }
  .navbar-inner { padding: 14px 16px; }
  .navbar-toggle { display: block; }
  .navbar-nav {
    display: none;
    flex-direction: column;
    margin-top: 12px;
  }
  .navbar-nav.is-open { display: flex; }
  .page-content { margin-left: 0; padding: 20px 16px; }
}

/* ════════════════════════════════════════════════════════════════
   CARDS
   ════════════════════════════════════════════════════════════════ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 1px 2px rgba(15, 27, 45, 0.04);
}

.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.card-link:hover {
  text-decoration: none;
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(47, 111, 237, 0.12);
  transform: translateY(-2px);
}

.card-title { font-size: 17px; margin-bottom: 16px; }
.text-center { text-align: center; }

.auth-wrap {
  max-width: 420px;
  margin: 40px auto;
}

.panel-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

/* ════════════════════════════════════════════════════════════════
   BOTÕES
   ════════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.05s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-primary:disabled { background: #A9C0F0; cursor: not-allowed; }

.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-soft); color: #fff; }

.btn-secondary { background: var(--canvas); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); color: var(--text); }

.btn-danger { background: var(--signal-red); color: #fff; }
.btn-danger:hover { background: #C0392E; color: #fff; }

.btn-block { display: flex; width: 100%; }

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  padding: 0;
}

/* ════════════════════════════════════════════════════════════════
   FORMULÁRIOS
   ════════════════════════════════════════════════════════════════ */

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

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ════════════════════════════════════════════════════════════════
   TABELA DE DADOS — borda de status à esquerda + monoespaçada
   ════════════════════════════════════════════════════════════════ */

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

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.data-table thead th {
  background: var(--canvas);
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.data-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }

/* aplicar manualmente nas células com dado técnico (username, IP, senha) */
.mono { font-family: var(--font-mono); font-size: 13px; }

/* borda colorida lateral conforme status (aplicada via classe na <tr>) */
.data-table tbody tr.status-active td:first-child { box-shadow: inset 3px 0 0 var(--signal-green); }
.data-table tbody tr.status-expired td:first-child { box-shadow: inset 3px 0 0 var(--signal-red); }
.data-table tbody tr.status-disabled td:first-child { box-shadow: inset 3px 0 0 #C5CCD6; }

.data-table tbody tr.details-row td { background: var(--canvas); font-size: 13px; }
.data-table tbody tr.details-row b { color: var(--ink); }

/* ════════════════════════════════════════════════════════════════
   BADGES + SINAL PULSANTE (elemento de assinatura)
   ════════════════════════════════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

.badge-success { background: var(--signal-green-soft); color: #0E8F56; }
.badge-danger  { background: var(--signal-red-soft); color: #C0392E; }
.badge-muted   { background: #F0F1F3; color: var(--text-muted); }

.signal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--signal-green);
  flex-shrink: 0;
  animation: signal-pulse 1.8s ease-in-out infinite;
}

@keyframes signal-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22, 193, 114, 0.45); }
  50% { box-shadow: 0 0 0 4px rgba(22, 193, 114, 0); }
}

/* ════════════════════════════════════════════════════════════════
   AÇÕES / ÍCONES
   ════════════════════════════════════════════════════════════════ */

.actions { white-space: nowrap; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--canvas);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  margin-right: 4px;
  font-size: 13px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.icon-btn:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.icon-btn-danger:hover { background: var(--signal-red-soft); color: var(--signal-red); }

.inline-form { display: inline; }

/* ════════════════════════════════════════════════════════════════
   ALERTAS
   ════════════════════════════════════════════════════════════════ */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 18px;
  border: 1px solid transparent;
}

.alert-success { background: var(--signal-green-soft); color: #0E8F56; border-color: #BCEBD3; }
.alert-error   { background: var(--signal-red-soft); color: #C0392E; border-color: #F5C6C2; }
.alert-warning { background: var(--signal-amber-soft); color: #95630A; border-color: #F6DFA8; }

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ════════════════════════════════════════════════════════════════
   TELAS DE AUTENTICAÇÃO (login/cadastro) — topbar + fundo gradiente,
   layout separado (authLayout.ejs) do resto do painel (sidebar).
   ════════════════════════════════════════════════════════════════ */

body.auth-body {
  background: linear-gradient(135deg, #2F6FED 0%, #5B9BFF 100%);
  min-height: 100vh;
  margin: 0;
}

.auth-topbar {
  background: var(--ink);
}

.auth-topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
}

.auth-topbar-brand {
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
}
.auth-topbar-brand:hover { text-decoration: none; opacity: 0.9; }

.auth-topbar-links a {
  color: #B8C2D4;
  font-weight: 500;
  margin-left: 22px;
}
.auth-topbar-links a:hover { color: #fff; text-decoration: none; }

.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
  padding: 40px 16px;
}

.auth-body .auth-wrap { margin: 0 auto; }

.auth-body .card-title {
  font-weight: 500;
  font-size: 22px;
  color: var(--ink);
}

.auth-body .btn-primary {
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 15px;
}

.auth-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.auth-checkbox input { margin-top: 3px; }

/* ════════════════════════════════════════════════════════════════
   PÁGINA INICIAL PÚBLICA (vitrine de preços)
   ════════════════════════════════════════════════════════════════ */

.home-hero {
  text-align: center;
  color: #fff;
  margin-bottom: 28px;
}
.home-hero h1 {
  color: #fff;
  font-size: 26px;
  margin-bottom: 6px;
}
.home-hero .muted { color: rgba(255,255,255,0.75); }

.plans-carousel {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1100px;
  margin: 0 auto;
}

.plans-page {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 820px) {
  .plans-page { grid-template-columns: 1fr; }
}

.carousel-arrow {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.carousel-arrow:hover { background: rgba(255,255,255,0.3); }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}
.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.35);
  cursor: pointer;
  padding: 0;
}
.carousel-dot.active { background: #fff; }

.plan-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 4px 16px rgba(15, 27, 45, 0.08);
}

.plan-featured { border: 2px solid var(--accent); }

.plan-badge {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 12px;
  border-radius: 999px;
}

.plan-eyebrow {
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 4px 0 4px;
}

.plan-price {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 12px;
}
.plan-price .period {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

.progress-bar-track {
  height: 6px;
  background: var(--canvas);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 999px;
  /* largura controlada via JS — timer de avanço automático do carrossel */
  transition: width 0.1s linear;
}

.plan-features {
  list-style: none;
  margin: 16px 0 20px;
  padding: 0;
  font-size: 13.5px;
}
.plan-features li { margin-bottom: 8px; color: var(--text); }
.plan-features li.muted { color: var(--text-muted); }

.channels-section {
  max-width: 1100px;
  margin: 40px auto 0;
  color: #fff;
}
.channels-section h2 { color: #fff; }
.channels-section hr { border: none; border-top: 1px solid rgba(255,255,255,0.25); }
.channels-note { color: rgba(255,255,255,0.85); font-size: 13.5px; }

/* ════════════════════════════════════════════════════════════════
   CLASSES QUE FALTAVAM (usadas em domains.ejs e menu.ejs, nunca
   tinham sido definidas no design system novo).
   ════════════════════════════════════════════════════════════════ */

.inline-search-form {
  display: flex;
  gap: 10px;
  align-items: center;
}
.inline-search-form .form-control {
  width: auto;
  min-width: 260px;
}

.badge-warning { background: var(--signal-amber-soft); color: #95630A; }

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  max-width: 700px;
  margin: 28px auto 0;
}

.menu-square {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  aspect-ratio: 1.2 / 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(15, 27, 45, 0.04);
  transition: border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.menu-square:hover {
  text-decoration: none;
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(47, 111, 237, 0.12);
  transform: translateY(-2px);
}
.menu-square i {
  font-size: 26px;
  color: var(--accent);
}
