/* ============================================================
   AQVEX — Folha de Estilos Global (Mobile-First)
   ============================================================ */

/* Variáveis (paleta AQVEX extraída do site) */
:root {
  --primary:        #8f2cad; /* Roxo Aqvex */
  --primary-dark:   #7a2594;
  --primary-light:  #ab3dcc;
  --accent:         #25d366; /* Verde Aqvex (WhatsApp/Suporte) */
  --accent-hover:   #128c7e;
  --accent-light:   #e9f7ef;
  --bg:             #f4f7fa;
  --surface:        #ffffff;
  --surface-2:      #f8f9fa;
  --border:         #e0e6ed;
  --text:           #2c3e50; /* Cor de texto do site */
  --text-muted:     #7f8c8d;
  --success:        #27ae60;
  --warning:        #f39c12;
  --danger:         #e74c3c;
  --info:           #3498db;
  --sidebar-w:      260px;
  --header-h:       64px;
  --radius:         12px;
  --radius-sm:      8px;
  --shadow:         0 4px 12px rgba(0,0,0,0.05);
  --shadow-md:      0 8px 24px rgba(143, 44, 173, 0.12);
  --transition:     .3s cubic-bezier(0.4, 0, 0.2, 1);
  --font:           'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { 
  font-size: 16px; 
  -webkit-text-size-adjust: 100%; 
  scroll-behavior: smooth;
  height: 100%;
}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; outline: none; }

/* ── Login ─────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  padding: 1.5rem;
}
.login-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  animation: fadeUp 0.5s ease-out;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.login-logo img { height: 60px; margin: 0 auto 0.8rem; }
.login-logo .brand {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}
.login-logo .brand span { color: var(--text); }
.login-logo p { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.3rem; }

.login-card h2 {
  font-size: 1.25rem;
  color: var(--text);
  margin-bottom: 1.5rem;
  font-weight: 700;
  text-align: center;
}

/* ── Formulários ────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.input-wrap { position: relative; }
.input-wrap i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.input-wrap input,
.input-wrap select,
.input-wrap textarea {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.8rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  transition: all var(--transition);
}
.input-wrap input:focus,
.input-wrap select:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(143, 44, 173, 0.1);
}
.input-wrap .toggle-pass {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}
.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
.form-check input { accent-color: var(--primary); width: 16px; height: 16px; }

/* Botões */
/* ── Botões ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

/* Principal (roxo AQVEX) */
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(143, 44, 173, 0.2);
}

/* Sucesso (verde) */
.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover {
  background: #219a52;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(39, 174, 96, 0.25);
}

/* Perigo (vermelho) */
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: #c0392b;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.25);
}

/* Aviso (amarelo) */
.btn-warning {
  background: var(--warning);
  color: #fff;
}
.btn-warning:hover {
  background: #d68910;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(243, 156, 18, 0.25);
}

/* Informação (azul) */
.btn-info {
  background: var(--info);
  color: #fff;
}
.btn-info:hover {
  background: #2980b9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.25);
}

/* Light (cinza claro) — o que você disse que faltou */
.btn-light {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-light:hover {
  background: var(--border);
  transform: translateY(-1px);
}

/* Dark (texto principal) */
.btn-dark {
  background: var(--text);
  color: #fff;
}
.btn-dark:hover {
  background: #1a252f;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(44, 62, 80, 0.25);
}

/* Variações outline */
.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline-primary:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}

.btn-outline-danger {
  background: transparent;
  color: var(--danger);
  border: 1.5px solid var(--danger);
}
.btn-outline-danger:hover {
  background: var(--danger);
  color: #fff;
  transform: translateY(-1px);
}

/* Tamanhos */
.btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  border-radius: 6px;
}
.btn-lg {
  padding: 1rem 2rem;
  font-size: 1rem;
}
.btn-block {
  width: 100%;
}

/* Desabilitado */
.btn:disabled,
.btn.disabled {
  opacity: 0.5;
  pointer-events: none;
  transform: none;
  box-shadow: none;
}

/* ── Tamanhos ────────────────────────────────────────────────── */
.btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  border-radius: 6px;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

/* ── Desabilitado ────────────────────────────────────────────── */
.btn:disabled,
.btn.disabled {
  opacity: 0.5;
  pointer-events: none;
  transform: none;
  box-shadow: none;
}

.app-header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
}
.header-logo img { height: 32px; }

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}
.user-info {
  display: none; /* Escondido no mobile */
}
@media (min-width: 768px) {
  .user-info { display: block; text-align: right; }
  .user-name { font-weight: 700; font-size: 0.9rem; display: block; }
  .user-role { font-size: 0.75rem; color: var(--text-muted); display: block; }
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-light);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

/* Dashboard Cards */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  padding: 1.25rem;
}
.stat-card {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

/* Grid Responsivo de Clientes */
.content-area {
  padding: 1.25rem;
  flex: 1;
}
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  background: var(--surface-2);
  padding: 1rem;
  text-align: left;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
}
th:hover { color: var(--primary); }
td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
tr:hover td { background: var(--surface-2); }

/* Mobile Table (Card Style) */
@media (max-width: 600px) {
  .table-responsive table, 
  .table-responsive thead, 
  .table-responsive tbody, 
  .table-responsive th, 
  .table-responsive td, 
  .table-responsive tr { 
    display: block; 
  }
  .table-responsive thead tr { position: absolute; top: -9999px; left: -9999px; }
  .table-responsive tr { border: 1px solid var(--border); margin-bottom: 1rem; border-radius: var(--radius-sm); }
  .table-responsive td {
    border: none;
    border-bottom: 1px solid var(--surface-2);
    position: relative;
    padding-left: 50%;
    text-align: right;
  }
  .table-responsive td:before {
    position: absolute;
    left: 1rem;
    width: 45%;
    padding-right: 10px;
    white-space: nowrap;
    text-align: left;
    font-weight: 700;
    content: attr(data-label);
    color: var(--text-muted);
  }
}

/* Bottom Nav (Mobile Only) */
.bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  height: 60px;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}
@media (min-width: 768px) {
  .bottom-nav { display: none; }
  .app-container { padding-bottom: 0; }
}
@media (max-width: 767px) {
  .app-container { padding-bottom: 60px; }
}
.nav-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.7rem;
  gap: 0.25rem;
}
.nav-link.active { color: var(--primary); }
.nav-link i { font-size: 1.25rem; }

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}
.alert-error { background: #fff5f5; color: #c53030; border: 1px solid #feb2b2; }
.alert-success { background: #f0fff4; color: #2f855a; border: 1px solid #9ae6b4; }

.btn-filtrar {
    padding: 0.8rem 1.5rem;
}

/* 📱 Celular */
@media (max-width: 768px) {
    .btn-filtrar {
        flex: 1;
        min-width: 150px;
    }
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.badge-success {
  background: #e8f8f0;
  color: var(--success);
}

.badge-warning {
  background: #fef9ec;
  color: var(--warning);
}

.badge-danger {
  background: #fdf0ef;
  color: var(--danger);
}

.badge-info {
  background: #eaf4fd;
  color: var(--info);
}

.badge-primary {
  background: rgba(143, 44, 173, 0.1);
  color: var(--primary);
}

.badge-light {
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

