/* ==========================================================================
   PDF Merger Pro - Design System & Modern Glassmorphism Styling
   ========================================================================== */

:root {
  --font-primary: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Color Tokens */
  --bg-main: #090D16;
  --bg-card: rgba(17, 24, 39, 0.72);
  --bg-card-hover: rgba(26, 36, 56, 0.85);
  --bg-card-elevated: rgba(30, 41, 59, 0.8);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(99, 102, 241, 0.4);
  --border-glow: rgba(99, 102, 241, 0.6);

  /* Brand Accents */
  --accent-primary: #6366F1;
  --accent-secondary: #8B5CF6;
  --accent-cyan: #06B6D4;
  --accent-pink: #EC4899;
  --accent-emerald: #10B981;
  --accent-amber: #F59E0B;
  --accent-rose: #F43F5E;

  /* Typography Colors */
  --text-main: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-inverse: #0F172A;

  /* Shadow & Glow */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
  --glow-primary: 0 0 25px rgba(99, 102, 241, 0.35);

  /* Layout */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* Background Ambient Glows */
.background-glows {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.45;
  animation: pulseGlow 12s ease-in-out infinite alternate;
}

.glow-1 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, #6366F1, transparent 70%);
  top: -100px;
  left: 10%;
}

.glow-2 {
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, #EC4899, transparent 70%);
  top: 25%;
  right: -100px;
  animation-delay: -4s;
}

.glow-3 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #06B6D4, transparent 70%);
  bottom: -150px;
  left: 20%;
  animation-delay: -8s;
}

@keyframes pulseGlow {
  0% { transform: scale(1) translate(0, 0); opacity: 0.35; }
  50% { transform: scale(1.15) translate(30px, -20px); opacity: 0.55; }
  100% { transform: scale(0.95) translate(-20px, 30px); opacity: 0.4; }
}

/* Layout Container */
.app-layout {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.app-header {
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(9, 13, 22, 0.7);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 50;
}

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

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

.logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(236, 72, 153, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
  transition: transform var(--transition-fast);
}

.logo-icon:hover {
  transform: rotate(5deg) scale(1.05);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.badge-pro {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  background: linear-gradient(135deg, #EC4899, #F43F5E);
  color: #FFFFFF;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.brand-tagline {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

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

.pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
}

.pill-green {
  color: #34D399;
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.08);
}

.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #34D399;
  box-shadow: 0 0 8px #34D399;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.pill-blue {
  color: #38BDF8;
  border-color: rgba(56, 189, 248, 0.3);
  background: rgba(56, 189, 248, 0.08);
}

.pill-purple {
  color: #C084FC;
  border-color: rgba(192, 132, 252, 0.3);
  background: rgba(192, 132, 252, 0.08);
}

/* Main Container */
.main-container {
  max-width: 980px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
  width: 100%;
  flex: 1;
}

/* Hero Section */
.hero-section {
  text-align: center;
  margin-bottom: 2.5rem;
}

.hero-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  background: linear-gradient(135deg, #FFFFFF 30%, #94A3B8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto;
  font-weight: 400;
}

/* Card Workspace */
.card-workspace {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.04);
  padding: 2.25rem;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition-normal);
}

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

/* Dropzone */
.dropzone-area {
  border: 2px dashed rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  padding: 3.5rem 2rem;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.015);
  transition: all var(--transition-normal);
  position: relative;
}

.dropzone-area:hover, .dropzone-area.dragover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.05);
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.18) inset;
  transform: translateY(-2px);
}

.file-input-hidden {
  display: none;
}

.dropzone-icon-wrapper {
  width: 76px;
  height: 76px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(6, 182, 212, 0.15));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.2);
  transition: transform var(--transition-normal), color var(--transition-normal);
}

.dropzone-area:hover .dropzone-icon-wrapper,
.dropzone-area.dragover .dropzone-icon-wrapper {
  transform: scale(1.1) translateY(-4px);
  color: #38BDF8;
}

.dropzone-heading {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.dropzone-sub {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.dropzone-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

.dropzone-badge {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Files Stage */
.files-stage {
  animation: fadeIn 0.3s ease;
}

.files-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 1rem;
}

.files-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.files-counter {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  background: rgba(99, 102, 241, 0.15);
  color: #A5B4FC;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-full);
}

.files-instruction {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.files-actions-top {
  display: flex;
  gap: 0.6rem;
}

/* File List & Items */
.file-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 0.35rem;
}

.file-list::-webkit-scrollbar {
  width: 6px;
}
.file-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}
.file-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  transition: all var(--transition-fast);
  cursor: grab;
  user-select: none;
}

.file-item:active {
  cursor: grabbing;
}

.file-item:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateX(2px);
}

.file-item.dragging {
  opacity: 0.4;
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
}

.file-item-left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
  flex: 1;
}

.drag-handle {
  color: var(--text-muted);
  cursor: grab;
  display: flex;
  align-items: center;
  padding: 0.2rem;
}
.drag-handle:hover {
  color: var(--text-main);
}

.file-order-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.file-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(249, 115, 22, 0.2));
  border: 1px solid rgba(239, 68, 68, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #F87171;
  flex-shrink: 0;
}

.file-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.menu-title-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 520px;
}

.menu-label-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: #A5B4FC;
  background: rgba(99, 102, 241, 0.2);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.menu-title-input {
  flex: 1;
  font-family: var(--font-primary);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  outline: none;
  transition: all var(--transition-fast);
}

