/* =====================================================================
   DATANEXUS v3.0 - MODERN CYBER/DARK DESIGN SYSTEM (MOBILE-FIRST)
   Inspirado no visual Mind-7, com foco em responsividade total
   ===================================================================== */

:root {
  --bg-primary: #070a13;
  --bg-secondary: #0d1527;
  --bg-surface: #111c34;
  --bg-card: rgba(17, 28, 52, 0.75);
  --bg-card-hover: rgba(23, 38, 70, 0.9);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 229, 255, 0.25);
  --border-active: #00e5ff;
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  
  --accent-cyan: #00e5ff;
  --accent-cyan-glow: rgba(0, 229, 255, 0.4);
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.3);
  --accent-purple: #818cf8;
  --accent-warning: #f59e0b;
  --accent-danger: #ef4444;

  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden; /* Elimina scrollbars horizontais indesejados */
  margin: 0;
  padding: 0;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

/* Scrollbar fina, estilizada e dark (elimina a barra cinza nativa do Windows) */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-main);
  min-height: 100vh;
  line-height: 1.5;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* Background Ambient Glows */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
}
.bg-glow-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.08) 0%, transparent 70%);
  top: -100px;
  left: 10%;
}
.bg-glow-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.06) 0%, transparent 70%);
  bottom: 0;
  right: 5%;
}

.app-layout {
  position: relative;
  z-index: 1;
  display: none; /* Inicia oculto para evitar flash em guias anônimas ou não autenticadas */
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
}

/* =====================================================================
   LOGIN OVERLAY (TELA DE AUTENTICAÇÃO)
   ===================================================================== */
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 19, 0.95);
  backdrop-filter: blur(25px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: fadeIn 0.3s ease-out;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 25px 50px -12px rgba(0, 229, 255, 0.15);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple), var(--accent-emerald));
}

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

.login-brand-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.2), rgba(99, 102, 241, 0.3));
  border: 1px solid var(--border-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--accent-cyan);
  margin: 0 auto 1.25rem;
  box-shadow: 0 0 25px rgba(0, 229, 255, 0.25);
}

.login-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.login-header p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.login-field {
  margin-bottom: 1.25rem;
}

.login-field label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.45rem;
}

.login-field input {
  width: 100%;
  background: rgba(7, 10, 19, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.login-field input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.25);
}

.turnstile-wrapper {
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: center;
}

.btn-login-submit {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-cyan), #00b4d8);
  color: #04101e;
  border: none;
  padding: 0.95rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(0, 229, 255, 0.35);
}

.btn-login-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 25px rgba(0, 229, 255, 0.5);
}

.login-footer {
  text-align: center;
  margin-top: 1.75rem;
  font-size: 0.75rem;
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

/* =====================================================================
   HEADER & NAVBAR
   ===================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 10, 19, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.65rem 1.25rem;
  width: 100%;
}

.nav-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.2), rgba(99, 102, 241, 0.3));
  border: 1px solid var(--border-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

.text-accent { color: var(--accent-cyan); }
.text-warning { color: var(--accent-warning); }
.text-purple { color: var(--accent-purple); }

/* Center Tabs (Desktop) */
.nav-tabs {
  display: flex;
  align-items: center;
  background: rgba(17, 28, 52, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.nav-tab.active {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.15), rgba(99, 102, 241, 0.2));
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 229, 255, 0.3);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.15);
}

/* Header Right */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.quota-pill {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(17, 28, 52, 0.8);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
}

.quota-icon {
  color: var(--accent-emerald);
  font-size: 1rem;
}

.quota-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 105px;
}

.quota-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.quota-label strong {
  color: var(--accent-emerald);
  font-family: var(--font-mono);
}

.quota-progress-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.quota-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-emerald), var(--accent-cyan));
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* User Pill & Logout */
.user-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
}

.btn-logout {
  background: transparent;
  border: none;
  color: var(--accent-danger);
  cursor: pointer;
  padding: 0.2rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.btn-logout:hover {
  transform: scale(1.15);
}

/* =====================================================================
   MAIN CONTENT & TABS
   ===================================================================== */
.main-content {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 5rem; /* Espaço para barra mobile inferior */
  width: 100%;
  flex: 1;
}

.tab-pane {
  display: none;
}

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

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

/* =====================================================================
   CONSOLE CARD & FORM
   ===================================================================== */
.console-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.console-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), var(--accent-purple), transparent);
}

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

