/* =====================================================================
   style.css - Tokens de design do Gerenciador de Clientes ERP
   Paleta: "painel de suporte técnico" — slate profundo + teal de status
   ===================================================================== */

@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 {
  --bg-shell: #0b1220;       /* sidebar / shell escuro */
  --bg-panel: #0f1b2e;       /* painéis dentro do shell */
  --bg-app: #f4f6f9;         /* fundo da área de conteúdo */
  --bg-card: #ffffff;
  --line: #e2e8f0;
  --line-dark: #1e2c42;

  --text-strong: #0f172a;
  --text-muted: #5b6b82;
  --text-inverse: #e7edf5;
  --text-inverse-muted: #90a3bd;

  --accent: #0f9d94;         /* teal - status "ok" / ação primária */
  --accent-dark: #0b7a73;
  --warn: #d98a1f;           /* âmbar - certificado a vencer */
  --danger: #d64545;         /* vermelho - inadimplente */
  --ok-dot: #22c55e;
}

html, body { height: 100%; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-app);
  color: var(--text-strong);
}

.font-display { font-family: 'Space Grotesk', 'Inter', sans-serif; }
.font-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* ---------- Shell / navegação lateral ---------- */
.app-shell {
  display: grid;
  grid-template-columns: 264px 1fr;
  min-height: 100vh;
}
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

.sidebar {
  background: var(--bg-shell);
  color: var(--text-inverse);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  border-right: 1px solid var(--line-dark);
}

.brand-mark {
  width: 38px; height: 38px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #14b8ac);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; color: #04231f; font-size: 15px;
}

.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  color: var(--text-inverse-muted);
  font-size: 13.5px; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: rgba(255,255,255,0.04); color: var(--text-inverse); }
.nav-link.active {
  background: rgba(15,157,148,0.14);
  color: #6be2d8;
}

.status-dot {
  width: 7px; height: 7px; border-radius: 999px;
  background: var(--ok-dot);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.18);
}

/* ---------- Cards de resumo (dashboard) ---------- */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent-bar, var(--accent));
}
.stat-label {
  font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 600;
}
.stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px; font-weight: 700; margin-top: 6px;
}

/* ---------- Tabela / listagem de clientes ---------- */
.table-shell {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data-table thead th {
  text-align: left; padding: 11px 16px;
  background: #fafbfd; color: var(--text-muted);
  font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em;
  border-bottom: 1px solid var(--line);
}
table.data-table tbody td {
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
table.data-table tbody tr:hover { background: #f8fafc; cursor: pointer; }
table.data-table tbody tr:last-child td { border-bottom: none; }

/* ---------- Badges de status ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
}
.badge-ativo { background: rgba(34,197,94,0.12); color: #16803a; }
.badge-inadimplente { background: rgba(214,69,69,0.12); color: var(--danger); }
.badge-suspenso { background: rgba(217,138,31,0.12); color: var(--warn); }
.badge-cancelado { background: #eef0f4; color: var(--text-muted); }

/* ---------- Painel de credenciais (acesso remoto) — estilo terminal ---------- */
.credential-panel {
  background: var(--bg-shell);
  border-radius: 10px;
  padding: 14px 16px;
  color: var(--text-inverse);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}
.credential-copy-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line-dark);
  color: var(--text-inverse-muted);
  padding: 4px 10px; border-radius: 6px; font-size: 12px;
  transition: background .15s, color .15s;
}
.credential-copy-btn:hover { background: var(--accent); color: #04231f; border-color: var(--accent); }

/* ---------- Abas (visão 360º do cliente) ---------- */
.tab-btn {
  padding: 9px 4px; margin-right: 22px;
  font-size: 13.5px; font-weight: 600; color: var(--text-muted);
  border-bottom: 2px solid transparent;
}
.tab-btn.active { color: var(--text-strong); border-color: var(--accent); }

/* ---------- Botões ---------- */
.btn-primary {
  background: var(--accent); color: white; font-weight: 600; font-size: 13.5px;
  padding: 9px 16px; border-radius: 8px; transition: background .15s;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-outline {
  border: 1px solid var(--line); background: white; font-weight: 600; font-size: 13.5px;
  padding: 9px 16px; border-radius: 8px; color: var(--text-strong); transition: border-color .15s;
}
.btn-outline:hover { border-color: var(--accent); }

.toast {
  position: fixed; bottom: 22px; right: 22px;
  background: var(--text-strong); color: white;
  padding: 12px 18px; border-radius: 9px; font-size: 13.5px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  opacity: 0; transform: translateY(8px); transition: all .25s;
  z-index: 60;
}
.toast.show { opacity: 1; transform: translateY(0); }
