:root {
  --bg: #060B14;
  --bg-alt: #0a111c;
  --card: #0d1520;
  --card-hover: #111d2e;
  --text: #f0f2f8;
  --text-muted: #8a96b0;
  --heading: #ffffff;
  --accent: #00CCF7;
  --accent-dim: rgba(0,204,247,0.10);
  --accent-glow: rgba(0,204,247,0.20);
  --ok: #22c97a;
  --ok-dim: rgba(34,201,122,0.12);
  --wip: #f5a623;
  --wip-dim: rgba(245,166,35,0.12);
  --err: #ef4444;
  --err-dim: rgba(239,68,68,0.12);
  --border: rgba(255,255,255,0.07);
  --border-strong: rgba(255,255,255,0.13);
  --sidebar-w: 220px;
  --radius: 10px;
  --radius-sm: 6px;
}

[data-theme="light"] {
  --bg: #F5F4F0;
  --bg-alt: #ECEAE4;
  --card: #FDFCF8;
  --card-hover: #F5F2EC;
  --text: #1e1c18;
  --text-muted: #6b6658;
  --heading: #0d0b08;
  --accent: #4f46e5;
  --accent-dim: rgba(79,70,229,0.08);
  --accent-glow: rgba(79,70,229,0.16);
  --ok: #16a34a;
  --ok-dim: rgba(22,163,74,0.08);
  --wip: #d97706;
  --wip-dim: rgba(217,119,6,0.08);
  --err: #dc2626;
  --err-dim: rgba(220,38,38,0.08);
  --border: #e2ddd5;
  --border-strong: #ccc5ba;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  height: 100vh;
  overflow: hidden;
}

#app {
  display: flex;
  height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-alt);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-logo {
  padding: 20px 16px 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--heading);
  border-bottom: 1px solid var(--border);
}
.sidebar-logo .logo-ia { color: var(--accent); }
.sidebar-logo .logo-app {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 8px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  position: relative;
  user-select: none;
  margin-bottom: 2px;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item:hover { background: var(--accent-dim); color: var(--text); }
.nav-item.active { background: var(--accent-dim); color: var(--accent); }
.nav-badge {
  margin-left: auto;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.nav-badge.urgent { background: var(--err-dim); color: var(--err); border-color: transparent; }
.nav-badge:empty { display: none; }

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid var(--border);
}
.theme-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
}
.theme-btn svg { width: 14px; height: 14px; }
.theme-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Main */
.main {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.view { display: none; flex-direction: column; height: 100%; overflow: hidden; }
.view.active { display: flex; }

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.view-header h1 { font-size: 18px; font-weight: 700; color: var(--heading); }
.header-actions { display: flex; gap: 8px; align-items: center; }

.view-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 28px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
  text-decoration: none;
}
.btn:hover { opacity: 0.85; }
.btn-primary { background: var(--accent); color: #000; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--err-dim); color: var(--err); border: 1px solid transparent; }

/* Selects */
select {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
select:focus { outline: none; border-color: var(--accent); }

/* Loading */
.loading { color: var(--text-muted); padding: 40px 28px; font-size: 13px; }

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 6px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--heading); line-height: 1; }
.stat-value.ok { color: var(--ok); }
.stat-value.err { color: var(--err); }
.stat-value.accent { color: var(--accent); }

/* Dashboard sections */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.dash-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.dash-section h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 12px;
}
.dash-section .empty { color: var(--text-muted); font-size: 13px; }

