/* ==========================================================================
   Be Consulting · Navigateur SVN — feuille de style principale
   ========================================================================== */

:root {
  --font: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", Roboto, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  --accent: #5b5bf0;
  --accent-2: #8b5cf6;
  --accent-strong: #4338ca;
  --accent-soft: rgba(91, 91, 240, .10);
  --accent-ring: rgba(91, 91, 240, .35);
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #d946ef 120%);

  --bg: #f5f6fa;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f2f3f8;
  --surface-3: #e9ebf3;
  --hover: rgba(15, 23, 42, .045);
  --border: #e5e7ef;
  --border-strong: #d6d9e4;
  --text: #0f1729;
  --text-2: #3b4458;
  --muted: #6b7489;
  --faint: #9aa2b4;

  --green: #16a34a; --red: #dc2626; --orange: #ea580c; --amber: #d97706; --blue: #2563eb; --purple: #9333ea; --teal: #0d9488; --pink: #db2777; --slate: #64748b;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px -6px rgba(15, 23, 42, .10);
  --shadow-lg: 0 2px 6px rgba(15, 23, 42, .06), 0 24px 64px -12px rgba(15, 23, 42, .25);

  --r-sm: 8px; --r: 12px; --r-lg: 18px; --r-xl: 24px;
  --sidebar-w: 272px;
  --preview-w: min(46vw, 760px);
  --topbar-h: 64px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  color-scheme: light;
}

:root[data-theme="dark"] {
  --accent: #8183ff;
  --accent-2: #a78bfa;
  --accent-strong: #a5b4fc;
  --accent-soft: rgba(129, 131, 255, .14);
  --accent-ring: rgba(129, 131, 255, .45);

  --bg: #0a0c12;
  --bg-elev: #10131b;
  --surface: #12151e;
  --surface-2: #181c27;
  --surface-3: #212634;
  --hover: rgba(255, 255, 255, .045);
  --border: #222736;
  --border-strong: #2e3446;
  --text: #eceef5;
  --text-2: #c3c8d6;
  --muted: #8a93a8;
  --faint: #5d6579;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 30px -8px rgba(0, 0, 0, .6);
  --shadow-lg: 0 2px 8px rgba(0, 0, 0, .4), 0 30px 80px -10px rgba(0, 0, 0, .75);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-ring); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* Scrollbars discrètes */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }

/* ---------- Démarrage ---------- */
.boot { height: 100vh; display: grid; place-items: center; }
.boot-mark {
  width: 56px; height: 56px; border-radius: 16px; background: var(--grad); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-family: var(--font-display); letter-spacing: .5px;
  animation: pulse 1.4s var(--ease) infinite;
}
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.92); opacity: .7; } }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: 10px;
  font-weight: 560; font-size: 14px; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary {
  background: var(--grad); color: #fff; border-color: transparent;
  box-shadow: 0 1px 2px rgba(79, 70, 229, .3), 0 8px 20px -6px rgba(99, 102, 241, .55);
}
.btn-primary:hover { background: var(--grad); filter: brightness(1.06); border-color: transparent; }
.btn-primary:disabled { filter: grayscale(.4) opacity(.7); cursor: progress; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--hover); border-color: transparent; }
.btn-lg { height: 46px; padding: 0 20px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; display: inline-grid; place-items: center;
  color: var(--text-2); transition: background .15s, color .15s; flex: none;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn.active { background: var(--accent-soft); color: var(--accent); }

/* ---------- Champs ---------- */
.field { display: grid; gap: 7px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.input {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border-strong);
  transition: border-color .15s, box-shadow .15s; outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.input-wrap { position: relative; }
.input-wrap .input { padding-left: 42px; }
.input-wrap > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--faint); pointer-events: none; }
.input-wrap .reveal { position: absolute; right: 4px; top: 4px; }

/* ==========================================================================
   Connexion
   ========================================================================== */