.active-module-badge {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.active-module-badge i {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid var(--border-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: var(--accent-cyan);
}

.active-module-badge h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.active-module-badge p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.module-quick-example {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.example-label {
  font-size: 0.72rem;
  color: var(--text-subtle);
}

.btn-example {
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.3);
  color: var(--accent-cyan);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition);
}

.btn-example:hover {
  background: var(--accent-cyan);
  color: #000;
}

/* Search Input Form */
.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(7, 10, 19, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 0.35rem 0.45rem 0.35rem 1rem;
  transition: var(--transition);
  width: 100%;
}

.search-input-wrapper:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.25);
}

.input-icon {
  color: var(--text-subtle);
  font-size: 1.1rem;
  margin-right: 0.75rem;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1.05rem;
  font-family: var(--font-mono);
  color: #fff;
  padding: 0.45rem 0;
  min-width: 0; /* Impede overflow no flexbox */
}

.search-input::placeholder {
  color: var(--text-subtle);
  font-family: var(--font-main);
  font-size: 0.95rem;
}

.btn-clear {
  background: transparent;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  padding: 0.5rem;
  display: none;
}
.btn-clear:hover { color: #fff; }

.btn-submit {
  background: linear-gradient(135deg, var(--accent-cyan), #00b4d8);
  color: #04101e;
  border: none;
  outline: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(0, 229, 255, 0.35);
  white-space: nowrap;
}

.btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 229, 255, 0.5);
}

.kbd-shortcut {
  background: rgba(0, 0, 0, 0.25);
  color: rgba(4, 16, 30, 0.85);
  font-size: 0.68rem;
  padding: 0.15rem 0.35rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-family: var(--font-mono);
}

/* =====================================================================
   CATALOG & 31 MODULES GRID
   ===================================================================== */
.catalog-section {
  margin-bottom: 2.5rem;
}

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

.catalog-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.catalog-title h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.counter-badge {
  background: rgba(0, 229, 255, 0.15);
  color: var(--accent-cyan);
  font-size: 0.78rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 700;
}

.catalog-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(17, 28, 52, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.75rem;
  width: 250px;
}

.catalog-search input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.82rem;
  width: 100%;
}

.category-pills {
  display: flex;
  flex-wrap: wrap; /* Envolve os botões sem gerar scrollbar horizontal */
  gap: 0.5rem;
  padding-bottom: 0.25rem;
  margin-bottom: 1.25rem;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.category-pills::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.cat-pill {
  background: rgba(17, 28, 52, 0.5);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.cat-pill:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.cat-pill.active {
  background: rgba(0, 229, 255, 0.12);
  color: var(--accent-cyan);
  border-color: rgba(0, 229, 255, 0.35);
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.85rem;
}

.module-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.module-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(0, 229, 255, 0.3);
  transform: translateY(-2px);
}

.module-card.active {
  border-color: var(--accent-cyan);
  background: rgba(0, 229, 255, 0.08);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
}

.module-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.module-icon-box {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  font-size: 1rem;
}

.module-card.active .module-icon-box {
  background: var(--accent-cyan);
  color: #04101e;
}

.module-badge-tag {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 229, 255, 0.15);
  color: var(--accent-cyan);
}

.module-card-info h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: #fff;
}

.module-card-info p {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0.65rem;
}

.module-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-subtle);
}

.module-id-tag {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(0, 229, 255, 0.06);
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
}

/* =====================================================================
   RESULTS CONTAINER
   ===================================================================== */
.results-container {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-top: 1.75rem;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
  animation: fadeIn 0.3s ease-out;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.15rem;
  margin-bottom: 1.15rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.results-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.result-details-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 0.3rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.pill-label { color: var(--text-subtle); }

.results-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.btn-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition);
}

.btn-action:hover {
  background: rgba(0, 229, 255, 0.15);
  color: var(--accent-cyan);
  border-color: rgba(0, 229, 255, 0.3);
}

.result-subtabs {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 1.15rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.65rem;
  overflow-x: auto;
}

.subtab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
  white-space: nowrap;
}

.subtab-btn.active {
  background: rgba(0, 229, 255, 0.12);
  color: var(--accent-cyan);
}

.subtab-content { display: none; }
.subtab-content.active { display: block; animation: fadeIn 0.2s ease-out; }

/* Structured Grid */
.structured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.85rem;
}

