/* ═══════════════════════════════════════════════════════════════
   ML EXTRACT  —  Design System v2
   Dark premium theme · CSS Custom Properties · Mobile-first
═══════════════════════════════════════════════════════════════ */

/* ── Design tokens ────────────────────────────────────────── */
:root {
  --bg-base:     #080810;
  --bg-surface:  #10101a;
  --bg-card:     #14141f;
  --bg-raised:   #1c1c2c;
  --bg-input:    #1a1a2a;
  --bg-hover:    #22223a;
  --border-muted:  #232336;
  --border-soft:   #30304e;
  --border-accent: #7c3aed;
  --accent-1:  #7c3aed;
  --accent-2:  #a855f7;
  --accent-3:  #c084fc;
  --accent-dim: rgba(168,85,247,.15);
  --text-primary:   #eeeef8;
  --text-secondary: #9090b0;
  --text-muted:     #52526e;
  --text-accent:    #a855f7;
  --success-bg:  #0d2318;
  --success-fg:  #34d399;
  --success-bd:  #065f46;
  --warning-bg:  #1f1300;
  --warning-fg:  #fbbf24;
  --warning-bd:  #92400e;
  --danger-bg:   #1a0808;
  --danger-fg:   #f87171;
  --danger-bd:   #7f1d1d;
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  22px;
  --radius-pill: 999px;
  --shadow-sm:  0 2px 8px rgba(0,0,0,.35);
  --shadow-md:  0 4px 20px rgba(0,0,0,.5);
  --shadow-lg:  0 8px 40px rgba(0,0,0,.65);
  --shadow-glow: 0 0 20px rgba(124,58,237,.25);
  --ease: cubic-bezier(.4,0,.2,1);
  --dur-fast: 0.15s;
  --dur-base: 0.22s;
}

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

/* ── Base ─────────────────────────────────────────────────── */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.65;
  min-height: 100vh;
  background-image: radial-gradient(ellipse 80% 60% at 50% -20%,
    rgba(124,58,237,.08) 0%, transparent 70%);
  background-attachment: fixed;
}

/* ── Layout wrapper ───────────────────────────────────────── */
.container, .app-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

/* ── App header ───────────────────────────────────────────── */
header, .app-header {
  margin-bottom: 24px;
}

.header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

h1 {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #a855f7 0%, #c084fc 60%, #e879f9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 4px;
}

.header-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ── Navigation tabs ──────────────────────────────────────── */
.app-nav {
  display: flex;
  gap: 2px;
  margin: 20px 0 0;
  padding: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-lg);
}

.app-nav-item {
  flex: 1;
  background: none;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 9px 12px;
  cursor: pointer;
  transition: color var(--dur-base) var(--ease),
              background var(--dur-base) var(--ease);
  text-align: center;
  white-space: nowrap;
  font-family: inherit;
}
.app-nav-item:hover  { color: var(--text-primary); background: var(--bg-hover); }
.app-nav-item.active { background: var(--accent-1); color: #fff; font-weight: 600; box-shadow: var(--shadow-glow); }

.app-page { padding-top: 22px; }

/* ── Shared button base ───────────────────────────────────── */
button { font-family: inherit; font-size: inherit; cursor: pointer; }

/* ── Primary button ───────────────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 13px 20px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.97rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity var(--dur-base), transform var(--dur-fast), box-shadow var(--dur-base);
  box-shadow: 0 4px 14px rgba(124,58,237,.45);
  letter-spacing: 0.01em;
}
.btn-primary:hover    { opacity: .92; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(124,58,237,.55); }
.btn-primary:active   { transform: translateY(0); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Secondary button ─────────────────────────────────────── */
.btn-secondary {
  padding: 10px 20px;
  background: transparent;
  color: var(--text-accent);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0;
  transition: background var(--dur-base), color var(--dur-base),
              border-color var(--dur-base), box-shadow var(--dur-base);
  font-family: inherit;
}
.btn-secondary:hover    { background: var(--accent-dim); color: var(--accent-3); border-color: var(--accent-2); }
.btn-secondary:disabled { opacity: .45; cursor: not-allowed; }

/* ── Back button ──────────────────────────────────────────── */
.btn-voltar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: 0.88rem;
  cursor: pointer;
  margin-bottom: 18px;
  transition: border-color var(--dur-base), color var(--dur-base), background var(--dur-base);
  font-family: inherit;
}
.btn-voltar:hover { border-color: var(--accent-2); color: var(--accent-3); background: var(--accent-dim); }