.login {
  height: 100vh; height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(420px, 1fr);
  overflow: auto;
}
.login-art {
  position: relative; overflow: hidden; color: #fff; padding: 48px 56px;
  display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(900px 600px at 10% 10%, rgba(139, 92, 246, .55), transparent 60%),
    radial-gradient(700px 500px at 90% 80%, rgba(217, 70, 239, .35), transparent 60%),
    radial-gradient(600px 600px at 70% 20%, rgba(56, 189, 248, .25), transparent 60%),
    linear-gradient(160deg, #1e1b4b 0%, #0f0c29 55%, #120a24 100%);
}
.login-art::before {
  content: ""; position: absolute; inset: 0; opacity: .35;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 40% 40%, #000 20%, transparent 75%);
}
.login-art > * { position: relative; }
.brand-row { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: none;
  background: var(--grad); color: #fff; font-family: var(--font-display); font-weight: 700; letter-spacing: .3px;
  box-shadow: 0 8px 24px -6px rgba(139, 92, 246, .7), inset 0 1px 0 rgba(255,255,255,.25);
}
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; line-height: 1.15; }
.brand-tag { font-size: 12.5px; opacity: .7; }
.login-hero h1 {
  font-family: var(--font-display); font-size: clamp(34px, 3.6vw, 52px); line-height: 1.05; letter-spacing: -.02em; margin: 0 0 18px; font-weight: 700;
}
.login-hero h1 span { background: linear-gradient(90deg, #c4b5fd, #f0abfc, #93c5fd); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-hero p { font-size: 16.5px; opacity: .78; max-width: 460px; margin: 0; }
.login-features { display: grid; gap: 14px; max-width: 460px; margin-top: 40px; }
.login-feature { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.09); backdrop-filter: blur(6px); }
.login-feature svg { width: 20px; height: 20px; flex: none; margin-top: 2px; color: #c4b5fd; }
.login-feature b { display: block; font-weight: 600; font-size: 14.5px; }
.login-feature span { font-size: 13.5px; opacity: .72; }
.login-foot { font-size: 12.5px; opacity: .55; }

/* Aperçu flottant décoratif */
.float-cards { position: absolute; right: -40px; top: 46%; width: 300px; transform: rotate(-8deg); pointer-events: none; }
.float-card { height: 54px; border-radius: 14px; margin-bottom: 12px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); display: flex; align-items: center; gap: 12px; padding: 0 14px; backdrop-filter: blur(4px); }
.float-card i { width: 26px; height: 32px; border-radius: 5px; display: block; }
.float-card s { display: block; height: 8px; border-radius: 4px; background: rgba(255,255,255,.25); flex: 1; text-decoration: none; }

.login-panel { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.login-card { width: 100%; max-width: 400px; }
.login-card h2 { font-family: var(--font-display); font-size: 28px; letter-spacing: -.015em; margin: 0 0 6px; }
.login-card .sub { color: var(--muted); margin: 0 0 28px; }
.login-card form { display: grid; gap: 18px; }
.login-mobile-brand { display: none; }
.form-error {
  display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 11px; font-size: 13.5px;
  background: color-mix(in srgb, var(--red) 10%, transparent); color: color-mix(in srgb, var(--red) 85%, var(--text));
  border: 1px solid color-mix(in srgb, var(--red) 25%, transparent);
}
.form-error svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.security-note { display: flex; gap: 8px; align-items: center; justify-content: center; color: var(--faint); font-size: 12.5px; margin-top: 26px; }
.security-note svg { width: 14px; height: 14px; }
.steps { display: flex; gap: 6px; margin-bottom: 26px; }
.steps i { height: 4px; flex: 1; border-radius: 4px; background: var(--surface-3); }
.steps i.on { background: var(--grad); }

/* Code à 6 chiffres */
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp input {
  height: 58px; text-align: center; font-size: 24px; font-weight: 650; font-family: var(--mono);
  border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s, transform .15s; padding: 0; min-width: 0;
}
.otp input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); transform: translateY(-1px); }
.otp.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.enroll { display: grid; gap: 16px; }
.qr { width: 196px; height: 196px; margin: 0 auto; padding: 10px; background: #fff; border-radius: 16px; box-shadow: var(--shadow); }
.qr svg { width: 100%; height: 100%; }
.secret-box { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--border-strong); }
.secret-box code { flex: 1; font-family: var(--mono); font-size: 13px; letter-spacing: 1.5px; word-break: break-all; }
.enroll ol { margin: 0; padding-left: 20px; color: var(--text-2); font-size: 13.5px; display: grid; gap: 4px; }

/* ==========================================================================
   Coquille de l'application
   ========================================================================== */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); height: 100vh; height: 100dvh; }

/* ---------- Barre latérale ---------- */
.sidebar {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--bg-elev); border-right: 1px solid var(--border);
  padding: 18px 14px calc(14px + var(--safe-b));
}
.sidebar .brand-row { padding: 4px 8px 20px; }
.sidebar .brand-name { color: var(--text); }
.sidebar .brand-tag { color: var(--muted); opacity: 1; }
.nav-section { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 18px 10px 8px; display: flex; align-items: center; justify-content: space-between; }
.nav { display: grid; gap: 2px; }
.nav-scroll { overflow: auto; min-height: 0; flex: 1; margin: 0 -6px; padding: 0 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 0 10px; height: 38px; border-radius: 10px;
  color: var(--text-2); font-weight: 520; transition: background .15s, color .15s; text-align: left; width: 100%;
}
.nav-item:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 620; }
:root[data-theme="dark"] .nav-item.active { color: var(--text); }
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav-item .repo-dot { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700; flex: none; }
.nav-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 4px; }
.user-chip .who { min-width: 0; }
.user-chip b { display: block; font-size: 13.5px; font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip small { color: var(--muted); font-size: 12px; display: flex; gap: 5px; align-items: center; }
.user-chip small i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); display: block; box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 20%, transparent); }

.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-size: 12px; font-weight: 700; color: #fff; text-transform: uppercase; letter-spacing: .02em;
}
.avatar.sm { width: 22px; height: 22px; font-size: 9.5px; }
.avatar.lg { width: 40px; height: 40px; font-size: 14px; }

/* ---------- Zone principale ---------- */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.topbar {
  height: var(--topbar-h); flex: none; display: flex; align-items: center; gap: 10px; padding: 0 20px 0 24px;
  border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  position: relative; z-index: 5;
}
.topbar .menu-btn { display: none; }
.crumbs { display: flex; align-items: center; gap: 2px; min-width: 120px; flex: 1 1 auto; overflow: hidden; }
.crumb {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 8px; border-radius: 8px;
  color: var(--muted); font-weight: 560; white-space: nowrap; max-width: 220px; min-width: 0;
}
.crumb span { overflow: hidden; text-overflow: ellipsis; }
.crumb:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.crumb.current { color: var(--text); font-weight: 650; }
.crumb svg { width: 16px; height: 16px; flex: none; }
.crumb-sep { color: var(--faint); flex: none; }
.crumb-sep svg { width: 14px; height: 14px; }
.crumb-ellipsis { color: var(--muted); padding: 0 6px; }

