/* -------------------------------------------------------------
 * Afiliados Bot - Styles System (Premium Dark Theme)
 * ------------------------------------------------------------- */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-brand: 'Outfit', sans-serif;

  /* Color Palette (Deep Dark Theme) */
  --bg-app: #0b0f19;
  --bg-sidebar: #0f172a;
  --bg-card: #1e293b;
  --bg-console: #020617;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #6366f1;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.25);

  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.15);

  --yellow: #f59e0b;
  --yellow-glow: rgba(245, 158, 11, 0.15);

  --red: #ef4444;
  --red-glow: rgba(239, 68, 68, 0.15);

  --info: #06b6d4;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  overflow: hidden;
  height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* -------------------------------------------------------------
 * Layout Structure
 * ------------------------------------------------------------- */

.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  padding-left: 8px;
}

.brand-icon {
  font-size: 28px;
}

.brand-name {
  font-family: var(--font-brand);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #a5b4fc, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-fast);
}

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

.nav-link.active {
  background-color: var(--primary-glow);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.sidebar-footer .version {
  font-family: monospace;
  margin-top: 4px;
  opacity: 0.7;
}

/* Main Content Styling */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.top-bar {
  height: 80px;
  border-bottom: 1px solid var(--border-color);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(8px);
}

.header-title h1 {
  font-family: var(--font-brand);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.text-muted {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 2px;
}

.header-status {
  display: flex;
  gap: 16px;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
}

.pulse-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-muted);
}

/* Badge States */
.status-badge.running .pulse-indicator {
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse 1.5s infinite;
}

.status-badge.stopped .pulse-indicator {
  background-color: var(--red);
  box-shadow: 0 0 8px var(--red);
}

@keyframes pulse {
  0% { opacity: 0.3; }
  50% { opacity: 1; }
  100% { opacity: 0.3; }
}

