/* ==========================================================================
   SISTEMA DE LISTAS POR ASSINATURA — ESTILOS COMPLETOS
   Reproduz exatamente o design original do ANEXO 1 (Lista de Compras)
   ========================================================================== */

:root {
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Cores Principais do ANEXO 1 */
  --purple-gradient-start: #2b1154;
  --purple-gradient-end: #1c0a38;
  --purple-hero-bg: #2b1154;
  --purple-subtitle: #d8b4fe;
  
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #ede9fe;
  
  --secondary: #64748b;
  --secondary-light: #f1f5f9;

  /* Cores de Status Estritas do ANEXO 1 */
  --status-pending-text: #dc2626;        /* Alaranjado avermelhado */
  --status-pending-bg: #fff7ed;
  --status-pending-border: #fca5a5;
  --status-pending-circle: #dc2626;

  --status-purchased-text: #16a34a;      /* Verde */
  --status-purchased-bg: #f0fdf4;
  --status-purchased-border: #86efac;
  --status-purchased-circle: #16a34a;

  --danger: #ef4444;
  --danger-hover: #dc2626;
  --warning: #f59e0b;
  --info: #0284c7;

  --bg-app: #f7f6fb;
  --bg-card: #ffffff;
  --text-main: #111827;
  --text-muted: #6b7280;
  --border-color: #e5e7eb;
  --border-light: #f3f4f6;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   TIPOGRAFIA E UTILITÁRIOS
   ========================================================================== */

h1, h2, h3, h4, h5 {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.25;
}

.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.font-semibold { font-weight: 600; }
.text-center { text-align: center; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.hidden { display: none !important; }

/* ==========================================================================
   CABEÇALHO GLOBAL (Admin e Navegação Geral)
   ========================================================================== */

.main-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.brand-icon {
  background: var(--primary);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.admin-nav-links {
  display: flex;
  gap: 0.5rem;
}

.nav-btn {
  background: transparent;
  border: none;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-btn:hover {
  background: var(--secondary-light);
  color: var(--text-main);
}

.nav-btn.active {
  background: #ede9fe;
  color: #4338ca;
}

.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
  border-left: 1px solid var(--border-color);
  padding-left: 1rem;
}

.user-name {
  font-weight: 600;
  font-size: 0.875rem;
}

/* ==========================================================================
   CONTEÚDO PRINCIPAL
   ========================================================================== */

.main-content {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.page-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.action-buttons-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   COMPONENTES: CARDS & TABELAS GERAIS
   ========================================================================== */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

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

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.table th {
  background: #f9fafb;
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.table tr:hover td {
  background-color: #fafbfc;
}

/* ==========================================================================
   BOTÕES E FORMULÁRIOS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}
.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: var(--secondary);
  color: white;
}
.btn-secondary:hover {
  background-color: #475569;
}

.btn-success {
  background-color: #16a34a;
  color: white;
}
.btn-success:hover {
  background-color: #15803d;
}

.btn-danger {
  background-color: var(--danger);
  color: white;
}

.btn-outline-primary {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}
.btn-outline-primary:hover {
  background: var(--primary-light);
}

.btn-outline-secondary {
  background: transparent;
  border-color: var(--border-color);
  color: var(--secondary);
}
.btn-outline-secondary:hover {
  background: var(--secondary-light);
  color: var(--text-main);
}

.btn-outline-danger {
  background: transparent;
  border-color: #fca5a5;
  color: var(--danger);
}
.btn-outline-danger:hover {
  background: #fef2f2;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.btn-block { width: 100%; }

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

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

.form-control {
  width: 100%;
  padding: 0.6rem 0.85rem;
  font-family: inherit;
  font-size: 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: #fff;
  color: var(--text-main);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.form-control-lg {
  padding: 0.75rem 1rem;
  font-size: 1.05rem;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  display: block;
}

.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.col-md-4 { flex: 1; min-width: 200px; }
.col-md-6 { flex: 1; min-width: 240px; }
.col-md-8 { flex: 2; min-width: 300px; }

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.form-check-input {
  margin-top: 0.25rem;
  accent-color: var(--primary);
}

/* ==========================================================================
   BADGES & PILLS
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-info { background: #e0f2fe; color: #0369a1; }
.badge-secondary { background: #f1f5f9; color: #475569; }

/* Barra de filtros de Admin */
.filter-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: white;
  border: 1px solid var(--border-color);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  min-width: 280px;
}

.search-box input {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.875rem;
  width: 100%;
}
.search-box input:focus { outline: none; }

.filter-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pill {
  border: 1px solid var(--border-color);
  background: white;
  color: var(--text-muted);
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* ==========================================================================
   TELA DE AUTENTICAÇÃO E SETUP
   ========================================================================== */

.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 100px);
  padding: 1rem;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
}

.auth-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-logo {
  width: 56px;
  height: 56px;
  background: #ede9fe;
  color: var(--primary);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-light);
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.alert-danger {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* ==========================================================================
   DASHBOARD ADMIN
   ========================================================================== */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.metric-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.metric-value {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1;
  margin-bottom: 0.35rem;
}

.metric-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.metric-success .metric-value { color: #16a34a; }
.metric-warning .metric-value { color: #f59e0b; }
.metric-danger .metric-value { color: #dc2626; }
.metric-info .metric-value { color: #0284c7; }

/* ==========================================================================
   ÁREA DO CLIENTE: MINHAS LISTAS
   ========================================================================== */

.subscription-banner {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.banner-icon { color: var(--primary); }

.lists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.list-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.list-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.list-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.list-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
}
.list-card-title:hover { color: var(--primary); }

.list-card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  flex: 1;
}

.list-card-stats {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 1rem;
}

.list-stat-item {
  display: flex;
  flex-direction: column;
}

.list-stat-item .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.list-stat-item .stat-val {
  font-weight: 700;
  font-size: 0.95rem;
}

.list-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==========================================================================
   TELA DE IMPORTAÇÃO (DROPZONE & OCR)
   ========================================================================== */

.import-card {
  max-width: 800px;
  margin: 0 auto;
}

.dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropzone:hover, .dropzone.drag-active {
  border-color: var(--primary);
  background: #ede9fe;
}

.dropzone-icon {
  color: var(--primary);
  margin-bottom: 1rem;
}

.selected-files-list {
  list-style: none;
  margin: 1rem 0;
}

.selected-files-list li {
  padding: 0.5rem 0.75rem;
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 1rem;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s ease;
}

.divider-text {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 2rem 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
}
.divider-text::before, .divider-text::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}
.divider-text::before { margin-right: 1em; }
.divider-text::after { margin-left: 1em; }

/* ==========================================================================
   TELA DE REVISÃO DOS ITENS ANTES DE SALVAR
   ========================================================================== */

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

.review-toolbar-left {
  display: flex;
  align-items: center;
  min-width: 170px;
}

.review-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.85rem;
  min-width: 250px;
  max-width: 360px;
  flex: 1;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.review-search-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.review-search-wrap svg {
  color: #9ca3af;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

.review-search-input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.875rem;
  width: 100%;
  color: var(--text-main);
  font-family: inherit;
}

.review-search-input::placeholder {
  color: #9ca3af;
}

.review-search-clear {
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.15s;
}

.review-search-clear:hover {
  color: var(--danger);
}

.review-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Painel retrátil de Diagnóstico e Rastreabilidade do OCR */
.diagnostics-preview-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.diagnostics-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: #166534;
}

.diagnostics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.diag-card {
  background: #ffffff;
  border: 1px solid #dcfce7;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.diag-card-num {
  font-size: 1.25rem;
  font-weight: 800;
  color: #166534;
  line-height: 1.2;
}

.diag-card-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-top: 2px;
}

.diag-card.diag-card-success .diag-card-num {
  color: #15803d;
}

.diag-card.diag-card-warning {
  border-color: #fef08a;
  background: #fefce8;
}

.diag-card.diag-card-warning .diag-card-num {
  color: #b45309;
}

.diag-details-list {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed #bbf7d0;
}

.diag-details-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #166534;
  margin-bottom: 0.35rem;
}

.diag-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.diag-tag {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.btn-outline-info {
  color: #0284c7;
  border-color: #bae6fd;
  background: #f0f9ff;
}

.btn-outline-info:hover {
  color: #0369a1;
  border-color: #7dd3fc;
  background: #e0f2fe;
}

/* Painel retrátil de prévia do texto bruto */
.raw-text-preview-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
}

.raw-text-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.825rem;
  color: #334155;
}

.raw-text-preview-content {
  width: 100%;
  height: 150px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.4;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 0.6rem;
  resize: vertical;
  color: #1e293b;
  white-space: pre-wrap;
}

/* Tabela de Revisão com Campos Espaçosos */
.review-table {
  min-width: 980px;
  width: 100%;
}

.review-table th,
.review-table td {
  padding: 0.55rem 0.65rem;
  vertical-align: middle;
}

.form-control-sm {
  padding: 0.45rem 0.65rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.review-input-name {
  min-width: 320px;
  width: 100%;
  font-weight: 500;
  color: #111827;
}

.review-input-name:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Chips de Sugestões Ortográficas (Apresentadas separadamente e nunca aplicadas silenciosamente) */
.suggestion-chip-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: #64748b;
}

.suggestion-chip-label {
  font-weight: 500;
  font-size: 0.72rem;
  color: #6b7280;
}

.btn-suggestion-chip {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #2563eb;
  padding: 1px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.btn-suggestion-chip:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

/* Alerta e Linhas Marcadas para Revisão Manual (Fidelidade ao OCR) */
.alert-review-warning {
  background-color: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  color: #92400e;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.review-row-warning {
  background-color: #fffbeb !important;
  border-left: 3px solid #f59e0b !important;
}

.badge-needs-review {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: #fef3c7;
  color: #b45309;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #fcd34d;
}

.card-footer-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

/* ==========================================================================
   EDITOR DE LISTAS — REPRODUÇÃO EXATA DO ANEXO 1
   ========================================================================== */

.editor-view {
  width: 100%;
}

/* Cabeçalho Roxo em Degradê (ANEXO 1) */
.editor-hero-header {
  background: linear-gradient(135deg, #2b1154 0%, #1a0836 100%);
  padding: 2.25rem 2rem;
  border-radius: var(--radius-lg);
  color: white;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 14px rgba(43, 17, 84, 0.25);
}

.editor-hero-container {
  max-width: 100%;
}

.editor-hero-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.btn-hero-back {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-hero-back:hover {
  background: rgba(255, 255, 255, 0.25);
}

.editor-hero-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.btn-hero-import {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 0.45rem 1.05rem;
  border-radius: var(--radius-md);
  font-size: 0.825rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  backdrop-filter: blur(4px);
}

.btn-hero-import:hover {
  background: rgba(255, 255, 255, 0.32);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-1px);
}

.btn-hero-add-title {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 0.45rem 1.05rem;
  border-radius: var(--radius-md);
  font-size: 0.825rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  backdrop-filter: blur(4px);
}

.btn-hero-add-title:hover {
  background: rgba(255, 255, 255, 0.32);
  border-color: rgba(255, 255, 255, 0.65);
  transform: translateY(-1px);
}

.alert-review-append {
  background: #ede9fe;
  color: #4c1d95;
  border: 1px solid #c4b5fd;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-hero-add {
  background: #ffffff;
  color: #2b1154;
  border: none;
  padding: 0.45rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.825rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}
.btn-hero-add:hover {
  background: #f3e8ff;
}

.editor-hero-title {
  font-size: 2rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.35rem;
  cursor: pointer;
  display: inline-block;
  line-height: 1.2;
}

.editor-hero-subtitle {
  font-size: 0.95rem;
  color: var(--purple-subtitle);
  font-weight: 400;
}

/* Indicadores Superiores: 4 Cartões Brancos (ANEXO 1) */
.editor-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.editor-metric-card {
  background: #ffffff;
  border: 1px solid #ebe5f5;
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.editor-metric-label {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
  margin-bottom: 6px;
}

.editor-metric-val {
  font-size: 1.75rem;
  font-weight: 800;
  color: #111827;
  line-height: 1;
}

/* Barra de Ferramentas (ANEXO 1) */
.editor-toolbar-box {
  background: #ffffff;
  border: 1px solid #ebe5f5;
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.editor-search-wrapper {
  flex: 1;
}

.editor-search-input {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 14px;
  color: #1f2937;
  background: #ffffff;
  outline: none;
  transition: border-color 0.15s;
}
.editor-search-input:focus {
  border-color: #4f46e5;
}

.editor-filter-wrapper {
  min-width: 160px;
}

.editor-filter-select {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 14px;
  color: #374151;
  background: #ffffff;
  outline: none;
  cursor: pointer;
}

.btn-print-purple {
  background: #ede9fe;
  color: #4338ca;
  border: none;
  border-radius: 8px;
  padding: 9px 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-print-purple:hover {
  background: #ddd6fe;
}

/* Seção / Categoria (ex: Lista geral, Oxalá, etc.) */
.editor-section-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 24px 0 12px;
  padding: 0 4px;
}

.editor-section-title {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
}

.editor-section-count {
  font-size: 13px;
  color: #6b7280;
  font-weight: 400;
}

/* ==========================================================================
   TÍTULOS EM NEGRITO ORGANIZACIONAIS (INSERIDOS PELO USUÁRIO)
   ========================================================================== */
.editor-section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: #f8fafc;
  border-left: 4px solid #6b21a8;
  border-radius: 6px;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.editor-section-header-content {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.editor-section-header-tag {
  font-size: 1rem;
  user-select: none;
}

.editor-section-header-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1e1b4b;
  letter-spacing: -0.01em;
}

.editor-section-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-sec-action {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  border-radius: 4px;
  height: 28px;
  min-width: 28px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.15s ease;
}

.btn-sec-action:hover {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #94a3b8;
}

.btn-sec-action.btn-sec-delete:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

/* ==========================================================================
   CARTÕES INDIVIDUAIS DE ITENS (ANEXO 1 & ANEXO 2)
   ========================================================================== */

.editor-cards-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 2rem;
}

.original-item-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.original-item-card:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

/* BORDA LATERAL OBRIGATÓRIA CONFORME O STATUS (ANEXO 1 & 2) */
.original-item-card.card-pending {
  border-left: 5px solid #dc2626 !important;
}

.original-item-card.card-purchased {
  border-left: 5px solid #16a34a !important;
  background: #fbfdfc;
}

/* Riscar automaticamente o nome do item marcado como Comprei */
.original-item-card.card-purchased .card-item-name {
  text-decoration: line-through !important;
  text-decoration-color: #16a34a !important;
  text-decoration-thickness: 2px !important;
  color: #4b5563 !important;
}

/* Quantidade com estilo sutil de concluída */
.original-item-card.card-purchased .card-qty-highlight {
  opacity: 0.85;
}

.original-item-card.card-purchased .card-qty-val {
  color: #15803d;
  background: #dcfce7;
  border-color: #bbf7d0;
}

/* Controles de Reordenação e Arraste (6 pontos e botões de mover) */
.card-reorder-controls {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-right: 4px;
  flex-shrink: 0;
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: #94a3b8;
  cursor: grab;
  user-select: none;
  touch-action: none;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.drag-handle:hover {
  color: #6b21a8;
  background: rgba(107, 33, 168, 0.08);
}

.drag-handle:active {
  cursor: grabbing;
}

.card-move-buttons {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.btn-card-move {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #64748b;
  border-radius: 3px;
  width: 17px;
  height: 12px;
  font-size: 7px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.12s ease;
}

.btn-card-move:hover {
  background: #ede9fe;
  color: #6b21a8;
  border-color: #c4b5fd;
}

/* Feedback visual durante arrastar e soltar */
.original-item-card.is-dragging,
.editor-section-header-row.is-dragging {
  opacity: 0.45;
  border: 2px dashed #9333ea !important;
  box-shadow: 0 4px 14px rgba(147, 51, 234, 0.18) !important;
}

.original-item-card.is-group-dragging {
  opacity: 0.55;
  background: #faf5ff !important;
  border-left-color: #a855f7 !important;
}

.original-item-card.drag-over-top,
.editor-section-header-row.drag-over-top {
  border-top: 3px solid #7e22ce !important;
}

.original-item-card.drag-over-bottom,
.editor-section-header-row.drag-over-bottom {
  border-bottom: 3px solid #7e22ce !important;
}

/* Linha Superior do Cartão */
.card-top-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: flex-start;
  gap: 20px;
}

/* Lado Esquerdo: Badge Sequencial + Nome e Quantidade */
.card-left-info {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.card-seq-badge {
  background: #ede9fe;
  color: #4338ca;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  padding: 3px 8px;
  font-family: monospace;
  letter-spacing: 0.03em;
  margin-top: 2px;
  line-height: 1.2;
}

.card-name-qty-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Destaque visual da quantidade ACIMA do nome do item */
.card-qty-highlight {
  display: flex;
  align-items: center;
  margin-bottom: 2px;
}

.card-qty-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 2px 8px;
  line-height: 1.25;
  transition: all 0.15s ease;
}

.original-item-card:hover .card-qty-badge {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

.card-qty-label {
  font-size: 11px;
  font-weight: 700;
  color: #475569; /* cinza escuro elegante */
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-qty-val {
  font-size: 13px;
  font-weight: 800;
  color: #4338ca; /* roxo/índigo de destaque harmonioso */
  background: #ede9fe;
  border: 1px solid #ddd6fe;
  padding: 1px 7px;
  border-radius: 4px;
  letter-spacing: 0.01em;
}

.card-item-name {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  line-height: 1.35;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

/* Linha do Nome com Botão de Edição */
.card-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Botão de Lápis para Edição Inline (discreto e elegante) */
.btn-edit-pencil {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  padding: 3px 5px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  line-height: 1;
}

.btn-edit-pencil:hover {
  color: #4338ca;
  background: #ede9fe;
}

/* Controles de Edição Inline de Nome e Quantidade */
.inline-edit-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 2px 0;
  flex-wrap: wrap;
}

.inline-edit-name-input {
  border: 1px solid #c7d2fe;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  background: #ffffff;
  outline: none;
  font-family: inherit;
  min-width: 200px;
  max-width: 380px;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.12);
  transition: border-color 0.15s;
}

.inline-edit-name-input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.inline-edit-qty-input {
  border: 1px solid #c7d2fe;
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 13px;
  font-weight: 700;
  color: #4338ca;
  background: #ffffff;
  outline: none;
  font-family: inherit;
  width: 110px;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.12);
  transition: border-color 0.15s;
}

.inline-edit-qty-input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.btn-inline-action {
  border: none;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  height: 26px;
  transition: all 0.15s ease;
}

.btn-inline-save {
  background: #16a34a;
  color: #ffffff;
}

.btn-inline-save:hover {
  background: #15803d;
}

.btn-inline-cancel {
  background: #f3f4f6;
  color: #4b5563;
  font-size: 15px;
}

.btn-inline-cancel:hover {
  background: #fee2e2;
  color: #dc2626;
}

.card-item-qty {
  font-size: 13px;
  color: #6b7280;
  margin-top: 2px;
  font-weight: 500;
}

/* Coluna Central: STATUS */
.card-status-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-col-label {
  font-size: 10px;
  font-weight: 700;
  color: #9ca3af;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: block;
}

.card-status-options {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Botões Circulares de Status */
.card-status-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 9999px;
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.card-status-btn input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Bolinha do Rádio */
.card-radio-circle {
  width: 14px;
  height: 14px;
  border: 2px solid #9ca3af;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  transition: all 0.15s ease;
}

/* Estado Não Selecionado */
.card-status-btn {
  background: transparent;
  border: 1px solid #e5e7eb;
  color: #6b7280;
}

/* ==========================================================================
   STATUS: PENDENTE (ANEXO 1: Alaranjado Avermelhado #dc2626)
   ========================================================================== */
.card-status-btn.btn-status-pending.is-selected,
.card-status-btn.btn-status-pending:has(input:checked) {
  background: #fff7ed !important;
  border-color: #fca5a5 !important;
  color: #dc2626 !important;
}

.card-status-btn.btn-status-pending.is-selected .card-radio-circle,
.card-status-btn.btn-status-pending:has(input:checked) .card-radio-circle {
  border-color: #dc2626 !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}

.card-status-btn.btn-status-pending.is-selected .card-radio-circle::after,
.card-status-btn.btn-status-pending:has(input:checked) .card-radio-circle::after {
  content: '';
  width: 6px;
  height: 6px;
  background: #dc2626;
  border-radius: 50%;
  display: block;
}

/* ==========================================================================
   STATUS: COMPREI (ANEXO 1 & 2: Verde #16a34a)
   ========================================================================== */
.card-status-btn.btn-status-purchased.is-selected,
.card-status-btn.btn-status-purchased:has(input:checked) {
  background: #f0fdf4 !important;
  border-color: #86efac !important;
  color: #16a34a !important;
}

.card-status-btn.btn-status-purchased.is-selected .card-radio-circle,
.card-status-btn.btn-status-purchased:has(input:checked) .card-radio-circle {
  border-color: #16a34a !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.15);
}

.card-status-btn.btn-status-purchased.is-selected .card-radio-circle::after,
.card-status-btn.btn-status-purchased:has(input:checked) .card-radio-circle::after {
  content: '';
  width: 6px;
  height: 6px;
  background: #16a34a;
  border-radius: 50%;
  display: block;
}

/* Coluna Direita: PREÇO (R$) */
.card-price-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-price-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-price-input {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  color: #374151;
  background: #ffffff;
  width: 100px;
  text-align: left;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s;
}
.card-price-input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.card-delete-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  color: #9ca3af;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s;
}
.card-delete-btn:hover {
  color: #dc2626;
}

/* Linha Inferior do Cartão: OBSERVAÇÕES */
.card-bottom-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.card-notes-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.card-notes-input {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  color: #374151;
  background: #ffffff;
  outline: none;
  transition: border-color 0.15s;
}
.card-notes-input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.card-save-indicator {
  position: absolute;
  right: 12px;
  font-size: 11px;
  font-weight: 700;
  color: #16a34a;
  background: #ffffff;
  padding: 0 4px;
}

/* ==========================================================================
   TELA DE ACESSO BLOQUEADO OU VENCIDO
   ========================================================================== */

.blocked-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  padding: 1.5rem;
}

.blocked-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  max-width: 520px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.blocked-icon-box {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #fef2f2;
  color: var(--danger);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.pix-payment-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 1.5rem 0;
  text-align: left;
}

.pix-key-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  margin-top: 0.5rem;
}

.pix-key-display code {
  font-family: monospace;
  font-weight: 700;
  color: var(--primary);
  font-size: 0.95rem;
}

.blocked-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ==========================================================================
   MODAIS
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal-dialog {
  background: white;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn 0.15s ease-out;
}

.modal-dialog-sm { max-width: 400px; }
.modal-dialog-md { max-width: 620px; }
.modal-dialog-lg { max-width: 760px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.modal-body { padding: 1.5rem; }

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: #f8fafc;
}

/* ==========================================================================
   TOAST / AVISOS
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--text-main);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: toastIn 0.2s ease;
}

.toast-success { background: #15803d; }
.toast-danger { background: #b91c1c; }
.toast-info { background: #0369a1; }

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

/* ==========================================================================
   LAYOUT DE IMPRESSÃO LIMPA (PRINT MEDIA)
   ========================================================================== */

@media print {
  body {
    background: white !important;
    color: black !important;
  }

  .main-header,
  .editor-hero-header,
  .editor-toolbar-box,
  .card-delete-btn,
  .btn,
  .modal-backdrop,
  .toast-container {
    display: none !important;
  }

  .main-content,
  .editor-main-body {
    max-width: 100% !important;
    padding: 0 !important;
  }

  .original-item-card {
    border: 1px solid #999 !important;
    box-shadow: none !important;
    padding: 8px 12px !important;
    break-inside: avoid;
    margin-bottom: 8px;
  }

  .card-top-row {
    grid-template-columns: 1fr auto auto;
    gap: 12px;
  }

  .card-price-input,
  .card-notes-input {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
  }

  /* Risco preservado na impressão para itens marcados como Comprei */
  .original-item-card.card-purchased .card-item-name {
    text-decoration: line-through !important;
    text-decoration-color: #000000 !important;
    text-decoration-thickness: 1.5px !important;
    color: #444444 !important;
  }

  .card-reorder-controls,
  .drag-handle,
  .card-move-buttons,
  .btn-card-move,
  .btn-edit-pencil,
  .inline-edit-wrap {
    display: none !important;
  }

  /* Formatação limpa de títulos organizadores na impressão */
  .editor-section-header-actions,
  .btn-sec-action,
  .no-print {
    display: none !important;
  }

  .editor-section-header-row {
    display: block !important;
    break-after: avoid !important;
    page-break-after: avoid !important;
    margin-top: 18px !important;
    margin-bottom: 8px !important;
    padding: 6px 0 !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 2px solid #000000 !important;
    box-shadow: none !important;
  }

  .editor-section-header-tag {
    display: none !important;
  }

  .editor-section-header-title {
    font-size: 14pt !important;
    font-weight: 800 !important;
    color: #000000 !important;
  }
}

/* ==========================================================================
   RESPONSIVIDADE (TABLETS E CELULARES)
   ========================================================================== */

@media (max-width: 860px) {
  .editor-metrics-grid {
    grid-template-columns: 1fr 1fr;
  }

  .card-top-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .card-status-col,
  .card-price-col {
    width: 100%;
  }

  .card-price-input {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    gap: 0.75rem;
  }

  .header-nav {
    width: 100%;
    justify-content: space-between;
  }

  .user-profile-menu {
    border-left: none;
    padding-left: 0;
  }

  .editor-toolbar-box {
    flex-direction: column;
    align-items: stretch;
  }

  .editor-filter-wrapper,
  .btn-print-purple {
    width: 100%;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .editor-hero-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .editor-hero-actions {
    display: flex;
    gap: 0.5rem;
    width: 100%;
  }

  .btn-hero-import,
  .btn-hero-add-title,
  .btn-hero-add {
    flex: 1;
    justify-content: center;
    text-align: center;
  }
}