.menu-title-input:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.menu-title-input:focus {
  background: rgba(15, 23, 42, 0.9);
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.file-meta-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.file-original-name {
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.meta-separator {
  color: rgba(255, 255, 255, 0.15);
}

.file-size {
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.file-badge-pages {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.12);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.file-item-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  margin-left: 1rem;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.btn-icon-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
  border-color: rgba(239, 68, 68, 0.3);
}

/* Options Panel */
.options-panel {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.option-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.input-with-suffix {
  display: flex;
  align-items: center;
  max-width: 480px;
  position: relative;
}

.text-input {
  width: 100%;
  padding: 0.75rem 1rem;
  padding-right: 3.5rem;
  font-family: var(--font-primary);
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.text-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.input-suffix {
  position: absolute;
  right: 1rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  pointer-events: none;
}

.toggles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.toggle-control {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  cursor: pointer;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: background var(--transition-fast);
}

.toggle-control:hover {
  background: rgba(255, 255, 255, 0.05);
}

.toggle-control input[type="checkbox"] {
  display: none;
}

.toggle-switch {
  width: 40px;
  height: 22px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  position: relative;
  transition: background var(--transition-fast);
  flex-shrink: 0;
  margin-top: 2px;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #FFFFFF;
  border-radius: 50%;
  transition: transform var(--transition-fast);
}

.toggle-control input[type="checkbox"]:checked + .toggle-switch {
  background: var(--accent-primary);
}

.toggle-control input[type="checkbox"]:checked + .toggle-switch::after {
  transform: translateX(18px);
}

.toggle-label-group {
  display: flex;
  flex-direction: column;
}

.toggle-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.toggle-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 0.15rem;
}

/* Action Footer */
.action-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 1rem;
}

.summary-info {
  display: flex;
  flex-direction: column;
}

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

.summary-value {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: #38BDF8;
}

/* Buttons */
.btn {
  font-family: var(--font-primary);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.6);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

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

.btn-danger-hover:hover {
  color: #EF4444;
  background: rgba(239, 68, 68, 0.1);
}

.btn-sm {
  font-size: 0.82rem;
  padding: 0.45rem 0.85rem;
}

.btn-lg {
  font-size: 1.05rem;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-md);
}

/* Processing Stage */
.processing-stage {
  padding: 4rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeIn 0.4s ease;
}

.processing-spinner-box {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
}

.pulse-ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px solid rgba(99, 102, 241, 0.4);
  animation: pulseRing 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulseRing {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}

.spinner-core {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(236, 72, 153, 0.2));
  border: 1px solid rgba(99, 102, 241, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
}

.spin-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.processing-title {
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.processing-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.progress-bar-container {
  width: 100%;
  max-width: 480px;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  margin-bottom: 0.5rem;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6366F1, #EC4899, #38BDF8);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.6);
}

.progress-percentage {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: #A5B4FC;
  margin-bottom: 2rem;
}

.processing-steps {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  text-align: left;
  max-width: 460px;
  width: 100%;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.step-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  transition: all var(--transition-fast);
}

.step-bullet {
  font-weight: 700;
  font-size: 0.9rem;
}

.step-item.step-completed {
  color: #34D399;
}

.step-item.step-active {
  color: #FFFFFF;
  background: rgba(99, 102, 241, 0.12);
  font-weight: 600;
}

/* Result Stage */
.result-stage {
  padding: 3rem 1.5rem;
  text-align: center;
  animation: fadeIn 0.4s ease;
}

.success-icon-badge {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34D399;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
  animation: bounceSuccess 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounceSuccess {
  0% { transform: scale(0.3); opacity: 0; }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.result-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.result-filename {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: #38BDF8;
  margin-bottom: 2rem;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  max-width: 680px;
  margin: 0 auto 2.5rem;
}

.metric-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.metric-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-val {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
}

.text-gradient {
  background: linear-gradient(135deg, #38BDF8, #818CF8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.result-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Technical Features Section */
.features-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 3.5rem;
}

.feature-card {
  background: rgba(17, 24, 39, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  backdrop-filter: blur(12px);
  transition: transform var(--transition-normal), border-color var(--transition-normal);
}

.feature-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.15);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.15rem;
}

.icon-cyan {
  background: rgba(6, 182, 212, 0.15);
  color: #22D3EE;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.icon-violet {
  background: rgba(139, 92, 246, 0.15);
  color: #A78BFA;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.icon-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.feature-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.feature-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Modal Preview */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}

.modal-container {
  width: 100%;
  max-width: 1000px;
  height: 85vh;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.modal-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(17, 24, 39, 0.95);
}

.modal-title-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #38BDF8;
  background: rgba(56, 189, 248, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-body {
  flex: 1;
  background: #0B0F19;
}

.pdf-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 400px;
  background: #1E293B;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.15rem;
  box-shadow: var(--shadow-md);
  font-size: 0.88rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideInRight 0.25s ease, fadeOut 0.25s ease 3.75s forwards;
}

.toast-success {
  border-left: 4px solid #34D399;
}

.toast-error {
  border-left: 4px solid #EF4444;
}

.toast-info {
  border-left: 4px solid #38BDF8;
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 2rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  background: rgba(9, 13, 22, 0.6);
}

/* Utilities & Animations */
.hidden {
  display: none !important;
}

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

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateY(10px); }
}

/* Responsive */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    gap: 0.85rem;
    align-items: flex-start;
  }
  .system-pills {
    display: none;
  }
  .card-workspace {
    padding: 1.25rem;
  }
  .file-name {
    max-width: 180px;
  }
  .action-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-primary.btn-lg {
    width: 100%;
  }
}

/* ==========================================================================
   Pílula de Sugestões no Header
   ========================================================================== */
.pill-cyan {
  color: #38BDF8;
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.08);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.pill-cyan:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.6);
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
  color: #FFFFFF;
}

/* ==========================================================================
   Seção de Sugestões e Comentários (Ouvidoria da Comunidade)
   ========================================================================== */
.feedback-section {
  margin-top: 3.5rem;
  scroll-margin-top: 5rem;
}

.feedback-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.75) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2.25rem;
  box-shadow: var(--shadow-lg), 0 0 35px rgba(56, 189, 248, 0.08);
  position: relative;
  overflow: hidden;
}

.feedback-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #38BDF8, #818CF8, #34D399, transparent);
}

.feedback-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #38BDF8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
}

.feedback-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.feedback-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 720px;
  line-height: 1.55;
  margin-bottom: 2rem;
}

/* Formulário de Feedback */
.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin-bottom: 2rem;
}

.feedback-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.feedback-field-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.label-optional {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
}

.label-required {
  color: #F43F5E;
  font-weight: 700;
}

/* Chips de Categoria */
.feedback-cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.feedback-cat-chip {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.feedback-cat-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(56, 189, 248, 0.4);
  color: #FFFFFF;
}

.feedback-cat-chip.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(99, 102, 241, 0.25));
  border-color: #38BDF8;
  color: #FFFFFF;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.3);
}

/* Star Rating */
.feedback-rating-box {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.rating-stars-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.stars-picker {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.star-btn {
  all: unset;
  box-sizing: border-box;
  font-size: 1.6rem;
  line-height: 1;
  color: #334155;
  cursor: pointer;
  transition: transform 0.15s ease, color 0.15s ease;
  user-select: none;
}

.star-btn:hover,
.star-btn.hover-active {
  transform: scale(1.2);
  color: #FBBF24;
}

.star-btn.active {
  color: #FBBF24;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}

.rating-legend {
  font-size: 0.84rem;
  font-weight: 600;
  color: #FBBF24;
  min-width: 140px;
}

/* Grid de Inputs */
.feedback-inputs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.feedback-input-box {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.feedback-input,
.feedback-textarea {
  width: 100%;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.95rem;
  color: #FFFFFF;
  font-size: 0.88rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.feedback-input:focus,
.feedback-textarea:focus {
  outline: none;
  border-color: #38BDF8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
  background: rgba(15, 23, 42, 0.9);
}

.feedback-textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
}

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

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

/* Rodapé do Formulário */
.feedback-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.feedback-privacy-note {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.btn-feedback-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 1.4rem;
  font-weight: 700;
}

/* Card de Sucesso */
.feedback-success-card {
  text-align: center;
  padding: 3rem 1.5rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
  animation: fadeIn 0.3s ease;
}

.feedback-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.4);
  box-shadow: 0 0 20px rgba(52, 211, 153, 0.25);
  margin-bottom: 1rem;
}

.feedback-success-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #34D399;
  margin-bottom: 0.5rem;
}

.feedback-success-desc {
  font-size: 0.92rem;
  color: #CBD5E1;
  max-width: 500px;
  margin: 0 auto 1.5rem auto;
  line-height: 1.5;
}

/* Mural da Comunidade */
.feedback-board-container {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.75rem;
}

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

.board-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.board-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #FFFFFF;
}