/* ── Save / send / queue buttons ─────────────────────────── */
.btn-save {
  flex: 0 0 auto;
  padding: 11px 18px;
  background: var(--success-bg);
  border: 1px solid var(--success-bd);
  color: var(--success-fg);
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--dur-base), border-color var(--dur-base), box-shadow var(--dur-base);
  font-family: inherit;
}
.btn-save:hover    { background: #0f2e1e; border-color: #10b981; box-shadow: 0 0 12px rgba(16,185,129,.2); }
.btn-save:disabled { opacity: .45; cursor: not-allowed; }

.btn-send-now {
  padding: 11px 16px;
  background: var(--success-bg);
  border: 1px solid var(--success-bd);
  color: var(--success-fg);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--dur-base), box-shadow var(--dur-base);
  white-space: nowrap;
  font-family: inherit;
}
.btn-send-now:hover    { background: #0f2e1e; box-shadow: 0 0 14px rgba(16,185,129,.25); }
.btn-send-now:disabled { opacity: .45; cursor: not-allowed; }

.btn-add-queue {
  padding: 11px 16px;
  background: var(--warning-bg);
  border: 1px solid var(--warning-bd);
  color: var(--warning-fg);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--dur-base), box-shadow var(--dur-base);
  white-space: nowrap;
  font-family: inherit;
}
.btn-add-queue:hover    { background: #291500; box-shadow: 0 0 14px rgba(251,191,36,.18); }
.btn-add-queue:disabled { opacity: .45; cursor: not-allowed; }

/* ── Header action buttons ────────────────────────────────── */
.btn-salvos {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--dur-base), color var(--dur-base), background var(--dur-base);
  font-family: inherit;
}
.btn-salvos:hover { background: var(--bg-hover); border-color: var(--accent-2); color: var(--accent-3); }

.salvos-count {
  background: var(--accent-1);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  min-width: 20px;
  text-align: center;
}

.btn-config-vps {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--dur-base), color var(--dur-base), background var(--dur-base);
  font-family: inherit;
}
.btn-config-vps:hover { background: var(--bg-hover); border-color: var(--accent-2); color: var(--accent-3); }

/* ── Warning/Danger control buttons ──────────────────────── */
.btn-warning {
  background: transparent;
  border: 1px solid var(--warning-bd);
  color: var(--warning-fg);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  transition: background var(--dur-base);
  font-family: inherit;
}
.btn-warning:hover { background: var(--warning-bg); }

.btn-danger {
  background: transparent;
  border: 1px solid var(--danger-bd);
  color: var(--danger-fg);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  transition: background var(--dur-base);
  font-family: inherit;
}
.btn-danger:hover { background: var(--danger-bg); }

/* ── Form elements ────────────────────────────────────────── */
label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
}

input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.97rem;
  margin-bottom: 14px;
  transition: border-color var(--dur-base), box-shadow var(--dur-base);
  font-family: inherit;
}
input:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(168,85,247,.18);
}

