:root {
  --bg: #0a0b0e;
  --panel: #101218;
  --panel2: #151822;
  --line: #22262f;
  --text: #e9ecf2;
  --muted: #8a92a3;
  --accent: #e0912f; /* ambre */
  --accent-soft: #3a2e1c;
  --danger: #ef5350;
  --dispo: #2b8a5b;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { background: var(--bg); }
body {
  margin: 0;
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.wrap { max-width: 1180px; margin: 0 auto; padding: 20px 16px 60px; }

/* Barre utilisateur */
.userbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px;
}
.user { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700;
  background: linear-gradient(135deg, #d98a2b, #b3701f); color: #1a1206;
}
.uname { font-weight: 600; }
.usolde { color: var(--muted); font-size: 12px; }
.ghost {
  background: transparent; color: var(--muted);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px;
  cursor: not-allowed; font-size: 13px;
}

/* En-tête */
.head { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 14px; }
.head h1 { font-size: 22px; margin: 0; letter-spacing: -0.01em; }
.live { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #444; }
.dot.on { background: var(--dispo); box-shadow: 0 0 0 0 rgba(43,138,91,.5); animation: pulse 2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(43,138,91,.45); }
  70% { box-shadow: 0 0 0 7px rgba(43,138,91,0); }
  100% { box-shadow: 0 0 0 0 rgba(43,138,91,0); }
}

/* Panneau principal */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }

/* Onglets */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tab {
  background: var(--panel2); color: var(--text);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; font-size: 13px; cursor: pointer; display: inline-flex; gap: 7px; align-items: center;
}
.tab .n { color: var(--muted); font-size: 12px; }
.tab:hover { border-color: #333a46; }
.tab.active { border-color: var(--accent); color: #fff; }
.tab.active .n { color: var(--accent); }
.tab.toggle { margin-left: auto; }
.tab.toggle.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* Contrôles */
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
#search {
  flex: 1; min-width: 220px;
  background: var(--panel2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font-size: 13px;
}
.select {
  background: var(--panel2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font-size: 13px;
}
.sort { width: 100%; margin-bottom: 12px; }

/* Dropdown multi-dates */
.dd { position: relative; }
.dd-btn {
  background: var(--panel2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font-size: 13px; cursor: pointer;
  display: inline-flex; gap: 8px; align-items: center; white-space: nowrap;
}
.dd-btn .chev { color: var(--muted); }
.dd-panel {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0;
  min-width: 240px; max-height: 300px; overflow-y: auto;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 6px;
  box-shadow: 0 12px 30px rgba(0,0,0,.5);
}
.dd-item { display: flex; gap: 9px; align-items: center; padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.dd-item:hover { background: #1c2029; }
.dd-item input { accent-color: var(--accent); }

/* Bascule Table/Cards */
.viewtoggle { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.vt { background: var(--panel2); color: var(--muted); border: 0; padding: 9px 14px; font-size: 13px; cursor: pointer; }
.vt.active { background: var(--accent); color: #1a1206; font-weight: 600; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th, td { text-align: left; padding: 12px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
th.r, td.r { text-align: right; }
tbody tr:hover { background: var(--panel2); }
tbody tr.urgent { box-shadow: inset 3px 0 0 0 var(--danger); }
tbody tr.new { animation: flash 1.8s ease-out; }
@keyframes flash { from { background: rgba(224,145,47,.14); } to { background: transparent; } }

.ttl { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.ttl.warn { color: var(--danger); }
.ev-name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.ev-date { color: var(--muted); font-size: 12px; margin-top: 2px; }
.cat { max-width: 220px; }
.places { color: #c7cdd8; font-size: 13px; }
.retail { font-weight: 700; white-space: nowrap; }
.pas { color: var(--accent); white-space: nowrap; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge.split { background: rgba(239,83,80,.15); color: var(--danger); border: 1px solid rgba(239,83,80,.4); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); color: var(--muted); }
.pill.dispo { color: #7ee0a1; border-color: rgba(43,138,91,.5); }
.claimant { color: var(--accent); font-size: 13px; }

.claim {
  background: var(--accent); color: #1a1206; border: 0; border-radius: 8px;
  padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.claim:disabled { opacity: .55; cursor: not-allowed; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.card { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; position: relative; }
.card.urgent { border-color: rgba(239,83,80,.5); box-shadow: inset 3px 0 0 0 var(--danger); }
.card.new { animation: flash 1.8s ease-out; }
.card h3 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.card .ev-date { margin: 2px 0 10px; }
.card .line { font-size: 13px; margin: 4px 0; }
.card .line b { font-weight: 700; }
.card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }

.empty { color: var(--muted); text-align: center; padding: 34px; }