.board-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: #38BDF8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
}

.board-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-refresh-feedbacks {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-refresh-feedbacks:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  border-color: rgba(56, 189, 248, 0.35);
}

.btn-admin-moderate {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-tertiary);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-admin-moderate:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #F8FAFC;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-admin-moderate.admin-active {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.5);
  color: #FBBF24;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}

.btn-admin-moderate.admin-active:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: #FCA5A5;
}

/* Botão de Excluir Comentário (no modo moderador) */
.feedback-delete-btn {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #F87171;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.feedback-delete-btn:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #EF4444;
  color: #FFFFFF;
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

/* Modal Tamanho Pequeno (Admin Auth) */
.modal-container-sm {
  max-width: 440px !important;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.feedback-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.feedback-loading-placeholder {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.feedback-item-card {
  background: rgba(17, 24, 39, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.2s ease;
}

.feedback-item-card:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.feedback-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.feedback-item-user {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.feedback-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366F1, #38BDF8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #FFFFFF;
  flex-shrink: 0;
}

.feedback-user-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: #F8FAFC;
}

.feedback-item-cat-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.cat-badge-sugestao {
  background: rgba(56, 189, 248, 0.12);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.cat-badge-bug {
  background: rgba(239, 68, 68, 0.12);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.cat-badge-elogio {
  background: rgba(52, 211, 153, 0.12);
  color: #34D399;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.cat-badge-outro {
  background: rgba(192, 132, 252, 0.12);
  color: #C084FC;
  border: 1px solid rgba(192, 132, 252, 0.3);
}

.feedback-item-stars {
  color: #FBBF24;
  font-size: 0.85rem;
  letter-spacing: 1px;
}

.feedback-item-message {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.45;
  word-break: break-word;
}

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

@media (max-width: 640px) {
  .feedback-inputs-row {
    grid-template-columns: 1fr;
  }
  .feedback-card {
    padding: 1.75rem 1.25rem;
  }
  .feedback-form {
    padding: 1.25rem 1rem;
  }
  .feedback-cat-chips {
    gap: 0.4rem;
  }
  .feedback-cat-chip {
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
  }
  .feedback-form-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-feedback-submit {
    justify-content: center;
    width: 100%;
  }
}

/* ==========================================================================
   Seção de Doação & Apoio (PIX)
   ========================================================================== */

.pill-pink {
  color: #F472B6;
  border-color: rgba(244, 114, 182, 0.35);
  background: rgba(244, 114, 182, 0.08);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.pill-pink:hover {
  background: rgba(244, 114, 182, 0.18);
  border-color: rgba(244, 114, 182, 0.6);
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(244, 114, 182, 0.25);
}

.donation-section {
  margin-top: 3.5rem;
  scroll-margin-top: 5rem;
}

.donation-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(17, 24, 39, 0.85) 100%);
  border: 1px solid rgba(236, 72, 153, 0.25);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2.25rem;
  box-shadow: var(--shadow-lg), 0 0 35px rgba(236, 72, 153, 0.08);
  position: relative;
  overflow: hidden;
}

.donation-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #EC4899, #8B5CF6, transparent);
}

.donation-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #F472B6;
  background: rgba(244, 114, 182, 0.12);
  border: 1px solid rgba(244, 114, 182, 0.3);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
}

.donation-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.donation-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 680px;
  line-height: 1.55;
  margin-bottom: 2rem;
}

.pix-container {
  display: flex;
  align-items: center;
  gap: 2.25rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  flex-wrap: wrap;
}

.pix-qr-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.pix-qr-frame {
  background: #FFFFFF;
  padding: 0.75rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast);
}

.pix-qr-frame:hover {
  transform: scale(1.02);
}

.pix-qr-image {
  display: block;
  width: 170px;
  height: 170px;
  border-radius: 4px;
}

.pix-scan-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.pix-details-wrapper {
  flex: 1;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.pix-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pix-field-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.pix-copy-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.4rem 0.3rem 0.85rem;
  transition: border-color var(--transition-fast);
}

.pix-copy-box:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.pix-input-readonly {
  flex: 1;
  background: transparent;
  border: none;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: #38BDF8;
  outline: none;
  width: 100%;
}

.btn-copy {
  flex-shrink: 0;
  gap: 0.4rem;
}

.pix-merchant-info {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.pix-merchant-info strong {
  color: var(--text-secondary);
}

.result-support-box {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  background: rgba(236, 72, 153, 0.08);
  border: 1px solid rgba(236, 72, 153, 0.2);
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.link-highlight {
  color: #F472B6;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.link-highlight:hover {
  color: #EC4899;
}

/* ==========================================================================
   MENU DE FUNCIONALIDADES & FERRAMENTAS AVANÇADAS
   ========================================================================== */

/* ========================================================================= */
/* 1. BARRA DE BUSCA RÁPIDA (ACIMA DO MENU)                                   */
/* ========================================================================= */
.top-search-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 0.85rem;
  width: 100%;
}

.top-search-bar-trigger {
  all: unset;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  max-width: 520px;
  padding: 0.55rem 1.15rem;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.86rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.top-search-bar-trigger:hover {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.25);
  color: #FFFFFF;
  transform: translateY(-1px);
}

.top-search-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

.top-search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38BDF8;
  flex-shrink: 0;
}

.top-search-placeholder {
  color: var(--text-tertiary);
  font-size: 0.84rem;
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}

.top-search-bar-trigger:hover .top-search-placeholder {
  color: #CBD5E1;
}

.top-search-shortcut {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

/* ========================================================================= */
/* 2. BARRA DE NAVEGAÇÃO COM MENUS SUSPENSOS POR CATEGORIA (NO CENTRO)        */
/* ========================================================================= */
.category-nav-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.85rem;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  margin-bottom: 0.85rem;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), 0 0 20px rgba(99, 102, 241, 0.08);
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  position: relative;
  z-index: 80;
}

.category-dropdown-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

.cat-dropdown-wrapper {
  position: relative;
}

.cat-dropdown-trigger {
  all: unset;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap !important;
  word-break: keep-all !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.cat-trigger-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: #38BDF8;
  transition: all 0.2s ease;
}