/* Doc items (mini) */
.doc-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.doc-mini:last-child { border-bottom: none; }
.doc-mini:hover .doc-mini-name { color: var(--accent); }
.doc-mini-icon { font-size: 20px; flex-shrink: 0; width: 28px; text-align: center; }
.doc-mini-info { flex: 1; min-width: 0; }
.doc-mini-name { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-mini-meta { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* Type breakdown */
.type-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 13px;
}
.type-bar-wrap { flex: 1; background: var(--bg); border-radius: 4px; height: 4px; overflow: hidden; }
.type-bar { height: 100%; background: var(--accent); border-radius: 4px; }
.type-count { font-size: 12px; color: var(--text-muted); min-width: 20px; text-align: right; }

/* Document cards */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  padding: 20px 28px;
  overflow-y: auto;
  flex: 1;
}
.doc-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.doc-card:hover { border-color: var(--accent); background: var(--card-hover); }
.doc-card-top { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.doc-icon { font-size: 24px; flex-shrink: 0; }
.doc-name { font-size: 13px; font-weight: 600; color: var(--heading); line-height: 1.3; word-break: break-word; }
.doc-emetteur { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.doc-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.tag {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--accent-dim);
  color: var(--accent);
}
.doc-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.doc-date { font-size: 11px; color: var(--text-muted); }
.doc-montant { font-size: 12px; font-weight: 600; color: var(--ok); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-done { background: var(--ok-dim); color: var(--ok); }
.badge-processing { background: var(--wip-dim); color: var(--wip); }
.badge-error { background: var(--err-dim); color: var(--err); }
.badge-pending { background: var(--bg-alt); color: var(--text-muted); }
.badge-CH { background: rgba(255,50,50,0.12); color: #ff5555; }
.badge-FR { background: rgba(50,100,255,0.12); color: #6688ff; }
.badge-GR { background: rgba(30,180,255,0.12); color: #1eb4ff; }
.badge-OTHER { background: var(--bg-alt); color: var(--text-muted); }

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 28px;
  color: var(--text-muted);
  text-align: center;
  flex: 1;
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state p { font-size: 14px; }
.empty-state .hint { font-size: 12px; margin-top: 6px; }

/* Upload zone */
.upload-zone {
  margin: 20px 28px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 48px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}
.upload-zone:hover, .upload-zone.dragging {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.upload-zone svg { width: 40px; height: 40px; color: var(--text-muted); margin-bottom: 4px; }
.upload-zone p { font-size: 15px; font-weight: 600; color: var(--heading); }
.upload-zone span { font-size: 12px; color: var(--text-muted); }

/* Upload list */
#upload-list { padding: 0 28px 20px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.upload-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.upload-item-icon { font-size: 20px; flex-shrink: 0; }
.upload-item-info { flex: 1; min-width: 0; }
.upload-item-name { font-size: 13px; font-weight: 500; color: var(--heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-item-msg { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.upload-item-status { flex-shrink: 0; }

/* Spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* Search */
.search-bar-wrap { padding: 16px 28px 0; }
.search-input {
  width: 100%;
  padding: 11px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--accent); }
#search-results { padding: 12px 28px; overflow-y: auto; flex: 1; }

/* Reminders */
#reminders-content { padding: 16px 28px; overflow-y: auto; flex: 1; }
.reminder-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin: 16px 0 8px;
}
.reminder-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.reminder-item:hover { border-color: var(--accent); }
.reminder-item.urgent { border-color: var(--err); }
.reminder-date { font-size: 22px; font-weight: 700; color: var(--accent); min-width: 52px; text-align: center; line-height: 1; }
.reminder-date .reminder-month { font-size: 10px; font-weight: 500; color: var(--text-muted); display: block; text-transform: uppercase; }
.reminder-date.urgent-date { color: var(--err); }
.reminder-info { flex: 1; min-width: 0; }
.reminder-name { font-size: 13px; font-weight: 600; color: var(--heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reminder-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  backdrop-filter: blur(4px);
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--bg-alt);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  width: 920px;
  max-width: calc(100vw - 40px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: var(--bg-alt);
}
.modal-header h2 { font-size: 16px; font-weight: 700; color: var(--heading); }
.modal-close {
  background: transparent; border: none; color: var(--text-muted); cursor: pointer;
  padding: 4px; border-radius: 4px;
}
.modal-close:hover { color: var(--text); }
.modal-close svg { width: 18px; height: 18px; display: block; }
/* Modal layout — 2 colonnes */
.modal-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.modal-preview-pane {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.modal-preview-pane iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
.modal-preview-pane img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.modal-preview-pane .preview-unavail {
  text-align: center;
  color: var(--text-muted);
  padding: 32px;
  font-size: 13px;
}
.modal-preview-pane .preview-unavail svg { width: 40px; height: 40px; margin: 0 auto 12px; display: block; opacity: 0.4; }
.modal-info-pane {
  width: 340px;
  flex-shrink: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
#modal-body { padding: 16px 18px 18px; flex: 1; }

/* Modal fields */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); }
.field-value { font-size: 13px; color: var(--heading); font-weight: 500; }
.field-empty { color: var(--text-muted); font-style: italic; font-weight: 400; }
.modal-resume { font-size: 12px; color: var(--text); background: var(--bg); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 14px; line-height: 1.6; }
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 18px 16px; border-top: 1px solid var(--border); }

/* Edit form */
.edit-form .field input,
.edit-form .field select {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  padding: 6px 10px;
  font-family: inherit;
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}
.edit-form .field input:focus,
.edit-form .field select:focus { border-color: var(--accent); }
.edit-form .field input[type="date"] { color-scheme: dark; }
.edit-form .field-row { margin-bottom: 8px; }

/* Responsive modal */
@media (max-width: 700px) {
  .modal-layout { flex-direction: column; }
  .modal-preview-pane { height: 220px; border-right: none; border-bottom: 1px solid var(--border); }
  .modal-info-pane { width: 100%; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Upload mode tabs */
.upload-mode-tabs { display: flex; gap: 4px; background: var(--bg-alt); padding: 3px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.umode-tab {
  padding: 5px 14px; border: none; background: transparent; color: var(--text-muted);
  border-radius: 4px; cursor: pointer; font-size: 12px; font-weight: 600; font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.umode-tab.active { background: var(--accent); color: #000; }
.umode-tab:not(.active):hover { color: var(--text); }

/* Wizard */
.wizard { padding: 28px; max-width: 620px; overflow-y: auto; flex: 1; }
.wizard-steps { display: flex; align-items: center; gap: 0; margin-bottom: 32px; }
.wstep {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; color: var(--text-muted);
}
.wstep-num {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.wstep.done .wstep-num { border-color: var(--ok); background: var(--ok); color: #000; }
.wstep.active .wstep-num { border-color: var(--accent); background: var(--accent); color: #000; }
.wstep.active { color: var(--text); }
.wstep.done { color: var(--ok); }
.wstep-sep { flex: 1; height: 2px; background: var(--border); margin: 0 8px; min-width: 20px; }
.wstep.done + .wstep-sep { background: var(--ok); }

.wizard h2 { font-size: 18px; font-weight: 700; color: var(--heading); margin-bottom: 6px; }
.wizard p { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; line-height: 1.6; }

/* Folder picker */
.folder-pick-zone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  padding: 48px 28px; text-align: center; cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 16px;
}
.folder-pick-zone:hover { border-color: var(--accent); background: var(--accent-dim); }
.folder-pick-zone svg { width: 44px; height: 44px; color: var(--text-muted); margin-bottom: 12px; }
.folder-pick-zone p { font-size: 15px; font-weight: 600; color: var(--heading); margin-bottom: 4px; }
.folder-pick-zone span { font-size: 12px; color: var(--text-muted); }

/* File preview table */
.preview-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.preview-table th { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.preview-table td { font-size: 13px; padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text); }
.preview-table tr:last-child td { border-bottom: none; }
.preview-table .total-row td { font-weight: 700; color: var(--accent); }
.preview-total-bar {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.preview-total-bar .big-num { font-size: 28px; font-weight: 700; color: var(--accent); }
.preview-total-bar .big-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }

/* Progress bar wizard */
.wiz-progress-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.wiz-progress-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.wiz-progress-bar { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.wiz-progress-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.3s ease; }
.wiz-current-file { font-size: 11px; color: var(--text-muted); margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Result stats */
.wiz-results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.wiz-result-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; text-align: center; }
.wiz-result-num { font-size: 26px; font-weight: 700; }
.wiz-result-num.ok { color: var(--ok); }
.wiz-result-num.warn { color: var(--wip); }
.wiz-result-num.err { color: var(--err); }
.wiz-result-lbl { font-size: 11px; color: var(--text-muted); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.4px; }

/* Pre-flight duplicate check */
.preflight-list { padding: 16px 0; }
.preflight-header { display:flex; justify-content:space-between; align-items:center; font-size:13px; color:var(--text-muted); margin-bottom:10px; }
.preflight-counts { display:flex; gap:10px; }
.preflight-counts .ok { color:var(--ok,#4ade80); font-weight:600; }
.preflight-counts .dup { color:var(--warn,#facc15); font-weight:600; }
.preflight-items { display:flex; flex-direction:column; gap:6px; max-height:320px; overflow-y:auto; margin-bottom:16px; }
.preflight-item { display:flex; align-items:center; gap:10px; padding:8px 12px; background:var(--card); border:1px solid var(--border); border-radius:var(--radius-sm); font-size:13px; }
.preflight-item.is-dup { opacity:0.6; }
.preflight-badge { flex-shrink:0; font-size:12px; min-width:110px; }
.preflight-name { flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:var(--heading); }
.preflight-size { flex-shrink:0; color:var(--text-muted); font-size:12px; }
.preflight-go { width:100%; margin-top:4px; }

/* Scan banner */
.scan-banner {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--card); border: 1px solid var(--accent);
  border-radius: var(--radius); padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 150; min-width: 360px; max-width: calc(100vw - 40px);
  animation: slideUp 0.3s ease;
}
.scan-banner.hidden { display: none; }
@keyframes slideUp { from { opacity:0; transform: translateX(-50%) translateY(16px); } to { opacity:1; transform: translateX(-50%) translateY(0); } }
.scan-banner-icon { font-size: 22px; flex-shrink: 0; }
.scan-banner-text { flex: 1; font-size: 13px; color: var(--text); line-height: 1.4; }
.scan-banner-text strong { color: var(--accent); }
.scan-banner-btn { flex-shrink: 0; font-size: 12px; padding: 6px 14px; }
.scan-banner-dismiss { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 20px; line-height: 1; padding: 0 4px; flex-shrink: 0; }
.scan-banner-dismiss:hover { color: var(--text); }

/* Watch mode */
.watch-panel { padding: 28px; max-width: 580px; }
.watch-folder-box {
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 14px;
}
.watch-folder-icon { font-size: 32px; flex-shrink: 0; }
.watch-folder-info { flex: 1; min-width: 0; }
.watch-folder-name { font-size: 14px; font-weight: 600; color: var(--heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.watch-folder-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.watch-scan-result {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; margin-bottom: 16px;
}
.watch-scan-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; padding: 4px 0; }
.watch-scan-row .lbl { color: var(--text-muted); }
.watch-scan-row .val { font-weight: 600; color: var(--heading); }
.watch-scan-row .val.new { color: var(--accent); }
.watch-progress { margin-top: 12px; }

/* Mobile sidebar toggle */
@media (max-width: 768px) {
  .sidebar { width: 56px; }
  .sidebar-logo .logo-app, .nav-item span, .theme-btn span { display: none; }
  .nav-item { padding: 10px; justify-content: center; }
  .sidebar-logo { padding: 16px 10px; }
  .logo-ia + span { display: none; }
  .nav-badge { display: none; }
  .theme-btn { justify-content: center; padding: 9px; }
  .doc-grid { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
}
