/* Feuille de style personnalisée de l'application PDF vers Word OCR */
:root {
  --app-bg: #f8fafc;
  --app-card-bg: #ffffff;
  --app-sidebar-bg: #0f172a;
  --app-sidebar-text: #94a3b8;
  --app-sidebar-active: #38bdf8;
  --app-primary: #2563eb;
  --app-primary-hover: #1d4ed8;
  --app-border: #e2e8f0;
  --app-text-main: #1e293b;
  --app-text-muted: #64748b;
  --app-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --app-arabic-font: 'Traditional Arabic', 'Amiri', 'Segoe UI', Tahoma, sans-serif;
}

body {
  font-family: var(--app-font-family);
  background-color: var(--app-bg);
  color: var(--app-text-main);
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
}

/* Accessibilité et Focus visible */
:focus-visible {
  outline: 2px solid var(--app-primary) !important;
  outline-offset: 2px !important;
}

/* Layout Desktop avec Sidebar */
.app-container {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: 260px;
  background-color: var(--app-sidebar-bg);
  color: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease-in-out;
  z-index: 1030;
}

.sidebar-brand {
  padding: 1.25rem 1.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-nav {
  padding: 1rem 0.75rem;
  flex-grow: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  color: var(--app-sidebar-text);
  text-decoration: none;
  border-radius: 0.5rem;
  font-size: 0.92rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  transition: all 0.15s ease;
}

.sidebar-link:hover, .sidebar-link.active {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.08);
}

.sidebar-link.active {
  color: var(--app-sidebar-active);
  font-weight: 600;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.app-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-topbar {
  background-color: #fff;
  border-bottom: 1px solid var(--app-border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-content {
  padding: 1.75rem;
  flex-grow: 1;
}

/* Zone d'Upload Drag & Drop */
.upload-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 0.75rem;
  background-color: #ffffff;
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: var(--app-primary);
  background-color: #eff6ff;
}

.upload-icon {
  font-size: 3rem;
  color: var(--app-primary);
  margin-bottom: 1rem;
}

/* Badges de Statuts Personnalisés */
.badge-status {
  font-size: 0.82rem;
  padding: 0.35rem 0.65rem;
  border-radius: 9999px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.status-uploaded { background-color: #f1f5f9; color: #475569; }
.status-queued { background-color: #fef3c7; color: #92400e; }
.status-preparing { background-color: #e0e7ff; color: #3730a3; }
.status-processing { background-color: #dbeafe; color: #1e40af; }
.status-assembling { background-color: #f3e8ff; color: #6b21a8; }
.status-completed { background-color: #dcfce7; color: #166534; }
.status-completed_with_warnings { background-color: #fef9c3; color: #854d0e; }
.status-failed { background-color: #fee2e2; color: #991b1b; }
.status-cancelled { background-color: #f3f4f6; color: #374151; }

/* Visualiseur Textuel et Script Arabe */
.text-preview-box {
  background-color: #ffffff;
  border: 1px solid var(--app-border);
  border-radius: 0.5rem;
  padding: 1.25rem;
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.text-rtl {
  direction: rtl;
  text-align: right;
  font-family: var(--app-arabic-font);
  font-size: 1.1rem;
}

/* Barre de progression réelle */
.progress-real {
  height: 0.75rem;
  border-radius: 0.5rem;
  background-color: #e2e8f0;
  overflow: hidden;
}

.progress-bar-real {
  background: linear-gradient(90deg, #2563eb, #38bdf8);
  transition: width 0.4s ease;
}

/* Cartes de synthèse */
.stat-card {
  background-color: #ffffff;
  border: 1px solid var(--app-border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Responsive Mobile et Tablettes */
@media (max-width: 991.98px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -260px;
  }
  .app-sidebar.show {
    left: 0;
  }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1025;
  }
  .sidebar-backdrop.show {
    display: block;
  }
  .app-content {
    padding: 1rem;
  }
}
