/**
 * Kapela — Style : Tableaux, fenêtres modales, messages, listes, barres et logo
 * Auteur : Jacks Ngalangala
 */

/* ───────── Tableaux (traits fins et propres) ───────── */
.tw {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surf);
}
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.tbl th {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ink);
  background: var(--line2);
  white-space: nowrap;
}
.t-terre .tbl th {
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  border-bottom-color: var(--line);
}
.tbl td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line2);
  vertical-align: middle;
}
.tbl tr:last-child td {
  border-bottom: 0;
}
.tbl tbody tr:hover td {
  background: var(--bg);
}
.tbl tfoot td {
  font-weight: 700;
  border-top: 1px solid var(--ink);
  background: var(--line2);
}
.tbl .n {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tbl .click {
  cursor: pointer;
}
.tbl tr.sub td {
  background: var(--surf2);
  padding-top: 4px;
}
@media (max-width: 860px) {
  .tbl th,
  .tbl td {
    padding: 10px 12px;
  }
}

/* ───────── Fenêtres (modales), messages ───────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(20, 16, 12, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal > .box {
  background: var(--surf);
  border-radius: var(--r-pop);
  box-shadow: var(--shadow);
  width: min(560px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.modal > .box.wide {
  width: min(920px, 100%);
}
.modal .mh {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--line2);
}
.modal .mh .h2 {
  flex: 1;
}
.modal .mb {
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal .mf {
  padding: 14px 22px 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  border-top: 1px solid var(--line2);
}
@media (max-width: 860px) {
  .modal {
    padding: 0;
    align-items: flex-end;
  }
  .modal > .box {
    border-radius: var(--r-pop) var(--r-pop) 0 0;
    max-height: 94vh;
  }
  .modal .mf .btn {
    flex: 1;
  }
}
.toasts {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 24px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--dark);
  color: var(--dark-t);
  padding: 12px 18px;
  border-radius: var(--r-ui);
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow);
  max-width: 92vw;
}
.toast.bad {
  background: var(--bad);
  color: #fff;
}
@media (max-width: 860px) {
  .toasts {
    bottom: 90px;
  }
}
.banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--r);
  background: var(--warn-bg);
  color: var(--warn);
  font-weight: 600;
  font-size: 13px;
}
.banner.dark {
  background: var(--dark);
  color: var(--dark-t);
}
.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.empty .h2 {
  color: var(--ink);
}
.skel {
  background: linear-gradient(90deg, var(--line2), var(--surf), var(--line2));
  background-size: 200% 100%;
  animation: sk 1.2s infinite;
  border-radius: var(--r);
  min-height: 120px;
}
@keyframes sk {
  to {
    background-position: -200% 0;
  }
}

/* Liste simple */
.list {
  display: flex;
  flex-direction: column;
}
.li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line2);
  min-width: 0;
}
.li:last-child {
  border-bottom: 0;
}
.li .t {
  font-weight: 600;
}
.li .s {
  font-size: 12px;
  color: var(--muted);
}

/* Graphique en barres simple */
.bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 150px;
  padding-top: 8px;
}
.bars > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  height: 100%;
  justify-content: flex-end;
}
.bars .b {
  width: 100%;
  max-width: 44px;
  background: var(--dark);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
}
.t-terre .bars .b {
  border-radius: 10px 10px 4px 4px;
}
.bars .b.on {
  background: var(--acc);
}
.bars .l {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.meter {
  height: 8px;
  border-radius: 4px;
  background: var(--line2);
  overflow: hidden;
  display: flex;
}
.meter > i {
  display: block;
  height: 100%;
}

/* ───────── Logo ───────── */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.logo .w {
  font-family: Manrope, sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 5.5px;
}