.record-card {
  background: rgba(7, 10, 19, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.record-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 0.45rem;
}

.record-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.field-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 0.8rem;
  padding: 0.2rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.04);
}

.field-label {
  color: var(--text-muted);
  font-weight: 500;
  text-transform: capitalize;
  margin-right: 0.5rem;
}

.field-value {
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}

.terminal-box {
  background: #03060c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.terminal-header {
  background: rgba(255, 255, 255, 0.03);
  padding: 0.45rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.terminal-dot { width: 9px; height: 9px; border-radius: 50%; }
.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.terminal-title {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-subtle);
  margin-left: 0.4rem;
}

.terminal-body {
  padding: 1.15rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #a5f3fc;
  overflow-x: auto;
  line-height: 1.6;
  max-height: 500px;
}

.json-body { color: #67e8f9; }

/* =====================================================================
   TAB 2: DECIFRADOR PIX
   ===================================================================== */
.pix-card, .keys-card, .settings-card, .history-card, .automations-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
}

.pix-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.25rem;
}

.pix-banner-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-lg);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--accent-warning);
}

.pix-banner h2 { font-size: 1.35rem; font-weight: 800; margin-bottom: 0.2rem; }
.pix-banner p { color: var(--text-muted); font-size: 0.85rem; }

.pix-input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.pix-field label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.45rem;
}

