/* DataVault - interface (thème clair/sombre, aucune dépendance) */
:root {
  --bg: #0f1420;
  --bg2: #151c2c;
  --bg3: #1c2438;
  --line: #26314a;
  --txt: #e8edf6;
  --muted: #8b96ad;
  --accent: #5b8def;
  --accent2: #7ee0a3;
  --danger: #e06060;
  --warn: #e0b060;
  --radius: 10px;
  --shadow: 0 6px 24px rgba(0,0,0,.4);
}
:root[data-theme="light"] {
  --bg: #f4f6fb;
  --bg2: #ffffff;
  --bg3: #eef1f8;
  --line: #d8dee9;
  --txt: #1b2434;
  --muted: #697588;
  --accent: #3a6fd8;
  --accent2: #2faa6a;
  --danger: #d23f3f;
  --warn: #b7791f;
  --shadow: 0 6px 24px rgba(30,40,70,.12);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--txt);
  font-size: 14px;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.grow { flex: 1; }
.error { color: var(--danger); margin-top: 8px; font-size: 13px; }
h2, h3 { margin: 0; }

/* --------------------------------------------------------------- login */
#login-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card {
  background: var(--bg2); border: 1px solid var(--line);
  padding: 40px; border-radius: 16px; width: 360px; text-align: center; box-shadow: var(--shadow);
}
.login-card .logo { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.login-card input {
  background: var(--bg3); border: 1px solid var(--line); color: var(--txt);
  padding: 12px 14px; border-radius: var(--radius); font-size: 14px;
}
.login-card input:focus { outline: none; border-color: var(--accent); }

/* --------------------------------------------------------------- layout */
#app { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; background: var(--bg2); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 14px; gap: 14px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; flex-shrink: 0;
}
.side-top { display: flex; align-items: center; justify-content: space-between; }
.logo.small { font-weight: 700; font-size: 16px; }
.side-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { background: var(--bg3); border-radius: var(--radius); padding: 10px; }
.stat b { display: block; font-size: 18px; }
.stat span { font-size: 11px; color: var(--muted); }