.cat-trigger-text {
  white-space: nowrap !important;
  word-break: keep-all !important;
}

.cat-chevron {
  color: var(--text-tertiary);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.cat-dropdown-wrapper.open .cat-chevron {
  transform: rotate(180deg);
  color: #FFFFFF;
}

.cat-dropdown-trigger:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
}

.cat-dropdown-trigger:hover .cat-trigger-icon {
  background: rgba(56, 189, 248, 0.18);
  color: #38BDF8;
}

.cat-dropdown-trigger.active-category {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.28), rgba(139, 92, 246, 0.22));
  border-color: rgba(99, 102, 241, 0.6);
  color: #FFFFFF;
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.28);
}

.cat-dropdown-trigger.active-category .cat-trigger-icon {
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  color: #FFFFFF;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

/* O Menu Suspenso (Dropdown) */
.cat-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 320px;
  max-width: 370px;
  background: rgba(15, 23, 42, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.8), 0 0 24px rgba(99, 102, 241, 0.22);
  padding: 0.65rem;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
  pointer-events: none;
}

.cat-dropdown-wrapper.open .cat-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Alinhamento à direita para dropdowns próximos à borda */
.cat-dropdown-menu.dropdown-align-right {
  left: auto;
  right: 0;
}

.dropdown-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.4rem;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  white-space: nowrap !important;
  word-break: keep-all !important;
}

.dropdown-count-pill {
  font-size: 0.68rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.dropdown-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dropdown-tool-item {
  all: unset;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap !important;
  word-break: keep-all !important;
  transition: all 0.18s ease;
  user-select: none;
  position: relative;
}

.dropdown-tool-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  transform: translateX(3px);
}

.dropdown-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #38BDF8;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.dropdown-tool-item:hover .dropdown-item-icon {
  background: rgba(56, 189, 248, 0.18);
  color: #38BDF8;
  transform: scale(1.05);
}

.dropdown-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.dropdown-item-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #F8FAFC;
  white-space: nowrap !important;
  word-break: keep-all !important;
}

.dropdown-item-desc {
  font-size: 0.73rem;
  color: #94A3B8;
  white-space: nowrap !important;
  word-break: keep-all !important;
}

.dropdown-check-icon {
  display: none;
  font-size: 0.85rem;
  font-weight: 700;
  color: #34D399;
  margin-left: auto;
  padding-left: 0.5rem;
}

.dropdown-tool-item.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.15));
  border-color: rgba(99, 102, 241, 0.4);
  color: #FFFFFF;
}

.dropdown-tool-item.active .dropdown-item-icon {
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  color: #FFFFFF;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.dropdown-tool-item.active .dropdown-check-icon {
  display: block;
}

/* ========================================================================= */
/* 3. TAG DA FUNÇÃO ATIVA (ABAIXO DO MENU)                                   */
/* ========================================================================= */
.active-tool-banner-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 2rem;
  width: 100%;
}

.nav-active-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 1.15rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.12), rgba(16, 185, 129, 0.06));
  border: 1px solid rgba(52, 211, 153, 0.35);
  box-shadow: 0 4px 18px rgba(52, 211, 153, 0.16);
  color: #FFFFFF;
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap !important;
  word-break: keep-all !important;
  transition: all 0.25s ease;
}

.active-dot-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #34D399;
  box-shadow: 0 0 10px #34D399;
  animation: pulseDot 2s infinite;
}

.active-pill-label {
  color: #94A3B8;
  font-weight: 500;
  font-size: 0.8rem;
  white-space: nowrap !important;
}

.active-pill-name {
  color: #34D399;
  font-weight: 700;
  white-space: nowrap !important;
}

/* Botão de Disparo para o Modal "Buscar Todas as Ferramentas" */
.btn-all-tools-trigger {
  all: unset;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(236, 72, 153, 0.15));
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #FFFFFF;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap !important;
  word-break: keep-all !important;
  flex-shrink: 0;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-all-tools-trigger:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.32), rgba(236, 72, 153, 0.28));
  border-color: rgba(99, 102, 241, 0.65);
  box-shadow: 0 0 18px rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
}

.trigger-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38BDF8;
}

.shortcut-kbd {
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  color: #94A3B8;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap !important;
}

/* ========================================================================= */
/* MODAL DO CATÁLOGO DE TODAS AS FERRAMENTAS (COM BUSCA EM TEMPO REAL)       */
/* ========================================================================= */
.all-tools-modal-container {
  max-width: 980px;
  width: 94vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: #0B0F19;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.all-tools-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.75rem 1rem 1.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.all-tools-header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.all-tools-header-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
}

.all-tools-title {
  font-size: 1.18rem;
  font-weight: 800;
  color: #FFFFFF;
  margin: 0;
}

.all-tools-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 0.15rem 0 0 0;
}

/* Campo de busca */
.all-tools-search-box {
  position: relative;
  margin: 1.25rem 1.75rem 0.5rem 1.75rem;
}

.tools-search-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #64748B;
  pointer-events: none;
  transition: color 0.2s ease;
}

.all-tools-search-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  padding: 0.85rem 2.8rem 0.85rem 3rem;
  color: #FFFFFF;
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.all-tools-search-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-primary);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.35);
}

.all-tools-search-box:focus-within .tools-search-icon {
  color: var(--accent-cyan);
}

.tools-search-clear-btn {
  all: unset;
  box-sizing: border-box;
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94A3B8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
}

.tools-search-clear-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

/* Área de Rolagem do Catálogo */
.all-tools-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.75rem 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  scrollbar-width: thin;
}

.tools-cat-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

.tools-cat-pill {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #38BDF8;
}

.tools-cat-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tools-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 0.75rem;
}

/* Cards do Catálogo */
.all-tools-card {
  all: unset;
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.all-tools-card:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(99, 102, 241, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.all-tools-card.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(236, 72, 153, 0.15));
  border-color: var(--accent-primary);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.35);
}

.card-icon-box {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38BDF8;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.all-tools-card:hover .card-icon-box {
  background: rgba(56, 189, 248, 0.15);
  color: #38BDF8;
  transform: scale(1.05);
}

.all-tools-card.active .card-icon-box {
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  color: #FFFFFF;
  border-color: transparent;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.card-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.25;
}

.card-desc {
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.35;
  margin-top: 0.2rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.all-tools-card.active .card-desc {
  color: #CBD5E1;
}

/* Estado de busca vazia */
.tools-search-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
  gap: 0.75rem;
}

.tools-search-empty svg {
  stroke: #64748B;
}

.empty-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0;
}

.empty-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.all-tools-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.4);
}