textarea {
  width: 100%;
  padding: 13px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.93rem;
  resize: vertical;
  margin: 10px 0 0;
  font-family: inherit;
  line-height: 1.6;
  transition: border-color var(--dur-base);
}
textarea:focus          { outline: none; border-color: var(--accent-2); }
textarea:not([readonly]){ border-color: var(--accent-2); background: #1e1e30; }
textarea[readonly]      { cursor: pointer; }
textarea.editing        { border-color: var(--accent-2); background: #1e1e30; cursor: text; }

.label-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

/* ── Section cards ────────────────────────────────────────── */
.input-section {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  padding: 24px;
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.input-section--secondary {
  border-color: rgba(168,85,247,.22);
  background: #0e0e1a;
}

/* ── Loading ──────────────────────────────────────────────── */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border-soft);
  border-top-color: var(--accent-2);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error ────────────────────────────────────────────────── */
.erro {
  background: var(--danger-bg);
  color: var(--danger-fg);
  padding: 15px 18px;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--danger-fg);
  margin-bottom: 20px;
  font-size: 0.9rem;
}
.erro--social            { background: #130d1e; color: #d8b4fe; border-left-color: var(--accent-2); }
.erro--social strong     { display: block; font-size: 1rem; margin-bottom: 8px; color: #e9d5ff; }
.erro--social p          { margin-bottom: 10px; color: #c4b5fd; font-size: 0.92rem; }
.error-steps             { margin: 0 0 0 18px; }
.error-steps li          { margin-bottom: 7px; color: var(--text-secondary); font-size: 0.88rem; line-height: 1.5; }

/* ── Resultado / product area ─────────────────────────────── */
.resultado {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  padding: 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.product-card {
  display: flex;
  gap: 20px;
  margin-bottom: 22px;
  padding: 16px;
  background: var(--bg-raised);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
}

/* ── Product image wrap ───────────────────────────────────── */
.product-image {
  object-fit: contain;
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 6px;
  display: block;
}

.product-image-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.product-image-wrap {
  position: relative;
  width: 115px; height: 115px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-soft);
  transition: border-color var(--dur-base);
}
.product-image-wrap:hover { border-color: var(--accent-2); }

.product-image-wrap .product-image {
  width: 100%; height: 100%;
  object-fit: contain;
  background: #fff;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: block;
}

.thumbnail-upload { width: 115px; }
.btn-upload-thumb {
  width: 100%;
  background: var(--bg-card);
  color: var(--accent-2);
  border: 1px solid var(--border-accent);
  padding: 7px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  white-space: nowrap;
  text-align: center;
  font-family: inherit;
}
.btn-upload-thumb:hover {
  background: var(--accent-1);
  color: #fff;
  border-color: var(--accent-1);
}

/* ── Media section ────────────────────────────────────────── */
.media-section {
  background: var(--bg-raised);
  border-radius: var(--radius-md);
  padding: 12px;
  margin: 0 0 12px;
  border: 1px solid var(--border-soft);
}
.media-section > h4 {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 7px;
  max-height: 280px;
  overflow-y: auto;
  padding: 2px;
}
.media-grid::-webkit-scrollbar { width: 4px; }
.media-grid::-webkit-scrollbar-thumb { background: var(--border-soft); border-radius: 4px; }

.media-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.media-item:hover { transform: scale(1.04); border-color: var(--border-soft); }
.media-item.selected {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 2px rgba(168,85,247,.35);
  transform: scale(1.02);
  animation: pulse-select 0.6s ease-out;
}
@keyframes pulse-select {
  0%   { box-shadow: 0 0 0 0   rgba(168, 85, 247, 0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(168, 85, 247, 0);   }
  100% { box-shadow: 0 0 0 0   rgba(168, 85, 247, 0);   }
}
.media-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.media-check {
  position: absolute;
  bottom: 3px; right: 3px;
  background: var(--accent-1);
  color: #fff;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease);
}
.media-item.selected .media-check { opacity: 1; }
.media-empty {
  grid-column: 1/-1;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 20px 0;
}

/* .local-preview / .btn-confirm / .btn-cancel removidos — upload agora é direto sem confirmação */


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

.title-edit-row {
  display: flex; align-items: flex-start; gap: 6px; margin-bottom: 6px;
}
.title-edit-row h3, .product-info h3 {
  flex: 1;
  font-size: 0.97rem;
  line-height: 1.45;
  word-break: break-word;
  margin: 0 0 6px;
  color: var(--text-primary);
}
.title-edit-row h3 { margin: 0; }

.product-price { font-size: 1.4rem; color: var(--accent-2); font-weight: 800; margin: 6px 0; }
.price-current { font-size: 1.4rem; color: var(--accent-2); font-weight: 800; }
.price-original {
  display: inline-block;
  font-size: 0.85rem; color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 7px; vertical-align: middle;
}
.price-badge {
  display: inline-block;
  background: #2d1060; color: #d8b4fe;
  font-size: 0.7rem; font-weight: 700;
  padding: 2px 8px; border-radius: var(--radius-pill);
  margin-left: 7px; vertical-align: middle;
}
.product-link {
  color: var(--accent-2); text-decoration: none;
  font-size: 0.86rem; display: inline-block; margin-top: 6px;
  transition: color var(--dur-base);
}
.product-link:hover { color: var(--accent-3); text-decoration: underline; }

/* ── Edit btns ────────────────────────────────────────────── */
.edit-btn {
  background: none; border: none; cursor: pointer;
  font-size: 0.9rem; padding: 2px 4px; opacity: .5;
  transition: opacity var(--dur-fast); flex-shrink: 0; line-height: 1; margin-top: 1px;
}
.edit-btn:hover { opacity: 1; }

.title-input {
  flex: 1;
  padding: 6px 10px;
  background: var(--bg-hover);
  border: 1px solid var(--accent-2);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.93rem;
  margin-bottom: 0 !important;
  width: auto !important;
  font-family: inherit;
}
.title-input:focus { outline: none; box-shadow: 0 0 0 2px rgba(168,85,247,.25); }

/* ── Phrase picker ────────────────────────────────────────── */
.phrase-picker-section { margin-bottom: 18px; }
.phrase-picker-section > label {
  display: block; margin-bottom: 8px;
  color: var(--text-secondary); font-weight: 600; font-size: 0.88rem;
}

.phrase-picker {
  display: flex; flex-wrap: wrap; gap: 6px;
  max-height: 152px; overflow-y: auto; padding: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-1) var(--bg-card);
}
.phrase-picker::-webkit-scrollbar       { width: 4px; }
.phrase-picker::-webkit-scrollbar-track { background: var(--bg-card); }
.phrase-picker::-webkit-scrollbar-thumb { background: var(--accent-1); border-radius: 4px; }

.phrase-chip {
  padding: 5px 13px;
  background: var(--bg-raised);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--dur-fast);
  white-space: nowrap;
  line-height: 1.45;
  font-family: inherit;
}
.phrase-chip:hover  { border-color: var(--accent-2); color: var(--accent-3); background: var(--accent-dim); }
.phrase-chip.active { background: var(--accent-1); border-color: var(--accent-1); color: #fff; font-weight: 600; }

/* ── Message section ──────────────────────────────────────── */
.message-section { margin-top: 20px; }
.message-section label { margin-bottom: 4px; color: var(--text-secondary); font-size: 0.88rem; font-weight: 500; }

.msg-label-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.msg-label-row label { flex: 1; margin-bottom: 0; }

.msg-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.msg-actions .btn-secondary { flex: 1; margin-top: 0; }

/* ── VPS config panel ─────────────────────────────────────── */
.vps-config-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  margin-bottom: 22px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
/* Quando o painel VPS está isolado (nav oculta), remove bordas de card
   para parecer uma página completa */
.vps-config-panel:only-child,
.app-nav[style*="none"] + .vps-config-panel {
  border: none;
  box-shadow: none;
  background: transparent;
  margin-bottom: 0;
}
.vps-config-inner {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.vps-config-inner h3 { font-size: 0.98rem; color: var(--accent-3); margin-bottom: 2px; font-weight: 700; }
.vps-config-inner label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 0.85rem; color: var(--text-secondary); font-weight: 500;
}
.vps-config-inner input[type="url"],
.vps-config-inner input[type="text"] {
  background: var(--bg-input); border: 1px solid var(--border-muted);
  border-radius: var(--radius-md); color: var(--text-primary);
  padding: 10px 12px; font-size: 0.9rem;
  transition: border-color var(--dur-base);
  width: 100%; font-family: inherit; margin-bottom: 0;
}
.vps-config-inner input:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(168,85,247,.15); }

.vps-config-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.vps-test-result {
  font-size: 0.86rem; padding: 9px 14px;
  border-radius: var(--radius-md); min-height: 36px;
  display: flex; align-items: center;
}
.vps-test-result.vps-ok  { background: var(--success-bg); color: var(--success-fg); border: 1px solid var(--success-bd); }
.vps-test-result.vps-warn{ background: var(--warning-bg); color: var(--warning-fg); border: 1px solid var(--warning-bd); }
.vps-test-result.vps-err { background: var(--danger-bg);  color: var(--danger-fg);  border: 1px solid var(--danger-bd); }

/* ── Backup section ───────────────────────────────────────── */
.config-section {
  margin-top: 18px; padding-top: 18px;
  border-top: 1px solid var(--border-muted);
}
.config-section h4 { margin: 0 0 14px; font-size: 0.9rem; color: var(--accent-2); font-weight: 600; }
.config-section h5 { margin: 12px 0 8px; font-size: 0.84rem; color: var(--text-secondary); font-weight: 600; }

.backup-controls { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

.backup-list {
  background: var(--bg-raised);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.backup-list ul { list-style: none; padding: 0; margin: 0; }
.backup-list li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--border-muted);
  font-size: 0.83rem; color: var(--text-secondary);
}
.backup-list li:last-child { border-bottom: none; }

.restore-section {
  background: var(--bg-raised);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  padding: 14px;
}
.restore-section input[type="file"] {
  display: block; width: 100%; padding: 8px;
  background: var(--bg-input); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); color: var(--text-secondary);
  font-size: 0.83rem; margin: 8px 0 10px;
}
.warning-text { color: var(--warning-fg); font-size: 0.8rem; margin: 8px 0 0; }

/* ── Fila page ────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px; flex-wrap: wrap; gap: 12px;
}
.page-header h2 { margin: 0; font-size: 1.25rem; color: var(--text-primary); font-weight: 700; }
.fila-controls  { display: flex; gap: 8px; flex-wrap: wrap; }

.fila-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  padding: 16px 12px;
  border-radius: var(--radius-md);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur-base);
}
.stat-card:hover { border-color: var(--border-soft); }

.stat-label {
  display: block; color: var(--text-muted); font-size: 0.75rem;
  margin-bottom: 7px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.stat-value { font-size: 1.7rem; font-weight: 800; color: var(--accent-2); line-height: 1; }

.priority-indicator {
  display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(90deg, #1a062e 0%, #1a1a2e 100%);
  border: 1px solid #3a1070;
  padding: 10px 16px; border-radius: var(--radius-md);
  margin-bottom: 18px; color: var(--text-secondary); font-size: 0.88rem; gap: 12px;
}

.fila-table-wrap { overflow-x: auto; border-radius: var(--radius-md); }

.fila-table {
  width: 100%; border-collapse: collapse; font-size: 0.88rem;
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.fila-table th {
  text-align: left; padding: 11px 14px;
  background: #160830;
  color: var(--accent-2); font-weight: 600; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-soft);
}
.fila-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-muted);
  vertical-align: middle;
  color: var(--text-secondary);
}
.fila-table tr:last-child td { border-bottom: none; }
.fila-table tr:hover td      { background: var(--bg-hover); }

.fila-produto           { display: flex; align-items: center; gap: 10px; max-width: 260px; }
.fila-thumbnail         { width: 46px; height: 46px; object-fit: cover; border-radius: var(--radius-sm); flex-shrink: 0; background: var(--bg-raised); border: 1px solid var(--border-soft); }
.fila-thumbnail-placeholder { width: 46px; height: 46px; flex-shrink: 0; background: var(--bg-raised); border-radius: var(--radius-sm); border: 1px solid var(--border-soft); }
.fila-titulo            { flex: 1; font-size: 0.85rem; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.status-badge   { padding: 3px 9px; border-radius: var(--radius-pill); font-size: 0.78rem; font-weight: 600; white-space: nowrap; }
.status-pending { background: #1f1000; color: var(--warning-fg); }
.status-failed  { background: var(--danger-bg); color: var(--danger-fg); }
.status-sent    { background: #001f11; color: var(--success-fg); }

.btn-icon {
  background: none; border: none; font-size: 1.05rem; cursor: pointer;
  padding: 4px 7px; border-radius: var(--radius-sm);
  color: var(--text-muted); transition: background var(--dur-fast), color var(--dur-fast);
  font-family: inherit;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }

.empty-fila {
  text-align: center; padding: 52px 24px;
  background: var(--bg-card); border: 1px solid var(--border-muted);
  border-radius: var(--radius-md); color: var(--text-muted);
  margin-top: 10px; font-size: 1rem;
}

/* ── Relatorios page ──────────────────────────────────────── */
.stats-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 16px; margin-bottom: 20px;
}
.stat-card-large {
  background: var(--bg-card); border: 1px solid var(--border-muted);
  padding: 22px; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.stat-card-large h3 { margin: 0 0 10px; color: var(--accent-2); font-size: 0.9rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.big-number  { font-size: 2.8rem; font-weight: 800; color: var(--accent-2); line-height: 1; }
.small-text  { font-size: 0.82rem; color: var(--text-muted); margin-top: 5px; }

.progress-bar  { width: 100%; height: 7px; background: var(--bg-raised); border-radius: var(--radius-pill); margin-top: 14px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent-1), var(--accent-2)); border-radius: var(--radius-pill); transition: width .4s var(--ease); }

.distrib-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--border-muted);
  font-size: 0.86rem; color: var(--text-secondary);
}
.distrib-item:last-child { border-bottom: none; }
.distrib-val { font-weight: 700; color: var(--accent-2); }

