:root {
  --bg: #04060d;
  --bg-2: #0a1020;
  --panel: rgba(16, 24, 46, 0.72);
  --panel-solid: #0f1730;
  --border: rgba(214, 170, 82, 0.18);
  --border-strong: rgba(214, 170, 82, 0.45);
  --text: #eef1f8;
  --muted: #8f9ab3;
  --gold: #e3b75a;
  --gold-2: #f7dc8f;
  --gold-3: #a8781f;
  --blue: #3d8bff;
  --danger: #ff6b6b;
  --ok: #4ade80;
  --radius: 14px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --gold-grad: linear-gradient(135deg, var(--gold-2), var(--gold) 45%, var(--gold-3));
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font: 15px/1.5 Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(61, 139, 255, 0.22), transparent 70%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(227, 183, 90, 0.08), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
a { color: var(--gold-2); }
h1, h2, h3 { margin: 0; line-height: 1.25; }

.brand-title {
  font-family: Cinzel, Georgia, serif;
  letter-spacing: 0.06em;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.muted { color: var(--muted); }
.small { font-size: 13px; }
.text-danger { color: var(--danger); }
.mono, .address, .mono-soft { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.mono-soft { font-size: 13px; word-break: break-all; color: #c9d1e4; }
.nowrap { white-space: nowrap; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 20px;
  padding: 10px 24px;
  background: rgba(4, 6, 13, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { border-radius: 50%; box-shadow: 0 0 18px rgba(227, 183, 90, 0.35); }
.brand .brand-title { font-size: 20px; font-weight: 700; }
.brand-sub { color: var(--muted); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; }
.tabs { display: flex; gap: 4px; flex: 1; justify-content: center; }
.tabs a {
  padding: 8px 14px; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-weight: 500;
  transition: color .15s, background .15s;
}
.tabs a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.tabs a.active { color: #120d02; background: var(--gold-grad); font-weight: 600; }
.me { display: flex; align-items: center; gap: 10px; }
.me form { margin: 0; }
.me-name { font-weight: 500; font-size: 14px; }
/* Sélecteur de langue FR / EN. */
.lang-switch { display: inline-flex; border: 1px solid rgba(227, 183, 90, 0.35); border-radius: 999px; overflow: hidden; font-size: 12px; font-weight: 600; }
.lang-switch a { padding: 4px 9px; color: inherit; text-decoration: none; opacity: 0.65; }
.lang-switch a:hover { opacity: 1; }
.lang-switch a.active { background: rgba(227, 183, 90, 0.2); color: #e3b75a; opacity: 1; }
.login-lang { position: absolute; top: 14px; right: 14px; }

.avatar {
  width: 34px; height: 34px; flex: none;
  display: inline-grid; place-items: center;
  border-radius: 50%; overflow: hidden;
  background: var(--gold-grad); color: #120d02; font-weight: 700;
  border: 1px solid var(--border-strong);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 52px; height: 52px; font-size: 20px; }

/* ---------- Appel vidéo ---------- */
.me form[hidden], .me a[hidden], .call-banner[hidden] { display: none; }
.btn-call { white-space: nowrap; border-color: rgba(74, 222, 128, 0.45); color: #bbf7d0; }
.btn-call:hover { background: rgba(74, 222, 128, 0.12); }
.btn-call.live { background: #16a34a; color: #fff; border-color: transparent; animation: ring 1.6s ease-in-out infinite; }
@keyframes ring { 0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); } 50% { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); } }
.call-banner {
  position: sticky; top: 61px; z-index: 9;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 24px; font-size: 14px;
  background: rgba(22, 101, 52, 0.92); border-bottom: 1px solid rgba(74, 222, 128, 0.4); backdrop-filter: blur(8px);
}
.call-text { flex: 1; min-width: 200px; }
.call-banner .call-join { background: #fff; color: #14532d; border-color: transparent; }
.call-dot { width: 10px; height: 10px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); animation: ring 1.6s infinite; }
@media (max-width: 980px) { .call-banner { top: 0; position: relative; padding: 8px 16px; } }

/* Page de réunion (Galène intégré) */
.view-call .call-banner { display: none; }
.container-wide { max-width: none; padding: 12px 16px 16px; }
.call-page { display: flex; flex-direction: column; gap: 10px; height: calc(100vh - 61px - 28px); min-height: 480px; }
.call-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 14px; border-radius: 12px;
  background: rgba(22, 101, 52, 0.9); border: 1px solid rgba(74, 222, 128, 0.4);
}
.call-bar form { margin: 0; }
.call-bar .call-text { flex: 1; }
.rec-badge {
  padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: #dc2626; color: #fff; animation: ring-red 1.6s ease-in-out infinite;
}
.rec-badge[hidden], .rec-toggle[hidden] { display: none; }
@keyframes ring-red { 0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); } 50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); } }
.rec-toggle { border-color: rgba(239, 68, 68, 0.6); color: #fecaca; }
.call-bar .btn-danger { background: rgba(0, 0, 0, 0.25); }
.call-frame { flex: 1; width: 100%; border: 1px solid var(--border); border-radius: 14px; background: #000; }
.call-empty { text-align: center; padding: 60px 16px; display: grid; gap: 14px; justify-items: center; }
@media (max-width: 980px) { .call-page { height: calc(100vh - 110px); } }

/* ---------- Layout ---------- */
.container { max-width: 1280px; margin: 0 auto; padding: 28px 24px 60px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 28px; }
.page-head p { margin: 4px 0 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: transform .1s, background .15s, box-shadow .15s;
}
.btn:hover { background: rgba(255, 255, 255, 0.09); }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-gold { background: var(--gold-grad); color: #120d02; border-color: transparent; box-shadow: 0 4px 18px rgba(227, 183, 90, 0.25); }
.btn-gold:hover { background: var(--gold-grad); box-shadow: 0 4px 24px rgba(227, 183, 90, 0.45); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-danger { border-color: rgba(255, 107, 107, 0.5); color: var(--danger); background: transparent; }
.btn-danger:hover { background: rgba(255, 107, 107, 0.12); }

input, select, textarea {
  width: 100%;
  padding: 9px 12px; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(3, 6, 14, 0.6); color: var(--text);
  font: inherit;
}
.filters select { width: auto; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(227, 183, 90, 0.18); }
select option { background: var(--panel-solid); }
input[type="date"] { color-scheme: dark; }
label { display: grid; gap: 5px; font-size: 13px; font-weight: 500; color: var(--muted); }
.form { display: grid; gap: 12px; margin-top: 14px; }
.form-actions { display: flex; justify-content: flex-end; }
.grid-2 { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-4 { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.03em;
  background: rgba(61, 139, 255, 0.16); color: #9cc3ff; border: 1px solid rgba(61, 139, 255, 0.35);
  vertical-align: middle;
}
.badge-gold { background: rgba(227, 183, 90, 0.14); color: var(--gold-2); border-color: var(--border-strong); }

.flash { padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; border: 1px solid; }
.flash-ok { background: rgba(74, 222, 128, 0.1); border-color: rgba(74, 222, 128, 0.4); color: #bbf7d0; }
.flash-error { background: rgba(255, 107, 107, 0.1); border-color: rgba(255, 107, 107, 0.45); color: #fecaca; }
.notice { padding: 12px 16px; border-radius: 12px; background: rgba(227, 183, 90, 0.07); border: 1px solid var(--border); margin-bottom: 18px; font-size: 14px; }
.empty { color: var(--muted); font-style: italic; }

.panel, .column, .wallet, .member, .table-wrap {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel { padding: 14px; margin-bottom: 20px; }
.panel > summary { list-style: none; }
.panel > summary::-webkit-details-marker { display: none; }
.panel:not([open]) { background: none; border: 0; box-shadow: none; padding: 0; }

/* ---------- Board ---------- */
.board { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.column { padding: 14px; }
.column h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.column-doing h2 { color: #9cc3ff; }
.column-done h2 { color: var(--ok); }
.count { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); color: var(--text); }

.task {
  position: relative;
  padding: 12px 14px 12px 16px; margin-bottom: 10px;
  border-radius: 12px;
  background: rgba(3, 6, 14, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.task::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: rgba(255, 255, 255, 0.15); }
.task.prio-high::before { background: var(--danger); }
.task.prio-normal::before { background: var(--gold); }
.task.prio-low::before { background: var(--blue); }
.task.overdue { border-color: rgba(255, 107, 107, 0.45); }
.column-done .task { opacity: 0.7; }
.column-done .task h3 { text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, 0.35); }
.task header { display: flex; gap: 8px; align-items: baseline; }
.task h3 { font-size: 15px; font-weight: 600; }
.tid { color: var(--gold); font-weight: 700; font-size: 13px; }
.desc { margin: 6px 0 0; font-size: 13.5px; color: #c9d1e4; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); }
.chip-dim { color: var(--muted); }
.chip-danger { background: rgba(255, 107, 107, 0.14); color: #fecaca; }
.task-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.task-actions form { margin: 0; }
/* ---------- Fond du tableau ---------- */
body.has-board-bg { background-size: cover; background-position: center; background-attachment: fixed; }
body.has-board-bg .column { background: rgba(8, 12, 26, 0.78); backdrop-filter: blur(6px); }
.board-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; margin-bottom: 20px; }
.board-tools > .panel { margin-bottom: 0; }
.board-tools > .panel[open] { flex-basis: 100%; }
.board-tools > .panel[open] ~ .panel:not([open]) { order: -1; }
.bg-swatches { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.bg-swatch {
  height: 70px; border-radius: 10px; border: 2px solid transparent; cursor: pointer;
  background: var(--bg); background-size: cover; position: relative; overflow: hidden;
  display: flex; align-items: flex-end; padding: 0; font: inherit;
}
.bg-swatch span { width: 100%; padding: 4px 8px; font-size: 12px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, 0.65)); text-align: left; }
.bg-swatch:hover { border-color: var(--border-strong); }
.bg-swatch.active { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(227, 183, 90, 0.35); }
.bg-upload { border-top: 1px dashed var(--border); padding-top: 12px; }

/* ---------- Couleur, couverture et images des cartes ---------- */
.task.has-color {
  border-color: color-mix(in srgb, var(--card) 55%, transparent);
  background: linear-gradient(color-mix(in srgb, var(--card) 22%, rgba(3, 6, 14, 0.85)), color-mix(in srgb, var(--card) 10%, rgba(3, 6, 14, 0.85)));
  padding-top: 18px;
}
.task.has-color::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--card); }
.task.has-cover { padding-top: 0; }
.task.has-cover::after { display: none; }
.task-cover {
  display: block; width: calc(100% + 30px); margin: 0 -14px 10px -16px; padding: 0; border: 0;
  background: rgba(0, 0, 0, 0.3); cursor: zoom-in; overflow: hidden;
}
.task-cover img { display: block; width: 100%; height: auto; max-height: 190px; object-fit: cover; }
.task.has-color .task-cover { border-bottom: 4px solid var(--card); }
.task-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; margin-top: 10px; }
.task-images button { padding: 0; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 8px; overflow: hidden; aspect-ratio: 1; background: rgba(0, 0, 0, 0.3); cursor: zoom-in; }
.task-images img { width: 100%; height: 100%; object-fit: cover; display: block; }
.task-images button:hover { border-color: var(--gold); }
.task.file-over { outline: 2px dashed var(--gold); outline-offset: 2px; background: rgba(227, 183, 90, 0.08); }
.task.uploading { opacity: 0.6; pointer-events: none; }
.task.uploading::before { background: var(--gold); animation: pulse 1s infinite alternate; }
@keyframes pulse { from { opacity: 0.3; } to { opacity: 1; } }

.customize .color-form { margin: 10px 0 8px; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch {
  width: 28px; height: 28px; border-radius: 8px; padding: 0; cursor: pointer;
  border: 2px solid transparent; background: var(--sw); font-size: 14px; line-height: 1; color: var(--muted);
}
.swatch-none { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.15); }
.swatch:hover { transform: scale(1.1); }
.swatch.active { border-color: #fff; box-shadow: 0 0 0 2px var(--gold); }
.file-drop {
  display: block; padding: 10px 12px; border-radius: 10px; cursor: pointer;
  border: 1px dashed var(--border-strong); background: rgba(3, 6, 14, 0.4); color: var(--text); font-size: 13px;
}
.file-drop:hover { background: rgba(227, 183, 90, 0.07); }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-drop small { color: var(--muted); }
.image-form { margin-top: 0; }
.cover-off { margin-top: 8px; }

/* Visionneuse */
.lightbox {
  border: 1px solid var(--border-strong); border-radius: 16px; padding: 14px;
  background: var(--panel-solid); color: var(--text); max-width: min(1100px, calc(100vw - 24px)); width: 100%;
  box-shadow: var(--shadow);
}
.lightbox::backdrop { background: rgba(0, 0, 0, 0.82); backdrop-filter: blur(4px); }
.lb-stage { position: relative; display: grid; place-items: center; background: #000; border-radius: 10px; overflow: hidden; }
.lb-stage img { max-width: 100%; max-height: 72vh; display: block; object-fit: contain; }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: rgba(4, 6, 13, 0.7); color: var(--text); font-size: 24px; cursor: pointer;
}
.lb-prev { left: 10px; }
.lb-next { right: 10px; }
.lb-name { margin: 10px 2px 8px; word-break: break-all; }
.lb-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.lb-actions form { margin: 0; }

/* Glisser-déposer */
.task-list { min-height: 64px; border-radius: 12px; transition: background .15s, outline-color .15s; outline: 2px dashed transparent; outline-offset: 2px; }
.task-list.is-empty::before {
  content: attr(data-empty); display: grid; place-items: center; min-height: 64px;
  color: var(--muted); font-style: italic; font-size: 13px; text-align: center; padding: 0 10px;
}
.board.dragging .task-list { outline-color: rgba(227, 183, 90, 0.28); background: rgba(227, 183, 90, 0.03); }
.board.dragging .task-list.is-empty::before { content: 'Déposer ici'; color: var(--gold-2); }
.task { cursor: grab; touch-action: pan-y; }
.task input, .task textarea, .task select, .task button, .task summary, .task label { cursor: auto; }
.task button, .task summary, .task label.check { cursor: pointer; }
.task-ghost { opacity: 0.35; border: 1px dashed var(--gold) !important; background: rgba(227, 183, 90, 0.06) !important; }
.task-chosen { box-shadow: 0 0 0 2px var(--gold), 0 12px 30px rgba(0, 0, 0, 0.5); }
.task-drag { transform: rotate(2deg); cursor: grabbing; }
.task.saving { opacity: 0.7; }
.board-hint { margin-top: 14px; }

/* Avancement en % */
.task-progress { margin-top: 10px; }
.tp-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.tp-head small { font-size: 11px; opacity: 0.8; }
.tp-value { font-size: 13px; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.task-progress.complete .tp-value { color: var(--ok); }
.task-progress .progress { height: 6px; flex: none; }
.task-progress.complete .progress span { background: var(--ok); }
.progress-form { margin: 6px 0 0; }
.progress-form input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 18px; padding: 0; border: 0; background: transparent; box-shadow: none; cursor: pointer;
}
/* Sans liste à cocher, le curseur sert lui-même de barre (rempli jusqu'à --pct). */
.task-progress[data-mode="manual"] .progress { display: none; }
.progress-form { margin-top: 2px; }
.progress-form input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-2), var(--gold) var(--pct, 0%), rgba(255, 255, 255, 0.08) var(--pct, 0%));
}
.task-progress.complete .progress-form input[type="range"]::-webkit-slider-runnable-track { background: var(--ok); }
.progress-form input[type="range"]::-moz-range-track { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); }
.progress-form input[type="range"]::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--gold); }
.progress-form input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; margin-top: -5px; border-radius: 50%;
  background: var(--gold-grad); border: 2px solid #120d02; box-shadow: 0 0 0 1px var(--gold);
}
.progress-form input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--gold); border: 2px solid #120d02; }
.progress-form input[type="range"]:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Liste de cases à cocher */
.checklist { margin-top: 10px; }
.checklist-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.progress { flex: 1; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--gold-grad); border-radius: inherit; transition: width .25s ease; }
.progress-text { font-size: 12px; font-weight: 600; color: var(--muted); }
.checklist.complete .progress-text { color: var(--ok); }
.checklist ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.checklist li { display: flex; align-items: flex-start; gap: 4px; border-radius: 8px; padding: 3px 4px; }
.checklist li:hover { background: rgba(255, 255, 255, 0.04); }
.checklist li form { margin: 0; }
.check-form { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
.check { display: flex; align-items: flex-start; gap: 9px; color: var(--text); font-size: 13.5px; font-weight: 400; cursor: pointer; }
.check input {
  appearance: none; -webkit-appearance: none;
  flex: none; width: 18px; height: 18px; margin: 1px 0 0; padding: 0;
  border-radius: 5px; border: 1.5px solid var(--border-strong); background: rgba(3, 6, 14, 0.6);
  display: grid; place-items: center; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.check input::after { content: ""; width: 5px; height: 9px; border: solid #120d02; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); margin-top: -2px; transition: transform .12s; }
.check input:checked { background: var(--gold-grad); border-color: transparent; }
.check input:checked::after { transform: rotate(45deg) scale(1); }
.check input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; box-shadow: none; }
.check span { word-break: break-word; }
.checklist li.done .check span { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, 0.3); }
.checklist li.pending { opacity: 0.6; }
.item-delete button {
  border: 0; background: none; color: var(--muted); font-size: 16px; line-height: 1;
  padding: 2px 6px; border-radius: 6px; cursor: pointer; opacity: 0;
}
.checklist li:hover .item-delete button, .item-delete button:focus-visible { opacity: 1; }
.item-delete button:hover { color: var(--danger); background: rgba(255, 107, 107, 0.1); }
@media (hover: none) { .item-delete button { opacity: 0.6; } }
.add-items > summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-top: 4px; }
.add-items[open] > summary { color: var(--gold-2); }
.add-items .form { margin-top: 8px; }

