/* ============================================================
   style.css — Kanban Euris × Valbiotis
   ============================================================ */

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

body {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  background: #f0f2f5;
  color: #1a1a1a;
  min-height: 100vh;
}

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 0 16px;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.topbar-title {
  font-weight: 700;
  font-size: 16px;
  color: #1a1a1a;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-user {
  font-size: 13px;
  color: #555;
}
.btn-header {
  padding: 5px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  color: #333;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s;
}
.btn-header:hover  { background: #f5f5f5; }
.btn-logout        { color: #d93025; border-color: #f5c6c6; }
.btn-logout:hover  { background: #fdecea; }

/* ── Layout principal ──────────────────────────────────────── */
.filters-bar {
  background: #f7f7f7;
  border-bottom: 1px solid #e0e0e0;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.board {
  display: flex;
  gap: 12px;
  padding: 16px;
  width: 100%;
  align-items: flex-start;
  min-height: calc(100vh - 130px);
}

/* ── Onglets ───────────────────────────────────────────────── */
.tabs-bar {
  display: flex;
  gap: 6px;
  padding-bottom: 10px;
  margin-bottom: 2px;
  border-bottom: 1px solid #e0e0e0;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 18px;
  border-radius: 8px;
  border: 1.5px solid #ddd;
  background: #fff;
  color: #555;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.tab-btn:hover {
  border-color: #1a73e8;
  color: #1a73e8;
  background: #f0f6ff;
}
.tab-btn.active {
  background: #1a73e8;
  border-color: #1a73e8;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(26,115,232,.25);
}
.tab-count {
  display: inline-block;
  background: rgba(255,255,255,.25);
  color: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 99px;
  min-width: 20px;
  text-align: center;
}
.tab-btn:not(.active) .tab-count {
  background: #f0f0f0;
  color: #888;
}

/* ── Filtres ───────────────────────────────────────────────── */
.frow {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.flbl {
  font-size: 11px;
  color: #888;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
  min-width: 55px;
}
.fsep { height: 0.5px; background: #e0e0e0; }
.fbtn {
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 11px;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  transition: opacity .1s;
}
.fbtn:hover { opacity: .8; }

/* ── Colonnes ─────────────────────────────────────────────── */
.col {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 12px;
  padding: 12px 10px;
  border: 2px solid transparent;
  min-height: 400px;
  transition: border-color .1s;
}
.col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
}
.col-tw {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.col-title {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .02em;
}
.col-cnt {
  font-size: 12px;
  color: #fff;
  border-radius: 99px;
  padding: 1px 8px;
  font-weight: 600;
}
.btn-top {
  background: none;
  border: none;
  font-size: 22px;
  font-weight: 700;
  padding: 0;
  line-height: 1;
  cursor: pointer;
}
.btn-bot {
  margin-top: 10px;
  width: 100%;
  padding: 6px;
  font-size: 11px;
  color: #999;
  border: 0.5px dashed #ccc;
  border-radius: 8px;
  background: none;
  cursor: pointer;
  font-family: inherit;
}
.btn-bot:hover { background: rgba(0,0,0,.03); }

/* ── Cartes ────────────────────────────────────────────────── */
.card {
  border-radius: 8px;
  padding: 9px;
  cursor: grab;
  user-select: none;
  border: 0.5px solid #ddd;
  margin-bottom: 7px;
  transition: box-shadow .15s;
}
.card:hover    { box-shadow: 0 2px 8px rgba(0,0,0,.10); }
.card:active   { cursor: grabbing; }
.card.drag-src { opacity: .35; }

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 99px;
  white-space: nowrap;
}

/* ── Modal ─────────────────────────────────────────────────── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.overlay.on { display: flex; }

.modal-box {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  width: 480px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
}

/* Inputs dans modal */
.modal-box input,
.modal-box textarea,
.modal-box select {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  background: #fff;
  color: #333;
  margin-top: 4px;
  margin-bottom: 12px;
  outline: none;
  transition: border-color .2s;
}
.modal-box input:focus,
.modal-box textarea:focus,
.modal-box select:focus { border-color: #1a73e8; }

.tg {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 5px 0 12px;
}
.tgb {
  padding: 3px 11px;
  border-radius: 99px;
  font-size: 12px;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

/* ── Fiche ticket (70 % de la largeur, commentaire mis en avant) ── */
.modal-box.ticket-modal {
  width: 70vw;
  max-width: 1400px;
  max-height: 92vh;
  padding: 1.5rem 1.75rem;
}
.tk-grid {
  display: grid;
  grid-template-columns: minmax(300px, 2fr) 3fr;
  gap: 0 28px;
}
.tk-label { display: block; font-size: 12px; color: #555; font-weight: 500; }
.modal-box .tk-comment {
  min-height: 40vh;
  resize: vertical;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.modal-box .tk-comment[readonly],
.modal-box input[readonly] { background: #fafafa; }

/* Pièces jointes */
.tk-files       { border: 1px solid #e6e6e6; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.tk-files-head  { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.tk-file-btn    { font-size: 12px; padding: 4px 10px; border: 1px solid #1a73e8; color: #1a73e8; border-radius: 7px; cursor: pointer; background: #fff; }
.tk-file-btn:hover { background: #e8f0fe; }
.tk-file        { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 0.5px solid #f0f0f0; font-size: 13px; }
.tk-file:first-child { border-top: none; }
.tk-file a      { color: #1a73e8; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.tk-file a:hover { text-decoration: underline; }
.tk-file .meta  { font-size: 11px; color: #999; white-space: nowrap; }
.tk-file .del   { background: none; border: none; color: #c5221f; cursor: pointer; font-size: 14px; padding: 0 2px; }
.tk-hint        { font-size: 11px; color: #999; margin-top: 4px; }
.tk-empty       { font-size: 12px; color: #aaa; padding: 4px 0; }

/* ── Historique table ──────────────────────────────────────── */
#hist-content table th {
  padding: 6px 8px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  color: #666;
  border-bottom: 1px solid #e0e0e0;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .board      { flex-direction: column; padding: 10px; }
  .col        { min-width: 100%; }
  .tabs-bar   { flex-wrap: wrap; }
  .tab-btn    { flex: 1 1 auto; justify-content: center; }
  .topbar-right .topbar-user { display: none; }
  .modal-box.ticket-modal { width: 100%; max-width: calc(100vw - 16px); padding: 1rem; }
  .tk-grid    { grid-template-columns: 1fr; }
  .modal-box .tk-comment { min-height: 30vh; }
}