.pix-field input {
  width: 100%;
  background: rgba(7, 10, 19, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 0.8rem 1rem;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.pix-field input:focus {
  border-color: var(--accent-warning);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.25);
}

.pix-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.pix-help {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.btn-pix-submit {
  background: linear-gradient(135deg, var(--accent-warning), #d97706);
  color: #000;
  border: none;
  padding: 0.8rem 1.75rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
}

.pix-results {
  margin-top: 1.75rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.25rem;
}

/* =====================================================================
   TAB 3: GERENCIADOR DE API KEYS
   ===================================================================== */
.keys-header, .settings-header, .history-header, .automations-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.25rem;
}

.keys-header h2, .settings-header h2, .history-header h2, .automations-header h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.keys-header p, .settings-header p, .history-header p, .automations-header p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.btn-new-key {
  background: linear-gradient(135deg, var(--accent-cyan), #00b4d8);
  color: #04101e;
  border: none;
  padding: 0.75rem 1.35rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.create-key-box {
  background: rgba(7, 10, 19, 0.8);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.create-key-box h4 {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.create-key-input-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.create-key-input-row input {
  flex: 1;
  min-width: 240px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
}

.btn-confirm-key {
  background: var(--accent-cyan);
  color: #000;
  border: none;
}

.key-generated-alert {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid var(--accent-warning);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.key-alert-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-warning);
  margin-bottom: 0.35rem;
}

.key-display-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #03060c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  margin-top: 0.75rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.key-display-wrapper code {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  font-size: 0.95rem;
  word-break: break-all;
}

.btn-copy-token {
  background: rgba(0, 229, 255, 0.15);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Tables */
.keys-table-container, .history-table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  -webkit-overflow-scrolling: touch;
}

.keys-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}

.keys-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  padding: 0.75rem 1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.keys-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  white-space: nowrap;
}

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

.btn-revoke {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--accent-danger);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
}

/* =====================================================================
   TAB 4: CONFIGURAÇÕES & SWITCH TOGGLE
   ===================================================================== */
.settings-group {
  background: rgba(7, 10, 19, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.settings-group h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.settings-field.full-width {
  grid-column: 1 / -1;
}

.settings-field label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.settings-field input {
  width: 100%;
  background: rgba(7, 10, 19, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.85rem;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
}

.settings-field input:focus {
  border-color: var(--accent-cyan);
}

/* Turnstile Toggle */
.turnstile-toggle-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: 0.3s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
}
input:checked + .slider { background-color: var(--accent-emerald); }
input:checked + .slider:before { transform: translateX(22px); }
.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }

.settings-tip {
  margin-top: 1rem;
  background: rgba(0, 229, 255, 0.05);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.settings-submit-row {
  display: flex;
  justify-content: flex-end;
}

.btn-save-settings {
  background: linear-gradient(135deg, var(--accent-emerald), #059669);
  color: #fff;
  border: none;
  padding: 0.8rem 1.85rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

/* =====================================================================
   TAB 6: AUTOMAÇÕES
   ===================================================================== */
.btn-swagger-large {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.2), rgba(99, 102, 241, 0.3));
  border: 1px solid var(--border-glow);
  color: var(--accent-cyan);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
}

.snippets-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.snippet-box {
  background: rgba(7, 10, 19, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.snippet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.btn-copy-code {
  background: transparent;
  border: none;
  color: var(--accent-cyan);
  font-size: 0.72rem;
  cursor: pointer;
}

.code-block {
  padding: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #38bdf8;
  line-height: 1.5;
  overflow-x: auto;
}

.endpoints-list {
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.endpoint-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.78rem;
}

.badge-method {
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  font-family: var(--font-mono);
}
.badge-method.get { background: rgba(16, 185, 129, 0.2); color: var(--accent-emerald); }
.badge-method.post { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.endpoint-item code { font-family: var(--font-mono); color: #fff; }

/* =====================================================================
   MOBILE BOTTOM NAVIGATION (BARRA FLUTUANTE EM TELAS PEQUENAS)
   ===================================================================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(7, 10, 19, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  padding: 0.45rem 0.5rem max(0.45rem, env(safe-area-inset-bottom));
  justify-content: space-around;
  box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.5);
}

.mobile-nav-item {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  min-width: 52px;
}

.mobile-nav-item i {
  font-size: 1.15rem;
}

.mobile-nav-item.active {
  color: var(--accent-cyan);
}

/* Footer */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-subtle);
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

.footer-links { display: flex; gap: 1.25rem; }
.footer-links a { color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--accent-cyan); }

/* =====================================================================
   RESPONSIVIDADE MOBILE APROFUNDADA (Elimina Scrollbars e Ajusta Touch)
   ===================================================================== */
@media (max-width: 900px) {
  #desktop-nav-tabs { display: none; } /* Oculta tabs no topo no mobile */
  .mobile-bottom-nav { display: flex; } /* Ativa barra de navegação no rodapé */
  
  .navbar { padding: 0.5rem 1rem; }
  .main-content { padding: 1rem 0.85rem 5.5rem; } /* Margem inferior para o bottom nav */
  
  .console-card { padding: 1.25rem; border-radius: var(--radius-lg); }
  .console-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  
  .catalog-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  
  .catalog-search {
    width: 100%;
  }

  .category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .cat-pill {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
  }
  
  .search-input-wrapper {
    flex-direction: column;
    padding: 0.75rem;
    gap: 0.75rem;
  }
  
  .search-input { width: 100%; font-size: 1rem; }
  
  .btn-submit {
    width: 100%;
    justify-content: center;
    padding: 0.85rem;
  }
  
  .kbd-shortcut { display: none; }
  
  .pix-input-grid, .settings-grid, .snippets-grid { grid-template-columns: 1fr; }
  .settings-field.full-width { grid-column: auto; }
  
  .modules-grid {
    grid-template-columns: 1fr; /* 1 coluna no celular para toque fácil */
  }
  
  .header-right { gap: 0.5rem; }
  .quota-details { min-width: 85px; }
  .quota-label span { display: none; } /* Oculta 'Cota Diária' e mostra só o número */
  
  .results-header { flex-direction: column; align-items: flex-start; }
  .results-actions { width: 100%; justify-content: space-between; }
  .btn-action { flex: 1; justify-content: center; }
  
  .login-card { padding: 1.5rem; }
}

@media (max-width: 480px) {
  .brand-subtitle { display: none; }
  .user-pill span { display: none; } /* Mostra só o ícone do usuário */
  .catalog-search { width: 100%; }
}

/* =====================================================================
   TOAST NOTIFICATION SYSTEM (NOTIFICAÇÕES FLUTUANTES MODERNAS)
   ===================================================================== */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 400px;
  width: calc(100vw - 48px);
}

.toast {
  pointer-events: auto;
  background: rgba(13, 21, 39, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.15rem;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6);
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  line-height: 1.4;
}

.toast.success {
  border-left: 4px solid var(--accent-emerald);
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.25);
}
.toast.success .toast-icon { color: var(--accent-emerald); }

.toast.error {
  border-left: 4px solid var(--accent-danger);
  box-shadow: 0 10px 30px rgba(239, 68, 68, 0.25);
}
.toast.error .toast-icon { color: var(--accent-danger); }

.toast.info {
  border-left: 4px solid var(--accent-cyan);
  box-shadow: 0 10px 30px rgba(0, 229, 255, 0.25);
}
.toast.info .toast-icon { color: var(--accent-cyan); }