.content-body {
  flex-grow: 1;
  padding: 32px;
  overflow-y: auto;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* -------------------------------------------------------------
 * UI Cards & Components
 * ------------------------------------------------------------- */

.card {
  background-color: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.card-header {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.card-header h2 {
  font-family: var(--font-brand);
  font-size: 18px;
  font-weight: 600;
}

.justify-between {
  justify-content: space-between;
}

/* WhatsApp Card Styles */
.whatsapp-card {
  border-left: 4px solid #10b981;
}

.wa-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wa-info-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  background-color: rgba(15, 23, 42, 0.4);
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.wa-status-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--text-muted);
}

.wa-status-row strong {
  color: var(--text-main);
  font-size: 14px;
}

.wa-qr-box {
  text-align: center;
  padding: 20px;
  background-color: #ffffff;
  border-radius: 12px;
  color: #0f172a;
  max-width: 320px;
  margin: 0 auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.qr-instruction {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #0f172a;
}

.qr-img-wrapper img {
  width: 220px;
  height: 220px;
  display: block;
  margin: 0 auto;
}

/* System Update Card & Modal Overlay */
.system-update-card {
  border-left: 4px solid #6366f1;
}

.update-info-box {
  display: flex;
  align-items: center;
  background-color: rgba(15, 23, 42, 0.4);
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.update-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.update-modal {
  background-color: var(--bg-card);
  border: 1px solid var(--primary);
  border-radius: 16px;
  padding: 36px 28px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 20px var(--primary-glow);
}

/* Modal Card & Manual Product Entry Styles */
.modal-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  color: var(--text-main);
}

.modal-header {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  font-family: var(--font-brand);
  font-size: 18px;
  font-weight: 600;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: var(--transition-fast);
}

.btn-close:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.manual-preview-card {
  display: flex;
  gap: 16px;
  background-color: rgba(15, 23, 42, 0.4);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  margin-top: 12px;
}

.manual-preview-card img {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: #fff;
  flex-shrink: 0;
}

.manual-preview-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

/* Banner de Alerta Visual no Modal */
.modal-alert {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}

.alert-success {
  background-color: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.alert-warning {
  background-color: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.alert-danger {
  background-color: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(99, 102, 241, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s infinite linear;
  margin: 0 auto 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Stats Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background-color: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.bg-blue { background-color: rgba(99, 102, 241, 0.12); color: #818cf8; }
.bg-green { background-color: rgba(16, 185, 129, 0.12); color: #34d399; }
.bg-yellow { background-color: rgba(245, 158, 11, 0.12); color: #fbbf24; }
.bg-red { background-color: rgba(239, 68, 68, 0.12); color: #f87171; }

.stat-info h3 {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-number {
  font-size: 24px;
  font-weight: 700;
  margin-top: 4px;
}

.text-green { color: var(--success); }
.text-yellow { color: var(--yellow); }
.text-red { color: var(--red); }

/* Dashboard Rows */
.dashboard-row {
  display: flex;
  gap: 20px;
}

.flex-1 {
  flex: 1;
}

/* Buttons System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary { background-color: var(--primary); color: #fff; }
.btn-primary:hover { background-color: var(--primary-hover); box-shadow: 0 0 12px var(--primary-glow); }

.btn-success { background-color: var(--success); color: #fff; }
.btn-success:hover { background-color: #059669; box-shadow: 0 0 12px var(--success-glow); }

.btn-danger { background-color: var(--red); color: #fff; }
.btn-danger:hover { background-color: #dc2626; box-shadow: 0 0 12px var(--red-glow); }

.btn-info { background-color: var(--info); color: #fff; }
.btn-info:hover { background-color: #0891b2; }

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}
.btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--text-muted);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Action buttons inside table rows */
.action-btn-group {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.btn-tbl-action {
  padding: 5px 8px;
  font-size: 11px;
  border-radius: 6px;
  line-height: 1;
}

/* -------------------------------------------------------------
 * Console Terminal Viewer
 * ------------------------------------------------------------- */

.console-box {
  background-color: var(--bg-console);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  padding: 16px;
  overflow-y: auto;
  color: #38bdf8;
  line-height: 1.5;
  white-space: pre-wrap;
}

.mini-console {
  height: 180px;
}

.full-console {
  height: 520px;
}

.log-line {
  margin-bottom: 4px;
}

/* -------------------------------------------------------------
 * Log Filtering & Syntax Highlighting Badges
 * ------------------------------------------------------------- */
.log-filter-btn {
  background-color: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.log-filter-btn:hover {
  border-color: var(--text-muted);
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.05);
}

.log-filter-btn.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 0 10px var(--primary-glow);
}

.log-filter-btn.btn-filter-error.active {
  background-color: var(--red);
  border-color: var(--red);
  box-shadow: 0 0 10px var(--red-glow);
}

/* Colors for Log Tags in Console */
.log-time { color: #64748b; margin-right: 4px; }
.log-tag-system { color: #94a3b8; font-weight: 600; }
.log-tag-worker { color: #38bdf8; font-weight: 600; }
.log-tag-scheduler { color: #c084fc; font-weight: 600; }
.log-tag-discovery { color: #22d3ee; font-weight: 600; }
.log-tag-amazon { color: #fbbf24; font-weight: 700; }
.log-tag-shopee { color: #fb923c; font-weight: 700; }
.log-tag-ai { color: #34d399; font-weight: 600; }
.log-tag-whatsapp { color: #4ade80; font-weight: 600; }
.log-tag-telegram { color: #60a5fa; font-weight: 600; }
.log-tag-error { color: #f87171; font-weight: 700; }

.logs-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.logs-actions input[type="checkbox"] {
  cursor: pointer;
}

/* -------------------------------------------------------------
 * Data Tables
 * ------------------------------------------------------------- */

.table-container {
  overflow-x: auto;
}

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

.data-table th,
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

/* Product list item structure */
.product-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 420px;
  min-width: 0;
}

.product-img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background-color: #fff;
  flex-shrink: 0;
}

.product-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.product-name {
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.product-id {
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.badge-discovered { background-color: rgba(6, 182, 212, 0.15); color: #22d3ee; }
.badge-queued { background-color: rgba(99, 102, 241, 0.15); color: #818cf8; }
.badge-sending { background-color: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-sent { background-color: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-failed { background-color: rgba(239, 68, 68, 0.15); color: #f87171; }
.badge-skipped_limit { background-color: rgba(148, 163, 184, 0.15); color: #cbd5e1; }
.badge-rejected_rating { background-color: rgba(244, 63, 94, 0.15); color: #fda4af; }

/* Platform Badges */
.badge-platform {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge-platform-shopee { background-color: rgba(238, 77, 45, 0.2); color: #ff6b4a; border: 1px solid rgba(238, 77, 45, 0.4); }
.badge-platform-amazon { background-color: rgba(255, 153, 0, 0.2); color: #ffb74d; border: 1px solid rgba(255, 153, 0, 0.4); }
.badge-platform-ml { background-color: rgba(255, 224, 0, 0.2); color: #facc15; border: 1px solid rgba(255, 224, 0, 0.4); }
.badge-platform-manual { background-color: rgba(99, 102, 241, 0.2); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.4); }
.badge-platform-generic { background-color: rgba(148, 163, 184, 0.2); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.4); }

.table-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.table-link:hover {
  text-decoration: underline;
}

.text-center { text-align: center; }

/* -------------------------------------------------------------
 * Settings Forms System
 * ------------------------------------------------------------- */

.form-section-title {
  font-family: var(--font-brand);
  font-size: 16px;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  color: #a5b4fc;
}

.form-section-title:first-of-type {
  margin-top: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.col-span-2 {
  grid-column: span 2;
}

label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.form-control {
  background-color: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  padding: 10px 14px;
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: var(--transition-fast);
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-footer {
  margin-top: 40px;
  display: flex;
  justify-content: flex-end;
}

/* -------------------------------------------------------------
 * Mobile Navigation & Header Brand Elements (Default Hidden)
 * ------------------------------------------------------------- */
.brand-mobile {
  display: none;
  align-items: center;
  gap: 8px;
}

.brand-mobile .brand-icon {
  font-size: 22px;
}

.brand-mobile .brand-name {
  font-family: var(--font-brand);
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(135deg, #a5b4fc, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.mobile-nav-bar {
  display: none;
}

/* -------------------------------------------------------------
 * Responsive Media Queries (< 768px - Mobile & Touch Optimization)
 * ------------------------------------------------------------- */
@media (max-width: 768px) {
  body {
    height: 100dvh;
    overflow: hidden;
  }

  .app-layout {
    flex-direction: column;
    height: 100dvh;
    width: 100vw;
  }

  .sidebar {
    display: none;
  }

  .brand-mobile {
    display: flex;
  }

  .main-content {
    height: 100dvh;
    overflow: hidden;
  }

  .top-bar {
    height: auto;
    padding: 14px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    background-color: var(--bg-sidebar);
  }

  .header-title h1 {
    font-size: 20px;
  }

  .header-title .text-muted {
    font-size: 12px;
  }

  .header-status {
    width: 100%;
    gap: 8px;
  }

  .status-badge {
    flex: 1;
    font-size: 11px;
    padding: 6px 10px;
    justify-content: center;
  }

  .content-body {
    padding: 16px;
    padding-bottom: 90px;
    overflow-y: auto;
    height: calc(100dvh - 120px);
    -webkit-overflow-scrolling: touch;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
  }

  .stat-card {
    padding: 12px;
    gap: 10px;
  }

  .stat-icon {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }

  .stat-info h3 {
    font-size: 11px;
  }

  .stat-number {
    font-size: 18px;
  }

  .dashboard-row {
    flex-direction: column;
    gap: 16px;
  }

  .card {
    padding: 16px;
    margin-bottom: 16px;
  }

  .action-buttons {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .action-buttons .btn {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    min-height: 48px;
    justify-content: center;
    border-radius: 10px;
  }

  /* Modal Mobile Responsiveness */
  .modal-card {
    padding: 18px;
    max-height: 88vh;
    border-radius: 14px;
    width: 100%;
  }

  .modal-header h2 {
    font-size: 16px;
  }

  .manual-input-row {
    flex-direction: column !important;
    gap: 10px !important;
  }

  .manual-input-row button {
    width: 100% !important;
    min-height: 48px;
  }

  .manual-preview-card {
    flex-direction: column;
    align-items: center;
    padding: 12px;
  }

  .manual-preview-card img {
    width: 100px;
    height: 100px;
  }

  .modal-footer-actions {
    flex-direction: column !important;
    gap: 10px !important;
    width: 100%;
  }

  .modal-footer-actions button {
    width: 100% !important;
    min-height: 48px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .col-span-2 {
    grid-column: span 1;
  }

  .form-control {
    font-size: 16px; /* Evita auto-zoom do Safari iOS */
    padding: 12px 14px;
    min-height: 48px;
    border-radius: 10px;
  }

  .form-footer {
    margin-top: 24px;
    justify-content: center;
  }

  .form-footer .btn {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    border-radius: 10px;
  }

  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table th,
  .data-table td {
    padding: 10px 10px;
    font-size: 12px;
  }

  .product-cell {
    max-width: 180px;
  }

  .product-name {
    max-width: 120px;
    font-size: 12px;
  }

  .product-img {
    width: 36px;
    height: 36px;
  }

  .mini-console {
    height: 180px;
    font-size: 11px;
    padding: 12px;
  }

  .full-console {
    height: calc(100dvh - 270px);
    min-height: 280px;
    font-size: 11px;
    padding: 12px;
  }

  .mobile-nav-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background-color: var(--bg-sidebar);
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    align-items: center;
    justify-content: space-around;
    padding: 0 8px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
  }

  .mobile-nav-bar .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    height: 100%;
    padding: 6px 4px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition-fast);
  }

  .mobile-nav-bar .nav-icon {
    font-size: 18px;
  }

  .mobile-nav-bar .nav-label {
    font-size: 11px;
  }

  .mobile-nav-bar .nav-link.active {
    color: #a5b4fc;
    background-color: rgba(99, 102, 241, 0.15);
    font-weight: 600;
  }
}

@media (max-width: 380px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}