/* TaskBoard — esthétique « pupitre de commande » */
:root {
  --bg: #ECEEF0;
  --panel: #182830;
  --panel-2: #213642;
  --surface: #FFFFFF;
  --ink: #1C2329;
  --muted: #5E6B74;
  --line: #D3D9DD;
  --accent: #E8740C;
  --accent-dark: #C25F06;
  --ok: #2F9E63;
  --warn: #DFA400;
  --late: #D6453D;
  --radius: 6px;
  --font-ui: 'Barlow', system-ui, sans-serif;
  --font-display: 'Barlow Semi Condensed', 'Barlow', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
}
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 14px; }

/* ---------- Barre supérieure ---------- */
.topbar {
  display: flex; align-items: center; gap: 16px;
  background: var(--panel); color: #E8EDF0;
  padding: 0 18px; height: 52px;
  position: sticky; top: 0; z-index: 50;
}
.brand {
  font-family: var(--font-display); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.14em; font-size: 15px;
  display: flex; align-items: center; gap: 9px; color: #fff;
  text-decoration: none; cursor: pointer; background: none; border: 0; padding: 0;
}
.brand .led {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 6px var(--accent);
}
.topbar .spacer { flex: 1; }
.searchbox { position: relative; }
.searchbox input {
  background: var(--panel-2); border: 1px solid #2E4654; color: #E8EDF0;
  border-radius: var(--radius); padding: 7px 12px; width: 260px; outline: none;
}
.searchbox input::placeholder { color: #7E929E; }
.searchbox input:focus { border-color: var(--accent); }
.search-results {
  position: absolute; top: 40px; right: 0; width: 380px; max-height: 420px; overflow: auto;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.25); display: none;
}
.search-results.open { display: block; }
.search-results .sr-item { padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.search-results .sr-item:hover { background: #F2F5F7; }
.search-results .sr-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.topbar .userchip {
  font-size: 13px; color: #B9C6CD;
}
.btn-ghost {
  background: transparent; color: #C9D4DA; border: 1px solid #34505F;
  border-radius: var(--radius); padding: 6px 12px; font-size: 13px;
}
.btn-ghost:hover { border-color: var(--accent); color: #fff; }

/* ---------- Boutons ---------- */
.btn {
  background: var(--accent); color: #fff; border: 0;
  border-radius: var(--radius); padding: 8px 14px; font-weight: 600; font-size: 13.5px;
}
.btn:hover { background: var(--accent-dark); }
.btn.secondary { background: #E3E8EB; color: var(--ink); }
.btn.secondary:hover { background: #D5DCE0; }
.btn.danger { background: var(--late); }
.btn.small { padding: 5px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- Vue liste des tableaux ---------- */
.page { padding: 26px; max-width: 1200px; margin: 0 auto; }
.page h1 {
  font-family: var(--font-display); text-transform: uppercase;
  letter-spacing: .1em; font-size: 19px; font-weight: 600;
  display: flex; align-items: center; gap: 12px; margin: 4px 0 20px;
}
.page h1 .count { font-family: var(--font-mono); font-size: 13px; color: var(--muted); font-weight: 400; }
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.board-tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  border-top: 4px solid var(--accent);
  padding: 16px; cursor: pointer; transition: box-shadow .12s, transform .12s;
  display: flex; flex-direction: column; gap: 8px; min-height: 92px;
}
.board-tile:hover { box-shadow: 0 6px 18px rgba(20,40,48,.12); transform: translateY(-1px); }
.board-tile .bt-name { font-weight: 600; font-size: 15.5px; }
.board-tile .bt-meta { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-top: auto; }
.board-tile .ro-tag {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); border: 1px solid var(--line); border-radius: 3px;
  padding: 1px 6px; width: fit-content;
}
.board-tile.add {
  border: 2px dashed var(--line); border-top: 2px dashed var(--line);
  background: transparent; align-items: center; justify-content: center;
  color: var(--muted); font-weight: 600;
}
.board-tile.add:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Vue tableau (kanban) ---------- */
.board-head {
  display: flex; align-items: center; gap: 14px; padding: 14px 20px 0;
}
.board-head h2 {
  margin: 0; font-family: var(--font-display); font-size: 18px;
  text-transform: uppercase; letter-spacing: .08em; font-weight: 600;
  border-left: 5px solid var(--accent); padding-left: 10px;
}
.board-head .actions { margin-left: auto; display: flex; gap: 8px; }
.kanban {
  display: flex; gap: 14px; padding: 16px 20px 26px; overflow-x: auto;
  align-items: flex-start; min-height: calc(100vh - 130px);
}
.col {
  background: #E2E6E9; border: 1px solid var(--line); border-radius: var(--radius);
  width: 292px; flex: 0 0 292px; display: flex; flex-direction: column; max-height: calc(100vh - 150px);
}
.col-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-bottom: 2px solid var(--panel);
}
.col-head .col-name {
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: .1em;
  font-size: 12.5px; font-weight: 600; flex: 1; cursor: text;
}
.col-head .col-count {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--muted);
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 0 7px;
}
.col-head .col-del { background: none; border: 0; color: var(--muted); font-size: 15px; padding: 0 2px; }
.col-head .col-del:hover { color: var(--late); }
.col-cards { padding: 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; flex: 1; min-height: 30px; }
.col-cards.dragover { background: rgba(232,116,12,.08); border-radius: var(--radius); }
.col-add { padding: 8px 10px 10px; }
.col-add button {
  width: 100%; background: none; border: 1px dashed #B8C1C7; border-radius: var(--radius);
  color: var(--muted); padding: 7px; font-size: 13px;
}
.col-add button:hover { border-color: var(--accent); color: var(--accent); }
.add-col {
  flex: 0 0 260px; border: 2px dashed var(--line); border-radius: var(--radius);
  color: var(--muted); background: none; padding: 12px; font-weight: 600; height: 46px;
}
.add-col:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Cartes ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 9px 11px; cursor: pointer; box-shadow: 0 1px 2px rgba(20,40,48,.07);
  display: flex; flex-direction: column; gap: 6px;
}
.card:hover { border-color: #AEB9C0; }
.card.dragging { opacity: .45; }
.card .labels { display: flex; flex-wrap: wrap; gap: 4px; }
.card .label-pill { height: 7px; width: 34px; border-radius: 4px; }
.card .title { font-size: 14px; line-height: 1.35; }
.card.completed .title { text-decoration: line-through; color: var(--muted); }
.card .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip {
  font-family: var(--font-mono); font-size: 11px; border-radius: 4px;
  padding: 1.5px 6px; background: #EEF1F3; color: var(--muted); border: 1px solid var(--line);
}
.chip.due-late { background: var(--late); color: #fff; border-color: var(--late); }
.chip.due-soon { background: var(--warn); color: #fff; border-color: var(--warn); }
.chip.due-done { background: var(--ok); color: #fff; border-color: var(--ok); }
.chip.assignee { background: var(--panel); color: #DCE5EA; border-color: var(--panel); font-family: var(--font-ui); }

/* ---------- Modale ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(16,26,32,.55); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px;
  overflow-y: auto;
}
.modal {
  background: var(--bg); border-radius: 8px; width: 100%; max-width: 760px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4); padding: 20px 22px 24px;
}
.modal.narrow { max-width: 480px; }
.modal-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 6px; }
.modal-head h3 { margin: 0; font-size: 18px; flex: 1; font-weight: 600; }
.modal-head input.title-edit {
  flex: 1; font-size: 18px; font-weight: 600; border: 1px solid transparent;
  background: transparent; border-radius: var(--radius); padding: 2px 6px; margin-left: -6px;
}
.modal-head input.title-edit:hover { border-color: var(--line); background: #fff; }
.modal-head input.title-edit:focus { border-color: var(--accent); background: #fff; outline: none; }
.modal-close { background: none; border: 0; font-size: 22px; color: var(--muted); line-height: 1; }
.modal-close:hover { color: var(--ink); }
.modal-sub { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-bottom: 16px; }

.modal-grid { display: grid; grid-template-columns: 1fr 215px; gap: 22px; }
@media (max-width: 680px) { .modal-grid { grid-template-columns: 1fr; } }

.section { margin-bottom: 20px; }
.section > h4 {
  margin: 0 0 8px; font-family: var(--font-display); text-transform: uppercase;
  letter-spacing: .1em; font-size: 11.5px; color: var(--muted); font-weight: 600;
}
textarea.desc {
  width: 100%; min-height: 90px; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 9px; resize: vertical; background: #fff;
}
textarea.desc:focus { border-color: var(--accent); outline: none; }

/* Checklist */
.progress { height: 7px; background: #DDE2E6; border-radius: 4px; overflow: hidden; margin-bottom: 9px; }
.progress > div { height: 100%; background: var(--ok); transition: width .2s; }
.check-item { display: flex; align-items: center; gap: 8px; padding: 3.5px 0; }
.check-item input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--ok); }
.check-item .ci-text { flex: 1; }
.check-item.done .ci-text { text-decoration: line-through; color: var(--muted); }
.check-item .ci-del { background: none; border: 0; color: var(--muted); visibility: hidden; }
.check-item:hover .ci-del { visibility: visible; }
.check-item .ci-del:hover { color: var(--late); }
.inline-add { display: flex; gap: 6px; margin-top: 8px; }
.inline-add input { flex: 1; border: 1px solid var(--line); border-radius: var(--radius); padding: 7px 9px; background: #fff; }
.inline-add input:focus { border-color: var(--accent); outline: none; }

/* Commentaires */
.comment { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; margin-bottom: 8px; }
.comment .c-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 3px; }
.comment .c-author { font-weight: 600; font-size: 13px; }
.comment .c-time { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.comment .c-del { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 12px; }
.comment .c-del:hover { color: var(--late); }
.comment .c-body { white-space: pre-wrap; font-size: 13.5px; }

/* Panneau latéral de la modale */
.side-block { margin-bottom: 16px; }
.side-block label {
  display: block; font-family: var(--font-display); text-transform: uppercase;
  letter-spacing: .1em; font-size: 11px; color: var(--muted); margin-bottom: 5px; font-weight: 600;
}
.side-block select, .side-block input[type=date] {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius); padding: 7px 8px; background: #fff;
}
.label-row { display: flex; align-items: center; gap: 7px; padding: 3px 0; cursor: pointer; }
.label-row .swatch { width: 30px; height: 14px; border-radius: 4px; flex: 0 0 30px; }
.label-row .lname { font-size: 13px; flex: 1; }
.label-row input[type=checkbox] { accent-color: var(--accent); }
.side-actions { display: flex; flex-direction: column; gap: 7px; margin-top: 18px; }
.side-actions .btn { width: 100%; }
.complete-toggle { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.complete-toggle input { width: 17px; height: 17px; accent-color: var(--ok); }

/* ---------- Journal d'événements ---------- */
.journal { font-family: var(--font-mono); font-size: 12px; }
.journal .j-row { display: flex; gap: 10px; padding: 4px 0; border-bottom: 1px dashed #DCE1E5; }
.journal .j-time { color: var(--muted); white-space: nowrap; }
.journal .j-code { color: var(--accent-dark); font-weight: 600; white-space: nowrap; }
.journal .j-msg { color: var(--ink); word-break: break-word; }

/* ---------- Tables admin / archives / permissions ---------- */
table.list { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
table.list th {
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: .08em;
  font-size: 11px; color: var(--muted); text-align: left; padding: 9px 12px;
  border-bottom: 2px solid var(--panel); font-weight: 600;
}
table.list td { padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
table.list tr:last-child td { border-bottom: 0; }
table.list select { border: 1px solid var(--line); border-radius: 4px; padding: 4px 6px; }

.form-row { margin-bottom: 13px; }
.form-row label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 4px; color: var(--muted); }
.form-row input[type=text], .form-row input[type=password], .form-row input[type=color] {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 9px; background: #fff;
}
.form-row input:focus { border-color: var(--accent); outline: none; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.muted { color: var(--muted); font-size: 13px; }
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--panel); color: #fff; border-radius: var(--radius);
  padding: 10px 18px; font-size: 13.5px; z-index: 200; box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.toast.error { background: var(--late); }

/* ---------- Connexion ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--panel);
  background-image: radial-gradient(circle at 20% 20%, #213642 0%, #182830 60%);
}
.login-card {
  background: var(--surface); border-radius: 8px; padding: 34px 34px 30px;
  width: 100%; max-width: 380px; box-shadow: 0 24px 70px rgba(0,0,0,.5);
  border-top: 5px solid var(--accent);
}
.login-card .brand2 {
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: .16em;
  font-weight: 600; font-size: 17px; display: flex; align-items: center; gap: 10px; margin-bottom: 4px;
}
.login-card .brand2 .led { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.login-card .tagline { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-bottom: 24px; }
.login-error { color: var(--late); font-size: 13px; min-height: 18px; margin-bottom: 6px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
