/* ============================================================
   Thème sombre + accents musicaux · responsive PC / mobile
   ============================================================ */
:root {
  --bg: #0b0d17;
  --bg-2: #11131f;
  --surface: #171a29;
  --surface-2: #1e2233;
  --border: #262b40;
  --text: #eef0f8;
  --muted: #9aa0bd;
  --muted-2: #6c7291;

  --accent: #7c5cff;   /* violet */
  --accent-2: #ff5c8a; /* rose */
  --accent-3: #2dd4bf; /* turquoise */
  --accent-4: #f0a13c; /* ambre */

  --blocker: #ff5c7a;
  --important: #f0a13c;
  --comfort: #2dd4bf;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(124, 92, 255, 0.18), transparent 60%),
    radial-gradient(1000px 500px at 100% 0%, rgba(255, 92, 138, 0.14), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-top: 34px; /* place pour le bandeau */
}

/* ---------- Bandeau démo ---------- */
.demo-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12.5px;
  letter-spacing: 0.2px;
  color: #dfe2f2;
  background: linear-gradient(90deg, rgba(124,92,255,0.22), rgba(255,92,138,0.22));
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
}
.demo-banner .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-3);
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.2);
  animation: pulse 2.4s infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(45,212,191,0.05); } }

/* ---------- En-tête ---------- */
.app-header {
  position: sticky;
  top: 34px;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px clamp(16px, 4vw, 40px);
  background: rgba(11, 13, 23, 0.82);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  font-size: 26px;
  display: grid; place-items: center;
  width: 46px; height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(124,92,255,0.25), rgba(255,92,138,0.25));
  border: 1px solid var(--border);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 18px; letter-spacing: -0.2px; }
.brand-text .accent { color: var(--accent); }
.brand-text small { color: var(--muted); font-size: 11.5px; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 9px 15px;
  border-radius: 999px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}
.tab:hover { color: var(--text); background: var(--surface); }
.tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(124, 92, 255, 0.35);
}

/* ---------- Zone principale ---------- */
.app-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 38px) clamp(16px, 4vw, 40px) 60px;
}

.view-head { margin-bottom: 22px; }
.view-head h1 {
  font-size: clamp(22px, 3vw, 30px);
  margin: 0 0 6px;
  letter-spacing: -0.5px;
}
.view-head p { color: var(--muted); margin: 0; max-width: 70ch; }

/* ---------- Cartes de synthèse (jauges) ---------- */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}
.metric-card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: center;
  box-shadow: var(--shadow);
}
.gauge {
  --val: 0;
  --col: var(--accent);
  position: relative;
  width: 84px; height: 84px;
  flex: 0 0 84px;
  border-radius: 50%;
  background:
    conic-gradient(var(--col) calc(var(--val) * 1%), rgba(255,255,255,0.06) 0);
  display: grid; place-items: center;
}
.gauge::after {
  content: "";
  position: absolute; inset: 8px;
  border-radius: 50%;
  background: var(--bg-2);
}
.gauge span {
  position: relative;
  z-index: 1;
  font-weight: 700;
  font-size: 18px;
}
.metric-meta { display: flex; flex-direction: column; }
.metric-meta .label { font-size: 13px; color: var(--muted); }
.metric-meta .title { font-weight: 600; font-size: 15px; margin: 2px 0 4px; }
.metric-meta .trend { font-size: 12px; color: var(--muted-2); }

/* ---------- Sévérité ---------- */
.sev-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px;
  letter-spacing: 0.3px; text-transform: uppercase;
}
.sev-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sev-blocker { color: var(--blocker); background: rgba(255, 92, 122, 0.12); }
.sev-important { color: var(--important); background: rgba(240, 161, 60, 0.12); }
.sev-comfort { color: var(--comfort); background: rgba(45, 212, 191, 0.12); }

/* ---------- Statuts ---------- */
.status-pill {
  font-size: 11.5px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}
.status-todo { color: var(--muted); }
.status-progress { color: var(--accent-4); border-color: rgba(240,161,60,0.35); background: rgba(240,161,60,0.08); }
.status-done { color: var(--accent-3); border-color: rgba(45,212,191,0.35); background: rgba(45,212,191,0.08); }

