/* ── Variables ───────────────────────────────────────────────── */
:root {
  --bg:        #0f1117;
  --bg-card:   #1a1d27;
  --bg-hover:  #21253a;
  --border:    #2a2e42;
  --text:      #e2e8f0;
  --text-muted:#8892a4;
  --accent:    #6366f1;
  --accent-light: #818cf8;
  --green:     #22c55e;
  --orange:    #f97316;
  --red:       #ef4444;
  --sidebar-w: 230px;
  --sidebar-collapsed: 60px;
  --radius:    10px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: width 0.2s ease;
  overflow: hidden;
}

.sidebar.collapsed { width: var(--sidebar-collapsed); }

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 14px;
  border-bottom: 1px solid var(--border);
  min-height: 56px;
}

.sidebar-logo {
  font-size: 20px;
  flex-shrink: 0;
  color: var(--accent-light);
}

.sidebar-title {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 2px;
  color: var(--accent-light);
  white-space: nowrap;
}

.sidebar-toggle {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.sidebar-toggle:hover { color: var(--text); background: var(--bg-hover); }
.sidebar.collapsed .sidebar-toggle { transform: rotate(180deg); }

.sidebar-nav {
  flex: 1;
  padding: 10px 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 12px 16px 4px;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.sidebar.collapsed .nav-section-label { opacity: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  color: var(--text-muted);
  border-radius: 6px;
  margin: 2px 8px;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  white-space: nowrap;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active { background: var(--bg-hover); color: var(--accent-light); }

.nav-icon { font-size: 16px; flex-shrink: 0; width: 20px; text-align: center; }
.nav-label { font-size: 13px; transition: opacity 0.15s; }
.sidebar.collapsed .nav-label { opacity: 0; width: 0; overflow: hidden; }

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-date, .sidebar-version {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  transition: opacity 0.15s;
}
.sidebar.collapsed .sidebar-footer > * { opacity: 0; }

/* ── Main ────────────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  transition: margin-left 0.2s ease;
  padding: 0;
}
.main.sidebar-collapsed { margin-left: var(--sidebar-collapsed); }

.content { padding: 32px 36px; max-width: 1200px; }

/* ── Page header ─────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.page-header h1 { font-size: 22px; font-weight: 700; }
.page-subtitle { color: var(--text-muted); font-size: 13px; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--outline { background: transparent; border: 1px solid var(--border); color: var(--text); }

/* ── Widgets grid (dashboard) ────────────────────────────────── */
.widgets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 1100px) { .widgets-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px)  { .widgets-grid { grid-template-columns: 1fr; } }

.widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.15s, transform 0.15s;
  cursor: pointer;
}
.widget:hover { border-color: var(--accent); transform: translateY(-2px); }

.widget-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.widget-icon { font-size: 18px; }
.widget-title { font-weight: 600; font-size: 14px; flex: 1; }

.widget-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 500;
}
.status--active  { background: rgba(34,197,94,.15);  color: var(--green); }
.status--wait    { background: rgba(249,115,22,.15);  color: var(--orange); }
.status--red     { background: rgba(239,68,68,.15);   color: var(--red); }
.status--info    { background: rgba(99,102,241,.15);  color: var(--accent-light); }

.widget-no-data { color: var(--text-muted); font-size: 13px; }
.widget-meta { display: flex; flex-direction: column; gap: 3px; }
.widget-meta span { font-size: 12px; color: var(--text-muted); }

/* ── Sections grid (module pages) ───────────────────────────── */
.section-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
@media (max-width: 800px) { .section-grid { grid-template-columns: 1fr; } }