/* navigation par vues */
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: none; border: none; color: var(--txt); padding: 9px 10px;
  border-radius: 8px; cursor: pointer; font-size: 14px;
}
.nav-item:hover { background: var(--bg3); }
.nav-item.active { background: var(--accent); color: #fff; }
.nav-item .badge {
  margin-left: auto; background: var(--warn); color: #000; font-size: 11px;
  border-radius: 10px; padding: 0 7px; font-weight: 600; min-width: 18px; text-align: center;
}
.nav-item .badge:empty { display: none; }
.nav-item.active .badge { background: #fff; color: var(--accent); }

.side-section { display: flex; flex-direction: column; gap: 6px; }
.side-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); display: flex; justify-content: space-between; align-items: center;
}
.side-hint { font-size: 11px; color: var(--muted); margin: -2px 0 6px; }
.side-list { display: flex; flex-direction: column; gap: 2px; }
.side-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 10px; border-radius: 8px; cursor: pointer; gap: 6px;
}
.side-item:hover { background: var(--bg3); }
.side-item.active { background: var(--accent); color: #fff; }
.side-item .n { font-size: 11px; color: var(--muted); }
.side-item.active .n { color: #dbe7ff; }
.side-item.drop-target { outline: 2px dashed var(--accent); outline-offset: -2px; }
.side-bottom { margin-top: auto; }
.side-link {
  background: none; border: none; color: var(--muted); text-align: left;
  padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; width: 100%;
}
.side-link:hover { background: var(--bg3); color: var(--txt); }
.side-link.danger:hover { color: var(--danger); }
.side-link.small-link { font-size: 12px; padding: 6px 8px; margin-top: 4px; opacity: .85; }
.icon-btn {
  background: none; border: 1px solid var(--line); color: var(--muted);
  border-radius: 6px; width: 26px; height: 26px; cursor: pointer; line-height: 1; flex-shrink: 0;
}
.icon-btn:hover { color: var(--txt); border-color: var(--accent); }
.icon-btn.mini { font-size: 12px; width: auto; padding: 0 5px; border: none; opacity: 0; transition: opacity .12s; }
.side-item:hover .icon-btn.mini { opacity: .7; }
.icon-btn.mini:hover { opacity: 1; }
.row-actions { display: inline-flex; align-items: center; gap: 4px; }

/* --------------------------------------------------------------- main */
.main { flex: 1; display: flex; flex-direction: column; padding: 16px 20px; min-width: 0; }
.view { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.view-title { font-size: 18px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.toolbar input, .toolbar select, .btn, select, input[type=text], input[type=search] {
  background: var(--bg2); border: 1px solid var(--line); color: var(--txt);
  border-radius: var(--radius); padding: 9px 12px; font-size: 13px;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }
.btn { cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: rgba(224,96,96,.12); }
.btn.ghost { border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--txt); border-color: var(--line); }
.btn.full { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }

.tabs { display: flex; gap: 4px; }
.tab { background: var(--bg2); border: 1px solid var(--line); color: var(--muted);
  padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.breadcrumb { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 2px; font-size: 13px; }
.breadcrumb .crumb-count { font-size: 12px; color: var(--muted); }

.filter-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; align-items: center; }
.chip {
  background: var(--bg3); border: 1px solid var(--line); border-radius: 20px;
  padding: 4px 12px; font-size: 12px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center;
}
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip .x { opacity: .6; } .chip .x:hover { opacity: 1; }

.groups { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.group-card { background: var(--bg3); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; min-width: 140px; }
.group-card b { display: block; font-size: 15px; }
.group-card span { font-size: 11px; color: var(--muted); }

/* --------------------------------------------------------------- tables */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg2); flex: 1; min-height: 120px; }
table { width: 100%; border-collapse: collapse; }
thead th {
  position: sticky; top: 0; background: var(--bg3); text-align: left;
  padding: 10px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none;
}
#table-head th[data-key] { cursor: pointer; }
#table-head th[data-key]:hover { color: var(--accent); }
tbody td { padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--bg3); }
tbody tr.dragging { opacity: .4; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: 11px; margin-right: 4px; border: 1px solid transparent; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-icon { font-size: 42px; margin-bottom: 8px; }
.empty .btn { margin-top: 12px; }

.pagination { display: flex; gap: 6px; padding: 12px 0; align-items: center; }
.pagination button { background: var(--bg2); border: 1px solid var(--line); color: var(--txt); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.pagination button.cur { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination button:disabled { opacity: .4; cursor: default; }

.selection-bar {
  position: sticky; bottom: 0; background: var(--bg3); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 14px; display: flex; gap: 8px; align-items: center;
  margin-top: 8px; flex-wrap: wrap; box-shadow: var(--shadow);
}
.selection-bar #sel-count, .selection-bar #files-sel-count { font-weight: 600; }

/* --------------------------------------------------------------- doublons */
.dupes-body { overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 12px; }
.dupe-group { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg2); padding: 12px 14px; }
.dupe-group > .dg-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 13px; }
.dupe-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 6px; background: var(--bg3); flex-wrap: wrap; }
.dupe-row.keep { border-color: var(--accent2); }
.dupe-row .dr-main { flex: 1; min-width: 180px; }
.dupe-row .dr-main b { display: block; }
.dupe-row .dr-sub { font-size: 12px; color: var(--muted); }
.dr-badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; margin-left: 6px; white-space: nowrap; display: inline-block; }
.dr-badge.ok { background: rgba(126,224,163,.16); color: var(--accent2); border: 1px solid var(--accent2); }
.dr-badge.warn { background: rgba(224,176,96,.16); color: var(--warn); border: 1px solid var(--warn); }
.keep-tag { display: none; font-size: 11px; font-weight: 600; color: var(--accent2); background: rgba(126,224,163,.16); border: 1px solid var(--accent2); border-radius: 10px; padding: 2px 8px; white-space: nowrap; margin-left: auto; }
.dupe-row.keep .keep-tag { display: inline-block; }

/* --------------------------------------------------------------- fusion */
.merge-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; overflow: auto; flex: 1; align-content: start; }
.merge-col { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.merge-col h3 { font-size: 14px; margin: 16px 0 8px; } .merge-col h3:first-child { margin-top: 0; }
.radio-row, .check-row { display: flex; gap: 8px; align-items: center; font-size: 13px; margin: 8px 0; cursor: pointer; }
.merge-sources { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.merge-sources label { display: flex; gap: 8px; align-items: center; font-size: 13px; padding: 3px 4px; }
.merge-result { margin-top: 12px; font-size: 13px; }
.merge-result a { color: var(--accent); }

/* --------------------------------------------------------------- corbeille */
.trash-body { overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 14px; }
.trash-group h3 { font-size: 13px; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .06em; }
.trash-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg2); margin-bottom: 6px; }
.trash-item .ti-main { flex: 1; min-width: 0; }
.trash-item .ti-main b { display: block; }
.trash-item .ti-sub { font-size: 12px; color: var(--muted); }