.chart-container {
  background: var(--bg-card); border: 1px solid var(--border-muted);
  padding: 20px; border-radius: var(--radius-lg);
  position: relative; box-shadow: var(--shadow-sm);
}
.chart-container h3    { margin: 0 0 14px; font-size: 0.88rem; color: var(--text-muted); font-weight: 500; }
.chart-container canvas { max-height: 230px; }

/* ── Toast ────────────────────────────────────────────────── */
.saved-toast {
  position: fixed; bottom: 28px; right: 28px;
  background: #065f46; border: 1px solid var(--success-bd); color: var(--success-fg);
  padding: 10px 22px; border-radius: var(--radius-pill);
  font-size: 0.88rem; font-weight: 700;
  box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity var(--dur-base), transform var(--dur-base);
  z-index: 9999;
}
.saved-toast.visible { opacity: 1; transform: translateY(0); }

/* ── Salvos sidebar ───────────────────────────────────────── */
.salvos-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  z-index: 900;
}
.salvos-overlay.open { display: block; }

.salvos-sidebar {
  position: fixed; top: 0; right: 0;
  height: 100vh; width: 360px; max-width: 95vw;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-soft);
  z-index: 1000; display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.26s var(--ease);
  box-shadow: var(--shadow-lg);
}
.salvos-sidebar.open { transform: translateX(0); }