/* ---------- Liste des problèmes ---------- */
.section-title {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: 6px 0 14px;
}
.section-title h2 { font-size: 17px; margin: 0; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  appearance: none; border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 600;
  padding: 6px 12px; border-radius: 999px; cursor: pointer; transition: 0.15s;
}
.chip:hover { color: var(--text); }
.chip.is-active { color: #fff; background: var(--surface-2); border-color: var(--accent); }

.issue-list { display: flex; flex-direction: column; gap: 10px; }
.issue-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--sev, var(--border));
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s;
}
.issue-row:hover { transform: translateY(-2px); background: var(--surface-2); }
.issue-id { font-size: 12px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.issue-main { min-width: 0; }
.issue-main .t { font-weight: 600; margin-bottom: 5px; }
.issue-tags { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.issue-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; white-space: nowrap; }
.issue-side .effort { font-size: 12px; color: var(--muted); }

/* ---------- Détail problème ---------- */
.detail-back {
  appearance: none; background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); font: inherit; font-weight: 600; font-size: 13px;
  padding: 8px 14px; border-radius: 999px; cursor: pointer; margin-bottom: 18px;
}
.detail-back:hover { color: var(--text); }
.detail-card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(20px, 4vw, 32px);
  box-shadow: var(--shadow);
}
.detail-card h1 { margin: 12px 0 16px; font-size: clamp(20px, 3vw, 26px); }
.detail-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.detail-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; }
.detail-block h3 { margin: 0 0 8px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.detail-block p { margin: 0; color: var(--text); }
.kv { display: flex; gap: 10px; align-items: baseline; }
.kv .k { color: var(--muted); font-size: 13px; min-width: 90px; }
.kv .v { font-weight: 600; }

/* ---------- Plan par lots ---------- */
.lot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 18px; }
.lot-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--lot, var(--accent));
  border-radius: var(--radius);
  padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: var(--shadow);
}
.lot-card h2 { margin: 0; font-size: 17px; }
.lot-card .lot-sum { color: var(--muted); font-size: 13.5px; margin: -6px 0 0; }
.progress { height: 8px; border-radius: 999px; background: rgba(255,255,255,0.07); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: var(--lot, var(--accent)); transition: width 0.6s ease; }
.progress-label { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.task-list li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.task-check {
  width: 18px; height: 18px; border-radius: 6px; flex: 0 0 18px;
  border: 1px solid var(--border); display: grid; place-items: center; font-size: 11px;
}
.task-check.done { background: var(--accent-3); border-color: var(--accent-3); color: #07231f; }
.task-list li.done span { color: var(--muted-2); text-decoration: line-through; }

/* ---------- Catalogue de beats ---------- */
.producer-strip { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.producer-pill {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 14px 8px 8px;
}
.producer-pill .av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(124,92,255,0.3), rgba(45,212,191,0.3)); font-size: 16px; }
.producer-pill .pn { font-weight: 600; font-size: 13.5px; }
.producer-pill .pc { color: var(--muted); font-size: 11.5px; }

.beat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.beat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s;
}
.beat-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.beat-cover {
  height: 118px; position: relative;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--c1), var(--c2));
}
.beat-cover .wave { display: flex; gap: 3px; align-items: flex-end; height: 46px; }
.beat-cover .wave i { width: 4px; background: rgba(255,255,255,0.85); border-radius: 2px; animation: bar 1.1s ease-in-out infinite; }
@keyframes bar { 0%,100% { height: 20%; } 50% { height: 100%; } }
.play-btn {
  position: absolute; right: 12px; bottom: 12px;
  width: 40px; height: 40px; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(11,13,23,0.75); color: #fff;
  display: grid; place-items: center; font-size: 15px;
  backdrop-filter: blur(4px);
  transition: transform 0.15s, background 0.15s;
}
.play-btn:hover { transform: scale(1.08); background: var(--accent); }
.play-btn.playing { background: var(--accent-2); }
.beat-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.beat-body .bt { font-weight: 700; font-size: 15px; }
.beat-body .bp { color: var(--muted); font-size: 12.5px; }
.beat-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.beat-meta .m { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; }
.beat-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.beat-price { font-weight: 800; font-size: 16px; }
.buy-btn {
  appearance: none; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font: inherit; font-weight: 700; font-size: 12.5px;
  padding: 7px 14px; border-radius: 999px;
}
.buy-btn:active { transform: scale(0.97); }

/* ---------- Divers ---------- */
.app-footer {
  max-width: 1180px; margin: 0 auto;
  padding: 22px clamp(16px, 4vw, 40px) 40px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  color: var(--muted); font-size: 12.5px;
  border-top: 1px solid var(--border);
}
.muted { color: var(--muted-2); }
.count-badge { font-size: 12px; color: var(--muted); font-weight: 600; }

@media (max-width: 620px) {
  .app-header { position: static; }
  .issue-row { grid-template-columns: 1fr; }
  .issue-side { flex-direction: row; align-items: center; justify-content: flex-start; }
  .brand-text small { display: none; }
}
