/* ==========================================================================
   ESTILOS GERAIS & DESIGN SYSTEM MOBILE
   ========================================================================== */

:root {
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #263349;
  --bg-input: #131d2e;
  --border-color: #334155;
  --border-focus: #10b981;

  --color-emerald: #10b981;
  --color-emerald-dark: #059669;
  --color-emerald-glow: rgba(16, 185, 129, 0.25);

  --color-blue: #38bdf8;
  --color-amber: #f59e0b;
  --color-rose: #f43f5e;
  --color-text-main: #f8fafc;
  --color-text-muted: #94a3b8;
  --color-text-dim: #64748b;

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --shadow-card: 0 4px 16px -2px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 20px -3px var(--color-emerald-glow);

  --safe-bottom: env(safe-area-inset-bottom, 16px);
  --nav-height: 64px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--color-text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
}

/* Container que emula aparelho mobile ou centraliza em telas grandes */
.app-container {
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  background-color: var(--bg-secondary);
  position: relative;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   CABEÇALHO & ESTATÍSTICAS
   ========================================================================== */

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 16px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #10b981, #059669);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-glow);
}

.app-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text-main);
}

.app-subtitle {
  font-size: 0.72rem;
  color: var(--color-emerald);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--color-emerald);
  display: inline-block;
  box-shadow: 0 0 8px var(--color-emerald);
}

/* Barra rápida de Estatísticas */
.quick-stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat-pill {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  text-align: center;
}

.stat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  display: block;
  margin-bottom: 2px;
}

.stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text-main);
}

/* ==========================================================================
   CONTEÚDO DAS ABAS
   ========================================================================== */

.main-content {
  flex: 1;
  padding: 16px;
}

.tab-content {
  display: none;
  animation: fadeIn 0.25s ease-out forwards;
}

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

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

.section-header {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
}

.badge-count {
  font-size: 0.75rem;
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

/* ==========================================================================
   FORMULÁRIO DE CONTAGEM (ABA CONTAR)
   ========================================================================== */

.stock-form {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group label span.required {
  color: var(--color-rose);
}

.input-with-button {
  display: flex;
  gap: 8px;
}

.form-control {
  width: 100%;
  background-color: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--color-text-main);
  font-size: 1rem;
  font-family: inherit;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  border-color: var(--color-emerald);
  box-shadow: 0 0 0 3px var(--color-emerald-glow);
}

.form-control::placeholder {
  color: var(--color-text-dim);
}

.input-uppercase {
  text-transform: uppercase;
}

/* Checkbox estilizado para fixar endereço */
.checkbox-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  cursor: pointer;
  user-select: none;
}

.checkbox-container input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-emerald);
  cursor: pointer;
}

.checkbox-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* Stepper de Quantidade */
.stepper-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-qtd {
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
  max-width: 120px;
}

.btn-step {
  height: 48px;
  min-width: 48px;
  padding: 0 14px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--color-text-main);
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
}

.btn-step:active {
  background-color: var(--border-color);
  transform: scale(0.95);
}

.quick-steps {
  display: flex;
  gap: 6px;
  flex: 1;
}

.quick-steps .btn-step {
  flex: 1;
  font-size: 0.85rem;
}

/* Upload e Captura de Foto */
.foto-upload-area {
  position: relative;
}

.btn-capturar-foto {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: border-color 0.2s, background 0.2s;
}

.btn-capturar-foto:active {
  background: rgba(16, 185, 129, 0.08);
  border-color: var(--color-emerald);
}

.foto-preview-container {
  position: relative;
  width: 100%;
  height: 200px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #000;
}

.foto-preview-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.btn-remover-foto {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(244, 63, 94, 0.85);
  color: white;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Botões do Formulário */
.form-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 15px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px var(--color-emerald-glow);
  transition: opacity 0.2s, transform 0.1s;
}

.btn-primary:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--color-text-muted);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

/* Botão Scanner no input */
.btn-scan-trigger {
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 0 16px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 52px;
}

/* ==========================================================================
   LISTA DE ESTOQUE (ABA ESTOQUE)
   ========================================================================== */

