/* =========================================
   1. VARIÁVEIS E CONFIGURAÇÕES TEMA
   ========================================= */
:root {
    --bg-body: #f4f6f8;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --nav-bg: rgba(255, 255, 255, 0.9);
    --primary: #4f46e5;
    --primary-hover: #6366f1;
    --danger: #ef4444;
    --success: #10b981;
    --shadow: rgba(0, 0, 0, 0.08);
}

body.dark-theme {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --nav-bg: rgba(15, 23, 42, 0.9);
    --primary: #818cf8;
    --primary-hover: #a5b4fc;
    --shadow: rgba(0, 0, 0, 0.4);
}

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

html, body { 
    width: 100%; 
    overflow-x: hidden; 
}

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

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

/* =========================================
   2. NAVBAR RESPONSIVA
   ========================================= */
.navbar {
    position: sticky;
    top: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    padding: 10px 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 15px;
}

.nav-links {
    display: flex;
    gap: 15px;
    align-items: center;
}

.nav-item {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
}

/* =========================================
   3. TABELAS E BOTÕES (O ajuste principal)
   ========================================= */
.table-wrapper {
    width: 100%;
    overflow-x: auto; /* Permite scroll se necessário */
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* Garante que os dados não fiquem esmagados */
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

/* Centraliza e organiza os botões de ação */
.actions-cell {
    text-align: center;
}

.btn-group-mobile {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: nowrap; /* Mantém os botões na mesma linha na tabela */
}

.btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;  /* Botões quadrados facilitam o toque */
    height: 38px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 1.2rem;
    transition: 0.2s;
    border: none;
}

.btn-sm:active { transform: scale(0.9); }

.btn-whatsapp { background: #25D366; color: white; }
.btn-success  { background: #10b981; color: white; }
.btn-edit     { background: #f59e0b; color: white; }
.btn-delete   { background: #ef4444; color: white; }

/* Status Badges */
.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}
.status-badge.pendente { background: #ffedd5; color: #9a3412; }
.status-badge.pago     { background: #dcfce7; color: #166534; }

/* =========================================
   4. AJUSTES MOBILE (TELA < 600px)
   ========================================= */
@media (max-width: 600px) {
    .nav-container {
        flex-direction: column;
        gap: 12px;
    }
    
    .brand { font-size: 1.5rem; }
    
    /* Melhora o formulário no celular */
    input, select, .btn {
        font-size: 16px; /* Evita zoom no iPhone */
        padding: 15px;
    }
}

.header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.badge-limit {
  background: #1f2933;
  color: #e5e7eb;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
}

.badge-premium {
  background: linear-gradient(90deg, #6c63ff, #9b8cff);
  color: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
}

.locked-box {
  text-align: center;
  padding: 20px;
  border: 1px dashed #6c63ff;
  border-radius: 12px;
}


.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.card {
  background: var(--bg-card);
  padding: 25px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.card h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.value {
  font-size: 1.8rem;
  font-weight: 800;
  margin-top: 10px;
}

.value.success { color: var(--success); }
.value.warning { color: #f59e0b; }

.dashboard-nav {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.btn-nav {
  background: var(--bg-card);
  padding: 14px 24px;
  border-radius: 15px;
  border: 1px solid var(--border);
  font-weight: 600;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 15px;
}

.form-group label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.form-actions {
  display: flex;
  gap: 15px;
  margin-top: 20px;
  flex-wrap: wrap;
}

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

/* =========================================
   BOTÕES – ESTADOS E FEEDBACK
========================================= */

.btn,
.btn-primary,
.btn-nav,
.btn-back {
  transition: all 0.25s ease;
}

.btn:hover,
.btn-primary:hover,
.btn-nav:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.btn:active,
.btn-primary:active {
  transform: scale(0.96);
}

.btn.disabled,
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

input,
select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text-main);
  transition: border 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.page-header {
  margin-bottom: 25px;
}

.form-section {
  margin-bottom: 30px;
}

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

/* =========================================
   HOOKS PARA ANIMAÇÕES
========================================= */

.animate-fade,
.animate-slide,
.animate-page {
  opacity: 0;
}


/* =========================================
   MICROINTERAÇÕES – UI.JS
========================================= */

.clicked {
  transform: scale(0.96);
}

.shake {
  animation: shake 0.4s;
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}