.edit { margin-top: 10px; }
.edit > summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.edit[open] > summary { color: var(--gold-2); }
.edit form[data-confirm]:not(.form) { margin-top: 8px; }

/* ---------- Wallets ---------- */
.wallet-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.wallet { padding: 18px; display: grid; gap: 10px; align-content: start; }
.wallet header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.wallet h3 { font-size: 17px; }
.wallet p { margin: 0; }
.address {
  display: block; padding: 10px 12px; border-radius: 10px;
  background: rgba(3, 6, 14, 0.75); border: 1px dashed var(--border-strong);
  color: var(--gold-2); font-size: 13.5px; word-break: break-all; user-select: all;
}
.wallet-actions { display: flex; gap: 8px; }

/* ---------- Liens utiles ---------- */
.cat-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-nav .chip { text-decoration: none; color: var(--text); padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border); display: inline-flex; gap: 6px; align-items: center; }
.cat-nav .chip:hover { border-color: var(--border-strong); background: rgba(227, 183, 90, 0.08); }
.link-group { margin-bottom: 28px; scroll-margin-top: 90px; }
.link-group h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--gold-2); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.link-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.link-card {
  display: grid; gap: 10px; align-content: start; padding: 14px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
.link-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.link-main { display: flex; gap: 12px; align-items: flex-start; text-decoration: none; color: var(--text); }
.link-icon {
  flex: none; width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--gold-grad); color: #120d02; font-family: Cinzel, Georgia, serif; font-weight: 700; font-size: 19px;
}
.link-text { display: grid; gap: 2px; min-width: 0; }
.link-text strong { font-size: 15px; }
.link-host { font-size: 12.5px; color: var(--gold-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-desc { font-size: 13px; color: #c9d1e4; margin-top: 3px; }
.link-main:hover strong { color: var(--gold-2); }
.link-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ---------- Domaines ---------- */
.domain-list { display: grid; gap: 10px; }
.domain {
  --lvl: var(--ok);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: center;
  padding: 14px 16px 12px 18px; position: relative; overflow: hidden;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.domain::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--lvl); }
.domain.level-expired, .domain.level-danger { --lvl: var(--danger); border-color: rgba(255, 107, 107, 0.45); }
.domain.level-warning { --lvl: #f97316; }
.domain.level-soon { --lvl: #eab308; }
.domain.level-unknown { --lvl: var(--muted); }
.domain-name { font-weight: 700; font-size: 16px; color: var(--text); text-decoration: none; word-break: break-all; }
.domain-name:hover { color: var(--gold-2); }
.domain-main { display: grid; gap: 3px; min-width: 0; }
.domain-expiry { display: grid; justify-items: end; gap: 2px; text-align: right; }
.domain-expiry strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.level-badge { background: color-mix(in srgb, var(--lvl) 18%, transparent); color: var(--lvl); border-color: color-mix(in srgb, var(--lvl) 45%, transparent); }
.domain-edit { grid-column: 1 / -1; margin-top: 2px; }
.domain-actions { display: flex; gap: 8px; margin-top: 8px; }
.domain-actions form { margin: 0; }
.text-warn { color: #fbbf24; }
@media (max-width: 560px) {
  .domain { grid-template-columns: 1fr; }
  .domain-expiry { justify-items: start; text-align: left; grid-auto-flow: column; align-items: baseline; gap: 8px; }
}

/* ---------- Paramètres ---------- */
.settings-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); align-items: start; }
.settings-grid > .panel { margin: 0; scroll-margin-top: 90px; }
.settings-card h2 { font-size: 17px; margin-bottom: 12px; color: var(--gold-2); }
.settings-card h3 { font-size: 14px; margin: 18px 0 8px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.settings-card fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.settings-card legend { font-size: 13px; color: var(--muted); font-weight: 500; margin-bottom: 4px; }
.toggle { display: flex; align-items: flex-start; gap: 10px; color: var(--text); font-size: 14px; cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.toggle:hover { background: rgba(255, 255, 255, 0.04); }
.toggle input { width: auto; margin-top: 3px; accent-color: var(--gold); flex: none; }
.toggle small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.toggle.is-locked { opacity: 0.65; cursor: default; }
.toggle.inline { display: inline-flex; padding: 2px 4px; margin-left: 6px; }
.status-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.status-row { display: grid; grid-template-columns: 12px minmax(0, 180px) minmax(0, 1fr); gap: 10px; align-items: baseline; font-size: 14px; padding: 6px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); align-self: center; }
.status-row.is-ok .status-dot { background: var(--ok); }
.status-row.is-warn .status-dot { background: #f59e0b; }
.status-row.is-bad .status-dot { background: var(--danger); }
.status-row.is-wait .status-dot { background: var(--muted); animation: pulse 1s infinite alternate; }
.status-label { font-weight: 600; }
.status-detail { color: var(--muted); font-size: 13px; word-break: break-word; }
.admin-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.admin-list li { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.admin-list .admin-name { flex: 1; min-width: 0; font-size: 14px; }
.admin-list form { margin: 0; }
@media (max-width: 560px) { .status-row { grid-template-columns: 12px 1fr; } .status-detail { grid-column: 2; } }

/* ---------- Team ---------- */
.team-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-bottom: 16px; }
.member { display: flex; gap: 14px; align-items: center; padding: 14px; }
.member h3 { font-size: 15px; }
.member p { margin: 2px 0 0; }

/* ---------- Activity ---------- */
.table-wrap { overflow-x: auto; }
.activity { width: 100%; border-collapse: collapse; font-size: 14px; }
.activity th, .activity td { text-align: left; padding: 10px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); vertical-align: top; }
.activity th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.row-wallet td { background: rgba(227, 183, 90, 0.05); }

/* ---------- QR dialog ---------- */
.qr-dialog {
  border: 1px solid var(--border-strong); border-radius: 18px;
  background: var(--panel-solid); color: var(--text);
  padding: 22px; max-width: min(360px, calc(100vw - 32px));
  text-align: center; box-shadow: var(--shadow);
}
.qr-dialog::backdrop { background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(3px); }
.qr-dialog h3 { margin-bottom: 14px; }
#qr-code { display: inline-block; padding: 12px; background: #fff; border-radius: 12px; }
#qr-code img, #qr-code canvas { display: block; }
.qr-dialog .address { margin: 14px 0; text-align: left; }

/* ---------- Login ---------- */
.login-page { display: grid; place-items: center; padding: 24px 16px; }
.login-card {
  width: 100%; max-width: 420px; text-align: center;
  padding: 36px 28px; border-radius: 22px;
  background: var(--panel); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.login-logo { width: 180px; height: 180px; border-radius: 50%; box-shadow: 0 0 60px rgba(227, 183, 90, 0.28); }
.login-card h1 { font-size: 28px; margin: 18px 0 8px; }
.login-card .flash { text-align: left; }
.tg-widget { margin: 22px 0 8px; min-height: 48px; }
.dev-login { display: grid; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--border); }

/* ---------- Responsive ---------- */
/* Barre du haut sur une seule ligne mais étroite : on resserre pour garder la place du sélecteur de langue. */
@media (min-width: 981px) and (max-width: 1180px) {
  .topbar { gap: 12px; }
  .tabs a { padding: 8px 10px; }
  .brand-sub, .me-name { display: none; }
}
@media (max-width: 980px) {
  .board { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .tabs { order: 3; flex-basis: 100%; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { flex: none; }
  .me { margin-left: auto; }
}
@media (max-width: 560px) {
  .container { padding: 20px 16px 48px; }
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .me-name, .brand-sub { display: none; }
  .wallet-grid { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 24px; }
}