@media (max-width: 860px) {
  .top-search-wrapper {
    margin-bottom: 0.65rem;
    padding: 0 0.5rem;
  }
  .top-search-bar-trigger {
    padding: 0.5rem 0.95rem;
    font-size: 0.82rem;
  }
  .top-search-placeholder {
    font-size: 0.8rem;
  }
  .category-nav-bar {
    border-radius: var(--radius-full);
    padding: 0.35rem 0.5rem;
    margin-bottom: 0.75rem;
  }
  .category-dropdown-group {
    width: auto;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
    overflow: visible;
  }
  .cat-dropdown-trigger {
    padding: 0.38rem 0.7rem;
    font-size: 0.8rem;
    gap: 0.35rem;
  }
  .cat-trigger-icon {
    width: 20px;
    height: 20px;
  }
  .cat-dropdown-menu {
    min-width: 280px;
    max-width: calc(100vw - 2rem);
  }
  .active-tool-banner-wrapper {
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
  }
  .nav-active-pill {
    padding: 0.4rem 0.95rem;
    font-size: 0.8rem;
  }
  .tools-cat-grid {
    grid-template-columns: 1fr;
  }
}

/* Barra do Documento Ativo (Cabeçalho nas ferramentas de 1 PDF) */
.active-doc-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.doc-badge-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.doc-icon-mini {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #818CF8;
}

.doc-meta-texts {
  display: flex;
  flex-direction: column;
}

.doc-meta-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  word-break: break-all;
}

.doc-meta-details {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.doc-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Seletor de Modo Segmentado (Split & Extract) */
.split-mode-selector,
.extract-mode-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.mode-pill {
  position: relative;
  display: flex;
  cursor: pointer;
}

.mode-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-pill-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  width: 100%;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.mode-pill-content strong {
  font-size: 0.92rem;
  color: var(--text-main);
}

.mode-pill-content small {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.mode-pill input:checked + .mode-pill-content {
  background: rgba(99, 102, 241, 0.12);
  border-color: var(--accent-primary);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
}

.mode-pill input:checked + .mode-pill-content strong {
  color: #38BDF8;
}

/* Caixas de Controle do Split */
.split-controls-box {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.input-with-helper {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

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

.ranges-preview-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.preview-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.ranges-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.range-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  font-size: 0.82rem;
  color: #C7D2FE;
  font-family: var(--font-mono);
}

.info-alert-box {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--text-main);
  font-size: 0.9rem;
}

.info-alert-box strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  color: #38BDF8;
}

.highlight-num {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #38BDF8;
}

/* Barra de Rotação em Lote */
.batch-rotate-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.5rem;
}

.batch-group-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.batch-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/* Barra de Seleção do Extrair Páginas */
.extract-selection-bar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.selection-input-box {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.selection-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.selection-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chip-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent-primary);
  color: #FFFFFF;
}

/* Indicador de Carregamento de Miniaturas */
.thumbnails-loading {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2.5rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 1.5rem;
}

.thumbnails-loading.active {
  display: flex;
}

.spinner-mini {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.grid-instructions-bar {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-left: 0.25rem;
}

/* Grade de Miniaturas de Páginas (Organizar, Girar e Extrair) */
.thumbnails-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
  min-height: 180px;
}

/* Card Individual de Página */
.page-card {
  display: flex;
  flex-direction: column;
  background: rgba(17, 24, 39, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem;
  position: relative;
  transition: all var(--transition-normal);
  user-select: none;
  box-shadow: var(--shadow-sm);
}

.page-card:hover {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

/* Card Header */
.page-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.page-badge-order {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-primary);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.76rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
}

.page-badge-orig {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.page-card-drag-handle {
  cursor: grab;
  color: var(--text-muted);
  padding: 2px;
  border-radius: 4px;
  transition: color var(--transition-fast);
}

.page-card-drag-handle:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

/* Canvas / Imagem de Preview da Página */
.page-card-preview-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.414; /* Proporção A4 */
  background: #0B0F19;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.page-thumbnail-canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  background-color: #FFFFFF;
}

/* Indicador de Rotação */
.page-rotation-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #38BDF8;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
}

/* Ações no Rodapé do Card (Organizar e Girar) */
.page-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin-top: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.card-action-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.3rem;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.card-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  transform: scale(1.1);
}

.card-action-btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
}

/* Estados de Drag and Drop */
.page-card.dragging {
  opacity: 0.4;
  border: 2px dashed var(--accent-primary);
  transform: scale(0.95);
}

.page-card.drag-over {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.5);
  transform: scale(1.03);
}

/* Estado de Seleção no Extrair Páginas */
.page-card-selectable {
  cursor: pointer;
}

.page-select-checkbox {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  z-index: 5;
}

.page-card.selected {
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.08);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.35);
}

.page-card.selected .page-select-checkbox {
  background: #10B981;
  border-color: #10B981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

.page-card.selected .page-select-checkbox svg {
  display: block;
}

.page-select-checkbox svg {
  display: none;
  stroke: #FFFFFF;
}

.page-card:not(.selected) {
  opacity: 0.72;
}

.page-card:not(.selected):hover {
  opacity: 1;
}

/* Responsividade do Menu de Ferramentas */
@media (max-width: 1024px) {
  .tools-nav-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .tools-nav-container {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .tool-nav-btn {
    padding: 0.75rem 0.85rem;
  }

  .thumbnails-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }
}

/* ==========================================================================
   Tool Categories Ribbon
   ========================================================================== */
.tool-categories-ribbon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
}
.tool-categories-ribbon::-webkit-scrollbar {
  display: none;
}

.tool-category-pill {
  all: unset;
  box-sizing: border-box;
  font-family: var(--font-primary);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.tool-category-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: rgba(99, 102, 241, 0.3);
}

.tool-category-pill.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(236, 72, 153, 0.15));
  border-color: var(--accent-primary);
  color: #FFFFFF;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.3);
}

/* ==========================================================================
   Security & Conversion Card Boxes
   ========================================================================== */
.security-card-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.security-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.security-badge-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.security-box-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.security-box-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.sub-section-title {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.65rem;
}

/* Passwords Grid */
.passwords-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

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

.pwd-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.pwd-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pwd-input-wrap .text-input {
  width: 100%;
  padding-right: 2.75rem;
}

.btn-pwd-toggle {
  all: unset;
  position: absolute;
  right: 0.75rem;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.25rem;
  border-radius: 4px;
  transition: color var(--transition-fast);
  user-select: none;
}

.btn-pwd-toggle:hover {
  color: var(--text-main);
}

.pwd-meter-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.2rem;
}

.pwd-meter-bar {
  height: 4px;
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.pwd-meter-bar::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: var(--meter-pct, 0%);
  background: var(--meter-color, #EF4444);
  transition: width 0.3s ease, background 0.3s ease;
}

.pwd-meter-text {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.field-help-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Encryption & Radio Cards */
.encryption-radios,
.p2w-pages-radios {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .encryption-radios,
  .p2w-pages-radios {
    grid-template-columns: 1fr;
  }
}

.enc-radio-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.enc-radio-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(99, 102, 241, 0.3);
}

.enc-radio-card:has(input:checked) {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--accent-primary);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.2);
}