.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  padding-right: 40px;
}

.btn-clear-search {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--color-text-dim);
  font-size: 18px;
  cursor: pointer;
}

.filter-address-select {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--color-text-main);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  outline: none;
}

.stock-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Card de Produto */
.stock-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.15s, border-color 0.15s;
}

.stock-card:active {
  border-color: rgba(16, 185, 129, 0.5);
}

.card-main {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.card-thumb {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-sm);
  background: #000;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  border: 1px solid var(--border-color);
  cursor: pointer;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  content-visibility: auto;
}

.zoom-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  font-size: 10px;
  background: rgba(0, 0, 0, 0.7);
  padding: 2px 4px;
  border-radius: 4px;
}

.card-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
}

.no-photo-icon {
  font-size: 24px;
  opacity: 0.3;
}

.card-info {
  flex: 1;
  min-width: 0;
}

.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.badge-address {
  background: rgba(56, 189, 248, 0.15);
  color: var(--color-blue);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-no-address {
  background: rgba(148, 163, 184, 0.1);
  color: var(--color-text-dim);
}

.card-date {
  font-size: 0.68rem;
  color: var(--color-text-dim);
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 6px;
  word-break: break-word;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-tag {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  background: var(--bg-input);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.meta-tag strong {
  color: var(--color-text-main);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.card-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-step-mini {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--color-text-main);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-step-mini:active {
  background: var(--border-color);
}

.badge-qtd {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-emerald);
  min-width: 60px;
  text-align: center;
}

.badge-qtd small {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.card-actions {
  display: flex;
  gap: 6px;
}

.btn-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:active {
  transform: scale(0.92);
}

.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--color-text-muted);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.6;
}

/* ==========================================================================
   RELATÓRIO & EXPORTAÇÃO (ABA RELATÓRIO)
   ========================================================================== */

.report-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  text-align: center;
}

.report-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-emerald);
  display: block;
}

.report-lbl {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

.export-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-export {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--color-text-main);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}

.btn-export:active {
  border-color: var(--color-emerald);
  background: var(--bg-card-hover);
}

.btn-export-excel {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.05));
  border-color: rgba(16, 185, 129, 0.4);
}

.export-icon {
  font-size: 26px;
}

.export-title {
  font-weight: 700;
  font-size: 1rem;
  display: block;
}

.export-desc {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  display: block;
}

.danger-zone {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px dashed var(--border-color);
}

.btn-danger {
  width: 100%;
  background: rgba(244, 63, 94, 0.1);
  color: var(--color-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
  border-radius: var(--radius-md);
  padding: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ==========================================================================
   NAVEGAÇÃO INFERIOR FIXA (BOTTOM NAV)
   ========================================================================== */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  z-index: 90;
}

.nav-btn {
  background: none;
  border: none;
  color: var(--color-text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: color 0.15s, transform 0.1s;
}

.nav-btn .nav-icon {
  font-size: 20px;
  transition: transform 0.15s;
}

.nav-btn .nav-label {
  font-size: 0.72rem;
  font-weight: 600;
}

.nav-btn.active {
  color: var(--color-emerald);
}

.nav-btn.active .nav-icon {
  transform: scale(1.15);
}

/* ==========================================================================
   MODAL DE SCANNER DE CÓDIGO DE BARRAS
   ========================================================================== */

.modal-scanner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
  z-index: 100;
  display: none;
  flex-direction: column;
}

.modal-scanner.active {
  display: flex;
}

.scanner-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
}

.scanner-title {
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
}

.btn-scanner-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
}