/* ── Card ────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card--full { grid-column: 1 / -1; }
.card-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 14px; }

/* ── Metrics ─────────────────────────────────────────────────── */
.metric {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.metric--large .metric-value { font-size: 26px; font-weight: 700; }
.metric--small .metric-value { font-size: 24px; font-weight: 700; }
.metric-value { font-size: 22px; font-weight: 700; }
.metric-label { font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.metric--green .metric-value { color: var(--green); }
.metric--orange .metric-value { color: var(--orange); }
.metric--red .metric-value { color: var(--red); }

.metric-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

/* ── Progress bar ────────────────────────────────────────────── */
.progress-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.progress-bar {
  height: 6px;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.4s ease;
  max-width: 100%;
  position: relative;
}
.progress-bar::before {
  content: '';
  display: block;
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  position: absolute;
  left: 0; top: 0;
  z-index: -1;
}
.progress-bar--red { background: var(--red); }
.progress-label { font-size: 11px; color: var(--text-muted); }

/* ── Roadmap ─────────────────────────────────────────────────── */
.roadmap { display: flex; flex-direction: column; gap: 14px; }

.roadmap-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 13px;
  padding-left: 4px;
}
.roadmap-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
  border: 2px solid var(--border);
}
.roadmap--done .roadmap-dot { background: var(--green); border-color: var(--green); }
.roadmap--active .roadmap-dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 6px var(--accent); }
.roadmap--todo .roadmap-dot { background: transparent; border-color: var(--text-muted); }

.roadmap-done { color: var(--text-muted); }
.roadmap-desc { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.roadmap-sub { padding-left: 16px; margin-top: 6px; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.roadmap-sub li { font-size: 12px; color: var(--text-muted); }
.roadmap-sub li::before { content: '→ '; }

/* ── Info elements ───────────────────────────────────────────── */
.info-line  { font-size: 12px; color: var(--text-muted); }
.info-text  { font-size: 13px; color: var(--text-muted); line-height: 1.7; }
.info-list  { list-style: none; display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: var(--text-muted); }
.info-list li::before { content: '→ '; color: var(--accent); }

.no-data { color: var(--text-muted); font-size: 13px; font-style: italic; }

/* ── Tags ────────────────────────────────────────────────────── */
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font-size: 11px; padding: 3px 9px; border-radius: 20px; font-weight: 500; }
.tag--active { background: rgba(34,197,94,.15);  color: var(--green); }
.tag--wait   { background: rgba(249,115,22,.15);  color: var(--orange); }
.tag--info   { background: rgba(99,102,241,.15);  color: var(--accent-light); }

/* ── Table ───────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.data-table th { color: var(--text-muted); font-weight: 500; font-size: 11px; text-transform: uppercase; }
.data-table .row--total td { font-weight: 600; border-top: 2px solid var(--border); border-bottom: none; }
.text-right { text-align: right; }

/* ── Widget rows (dashboard pleine largeur) ──────────────────── */
.widgets-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.widget-row {
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  transition: border-color 0.15s, transform 0.15s;
  cursor: pointer;
}
.widget-row:hover { border-color: var(--accent); transform: translateX(3px); }

.wr-top {
  display: flex;
  align-items: center;
  gap: 24px;
}

.wr-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 260px;
  flex-shrink: 0;
}

.wr-icon { font-size: 36px; flex-shrink: 0; }

.wr-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wr-title { font-weight: 700; font-size: 20px; }
.wr-sub   { font-size: 14px; color: var(--text-muted); }

.wr-metrics {
  display: flex;
  align-items: center;
  gap: 40px;
  flex: 1;
  flex-wrap: wrap;
}

.wr-progress {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 120px;
}

.wr-arrow {
  color: var(--text-muted);
  font-size: 20px;
  flex-shrink: 0;
  margin-left: auto;
}

/* ── Roadmap inline (dashboard) ──────────────────────────────── */
.wr-roadmap {
  display: flex;
  align-items: center;
  gap: 0;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.rm-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.rm-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  background: transparent;
  flex-shrink: 0;
}

.rm-label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  text-align: center;
}

.rm-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin-bottom: 18px;
  min-width: 20px;
}
.rm-line--done { background: var(--green); }

.rm-done .rm-dot  { background: var(--green); border-color: var(--green); }
.rm-done .rm-label { color: var(--green); }

.rm-active .rm-dot  { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 8px var(--accent); }
.rm-active .rm-label { color: var(--accent-light); font-weight: 600; }

.rm-todo .rm-dot  { background: transparent; border-color: var(--border); }

/* ── Utilities ───────────────────────────────────────────────── */
.mt-1 { margin-top: 12px; }