.enc-radio-card input[type="radio"] {
  accent-color: var(--accent-primary);
  margin-top: 0.2rem;
  cursor: pointer;
}

.enc-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.enc-card-body strong {
  font-size: 0.88rem;
  color: var(--text-main);
}

.enc-card-body small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Preset Chips Grid */
.preset-chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem;
}

.preset-chip-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.preset-chip-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(244, 63, 94, 0.3);
}

.preset-chip-card:has(input:checked) {
  background: rgba(244, 63, 94, 0.1);
  border-color: var(--accent-rose);
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.25);
}

.preset-chip-card input[type="checkbox"] {
  accent-color: var(--accent-rose);
  cursor: pointer;
}

.preset-chip-content {
  display: flex;
  flex-direction: column;
}

.preset-chip-content strong {
  font-size: 0.82rem;
  color: var(--text-main);
}

.preset-chip-content small {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Custom Terms Box */
.custom-terms-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.term-input-row {
  display: flex;
  gap: 0.5rem;
}

.term-input-row .text-input {
  flex: 1;
}

.terms-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-height: 28px;
}

.term-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #FECDD3;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  animation: fadeIn 0.2s ease;
}

.term-tag-remove {
  all: unset;
  cursor: pointer;
  color: rgba(254, 205, 211, 0.6);
  font-weight: bold;
  font-size: 0.95rem;
  line-height: 1;
  transition: color var(--transition-fast);
}

.term-tag-remove:hover {
  color: #FFFFFF;
}

/* Custom Range Inputs */
.custom-range-inputs {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
}

.range-inputs-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.range-col {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.range-sublabel {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.range-sep {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 1rem;
}

.num-input {
  width: 90px;
  padding: 0.5rem 0.65rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.num-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

/* Word to PDF Highlight */
.word-info-highlight {
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.info-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tech-tag {
  font-size: 0.75rem;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #C7D2FE;
}

/* ==========================================================================
   ESTILOS NOVOS: IMAGEM PARA PDF & MARCA D'ÁGUA
   ========================================================================== */
.i2p-options-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.option-subgroup {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.color-picker-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.color-picker-input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
}

.color-picker-input::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.color-picker-input::-webkit-color-swatch {
  border: none;
  border-radius: calc(var(--radius-sm) - 2px);
}

.color-dot {
  all: unset;
  box-sizing: border-box;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.color-dot:hover {
  transform: scale(1.18);
  border-color: #FFFFFF;
}

.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  outline: none;
  margin-top: 0.5rem;
  transition: background var(--transition-fast);
}

.range-slider:hover {
  background: rgba(255, 255, 255, 0.18);
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-pink));
  cursor: pointer;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
  border: 2px solid #FFFFFF;
  transition: transform var(--transition-fast);
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.range-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-pink));
  cursor: pointer;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
  border: 2px solid #FFFFFF;
}

.wm-img-upload-box {
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
  transition: border-color var(--transition-fast);
}

.wm-img-upload-box:hover {
  border-color: var(--accent-primary);
}

.wm-img-upload-prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0.5rem;
}

.wm-img-upload-prompt:hover {
  color: var(--text-main);
}

.wm-img-preview-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem;
}

.wm-img-preview-box img {
  max-width: 60px;
  max-height: 60px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
}

.wm-img-preview-box span {
  font-size: 0.85rem;
  color: var(--text-main);
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.i2p-thumb-preview {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Customizador de Rodapé e Cabeçalho */
.footer-preview-sheet {
  background: #FFFFFF;
  color: #0F172A;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  padding: 1rem 1.25rem;
  height: 170px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin-top: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.footer-preview-skeleton-content {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  opacity: 0.12;
  pointer-events: none;
}

.footer-preview-skeleton-line {
  height: 6px;
  background: #0F172A;
  border-radius: 3px;
}

.footer-preview-live-text {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* ========================================================================= */
/* LUPA / ZOOM INSPECTOR DE PÁGINAS                                          */
/* ========================================================================= */
.page-card-preview-wrapper {
  cursor: zoom-in;
}

.thumbnail-hover-lens {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  color: #FFFFFF;
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  z-index: 5;
}

.thumbnail-hover-lens svg {
  stroke: #38BDF8;
  filter: drop-shadow(0 2px 6px rgba(56, 189, 248, 0.4));
  transition: transform 0.2s ease;
}

.page-card-preview-wrapper:hover .thumbnail-hover-lens {
  opacity: 1;
}

.page-card-preview-wrapper:hover .thumbnail-hover-lens svg {
  transform: scale(1.15);
}

.zoom-modal-container {
  max-width: 1050px;
  height: 90vh;
  background: #0B0F19;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.zoom-modal-body {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  background: #050811;
  user-select: none;
  flex: 1;
}

.zoom-controls-toolbar {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  padding: 2px 6px;
  gap: 4px;
}

.zoom-canvas-scroll-container {
  width: 100%;
  height: 100%;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 1.5rem;
  scrollbar-width: thin;
}

.zoom-page-canvas {
  background: #FFFFFF;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
  border-radius: 4px;
  display: block;
  margin: auto;
  flex-shrink: 0;
}

.zoom-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

.zoom-nav-arrow:hover:not(:disabled) {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  transform: translateY(-50%) scale(1.1);
}

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

.zoom-nav-prev {
  left: 1.25rem;
}

.zoom-nav-next {
  right: 1.25rem;
}

.zoom-loading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  padding: 0.6rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #FFFFFF;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 20;
}

.zoom-modal-footer {
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  background: rgba(17, 24, 39, 0.95);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==========================================================================
   Google AdSense - Espaços Publicitários Discretos
   ========================================================================== */

.ad-discreet-section {
  width: 100%;
  margin: 2rem 0 1rem;
  display: flex;
  justify-content: center;
}

.ad-discreet-container {
  width: 100%;
  max-width: 728px;
  margin: 1.5rem auto;
  padding: 0.65rem 0.85rem 0.85rem;
  background: rgba(17, 24, 39, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition-normal);
}

.ad-discreet-container:hover {
  border-color: rgba(99, 102, 241, 0.25);
}

.ad-result-card {
  margin: 1.25rem 0 0.5rem;
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(255, 255, 255, 0.08);
}

.ad-discreet-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.45rem;
}

.ad-discreet-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #64748B;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.15rem 0.65rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.ad-slot-body {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 90px;
}

.ad-slot-body ins.adsbygoogle {
  width: 100%;
  min-height: 90px;
}

/* Fallback / Preview discreto para modo de desenvolvimento ou pré-aprovação */
.ad-preview-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.85rem 1.25rem;
  text-align: center;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  width: 100%;
}

.ad-preview-pill {
  font-size: 0.72rem;
  font-weight: 700;
  color: #38BDF8;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.ad-preview-text {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0;
}

.ad-preview-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.ad-preview-hint code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.06);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  color: #A5B4FC;
}