.scanner-viewport {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.scanner-viewport video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Mira do scanner */
.scanner-overlay {
  position: absolute;
  width: 280px;
  height: 180px;
  border: 2px solid rgba(16, 185, 129, 0.6);
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

/* Linha de laser escaneando */
.scanner-laser {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #10b981;
  box-shadow: 0 0 12px #10b981, 0 0 24px #10b981;
  animation: laserScan 2s ease-in-out infinite;
}

@keyframes laserScan {
  0% { top: 5%; opacity: 0.8; }
  50% { top: 95%; opacity: 1; }
  100% { top: 5%; opacity: 0.8; }
}

.scanner-instructions {
  position: absolute;
  bottom: 80px;
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  padding: 0 20px;
}

.scanner-controls {
  position: absolute;
  bottom: 24px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 16px;
  z-index: 10;
}

.btn-torch {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 6px;
}

.btn-torch.active {
  background: #f59e0b;
  color: #000;
  border-color: #f59e0b;
}

/* ==========================================================================
   MÍDIA PARA MARKETPLACE (FOTOS MÚLTIPLAS & VÍDEO DO PRODUTO)
   ========================================================================== */

.media-marketplace-section {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 12px;
}

.media-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.media-header-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.media-section-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text-main);
}

.media-section-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.badge-media-count {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
  white-space: nowrap;
}

.badge-video-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(148, 163, 184, 0.15);
  color: var(--color-text-muted);
  border: 1px solid rgba(148, 163, 184, 0.25);
  white-space: nowrap;
  transition: all 0.2s;
}

.badge-video-pill.active-video {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.4);
}

/* Card de Código Identificador das Mídias (EAN/SKU) */
.media-id-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.media-id-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.media-id-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.media-id-text {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.media-id-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--color-blue);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.media-id-value-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.media-id-value {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.95rem;
  color: #fff;
  letter-spacing: 0.02em;
  word-break: break-all;
}

.btn-copy-code {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--color-blue);
  border-radius: 4px;
  font-size: 12px;
  padding: 2px 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-copy-code:hover, .btn-copy-code:active {
  background: var(--color-blue);
  color: #0f172a;
}

.media-id-filenames {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  padding-top: 6px;
}

.filenames-title {
  font-size: 0.68rem;
  color: var(--color-text-dim);
}

.filenames-preview {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.72rem;
  color: #38bdf8;
  word-break: break-all;
}

/* Card com Dicas / Checklist Mercado Livre */
.marketplace-tips-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tip-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.76rem;
  color: var(--color-text-muted);
  line-height: 1.35;
}

.tip-row strong {
  color: var(--color-text-main);
}

.tip-icon {
  font-size: 0.85rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Botões de Ação para Fotos (Câmera + Galeria) */
.media-upload-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.btn-media-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--color-text-main);
  transition: all 0.2s ease;
  user-select: none;
}

.btn-media-action:hover, .btn-media-action:active {
  border-color: var(--color-emerald);
  background: rgba(16, 185, 129, 0.12);
  transform: translateY(-1px);
}

.btn-camera {
  border-color: rgba(56, 189, 248, 0.3);
}

.btn-galeria {
  border-color: rgba(16, 185, 129, 0.3);
}

.btn-media-icon {
  font-size: 1.1rem;
}

/* Grade de Miniaturas no Formulário */
.galeria-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.galeria-empty-state {
  grid-column: 1 / -1;
  background: rgba(15, 23, 42, 0.4);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px 12px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--color-text-dim);
}

.foto-thumb-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #090d16;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, transform 0.15s;
}

.foto-thumb-card.is-capa {
  border: 2px solid #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
}

.foto-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  content-visibility: auto;
}

.foto-badge-pos {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.75);
  color: #e2e8f0;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.foto-thumb-card.is-capa .foto-badge-pos {
  background: #f59e0b;
  color: #0f172a;
}

.foto-thumb-actions {
  position: absolute;
  bottom: 4px;
  right: 4px;
  display: flex;
  gap: 4px;
}

.btn-thumb-action {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  transition: background 0.15s, transform 0.1s;
}

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

.btn-thumb-remove:hover {
  background: var(--color-rose);
}

.btn-thumb-star {
  color: #f59e0b;
}

.btn-thumb-star:hover {
  background: #f59e0b;
  color: #0f172a;
}

/* ==========================================
   GRAVAÇÃO E PLAYER DE VÍDEO DO PRODUTO
   ========================================== */
.video-section-box {
  padding-top: 14px;
  border-top: 1px dashed var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.video-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.video-label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-main);
}