.search {
  position: relative; flex: 0 1 320px; min-width: 150px;
}
.search input {
  width: 100%; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  padding: 0 40px 0 38px; outline: none; transition: border-color .15s, box-shadow .15s, width .2s;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.search > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--faint); pointer-events: none; }
.search kbd {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 6px; padding: 1px 6px; background: var(--surface-2);
}
.topbar-actions { display: flex; align-items: center; gap: 4px; flex: 0 1 auto; min-width: 0; justify-content: flex-end; }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); }
.seg button { width: 32px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); }
.seg button svg { width: 17px; height: 17px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.content { flex: 1; overflow: auto; min-height: 0; overscroll-behavior: contain; }
.content-inner { padding: 28px 32px calc(48px + var(--safe-b)); max-width: 1400px; margin: 0 auto; }

/* ---------- En-tête de dossier ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-title { display: flex; align-items: center; gap: 16px; min-width: 0; }
.page-title .big-icon { width: 52px; height: 52px; flex: none; }
.page-title h1 { font-family: var(--font-display); font-size: 26px; letter-spacing: -.02em; line-height: 1.15; margin: 0; overflow-wrap: anywhere; }
.page-meta { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 4px; }
.page-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.page-meta svg { width: 14px; height: 14px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Liste de fichiers ---------- */
.file-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.list-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.file-table th {
  text-align: left; font-size: 12px; font-weight: 620; color: var(--muted); text-transform: uppercase; letter-spacing: .05em;
  padding: 0 14px; height: 42px; border-bottom: 1px solid var(--border); background: var(--surface-2); position: sticky; top: 0; z-index: 1;
  white-space: nowrap; user-select: none;
}
.file-table th button { display: inline-flex; align-items: center; gap: 5px; text-transform: inherit; letter-spacing: inherit; font-weight: inherit; color: inherit; }
.file-table th button:hover { color: var(--text); }
.file-table th button svg { width: 13px; height: 13px; }
.file-table th:first-child, .file-table td:first-child { padding-left: 20px; }
.file-table th:last-child, .file-table td:last-child { padding-right: 16px; }
.file-table td { padding: 0 14px; height: 54px; border-bottom: 1px solid var(--border); color: var(--text-2); font-size: 13.5px; white-space: nowrap; }
.file-table tr:last-child td { border-bottom: 0; }
.file-row { cursor: pointer; transition: background .12s; }
.file-row:hover { background: var(--hover); }
.file-row.selected { background: var(--accent-soft); }
.file-row.selected td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.file-name { display: flex; align-items: center; gap: 12px; min-width: 0; max-width: 100%; }
.file-name .ficon { width: 32px; height: 32px; flex: none; }
.file-name .label { font-weight: 560; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.file-name .sub { display: none; }
.col-name { width: 100%; max-width: 0; }
.col-author .author { display: inline-flex; align-items: center; gap: 8px; }
.col-rev .rev, .rev-badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px;
  font-family: var(--mono); font-size: 11.5px; font-weight: 600; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border);
}
.col-size { text-align: right; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; opacity: 0; transition: opacity .15s; }
.file-row:hover .row-actions, .file-row:focus-within .row-actions { opacity: 1; }
.row-actions .icon-btn { width: 32px; height: 32px; }
.row-actions .icon-btn svg { width: 17px; height: 17px; }