.salvos-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--border-muted);
  font-size: 0.98rem; font-weight: 700; color: var(--accent-3); flex-shrink: 0;
}
.salvos-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 1.1rem; cursor: pointer; padding: 4px 6px;
  border-radius: var(--radius-sm); line-height: 1;
  transition: color var(--dur-fast), background var(--dur-fast);
  font-family: inherit;
}
.salvos-close:hover { color: var(--text-primary); background: var(--bg-hover); }

.salvos-list {
  flex: 1; overflow-y: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-1) var(--bg-surface);
}
.salvos-empty { color: var(--text-muted); text-align: center; margin-top: 40px; font-size: 0.9rem; }

/* ── Save card ────────────────────────────────────────────── */
.save-card {
  display: flex; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border-muted);
  border-radius: var(--radius-md); padding: 12px;
  transition: border-color var(--dur-base), box-shadow var(--dur-base);
}
.save-card:hover { border-color: var(--border-accent); box-shadow: 0 0 12px rgba(124,58,237,.15); }

.save-card-media {
  width: 66px; height: 66px; flex-shrink: 0;
  border-radius: var(--radius-sm); overflow: hidden;
  background: var(--bg-raised);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.save-card-media img       { width: 100%; height: 100%; object-fit: cover; }
.save-vid-icon, .save-no-media { font-size: 1.5rem; color: var(--text-muted); }

.save-vid-badge {
  position: absolute; bottom: 4px; right: 4px;
  background: rgba(0,0,0,.6); color: #fff;
  font-size: 0.62rem; line-height: 1; padding: 2px 5px;
  border-radius: 4px; pointer-events: none;
}

.save-card-body    { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.save-card-title   { font-size: 0.8rem; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.save-card-date    { font-size: 0.7rem; color: var(--text-muted); }
.save-card-msg     { font-size: 0.72rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 5px; }
.save-card-actions { display: flex; gap: 6px; }

.btn-sc-copy {
  flex: 1; padding: 5px 0;
  background: var(--bg-raised); border: 1px solid var(--border-soft);
  color: var(--accent-3); font-size: 0.72rem; font-weight: 600;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: background var(--dur-fast), border-color var(--dur-fast);
  font-family: inherit;
}
.btn-sc-copy:hover { background: var(--accent-dim); border-color: var(--accent-2); }

.btn-sc-del {
  padding: 5px 9px;
  background: var(--danger-bg); border: 1px solid var(--danger-bd); color: var(--danger-fg);
  font-size: 0.78rem; border-radius: var(--radius-sm); cursor: pointer;
  transition: background var(--dur-fast); font-family: inherit;
}
.btn-sc-del:hover { background: #260808; }

/* ── Media modal ──────────────────────────────────────────── */
.media-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 16px;
}
.media-modal-box {
  background: var(--bg-card); border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 600px; max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.media-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border-muted);
  font-weight: 700; color: var(--accent-3); font-size: 0.93rem;
}
.media-modal-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 1.1rem; cursor: pointer; padding: 0 4px; line-height: 1;
  transition: color var(--dur-fast); font-family: inherit;
}
.media-modal-close:hover { color: var(--text-primary); }

.media-modal-preview {
  background: #0a0a12; display: flex; align-items: center; justify-content: center;
  min-height: 260px; max-height: 340px; overflow: hidden;
}
.media-modal-preview img    { max-width: 100%; max-height: 340px; object-fit: contain; display: block; }
.media-modal-preview iframe { width: 100%; height: 315px; border: none; display: block; }

.media-modal-grid {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 14px; overflow-y: auto; max-height: 180px;
  scrollbar-width: thin; scrollbar-color: var(--accent-1) var(--bg-card);
}
.media-modal-grid::-webkit-scrollbar       { width: 4px; height: 4px; }
.media-modal-grid::-webkit-scrollbar-track { background: var(--bg-card); }
.media-modal-grid::-webkit-scrollbar-thumb { background: var(--accent-1); border-radius: 4px; }

.mgrid-item {
  position: relative; width: 86px;
  border-radius: var(--radius-sm); overflow: hidden;
  border: 2px solid var(--border-muted);
  cursor: pointer; background: var(--bg-raised); flex-shrink: 0;
  transition: border-color var(--dur-fast), transform var(--dur-fast);
}
.mgrid-item:hover  { border-color: var(--accent-1); transform: scale(1.04); }
.mgrid-item.active { border-color: var(--accent-2); box-shadow: 0 0 0 2px rgba(168,85,247,.35); }
.mgrid-item img    { width: 100%; height: 64px; object-fit: cover; display: block; }
.mgrid-item span   { display: block; text-align: center; font-size: 0.66rem; color: var(--text-muted); padding: 3px 0; background: #0f0f1a; }
.mgrid-item.active span { color: var(--accent-3); }

.mgrid-play {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, calc(-50% - 7px));
  width: 24px; height: 24px;
  background: rgba(0,0,0,.65); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem; color: #fff; pointer-events: none;
}

.media-modal-foot { padding: 12px 18px; border-top: 1px solid var(--border-muted); display: flex; justify-content: flex-end; }
.media-modal-foot .btn-primary { width: auto; padding: 10px 28px; }

/* ── Login screen ────────────────────────────────────────── */
.login-screen {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100vh;
  background: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
  background-image: radial-gradient(ellipse 70% 50% at 50% 0%,
    rgba(124,58,237,.12) 0%, transparent 70%);
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  padding: 44px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(124,58,237,.12);
  animation: loginFadeIn .4s var(--ease);
}

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

.login-header {
  text-align: center;
  margin-bottom: 36px;
}
.login-header h1 {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #a855f7 0%, #c084fc 60%, #e879f9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}
.login-header p { color: var(--text-muted); font-size: 0.9rem; }

.login-body { margin-bottom: 22px; }

.login-input-group {
  margin-bottom: 20px;
}
.login-input-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
}
.login-input-group input {
  width: 100%;
  padding: 13px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  text-align: center;
  letter-spacing: 3px;
  transition: border-color var(--dur-base), box-shadow var(--dur-base);
  margin-bottom: 0;
  font-family: monospace;
}
.login-input-group input:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(168,85,247,.2);
}

.login-body .btn-primary {
  margin-top: 0;
}

.login-error {
  background: rgba(239,68,68,.08);
  color: var(--danger-fg);
  border: 1px solid var(--danger-bd);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  margin-top: 14px;
  text-align: center;
  font-size: 0.88rem;
  animation: loginFadeIn .2s var(--ease);
}

.login-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border-muted);
  padding-top: 18px;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .container, .app-container { padding: 20px 14px 50px; }
  h1 { font-size: 1.6rem; }
  .header-top  { flex-wrap: wrap; }
  .fila-stats  { grid-template-columns: repeat(2, 1fr); }
  .stats-grid  { grid-template-columns: 1fr; }
  .fila-table  { font-size: 0.8rem; }
  .fila-controls { flex-wrap: wrap; }
  .app-nav-item  { padding: 8px 10px; font-size: 0.82rem; }
  .product-card  { flex-direction: column; align-items: center; text-align: center; }
  .product-image-wrap { width: 130px; height: 130px; }
  .msg-actions   { flex-direction: column; }
  .msg-actions .btn-secondary { flex: none; }
  .priority-indicator { flex-direction: column; gap: 4px; text-align: center; }
}