/* Em produção com AdSense ativo, o preview explicativo desaparece */
body.adsense-live-mode .ad-preview-fallback {
  display: none !important;
}

@media (max-width: 640px) {
  .ad-discreet-container {
    max-width: 100%;
    margin: 1rem 0;
    padding: 0.5rem;
  }
  .ad-preview-fallback {
    padding: 0.6rem 0.4rem;
  }
}

/* ==========================================================================
   MÓDULO: COMPARADOR DE PDFS (TEXT DIFF & AUDITORIA)
   ========================================================================== */

.compare-docs-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.compare-doc-card {
  background: rgba(17, 24, 39, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.compare-doc-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: var(--shadow-md);
}

#card-doc-a {
  border-left: 3px solid #F43F5E;
}

#card-doc-b {
  border-left: 3px solid #10B981;
}

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

.compare-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.tag-original {
  background: rgba(244, 63, 94, 0.12);
  color: #FDA4AF;
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.tag-modified {
  background: rgba(16, 185, 129, 0.12);
  color: #6EE7B7;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.compare-tag-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.compare-tag-dot.red {
  background: #F43F5E;
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.6);
}

.compare-tag-dot.green {
  background: #10B981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.btn-doc-action {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.74rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-doc-action:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.2);
}

.compare-card-body {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.compare-doc-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-doc-a {
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.2);
  color: #F43F5E;
}

.icon-doc-b {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #10B981;
}

.compare-doc-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.compare-doc-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compare-doc-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.compare-swap-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.btn-compare-swap {
  all: unset;
  box-sizing: border-box;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #818CF8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-compare-swap:hover {
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  color: #FFFFFF;
  border-color: transparent;
  transform: rotate(180deg) scale(1.08);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

.swap-hint-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

/* KPI Ribbon */
.compare-metrics-ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card-kpi {
  background: rgba(17, 24, 39, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.metric-similarity {
  border-top: 3px solid var(--accent-primary);
}

.metric-added {
  border-top: 3px solid var(--accent-emerald);
}

.metric-removed {
  border-top: 3px solid var(--accent-rose);
}

.metric-pages {
  border-top: 3px solid var(--accent-cyan);
}

.kpi-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.kpi-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 0.35rem;
  font-family: var(--font-primary);
  line-height: 1.1;
}

.text-emerald {
  color: #10B981 !important;
}

.text-rose {
  color: #F43F5E !important;
}

.text-cyan {
  color: #38BDF8 !important;
}

.kpi-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.kpi-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  margin-top: 0.6rem;
  overflow: hidden;
}

.kpi-bar-fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #6366F1, #10B981);
  transition: width 0.6s ease;
}

/* Diff Viewer Toolbar */
.diff-viewer-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.diff-toolbar-left, .diff-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.diff-toolbar-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.diff-page-pills {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  max-width: 450px;
  overflow-x: auto;
}

.btn-page-pill {
  all: unset;
  box-sizing: border-box;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.btn-page-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
}

.btn-page-pill.active {
  background: #6366F1;
  color: #FFFFFF;
  border-color: #6366F1;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.pill-dot.modified {
  background: #F43F5E;
}

.pill-dot.identical {
  background: #10B981;
}

.diff-search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 4px 10px;
}

.diff-search-box input {
  all: unset;
  font-size: 0.82rem;
  color: #FFFFFF;
  width: 140px;
}

.diff-search-box input::placeholder {
  color: var(--text-muted);
}

.diff-view-mode-toggle {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 2px;
}

.btn-mode-toggle {
  all: unset;
  box-sizing: border-box;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.btn-mode-toggle.active {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Diff Viewport */
.diff-viewer-viewport {
  background: #0B0F19;
  border: 1px solid var(--border-subtle);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  overflow: hidden;
}

.diff-scroll-pane-wrapper.mode-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.diff-pane {
  display: flex;
  flex-direction: column;
  min-height: 480px;
  max-height: 620px;
  overflow: hidden;
}

.diff-pane-left {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.diff-pane-header {
  padding: 8px 14px;
  background: rgba(17, 24, 39, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pane-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-main);
}

.diff-circle-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.diff-circle-indicator.red {
  background: #F43F5E;
}

.diff-circle-indicator.green {
  background: #10B981;
}

.diff-pane-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.badge-deleted {
  background: rgba(244, 63, 94, 0.15);
  color: #FDA4AF;
}

.badge-inserted {
  background: rgba(16, 185, 129, 0.15);
  color: #6EE7B7;
}

.diff-pane-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  padding: 8px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: #E2E8F0;
  scroll-behavior: smooth;
}

/* Linhas do Diff */
.diff-line-row {
  display: flex;
  min-width: 100%;
  padding: 3px 8px;
  transition: background 0.1s ease;
}

.diff-line-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.diff-line-num {
  width: 42px;
  color: #475569;
  text-align: right;
  padding-right: 12px;
  user-select: none;
  flex-shrink: 0;
  font-size: 11px;
}

.diff-line-text {
  flex: 1;
  word-break: break-word;
  white-space: pre-wrap;
}

.diff-line-row.row-delete {
  background: rgba(244, 63, 94, 0.08);
}

.diff-line-row.row-insert {
  background: rgba(16, 185, 129, 0.08);
}

.diff-line-row.row-replace {
  background: rgba(245, 158, 11, 0.06);
}

/* Tokens de destaque por palavra */
.diff-word-delete {
  background: rgba(244, 63, 94, 0.28);
  color: #FECDD3;
  text-decoration: line-through;
  border-radius: 3px;
  padding: 0 3px;
}

.diff-word-insert {
  background: rgba(16, 185, 129, 0.28);
  color: #A7F3D0;
  font-weight: 600;
  border-radius: 3px;
  padding: 0 3px;
}

.diff-page-separator {
  padding: 8px 14px;
  background: rgba(30, 41, 59, 0.85);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  font-weight: 700;
  color: #94A3B8;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0;
}

/* Modo Unificado */
.diff-unified-pane {
  min-height: 480px;
  max-height: 620px;
  overflow-y: auto;
  overflow-x: auto;
  padding: 12px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
}

.diff-unified-row {
  display: flex;
  min-width: 100%;
  padding: 3px 12px;
}

.diff-unified-type {
  width: 24px;
  font-weight: bold;
  user-select: none;
}

.diff-unified-row.unified-delete {
  background: rgba(244, 63, 94, 0.1);
  color: #FDA4AF;
}

.diff-unified-row.unified-insert {
  background: rgba(16, 185, 129, 0.1);
  color: #6EE7B7;
}

@media (max-width: 768px) {
  .compare-docs-grid {
    grid-template-columns: 1fr;
  }
  .compare-swap-wrapper {
    flex-direction: row;
  }
  .diff-scroll-pane-wrapper.mode-split {
    grid-template-columns: 1fr;
  }
  .diff-pane-left {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
}

/* ==========================================================================
   ORGANIZADOR DE PÁGINAS MULTI-ARQUIVO - JUNTAR PDF (FIGURA DE REFERÊNCIA)
   ========================================================================== */

/* Barra Superior do Juntar PDF */
.merge-top-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  margin-bottom: 0.85rem;
  gap: 1rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.merge-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.merge-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Alternador Segmentado: Arquivos vs Páginas */
.merge-view-switcher {
  display: inline-flex;
  align-items: center;
  background: rgba(11, 15, 25, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}

.merge-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-radius: 6px;
  padding: 0.4rem 0.85rem;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.merge-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.merge-tab-btn.active {
  background: #3B82F6;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.merge-tab-btn .crown-badge {
  font-size: 0.85rem;
  line-height: 1;
}

.toolbar-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.12);
}

.toolbar-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-tool-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-tool-action:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-tool-action-danger:hover {
  background: rgba(239, 68, 68, 0.18);
  color: #EF4444;
  border-color: rgba(239, 68, 68, 0.35);
}

/* Botão Terminar em Destaque */
.btn-finish-merge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #2563EB;
  color: #FFFFFF;
  font-weight: 700;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
  transition: all var(--transition-fast);
}

.btn-finish-merge:hover {
  background: #1D4ED8;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.55);
}

/* Sub-barra de Seleção e Controles de Visualização */
.merge-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.9rem;
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.subbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.merge-select-all-label {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
}

.merge-select-all-label input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: #3B82F6;
  cursor: pointer;
}