.video-label-hint {
  font-size: 0.72rem;
  font-weight: normal;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.video-action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-record-video {
  border-color: rgba(244, 63, 94, 0.4);
  background: rgba(244, 63, 94, 0.08);
}

.btn-record-video:hover, .btn-record-video:active {
  border-color: var(--color-rose);
  background: rgba(244, 63, 94, 0.18);
}

.btn-record-video .btn-media-icon {
  color: var(--color-rose);
  animation: pulseRecording 1.5s infinite;
}

@keyframes pulseRecording {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

.btn-upload-video {
  border-color: rgba(245, 158, 11, 0.3);
}

/* Card com Prévia do Vídeo Local */
.video-local-preview-card {
  background: #090d16;
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.video-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(30, 41, 59, 0.9);
  border-bottom: 1px solid var(--border-color);
}

.video-file-info {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.video-badge-ready {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  background: #10b981;
  color: #0f172a;
  border-radius: 4px;
  white-space: nowrap;
}

.video-filename-text {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.video-filesize-text {
  font-size: 0.68rem;
  color: var(--color-text-dim);
}

.btn-remove-video {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--color-rose);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-remove-video:hover {
  background: var(--color-rose);
  color: #fff;
}

.video-player-container {
  width: 100%;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.video-player-native {
  width: 100%;
  max-height: 240px;
  background: #000;
  display: block;
}

/* Área Opcional do YouTube */
.youtube-toggle-area {
  margin-top: 4px;
}

.btn-link-toggle {
  background: none;
  border: none;
  color: var(--color-text-dim);
  font-size: 0.75rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px 0;
  transition: color 0.15s;
}

.btn-link-toggle:hover {
  color: var(--color-blue);
}

.youtube-input-container {
  margin-top: 6px;
}

.video-input-wrapper {
  display: flex;
  gap: 6px;
}

.btn-video-preview-trigger {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--color-text-main);
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s, border-color 0.15s;
}

.btn-video-preview-trigger:hover {
  border-color: var(--color-emerald);
  background: rgba(16, 185, 129, 0.1);
}

.video-preview-box {
  margin-top: 8px;
  background: #090d16;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.video-preview-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.btn-close-mini {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 0 4px;
}

.btn-close-mini:hover {
  color: var(--color-rose);
}

.video-iframe-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect */
  height: 0;
}

.video-iframe-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Badges de Mídia nos Cards do Estoque */
.card-thumb {
  position: relative;
}

.badge-photos-count {
  position: absolute;
  top: 2px;
  left: 2px;
  font-size: 9px;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.85);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 1px 4px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.badge-video-card {
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

.badge-media-code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.15);
  color: var(--color-blue);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.btn-card-download {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--color-blue);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}

.btn-card-download:hover, .btn-card-download:active {
  background: var(--color-blue);
  color: #0f172a;
}

/* ==========================================================================
   MODAL DE GALERIA E CARROSSEL DE MÍDIA
   ========================================================================== */

.modal-galeria-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.modal-galeria-overlay.active {
  display: flex;
}

.modal-galeria-content {
  width: 100%;
  max-width: 520px;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.modal-galeria-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(30, 41, 59, 0.9);
  border-bottom: 1px solid var(--border-color);
}

.modal-galeria-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.modal-galeria-counter {
  font-size: 0.75rem;
  color: var(--color-emerald);
  font-weight: 600;
  display: inline-block;
}

.modal-top-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  flex-wrap: wrap;
}

.modal-filename-badge {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.68rem;
  font-weight: 600;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-modal-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.btn-modal-close:hover {
  background: var(--color-rose);
}

/* Abas de Alternância entre Fotos e Vídeo no Modal */
.modal-media-tabs {
  display: flex;
  background: #090d16;
  border-bottom: 1px solid var(--border-color);
  padding: 4px 8px;
  gap: 6px;
}

.tab-media-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.tab-media-btn.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Visualizador Central do Carrossel */
.modal-galeria-viewer {
  position: relative;
  width: 100%;
  min-height: 280px;
  max-height: 52vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}

.modal-slide {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.modal-slide.hidden {
  display: none !important;
}

.modal-slide img {
  max-width: 100%;
  max-height: 50vh;
  object-fit: contain;
  user-select: none;
}

.modal-capa-indicator {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(245, 158, 11, 0.9);
  color: #0f172a;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.modal-video-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.modal-video-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.modal-local-video-player {
  width: 100%;
  max-height: 50vh;
  background: #000;
}

/* Botões do Carrossel (Anterior / Próximo) */
.btn-carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}

.btn-carousel-nav:hover {
  background: var(--color-emerald);
  color: #090d16;
  border-color: var(--color-emerald);
  transform: translateY(-50%) scale(1.05);
}

.btn-carousel-prev {
  left: 8px;
}

.btn-carousel-next {
  right: 8px;
}

.btn-carousel-nav:disabled {
  opacity: 0.2;
  cursor: not-allowed;
  pointer-events: none;
}

/* Barra de Ações Rápidas de Download no Modal */
.modal-media-actions-row {
  display: flex;
  gap: 8px;
  padding: 8px 14px;
  background: #090d16;
  border-top: 1px solid var(--border-color);
}

.btn-modal-download {
  flex: 1;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--color-blue);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
}

.btn-modal-download:hover, .btn-modal-download:active {
  background: var(--color-blue);
  color: #0f172a;
}

.btn-modal-download-all {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
  color: var(--color-emerald);
}

.btn-modal-download-all:hover, .btn-modal-download-all:active {
  background: var(--color-emerald);
  color: #0f172a;
}

/* Barra Inferior com Miniaturas */
.modal-galeria-thumbs {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid var(--border-color);
  overflow-x: auto;
  scrollbar-width: thin;
}

.modal-thumb-item {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: #090d16;
  transition: border-color 0.15s, transform 0.15s;
}

.modal-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-thumb-item.active {
  border-color: var(--color-emerald);
  transform: scale(1.05);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.modal-thumb-capa-badge {
  position: absolute;
  top: 1px;
  left: 1px;
  font-size: 8px;
  background: #f59e0b;
  color: #000;
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 800;
}

/* ==========================================================================
   TOASTS DE NOTIFICAÇÃO
   ========================================================================== */

.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 440px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--color-text-main);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.25s ease-out forwards;
}