/* --------------------------------------------------------------- modales */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-box { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; width: 520px; max-width: 96vw; max-height: 92vh; overflow: auto; padding: 22px; box-shadow: var(--shadow); }
.modal-box.wide { width: 680px; }
.modal-box.sm { width: 400px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-head h3 { font-size: 17px; }
.modal-actions { display: flex; gap: 8px; margin-top: 18px; justify-content: flex-end; align-items: center; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.form-row input, .form-row select { width: 100%; }
.ask-input { width: 100%; background: var(--bg3); border: 1px solid var(--line); color: var(--txt); border-radius: 8px; padding: 10px 12px; margin-top: 6px; }

/* upload */
.drop-zone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 28px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; }
.drop-zone:hover, .drop-zone.dragover { border-color: var(--accent); background: rgba(91,141,239,.08); }
.dz-icon { font-size: 34px; margin-bottom: 6px; }
.drop-filelist { font-size: 12px; color: var(--muted); margin: 8px 0; }
.upload-results { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.upload-res { background: var(--bg3); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.upload-res.ok { border-left: 3px solid var(--accent2); }
.upload-res.warn { border-left: 3px solid var(--warn); }
.upload-res b { display: block; }

/* record form */
.record-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.record-form .form-row.full { grid-column: 1 / -1; }
.record-form input { background: var(--bg3); border: 1px solid var(--line); color: var(--txt); border-radius: 8px; padding: 9px 11px; font-size: 13px; width: 100%; }
.record-meta { grid-column: 1 / -1; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; }
.cat-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-picker .chip.active { outline: 1px solid var(--accent); }

/* triage import */
.upload-review { max-height: 46vh; overflow-y: auto; margin: 10px 0; }
.review-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 10px; background: var(--bg3); }
.review-item .rv-cat { display: flex; align-items: center; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.review-item .rv-cat label { color: var(--muted); font-size: 13px; }
.review-item .rv-cat-sel, .review-item .rv-cat-new { padding: 5px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg2); color: var(--txt); }
.review-item .rv-cat-new { flex: 1; min-width: 160px; }
.review-item details { margin-top: 6px; }
.review-item summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.review-item .rv-preview { font-size: 13px; line-height: 1.5; margin-top: 6px; }
.review-item .rv-text { white-space: pre-wrap; max-height: 160px; overflow: auto; background: var(--bg); padding: 8px; border-radius: 8px; font-size: 12px; color: var(--muted); }

/* audit */
.audit-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow: auto; }
.audit-item { background: var(--bg3); border-radius: 8px; padding: 8px 12px; font-size: 12px; }
.audit-item .t { color: var(--muted); }

/* toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--bg3); border: 1px solid var(--accent); color: var(--txt);
  padding: 10px 20px; border-radius: 10px; z-index: 100; font-size: 13px; box-shadow: var(--shadow);
}
.toast.error { border-color: var(--danger); }

/* --------------------------------------------- vue fichiers facon explorateur */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg-btn { background: var(--bg2); border: none; color: var(--muted); padding: 9px 12px; cursor: pointer; font-size: 13px; }
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn:hover { color: var(--txt); }
.seg-btn.active { background: var(--accent); color: #fff; }

.files-grid { overflow: auto; flex: 1; padding: 4px 2px; }
.fg-group { margin-bottom: 18px; }
.fg-head { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--line); padding: 4px 2px 6px; margin-bottom: 10px; }
.fg-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(106px, 1fr)); gap: 6px; }
.fg-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px 10px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; text-align: center; }
.fg-card:hover { background: var(--bg3); border-color: var(--line); }
.fg-card.sel { background: var(--bg3); border-color: var(--accent); }
.fg-cb { position: absolute; top: 6px; left: 6px; opacity: 0; transition: opacity .12s; cursor: pointer; }
.fg-card:hover .fg-cb, .fg-card.sel .fg-cb { opacity: 1; }
.fg-icon { width: 56px; height: 64px; display: flex; align-items: center; justify-content: center; }
.fi-svg { width: 46px; height: 58px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.25)); }
.fi-thumb { max-width: 64px; max-height: 64px; border-radius: 6px; border: 1px solid var(--line); object-fit: cover; background: var(--bg3); }
.fg-name { font-size: 12px; line-height: 1.25; max-width: 100%; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fg-meta { font-size: 11px; color: var(--muted); }
.fi-pdf { object-fit: cover; object-position: top; }

/* tailles d'icones */
.files-grid.size-s .fg-items { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.files-grid.size-s .fg-icon { width: 42px; height: 50px; }
.files-grid.size-s .fi-svg { width: 34px; height: 44px; }
.files-grid.size-s .fi-thumb { max-width: 46px; max-height: 50px; }
.files-grid.size-s .fg-name { font-size: 11px; }
.files-grid.size-l .fg-items { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.files-grid.size-l .fg-icon { width: 92px; height: 104px; }
.files-grid.size-l .fi-svg { width: 74px; height: 92px; }
.files-grid.size-l .fi-thumb { max-width: 120px; max-height: 104px; }
.files-grid.size-l .fg-name { font-size: 13px; }

/* cartes de fiches (contacts) */
.records-cards { overflow: auto; flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; align-content: start; padding: 2px; }
.rc-card { position: relative; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; }
.rc-card:hover { border-color: var(--accent); }
.rc-card.sel { border-color: var(--accent); background: var(--bg3); }
.rc-cb { position: absolute; top: 10px; right: 10px; cursor: pointer; opacity: 0; transition: opacity .12s; }
.rc-card:hover .rc-cb, .rc-card.sel .rc-cb { opacity: 1; }
.rc-top { display: flex; align-items: center; gap: 10px; }
.rc-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; flex-shrink: 0; }
.rc-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-lines { display: flex; flex-direction: column; gap: 2px; }
.rc-line { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-foot { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 2px; }
.rc-folder { margin-left: auto; }

/* --------------------------------------------------------------- explorateur */
.exp-breadcrumb { display: flex; align-items: center; gap: 4px; font-size: 16px; font-weight: 600; flex-wrap: wrap; }
.exp-breadcrumb .crumb-link { cursor: pointer; padding: 3px 7px; border-radius: 7px; }
.exp-breadcrumb .crumb-link:hover { background: var(--bg3); color: var(--accent); }
.exp-breadcrumb .crumb-sep { color: var(--muted); }
.folder-card .fg-icon { align-items: center; }
.folder-svg { width: 52px; height: auto; }
.fg-card.folder-card:hover { background: rgba(243,194,73,.10); border-color: #e3b23c; }
.fd-actions { display: flex; gap: 8px; margin: 10px 0 4px; flex-wrap: wrap; }
.fd-sub { margin: 14px 0 8px; font-size: 14px; }
.fd-records { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; max-height: 55vh; overflow: auto; }
.fd-records .rc-card { cursor: pointer; }
.exp-table { width: 100%; border-collapse: collapse; }
.exp-table th { position: sticky; top: 0; background: var(--bg3); color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.exp-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.exp-table tbody tr { cursor: pointer; } .exp-table tbody tr:hover { background: var(--bg3); }
.exp-table tbody tr.drop-target { outline: 2px dashed var(--accent); outline-offset: -2px; }
.list-badge { display: inline-block; color: #fff; font-size: 10px; font-weight: 700; border-radius: 5px; padding: 2px 6px; min-width: 34px; text-align: center; }
.files-grid.aslist { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg2); }

/* menu contextuel (clic droit) */
.ctxmenu { position: fixed; z-index: 200; min-width: 180px; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 4px; }
.ctx-item { padding: 8px 12px; border-radius: 7px; cursor: pointer; font-size: 13px; white-space: nowrap; }
.ctx-item:hover { background: var(--bg3); }
.ctx-item.danger { color: var(--danger); }
.ctx-item.danger:hover { background: rgba(224,96,96,.12); }
.ctx-sep { height: 1px; background: var(--line); margin: 4px 6px; }

/* --------------------------------------------------------------- editeur */
.editor-hint { margin: 0 2px 8px; }
.editor-wrap { overflow: auto; flex: 1; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg2); }
.editor-table { width: 100%; border-collapse: collapse; }
.editor-table th { position: sticky; top: 0; background: var(--bg3); color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.editor-table td { padding: 2px 4px; border-bottom: 1px solid var(--line); }
.editor-table tr:hover { background: var(--bg3); }
.editor-table .ed-cell { width: 100%; min-width: 120px; background: transparent; border: 1px solid transparent; color: var(--txt); border-radius: 6px; padding: 6px 8px; font-size: 13px; }
.editor-table .ed-cell:hover { border-color: var(--line); }
.editor-table .ed-cell:focus { outline: none; border-color: var(--accent); background: var(--bg3); }

@media (max-width: 900px) {
  #app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: column; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .nav-item { width: auto; }
  .nav-item span:not(.badge) { display: none; }
  .record-form, .merge-wrap { grid-template-columns: 1fr; }
}
