/* ==========================================================================
   ARQUITETOBIM - PAINEL ADMINISTRATIVO (ADMIN.CSS)
   ========================================================================== */

:root {
  --bg-dark: #070b14;
  --bg-card: #0e1626;
  --bg-card-hover: #141f36;
  --bg-sidebar: #0a0f1d;
  --bg-input: #121c30;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(74, 222, 128, 0.4);
  
  --color-lime: #4ade80;
  --color-lime-glow: rgba(74, 222, 128, 0.25);
  --color-cyan: #38bdf8;
  --color-blue: #3b82f6;
  --color-amber: #f59e0b;
  --color-danger: #ef4444;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --font-main: 'Plus Jakarta Sans', sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Utilities */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-lime { color: var(--color-lime); }
.text-center { text-align: center; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: var(--color-lime);
  color: #041624;
  box-shadow: 0 4px 14px var(--color-lime-glow);
}

.btn-primary:hover {
  background: #6ee7b7;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--color-lime-glow);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #ffffff;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
}

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

.btn-block {
  width: 100%;
}

.btn-link {
  background: none;
  border: none;
  color: var(--color-lime);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
}
.btn-link:hover { text-decoration: underline; }

/* ==========================================================================
   TELA DE LOGIN
   ========================================================================== */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(circle at center, #111d38 0%, #070b14 70%);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(74, 222, 128, 0.05);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo-wrap {
  width: 54px;
  height: 54px;
  margin: 0 auto 1rem;
}

.login-logo-svg {
  width: 100%;
  height: 100%;
}

.login-header h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.05em;
}

.lime { color: var(--color-lime); }

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.35rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-group input:focus {
  border-color: var(--color-lime);
  box-shadow: 0 0 0 3px var(--color-lime-glow);
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrap input {
  padding-right: 2.8rem;
}

.pass-toggle {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.7;
}
.pass-toggle:hover { opacity: 1; }

.login-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

.login-footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.back-link {
  color: var(--color-lime);
  text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

/* ==========================================================================
   LAYOUT PRINCIPAL DO DASHBOARD
   ========================================================================== */
.dashboard-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-brand {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.brand-logo-wrap {
  width: 36px;
  height: 36px;
}

.sidebar-logo-svg {
  width: 100%;
  height: 100%;
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
}

.brand-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(74, 222, 128, 0.15);
  color: var(--color-lime);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  margin-left: 0.3rem;
}

.sidebar-nav {
  padding: 1.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
}

.nav-item.active {
  background: rgba(74, 222, 128, 0.12);
  color: var(--color-lime);
  border: 1px solid rgba(74, 222, 128, 0.25);
}

.nav-counter {
  margin-left: auto;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

.sidebar-footer {
  padding: 1.25rem 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.user-avatar {
  font-size: 1.2rem;
  background: rgba(255, 255, 255, 0.05);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
}

.user-name {
  font-size: 0.85rem;
  font-weight: 700;
  display: block;
}

.user-status {
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.status-dot.online {
  width: 7px;
  height: 7px;
  background: var(--color-lime);
  border-radius: 50%;
  display: inline-block;
}

.sidebar-actions {
  display: flex;
  gap: 0.5rem;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.topbar {
  padding: 1.5rem 2.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(14, 22, 38, 0.4);
  backdrop-filter: blur(10px);
}

.topbar-title h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
}

.content-body {
  padding: 2.5rem;
  flex: 1;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   CARDS E KPIS
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.kpi-icon-wrap {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.kpi-icon-wrap.lime { background: rgba(74, 222, 128, 0.12); color: var(--color-lime); border: 1px solid rgba(74, 222, 128, 0.2); }
.kpi-icon-wrap.cyan { background: rgba(56, 189, 248, 0.12); color: var(--color-cyan); border: 1px solid rgba(56, 189, 248, 0.2); }
.kpi-icon-wrap.amber { background: rgba(245, 158, 11, 0.12); color: var(--color-amber); border: 1px solid rgba(245, 158, 11, 0.2); }
.kpi-icon-wrap.blue { background: rgba(59, 130, 246, 0.12); color: var(--color-blue); border: 1px solid rgba(59, 130, 246, 0.2); }

.kpi-details {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
  margin: 0.2rem 0;
}

.kpi-value-sm {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0.2rem 0;
}

.kpi-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* Overview Layout */
.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.dash-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.dash-card-header h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.quick-actions-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: #ffffff;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}

.action-btn:hover {
  background: var(--bg-card-hover);
  border-color: rgba(74, 222, 128, 0.3);
  transform: translateX(4px);
}

.action-icon {
  font-size: 1.4rem;
}

.action-info strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.action-info span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.action-arrow {
  margin-left: auto;
  font-weight: 700;
  color: var(--color-lime);
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.recent-item {
  padding: 0.85rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

/* ==========================================================================
   TABELAS DE DADOS (LEADS & NEWSLETTER)
   ========================================================================== */
.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.88rem;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.header-search {
  flex: 1;
  max-width: 380px;
}

.search-field {
  width: 100%;
  padding: 0.55rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
}

.search-field:focus {
  border-color: var(--color-lime);
}

/* ==========================================================================
   GERENCIADOR DE PLANOS
   ========================================================================== */
.plans-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.plan-config-box {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.plan-config-box.featured-box {
  border-color: rgba(74, 222, 128, 0.4);
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.05) 0%, var(--bg-input) 100%);
}

.plan-box-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.plan-box-head h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.badge-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.badge-tag.accent {
  background: rgba(74, 222, 128, 0.15);
  color: var(--color-lime);
}

.badge-tag.gold {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-amber);
}

.form-actions-full {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* Settings */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.settings-info-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.settings-info-card h4 {
  margin-bottom: 1rem;
  font-size: 1rem;
  color: #ffffff;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.88rem;
}

.info-label { color: var(--text-muted); }
.info-val { font-weight: 600; }

.sql-code-box {
  background: #060a12;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-top: 0.75rem;
  overflow-x: auto;
}

.sql-code-box pre {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #7dd3fc;
}

/* ==========================================================================
   MODAL
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 1000;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.modal-message-box {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 0.4rem;
  white-space: pre-wrap;
  color: #ffffff;
  line-height: 1.6;
}

.modal-footer {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  justify-content: flex-end;
}

/* ==========================================================================
   TOASTS
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.85rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 0.88rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideIn 0.3s ease;
}

.toast.success { border-color: rgba(74, 222, 128, 0.4); border-left: 4px solid var(--color-lime); }
.toast.error { border-color: rgba(239, 68, 68, 0.4); border-left: 4px solid var(--color-danger); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   RESPONSIVO
   ========================================================================== */
@media (max-width: 900px) {
  .dashboard-wrapper {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
  }
  .overview-grid, .settings-grid {
    grid-template-columns: 1fr;
  }
  .content-body {
    padding: 1.5rem;
  }
}