.toast-success {
  border-left: 4px solid var(--color-emerald);
}

.toast-error {
  border-left: 4px solid var(--color-rose);
}

.toast-info {
  border-left: 4px solid var(--color-blue);
}

.toast.fade-out {
  animation: toastOut 0.25s ease-in forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-10px); }
}

/* Utilitários */
.hidden {
  display: none !important;
}

/* ==========================================================================
   ESTILOS ESPECIALIZADOS PARA LOJA DE CALÇADOS
   ========================================================================== */

/* Botão de Bipagem Rápida no Cabeçalho */
.btn-header-scan {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.3));
  border: 1px solid var(--color-emerald);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
  transition: transform 0.15s, background 0.2s;
}

.btn-header-scan:active {
  transform: scale(0.94);
}

.section-subtitle {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  display: block;
}

/* Linha de Formulário Dupla (Cor e Categoria lado a lado) */
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Seletor Tátil de Tamanhos / Grade */
.size-selection-group {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 16px;
}

.size-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.size-group-header label {
  margin-bottom: 0;
}

.size-grade-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-primary);
  padding: 2px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-grade-tab {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-grade-tab.active {
  background: var(--color-emerald);
  color: #090d16;
  font-weight: 700;
}

.size-input-wrapper {
  margin-bottom: 8px;
}

.input-size-display {
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
  color: var(--color-emerald);
  letter-spacing: 0.05em;
}

.size-pills-grid {
  display: none;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  animation: fadeIn 0.2s ease-out forwards;
}

.size-pills-grid.active {
  display: grid;
}

.size-pill {
  height: 42px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--color-text-main);
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s, border-color 0.15s;
  user-select: none;
}

.size-pill:active {
  transform: scale(0.92);
}

.size-pill.selected {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border-color: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.45);
}

/* Seletor de Modo de Visualização (Grade vs Lista) */
.view-mode-selector {
  display: flex;
  background: var(--bg-primary);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  gap: 2px;
}