.selection-status-badge {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

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

.btn-subbar-action {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-subbar-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.dropdown-wrapper {
  position: relative;
}

.subbar-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 0.35rem 0;
  min-width: 210px;
  z-index: 50;
}

.subbar-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 0.5rem 0.85rem;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.subbar-dropdown-item:hover {
  background: rgba(59, 130, 246, 0.15);
  color: #60A5FA;
}

.view-density-group {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.btn-density {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-density.active {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-main);
}

/* Área de Carregamento de Miniaturas */
.merge-pages-loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  gap: 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Grade de Páginas Interativa (Flex Wrap com Botões + Intermediários) */
.merge-pages-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 0.45rem;
  padding: 1.25rem 0.5rem 2.5rem 0.5rem;
  min-height: 240px;
  user-select: none;
}

.merge-pages-grid.density-compact {
  gap: 0.5rem 0.35rem;
}

.merge-pages-grid.density-compact .merge-page-card {
  width: 105px;
  padding: 0.45rem;
}

.merge-pages-grid.density-compact .page-doc-badge {
  font-size: 0.65rem;
  padding: 0.12rem 0.35rem;
}

/* Card Individual de Página */
.merge-page-card {
  position: relative;
  width: 135px;
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 0.55rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  cursor: grab;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  flex-shrink: 0;
}

.merge-page-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  border-color: #38BDF8;
}

.merge-page-card:active {
  cursor: grabbing;
}

/* Checkbox no Canto Superior Esquerdo do Card */
.merge-page-card .page-card-check {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 18px;
  height: 18px;
  accent-color: #2563EB;
  cursor: pointer;
  z-index: 10;
}

/* Preview / Canvas da Página */
.page-preview-box {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.414; /* Padrão ISO A4 */
  background: #F8FAFC;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #E2E8F0;
  margin-top: 14px;
  margin-bottom: 0.45rem;
}

.page-preview-box canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #FFFFFF;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Ícone de Lupa no Hover */
.page-preview-box .page-lens-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity var(--transition-fast);
  cursor: pointer;
}

.page-preview-box:hover .page-lens-overlay {
  opacity: 1;
}

/* Badge do Nome do Arquivo com Cores Harmoniosas */
.page-doc-badge {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.18rem 0.45rem;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.2rem;
  border: 1px solid transparent;
}

/* Paleta de Cores Pastel por Arquivo (Igual ao Screenshot da Pergunta) */
.page-doc-badge.color-0 {
  background: #FCE7F3;
  color: #BE185D;
  border-color: #FBCFE8;
}

.page-doc-badge.color-1 {
  background: #FEF3C7;
  color: #B45309;
  border-color: #FDE68A;
}

.page-doc-badge.color-2 {
  background: #E0F2FE;
  color: #0369A1;
  border-color: #BAE6FD;
}

.page-doc-badge.color-3 {
  background: #D1FAE5;
  color: #047857;
  border-color: #A7F3D0;
}

.page-doc-badge.color-4 {
  background: #EDE9FE;
  color: #6D28D9;
  border-color: #DDD6FE;
}

.page-doc-badge.color-5 {
  background: #FFEDD5;
  color: #C2410C;
  border-color: #FED7AA;
}

.page-doc-badge.color-6 {
  background: #FEE2E2;
  color: #B91C1C;
  border-color: #FECACA;
}

.page-doc-badge.color-7 {
  background: #CCFBF1;
  color: #0F766E;
  border-color: #99F6E4;
}

/* Número da Página */
.page-num-label {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  margin-top: 0.15rem;
  font-family: var(--font-mono);
}

/* Estado de Seleção */
.merge-page-card.selected {
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* Estados de Drag and Drop */
.merge-page-card.dragging {
  opacity: 0.35;
  border: 2px dashed #3B82F6;
  transform: scale(0.95);
}

.merge-page-card.drag-over {
  border-color: #06B6D4;
  box-shadow: 0 0 18px rgba(6, 182, 212, 0.6);
  transform: scale(1.04);
}

/* Botão Redondo (+) Entre Páginas */
.btn-interpage-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #60A5FA;
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(96, 165, 250, 0.5);
  transition: all var(--transition-fast);
  flex-shrink: 0;
  z-index: 5;
}

.btn-interpage-add:hover {
  background: #2563EB;
  transform: scale(1.25);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.7);
}

.btn-interpage-add svg {
  pointer-events: none;
}

/* Menu Popover do Botão (+) */
.interpage-popover {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 8px;
  background: #0F172A;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 0.4rem 0;
  min-width: 220px;
  z-index: 100;
}

.interpage-popover-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 0.55rem 0.9rem;
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.interpage-popover-item:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #60A5FA;
}

/* Responsividade Mobile */
@media (max-width: 640px) {
  .merge-page-card {
    width: 110px;
  }
  .btn-interpage-add {
    width: 22px;
    height: 22px;
  }
}