/* ---------- Grille ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 12px; padding: 18px 16px 14px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); text-align: left;
  transition: transform .18s var(--ease), box-shadow .18s, border-color .18s; min-width: 0;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.tile.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.tile .tile-visual { height: 92px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); overflow: hidden; }
.tile .tile-visual .ficon { width: 52px; height: 52px; }
.tile .tile-visual img { width: 100%; height: 100%; object-fit: cover; }
.tile b { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.tile small { color: var(--muted); font-size: 12px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- États ---------- */
.empty { text-align: center; padding: 64px 24px; color: var(--muted); }
.empty .empty-icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 20px; display: grid; place-items: center; background: var(--surface-2); color: var(--faint); }
.empty .empty-icon svg { width: 30px; height: 30px; }
.empty h3 { color: var(--text); margin: 0 0 6px; font-size: 16px; }
.empty p { margin: 0 auto; max-width: 380px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 45%, var(--surface-2) 65%); background-size: 300% 100%; animation: shimmer 1.4s infinite; border-radius: 6px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.sk-row { display: flex; align-items: center; gap: 14px; height: 54px; padding: 0 20px; border-bottom: 1px solid var(--border); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center-pad { display: grid; place-items: center; gap: 14px; padding: 60px 20px; color: var(--muted); text-align: center; }

/* ==========================================================================
   Tableau de bord
   ========================================================================== */
.hello { margin-bottom: 28px; }
.hello h1 { font-family: var(--font-display); font-size: 30px; letter-spacing: -.02em; margin: 0; }
.hello h1 span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hello p { color: var(--muted); margin: 4px 0 0; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 32px 0 14px; }
.section-title h2 { font-size: 15px; font-weight: 680; margin: 0; display: flex; align-items: center; gap: 8px; }
.section-title h2 svg { width: 17px; height: 17px; color: var(--muted); }
.repo-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.repo-card {
  position: relative; overflow: hidden; padding: 18px; border-radius: var(--r-lg); text-align: left;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: transform .18s var(--ease), box-shadow .18s, border-color .18s; display: grid; gap: 14px;
}
.repo-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); text-decoration: none; }
.repo-card::after { content: ""; position: absolute; inset: 0 0 auto auto; width: 140px; height: 140px; border-radius: 50%; background: var(--c, var(--accent)); opacity: .07; transform: translate(40%, -45%); }
.repo-card .repo-head { display: flex; align-items: center; gap: 12px; }
.repo-card .repo-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px; flex: none; }
.repo-card b { font-size: 15px; color: var(--text); display: block; }
.repo-card small { color: var(--muted); font-size: 12.5px; }
.repo-card .repo-last { font-size: 13px; color: var(--text-2); display: flex; gap: 8px; align-items: center; min-width: 0; }
.repo-card .repo-last span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.timeline { display: grid; gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.commit { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.commit:last-child { border-bottom: 0; }
.commit-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.commit-head b { color: var(--text); font-weight: 620; }
.commit-msg { margin: 4px 0 8px; color: var(--text); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.commit-msg.none { color: var(--faint); font-style: italic; }
.repo-pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 620; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.repo-pill i { width: 7px; height: 7px; border-radius: 50%; display: block; }
.changes { display: grid; gap: 3px; }
.change { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; color: var(--text-2); text-align: left; padding: 3px 6px; margin: 0 -6px; border-radius: 7px; }
button.change:hover { background: var(--hover); color: var(--text); }
.change .act { width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center; font-size: 10.5px; font-weight: 750; flex: none; font-family: var(--mono); }
.act.A { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.act.M { background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); }
.act.D { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.act.R { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); }
.change span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: rtl; text-align: left; unicode-bidi: plaintext; }
.more-changes { font-size: 12.5px; color: var(--muted); padding-left: 26px; }

/* ==========================================================================
   Panneau d'aperçu
   ========================================================================== */
.preview-layer { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.preview-backdrop { position: absolute; inset: 0; background: rgba(10, 12, 20, .42); opacity: 0; transition: opacity .25s; backdrop-filter: blur(2px); }
.preview {
  position: absolute; top: 0; right: 0; bottom: 0; width: var(--preview-w); max-width: 100vw;
  background: var(--bg-elev); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; transform: translateX(105%); transition: transform .32s var(--ease);
  pointer-events: auto;
}
.preview-layer.open { pointer-events: auto; }
.preview-layer.open .preview-backdrop { opacity: 1; }
.preview-layer.open .preview { transform: none; }
.preview-layer.full .preview { width: 100vw; }
.preview-head { flex: none; padding: 16px 16px 0 20px; padding-top: calc(16px + var(--safe-t)); border-bottom: 1px solid var(--border); }
.preview-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.preview-title .ficon { width: 36px; height: 36px; flex: none; }
.preview-title .t { min-width: 0; flex: 1; }
.preview-title h3 { margin: 0; font-size: 15.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-title small { color: var(--muted); font-size: 12.5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.preview-tools { display: flex; gap: 2px; flex: none; }
.tabs { display: flex; gap: 4px; margin-top: 12px; }
.tab { height: 40px; padding: 0 12px; font-weight: 580; font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent; display: inline-flex; align-items: center; gap: 7px; }
.tab svg { width: 16px; height: 16px; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); border-bottom-color: var(--accent); }
.tab .count { font-size: 11px; background: var(--surface-2); border-radius: 999px; padding: 0 6px; color: var(--muted); }
.preview-body { flex: 1; min-height: 0; overflow: auto; position: relative; background: var(--surface-2); overscroll-behavior: contain; }
.preview-body.plain { background: var(--bg-elev); }
.rev-banner {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px 9px 20px; font-size: 13px;
  background: color-mix(in srgb, var(--amber) 12%, var(--bg-elev)); border-bottom: 1px solid color-mix(in srgb, var(--amber) 25%, transparent);
  color: color-mix(in srgb, var(--amber) 70%, var(--text));
}
.rev-banner svg { width: 16px; height: 16px; flex: none; }
.rev-banner .btn { height: 30px; margin-left: auto; font-size: 12.5px; }

/* Rendus */
.pv-image { min-height: 100%; display: grid; place-items: center; padding: 24px;
  background-color: var(--surface-2);
  background-image: linear-gradient(45deg, var(--surface-3) 25%, transparent 25%), linear-gradient(-45deg, var(--surface-3) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--surface-3) 75%), linear-gradient(-45deg, transparent 75%, var(--surface-3) 75%);
  background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; }
.pv-image img { max-width: 100%; max-height: calc(100vh - 220px); border-radius: 8px; box-shadow: var(--shadow); cursor: zoom-in; background: #fff; }
.pv-image.zoom { place-items: start; overflow: auto; }
.pv-image.zoom img { max-width: none; max-height: none; cursor: zoom-out; }
.pv-pages { display: grid; justify-items: center; gap: 16px; padding: 20px 16px 40px; }
.pv-page { background: #fff; box-shadow: var(--shadow); border-radius: 4px; position: relative; }
.pv-page canvas { display: block; width: 100%; height: 100%; border-radius: 4px; }
.pv-page .pg { position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%); font-size: 11.5px; color: var(--muted); }
.pv-toolbar {
  position: sticky; top: 12px; z-index: 3; margin: 12px auto 0; width: max-content; display: flex; align-items: center; gap: 4px;
  padding: 4px; border-radius: 12px; background: color-mix(in srgb, var(--bg-elev) 88%, transparent); border: 1px solid var(--border);
  box-shadow: var(--shadow); backdrop-filter: blur(10px);
}
.pv-toolbar .icon-btn { width: 32px; height: 32px; }
.pv-toolbar span { font-size: 12.5px; color: var(--text-2); padding: 0 8px; font-variant-numeric: tabular-nums; min-width: 64px; text-align: center; }
.pv-code { margin: 0; padding: 16px 0; font-family: var(--mono); font-size: 12.8px; line-height: 1.6; background: var(--bg-elev); min-height: 100%; counter-reset: ln; tab-size: 4; }
.pv-code .ln { display: block; padding: 0 20px 0 0; white-space: pre; }
.pv-code.wrap .ln { white-space: pre-wrap; overflow-wrap: anywhere; }
.pv-code .ln::before { counter-increment: ln; content: counter(ln); display: inline-block; width: 52px; padding-right: 16px; margin-right: 4px; text-align: right; color: var(--faint); user-select: none; border-right: 1px solid var(--border); }
.pv-code.wrap .ln { padding-left: 72px; text-indent: -72px; }
.pv-markdown { padding: 28px clamp(20px, 4vw, 48px) 60px; background: var(--bg-elev); min-height: 100%; max-width: 860px; margin: 0 auto; font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.pv-markdown h1, .pv-markdown h2, .pv-markdown h3 { font-family: var(--font-display); letter-spacing: -.01em; line-height: 1.25; margin: 1.6em 0 .6em; }
.pv-markdown h1 { font-size: 1.9em; margin-top: 0; } .pv-markdown h2 { font-size: 1.45em; border-bottom: 1px solid var(--border); padding-bottom: .3em; }
.pv-markdown code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: .1em .4em; }
.pv-markdown pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; overflow: auto; }
.pv-markdown pre code { background: none; border: 0; padding: 0; }
.pv-markdown blockquote { margin: 1em 0; padding: .2em 1em; border-left: 3px solid var(--accent); color: var(--text-2); background: var(--accent-soft); border-radius: 0 10px 10px 0; }
.pv-markdown table { border-collapse: collapse; display: block; overflow: auto; }
.pv-markdown th, .pv-markdown td { border: 1px solid var(--border); padding: 6px 12px; }
.pv-markdown img { max-width: 100%; display: inline; }
.pv-docx { padding: 16px 0 40px; overflow-x: hidden; }
.pv-docx .docx-wrapper { background: transparent !important; padding: 0 !important; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.pv-docx .docx-wrapper > section.docx { box-shadow: var(--shadow) !important; margin: 0 !important; border-radius: 3px; color: #111; }
.pv-sheet { display: flex; flex-direction: column; height: 100%; background: var(--bg-elev); }
.sheet-tabs { display: flex; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--border); overflow-x: auto; flex: none; background: var(--surface-2); }
.sheet-tabs button { height: 30px; padding: 0 12px; border-radius: 8px; font-size: 12.5px; font-weight: 580; color: var(--muted); white-space: nowrap; }
.sheet-tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.sheet-wrap { flex: 1; overflow: auto; }
.sheet-wrap table { border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.sheet-wrap td, .sheet-wrap th { border: 1px solid var(--border); padding: 4px 10px; white-space: nowrap; max-width: 380px; overflow: hidden; text-overflow: ellipsis; }
.sheet-wrap tr:first-child td { background: var(--surface-2); font-weight: 650; position: sticky; top: 0; }
.sheet-wrap tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.sheet-note { padding: 8px 14px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); flex: none; }
.pv-slides { padding: 20px; display: grid; gap: 14px; }
.pv-slides .thumb { width: 100%; border-radius: 10px; box-shadow: var(--shadow); background: #fff; }
.slide-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow-sm); }
.slide-card .num { font-size: 11.5px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.slide-card h4 { margin: 4px 0 8px; font-size: 15px; }
.slide-card p { margin: 3px 0; font-size: 13.5px; color: var(--text-2); }
.pv-zip { padding: 12px 16px 30px; background: var(--bg-elev); min-height: 100%; }
.pv-zip .zrow { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--border); font-size: 13px; }
.pv-zip .zrow .ficon { width: 22px; height: 22px; flex: none; }
.pv-zip .zrow span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-zip .zrow small { color: var(--muted); font-variant-numeric: tabular-nums; }
.pv-media { display: grid; place-items: center; min-height: 100%; padding: 24px; }
.pv-media video { max-width: 100%; max-height: calc(100vh - 220px); border-radius: 12px; background: #000; }
.pv-media audio { width: min(100%, 520px); }
.pv-fallback { display: grid; place-items: center; text-align: center; gap: 14px; padding: 60px 24px; min-height: 100%; }
.pv-fallback .ficon { width: 88px; height: 88px; }
.pv-fallback h4 { margin: 0; font-size: 16px; }
.pv-fallback p { margin: 0; color: var(--muted); max-width: 360px; }

/* Historique */
.history { padding: 8px 0 30px; background: var(--bg-elev); min-height: 100%; }
.h-item { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 14px 20px; }
.h-item::before { content: ""; position: absolute; left: 39px; top: 50px; bottom: -14px; width: 2px; background: var(--border); }
.h-item:last-of-type::before { display: none; }
.h-item.current .avatar { box-shadow: 0 0 0 3px var(--bg-elev), 0 0 0 5px var(--accent); }
.h-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.h-meta b { color: var(--text); font-size: 13.5px; }
.h-msg { margin: 4px 0 8px; font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.h-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.h-actions .btn { height: 30px; font-size: 12.5px; padding: 0 10px; border-radius: 8px; }
.h-actions .btn svg { width: 15px; height: 15px; }
.load-more { display: flex; justify-content: center; padding: 10px; }

/* Infos */
.info-list { padding: 18px 20px 30px; display: grid; gap: 0; background: var(--bg-elev); min-height: 100%; align-content: start; }
.info-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; align-items: center; }
.info-row dt { color: var(--muted); }
.info-row dd { margin: 0; overflow-wrap: anywhere; display: flex; align-items: center; gap: 8px; }
.info-row dd .icon-btn { width: 30px; height: 30px; }
.info-row dd .icon-btn svg { width: 15px; height: 15px; }

/* ---------- Menu contextuel / popover ---------- */
.menu {
  position: fixed; z-index: 60; min-width: 220px; padding: 6px; border-radius: 14px; background: var(--bg-elev);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: pop .14s var(--ease);
}
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border-radius: 9px; font-size: 13.5px; color: var(--text-2); }
.menu button:hover { background: var(--hover); color: var(--text); }
.menu button svg { width: 17px; height: 17px; }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 4px; }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(-4px); } }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 100; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); display: grid; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 12px; font-size: 13.5px; font-weight: 520;
  background: #111827; color: #f9fafb; box-shadow: var(--shadow-lg); animation: toastIn .3s var(--ease);
}
:root[data-theme="dark"] .toast { background: #f3f4f6; color: #111827; }
.toast svg { width: 17px; height: 17px; flex: none; }
.toast.err svg { color: #f87171; }
.toast.ok svg { color: #4ade80; }
.toast.out { animation: toastOut .25s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ---------- Icônes de type de fichier ---------- */
.ficon { position: relative; }
.ficon svg { width: 100%; height: 100%; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1280px) {
  .col-rev { display: none; }
}
@media (max-width: 1100px) {
  :root { --preview-w: min(620px, 100vw); }
  .col-author { display: none; }
}
@media (min-width: 1101px) {
  /* Sur grand écran, l'aperçu cohabite avec la liste */
  .preview-backdrop { display: none; }
  .preview-layer { left: auto; width: var(--preview-w); }
  .preview-layer.full { width: 100vw; }
  .shell.with-preview .main { margin-right: var(--preview-w); }
  .shell.with-preview .col-rev, .shell.with-preview .col-author { display: none; }
}
@media (max-width: 960px) {
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-mobile-brand { display: flex; margin-bottom: 36px; }
  .login-mobile-brand .brand-name { color: var(--text); }
  .login-mobile-brand .brand-tag { color: var(--muted); opacity: 1; }
  .login-panel {
    place-items: start center; padding-top: max(56px, 10vh);
    background:
      radial-gradient(600px 300px at 50% -10%, color-mix(in srgb, var(--accent-2) 22%, transparent), transparent 70%),
      var(--bg);
  }
}
@media (max-width: 860px) {
  :root { --topbar-h: 58px; }
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 50; transform: translateX(-102%);
    transition: transform .3s var(--ease); box-shadow: var(--shadow-lg); padding-top: calc(18px + var(--safe-t));
  }
  .shell.nav-open .sidebar { transform: none; }
  .nav-backdrop { position: fixed; inset: 0; z-index: 45; background: rgba(10, 12, 20, .45); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .shell.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
  .topbar { padding: 0 10px 0 8px; padding-top: var(--safe-t); height: calc(var(--topbar-h) + var(--safe-t)); gap: 4px; }
  .topbar .menu-btn { display: inline-grid; }
  .search { width: auto; flex: 1; display: none; }
  .search kbd { display: none; }
  .topbar.searching .search { display: block; }
  .topbar.searching .crumbs, .topbar.searching .topbar-actions > :not(.search-toggle) { display: none; }
  .search-toggle { display: inline-grid !important; }
  .crumb { max-width: 46vw; }
  .content-inner { padding: 18px 14px calc(40px + var(--safe-b)); }
  .page-title h1 { font-size: 21px; }
  .page-title .big-icon { width: 42px; height: 42px; }
  .page-head { margin-bottom: 16px; align-items: flex-start; }
  .page-actions .btn span { display: none; }
  .page-actions .btn { width: 40px; padding: 0; }
  .list-card { border-radius: 16px; }
  .file-table thead { display: none; }
  .file-table td { height: 62px; }
  .file-table td:first-child { padding-left: 14px; }
  .col-size, .col-date, .col-author, .col-rev { display: none; }
  .row-actions { opacity: 1; }
  .row-actions .hide-m { display: none; }
  .file-name .ficon { width: 36px; height: 36px; }
  .file-name .txt { min-width: 0; display: grid; }
  .file-name .sub { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .hello h1 { font-size: 24px; }
  .repo-cards { grid-template-columns: 1fr; }
  .commit { padding: 14px 16px; gap: 12px; }
  .preview { width: 100vw; border-left: 0; transform: translateY(100%); transition: transform .34s var(--ease); }
  .preview-head { padding: calc(10px + var(--safe-t)) 8px 0 14px; }
  .preview-tools .hide-m { display: none; }
  .tabs { margin-top: 6px; }
  .info-row { grid-template-columns: 100px minmax(0, 1fr); }
}
@media (min-width: 861px) { .search-toggle { display: none !important; } .nav-backdrop { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  .sidebar, .topbar, .preview-layer { display: none !important; }
}

/* ---------- Coloration syntaxique (highlight.js) ---------- */
.hljs-comment, .hljs-quote { color: #8b93a7; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-type, .hljs-doctag { color: #8b5cf6; }
.hljs-string, .hljs-regexp, .hljs-addition, .hljs-meta .hljs-string { color: #059669; }
.hljs-number, .hljs-symbol, .hljs-bullet, .hljs-variable.constant_ { color: #d97706; }
.hljs-title, .hljs-section, .hljs-title.function_ { color: #2563eb; }
.hljs-title.class_, .hljs-built_in { color: #db2777; }
.hljs-attr, .hljs-attribute, .hljs-property, .hljs-selector-class, .hljs-selector-id { color: #0891b2; }
.hljs-tag, .hljs-name { color: #dc2626; }
.hljs-meta { color: #64748b; }
.hljs-deletion { color: #dc2626; }
.hljs-emphasis { font-style: italic; } .hljs-strong { font-weight: 700; }
:root[data-theme="dark"] .hljs-keyword, :root[data-theme="dark"] .hljs-selector-tag, :root[data-theme="dark"] .hljs-literal, :root[data-theme="dark"] .hljs-type { color: #c4b5fd; }
:root[data-theme="dark"] .hljs-string, :root[data-theme="dark"] .hljs-regexp, :root[data-theme="dark"] .hljs-addition { color: #6ee7b7; }
:root[data-theme="dark"] .hljs-number, :root[data-theme="dark"] .hljs-symbol, :root[data-theme="dark"] .hljs-bullet { color: #fcd34d; }
:root[data-theme="dark"] .hljs-title, :root[data-theme="dark"] .hljs-section, :root[data-theme="dark"] .hljs-title.function_ { color: #93c5fd; }
:root[data-theme="dark"] .hljs-title.class_, :root[data-theme="dark"] .hljs-built_in { color: #f9a8d4; }
:root[data-theme="dark"] .hljs-attr, :root[data-theme="dark"] .hljs-attribute, :root[data-theme="dark"] .hljs-property { color: #67e8f9; }
:root[data-theme="dark"] .hljs-tag, :root[data-theme="dark"] .hljs-name, :root[data-theme="dark"] .hljs-deletion { color: #fca5a5; }

.shell.with-preview .search kbd { display: none; }

.file-name .txt { min-width: 0; display: grid; }
.file-name .txt .label { white-space: nowrap; }
@media (min-width: 1101px) and (max-width: 1600px) {
  .shell.with-preview .col-date { display: none; }
  .shell.with-preview .file-name .sub { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
}
.demo-hint {
  display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 11px; font-size: 13.5px; margin: -10px 0 22px;
  background: var(--accent-soft); color: var(--text-2); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.demo-hint svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--accent); }
.demo-hint b { color: var(--text); font-family: var(--mono); }

/* ==========================================================================
   Administration · Notifications
   ========================================================================== */
.admin-icon { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; color: #fff; background: var(--grad); box-shadow: 0 8px 22px -8px rgba(139, 92, 246, .6); }
.admin-icon svg { width: 26px; height: 26px; }
.admin-tabs { display: flex; gap: 4px; padding: 4px; margin: 0 0 20px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); width: max-content; max-width: 100%; overflow-x: auto; }
.admin-tab { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 9px; font-weight: 580; font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.admin-tab svg { width: 16px; height: 16px; }
.admin-tab:hover { color: var(--text); text-decoration: none; }
.admin-tab.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.notice { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; margin-bottom: 18px; border: 1px solid; }
.notice > svg { width: 20px; height: 20px; flex: none; }
.notice > div { flex: 1; display: grid; gap: 2px; font-size: 13.5px; }
.notice.warn { background: color-mix(in srgb, var(--amber) 10%, var(--bg-elev)); border-color: color-mix(in srgb, var(--amber) 30%, transparent); color: color-mix(in srgb, var(--amber) 55%, var(--text)); }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 620; white-space: nowrap; }
.pill svg { width: 14px; height: 14px; }
.pill.ok { background: color-mix(in srgb, var(--green) 14%, transparent); color: color-mix(in srgb, var(--green) 85%, var(--text)); }
.pill.err { background: color-mix(in srgb, var(--red) 13%, transparent); color: color-mix(in srgb, var(--red) 85%, var(--text)); white-space: normal; height: auto; padding: 4px 10px; }
.pill.muted { background: var(--surface-2); color: var(--muted); }

.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 16px; }
.task-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; overflow: hidden; }
.task-card.paused { opacity: .85; }
.task-card.paused .task-head { background: var(--surface-2); }
.task-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.task-title { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.task-title h3 { margin: 0; font-size: 16px; font-weight: 680; overflow-wrap: anywhere; }
.task-facts { margin: 0; padding: 6px 18px; display: grid; flex: 1; }
.fact { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; align-items: start; }
.fact:last-child { border-bottom: 0; }
.fact dt { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.fact dt svg { width: 15px; height: 15px; flex: none; }
.fact dd { margin: 0; overflow-wrap: anywhere; color: var(--text-2); }
.last-run { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.last-run small { flex-basis: 100%; font-size: 12.5px; }
.chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); }
.chip i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.chip button { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: var(--muted); margin-right: -4px; }
.chip button:hover { background: var(--hover); color: var(--text); }
.chip button svg { width: 12px; height: 12px; }
.task-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--border); background: var(--surface-2); }
.task-actions .btn { height: 34px; font-size: 13px; }
.task-actions .danger { margin-left: auto; color: var(--red); }
.btn:disabled { opacity: .6; cursor: progress; }
.block { display: block; }
.small { font-size: 12.5px; }

/* Interrupteur */
.switch { position: relative; display: inline-flex; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch > span { width: 42px; height: 24px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-strong); position: relative; transition: background .2s, border-color .2s; }
.switch > span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--accent); border-color: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Fenêtre modale */
.modal { border: 0; padding: 0; width: min(640px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); border-radius: var(--r-xl); background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-lg); overflow: hidden; }
.modal::backdrop { background: rgba(10, 12, 20, .5); backdrop-filter: blur(3px); }
.modal[open] { animation: pop .18s var(--ease); display: flex; }
.editor { display: flex; flex-direction: column; width: 100%; max-height: calc(100dvh - 48px); }
.editor-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 14px 24px; border-bottom: 1px solid var(--border); }
.editor-head h2 { margin: 0; font-size: 18px; font-family: var(--font-display); }
.editor-body { padding: 20px 24px; overflow: auto; display: grid; gap: 18px; }
.editor-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--border); background: var(--surface-2); }
fieldset.field { border: 0; padding: 0; margin: 0; }
fieldset.field legend { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; padding: 0; }
.hint { color: var(--muted); font-size: 12.5px; }
.input.mono, .mono { font-family: var(--mono); }
select.input { appearance: auto; }
.radio { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 11px; cursor: pointer; margin-bottom: 8px; }
.radio:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio input { margin-top: 3px; accent-color: var(--accent); }
.radio span { display: grid; gap: 1px; font-size: 14px; }
.radio small, .switch-row small { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; padding: 4px 2px 0 28px; }
.check-grid.disabled { opacity: .45; pointer-events: none; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.check:hover { background: var(--hover); }
.check input { accent-color: var(--accent); }
.check i { width: 9px; height: 9px; border-radius: 50%; display: block; }
.chip-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 46px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); cursor: text; }
.chip-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.chip-input input { flex: 1; min-width: 180px; border: 0; outline: none; background: none; height: 28px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; }
.switch-row > span:first-child { display: grid; gap: 2px; font-size: 14px; }

/* Réglages */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 16px; align-items: start; }
.settings-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 20px; display: grid; gap: 14px; }
.settings-card h2 { margin: 0; font-size: 15.5px; display: flex; align-items: center; gap: 10px; }
.settings-card h2 svg { width: 19px; height: 19px; color: var(--accent); }
.settings-card > p { margin: -4px 0 0; font-size: 13px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.test-row { display: flex; gap: 8px; flex-wrap: wrap; }
.test-row .input { flex: 1; min-width: 200px; height: 38px; }
.test-result:empty { display: none; }
.settings-save { position: sticky; bottom: 0; display: flex; justify-content: flex-end; padding: 16px 0 calc(8px + var(--safe-b)); background: linear-gradient(transparent, var(--bg) 40%); margin-top: 8px; }
.spinner.sm { width: 18px; height: 18px; border-width: 2px; }
.history-table td { white-space: normal; vertical-align: top; padding-top: 12px; padding-bottom: 12px; height: auto; }
.history-table .col-msg { color: var(--muted); font-size: 13px; }

@media (max-width: 860px) {
  .fact { grid-template-columns: 1fr; gap: 4px; }
  .task-actions .btn { flex: 1 1 auto; justify-content: center; }
  .task-actions .danger { flex: 0 0 auto; }
  .modal { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
  .editor { max-height: 100dvh; }
  .editor-head { padding-top: calc(14px + var(--safe-t)); }
  .editor-foot { padding-bottom: calc(14px + var(--safe-b)); }
  .check-grid { padding-left: 0; }
  .history-table thead { display: table-header-group; }
  .history-table .col-size, .history-table .col-msg { display: table-cell; }
  .history-table .col-msg { display: none; }
}

.topbar.no-search .search-toggle { display: none !important; }


/* Les cartes de réglages ne débordent jamais sur leurs voisines */
.settings-card, .task-card { min-width: 0; }
.settings-card .input { min-width: 0; }
.test-result .pill { white-space: normal; height: auto; padding: 5px 10px; line-height: 1.4; align-items: flex-start; overflow-wrap: anywhere; }
.test-result .pill svg { margin-top: 2px; }