.btn-view-mode {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.btn-view-mode.active {
  background: var(--color-emerald);
  color: #090d16;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

/* Dropdowns de Filtro Duplo */
.filter-dropdowns-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

/* Cards de Matriz de Grade (Modo Grade) */
.grade-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s;
}

.grade-card:hover {
  border-color: rgba(16, 185, 129, 0.4);
}

.grade-card-header {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.grade-header-info {
  flex: 1;
  min-width: 0;
}

.grade-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 4px;
}

.grade-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--color-text-main);
  line-height: 1.3;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grade-sku {
  font-size: 0.74rem;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.grade-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.grade-total-badge {
  font-size: 0.8rem;
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.grade-count-sizes {
  font-size: 0.72rem;
  color: var(--color-text-dim);
}

.grade-matrix-wrapper {
  background: var(--bg-primary);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.grade-matrix-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-dim);
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.grade-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.grade-size-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 62px;
  flex: 1 0 auto;
  max-width: 90px;
}

.chip-num {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--color-emerald);
}

.chip-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.btn-chip-step {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.btn-chip-step:active {
  background: var(--color-emerald);
  color: #000;
}

.chip-qty {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-text-main);
  min-width: 22px;
  text-align: center;
}

/* Badges Especializadas */
.badge-brand {
  font-size: 0.68rem;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.badge-color {
  font-size: 0.68rem;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.meta-size {
  background: rgba(16, 185, 129, 0.2);
  color: var(--color-emerald);
  font-weight: 700;
}

.card-badges-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* Scanner: Badge de Modo e HUD */
.scanner-mode-badge {
  font-size: 0.68rem;
  color: var(--color-text-dim);
  display: block;
}

.scanner-mode-badge.active {
  color: var(--color-emerald);
  font-weight: 700;
}

.scanner-hud {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid var(--color-emerald);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  gap: 12px;
  z-index: 25;
  animation: slideDown 0.25s ease-out forwards;
}

.scanner-hud.active {
  display: flex;
}

.scanner-hud.hud-alert {
  border-color: var(--color-amber);
}

.hud-icon {
  font-size: 1.5rem;
}

.hud-text {
  flex: 1;
  min-width: 0;
}

.hud-title {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-sub {
  display: block;
  font-size: 0.76rem;
  color: var(--color-emerald);
  font-weight: 600;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Switch Toggle no Scanner */
.switch-container {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.switch-container input[type="checkbox"] {
  display: none;
}

.switch-slider {
  width: 40px;
  height: 22px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  position: relative;
  transition: background-color 0.25s;
}

.switch-slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: white;
  top: 3px;
  left: 3px;
  transition: transform 0.25s;
}

.switch-container input:checked + .switch-slider {
  background-color: var(--color-emerald);
}

.switch-container input:checked + .switch-slider::before {
  transform: translateX(18px);
}

.switch-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
}

/* Relatórios Especializados de Calçados */
.highlight-card {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(145deg, var(--bg-card), rgba(16, 185, 129, 0.08));
}

.report-section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 14px;
}

.report-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 12px;
}

.curva-tamanhos-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.curva-size-bar {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 0 calc(25% - 8px);
  min-width: 80px;
}

.curva-size-bar.highlight {
  border-color: var(--color-emerald);
  background: rgba(16, 185, 129, 0.1);
}

.size-bubble {
  width: 28px;
  height: 28px;
  background: var(--color-emerald);
  color: #090d16;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.size-count-info {
  display: flex;
  flex-direction: column;
}

.size-count-info strong {
  font-size: 0.85rem;
  color: var(--color-text-main);
}

.size-count-info small {
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

.top-marcas-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.top-marca-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.top-marca-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.88rem;
}

.marca-rank {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--color-emerald);
  background: rgba(16, 185, 129, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
}

.top-marca-stats {
  font-size: 0.85rem;
}

.marca-pct {
  color: var(--color-text-muted);
  font-size: 0.75rem;
  margin-left: 4px;
}

.empty-note {
  font-size: 0.8rem;
  color: var(--color-text-dim);
  font-style: italic;
}

