/* ============================================================
   SYX CHAT — Estilos globais
   ============================================================ */

:root {
  --primary:       #0D47A1;
  --primary-light: #1565C0;
  --primary-dark:  #0A3880;
  --success:       #2e7d32;
  --warning:       #f57c00;
  --danger:        #c62828;
  --info:          #1565C0;
  --bg:            #f4f6fb;
  --surface:       #ffffff;
  --border:        #e0e6f0;
  --text:          #1a1a2e;
  --text-muted:    #6b7280;
  --radius:        10px;
  --radius-lg:     14px;
  --shadow:        0 1px 4px rgba(13,71,161,.08);
  --shadow-md:     0 4px 16px rgba(13,71,161,.12);
}

* { box-sizing: border-box; margin: 0; padding: 0 }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

/* ─── Tipografia ─────────────────────────────────────────── */
h1 { font-size: 22px; font-weight: 700 }
h2 { font-size: 18px; font-weight: 600 }
h3 { font-size: 15px; font-weight: 600 }

/* ─── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* ─── Métricas ────────────────────────────────────────────── */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.metric {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px;
  box-shadow: var(--shadow);
}
.metric .label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px }
.metric .value { font-size: 28px; font-weight: 700 }
.metric .value.blue    { color: var(--primary) }
.metric .value.green   { color: var(--success) }
.metric .value.amber   { color: var(--warning) }
.metric .value.red     { color: var(--danger) }

/* ─── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
}
.badge.ativo     { background: #e8f5e9; color: #2e7d32 }
.badge.trial     { background: #e3f2fd; color: #1565C0 }
.badge.suspenso  { background: #f5f5f5; color: #666 }
.badge.cancelado { background: #ffebee; color: #c62828 }
.badge.starter   { background: #e3f2fd; color: #1565C0 }
.badge.pro       { background: #ede7f6; color: #4527a0 }
.badge.business  { background: #e8f5e9; color: #1b5e20 }
.badge.pago      { background: #e8f5e9; color: #2e7d32 }
.badge.pendente  { background: #fff8e1; color: #f57c00 }
.badge.vencido   { background: #ffebee; color: #c62828 }

/* ─── Botões ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
  text-decoration: none;
}
.btn:hover  { background: #f0f4ff; border-color: #b0c4f0 }
.btn:active { transform: scale(.98) }
.btn:disabled { opacity: .5; cursor: not-allowed }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary) }
.btn.primary:hover { background: var(--primary-dark) }
.btn.danger  { color: var(--danger); border-color: #ef9a9a }
.btn.danger:hover  { background: #ffebee }
.btn.success { color: var(--success); border-color: #a5d6a7 }
.btn.success:hover { background: #e8f5e9 }
.btn.sm { padding: 4px 10px; font-size: 12px }

/* ─── Tabelas ────────────────────────────────────────────── */
.table-wrap { overflow-x: auto }
table { width: 100%; border-collapse: collapse; font-size: 13px }
th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
  background: #fafbfe;
}
td { padding: 12px 14px; border-bottom: 1px solid #f0f4f8 }
tr:last-child td { border-bottom: none }
tr:hover td { background: #f8faff }

/* ─── Formulários ────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px }
.form-group label { font-size: 13px; font-weight: 500; color: #444 }
input[type=text], input[type=email], input[type=password],
input[type=tel], select, textarea {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,71,161,.1);
}

/* ─── Alertas ────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 12px;
}
.alert.info    { background: #e3f2fd; color: #1565C0 }
.alert.success { background: #e8f5e9; color: #2e7d32 }
.alert.error   { background: #ffebee; color: #c62828 }
.alert.warning { background: #fff8e1; color: #f57c00 }

/* ─── Modal ──────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-md);
}
.modal h3 { margin-bottom: 8px }
.modal p  { color: var(--text-muted); font-size: 13px; margin-bottom: 12px }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px }

/* ─── Loading ────────────────────────────────────────────── */
.loading { text-align: center; padding: 40px; color: var(--text-muted) }
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg) } }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .metrics { grid-template-columns: 1fr 1fr }
}
@media (max-width: 480px) {
  .metrics { grid-template-columns: 1fr }
}
