/* Couche de design moderne par-dessus Bootstrap (page principale Régiste) */
:root {
    --bg1: #f7f8fa;
    --bg2: #fdf3cf;              /* halo doré très léger */
    --card: #ffffff;
    --border: #e6e8ec;
    --text: #2b333b;
    --muted: #747e88;           /* gris Studio Sous-Gare */
    --accent: #eec41e;          /* jaune Studio Sous-Gare */
    --accent-600: #d9ad12;
    --accent-ink: #38424d;      /* ardoise : texte sur le jaune */
    --success: #16a34a;
    --success-600: #15803d;
    --danger: #e4405f;
    --danger-600: #cc2e4c;
    --radius: 16px;
    --radius-sm: 11px;
    --shadow: 0 1px 2px rgba(16,24,40,.04), 0 10px 30px rgba(16,24,40,.06);
    --shadow-hover: 0 2px 6px rgba(16,24,40,.08), 0 16px 40px rgba(16,24,40,.10);
}

body {
    background: radial-gradient(1200px 600px at 100% -10%, var(--bg2), transparent 55%),
                linear-gradient(180deg, var(--bg1), #eef0f3);
    background-attachment: fixed;
    color: var(--text);
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* En-tête de marque */
.app-header {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    padding: 4px 2px 24px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
}
.brand { color: var(--accent-ink); }
.brand-logo { width: 40px; height: 40px; border-radius: 11px; display: block; box-shadow: 0 2px 8px rgba(56,66,77,.18); }
.brand-dot {
    width: 16px; height: 16px; border-radius: 50%;
    background: linear-gradient(135deg, #eec41e, #ffd700);
    box-shadow: 0 0 0 5px rgba(238,196,30,.18);
}
.brand-sub { color: var(--muted); font-size: .95rem; padding-bottom: 4px; }
.header-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Onglets (admin) */
.nav-tabs { border-bottom: 1px solid var(--border); }
.nav-tabs .nav-link { color: var(--muted); font-weight: 600; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 10px 16px; }
.nav-tabs .nav-link:hover { color: var(--accent-ink); border-color: transparent; }
.nav-tabs .nav-link.active { color: var(--accent-ink); background: transparent; border: 0; border-bottom: 2px solid var(--accent); }

/* Tableaux */
.table > :not(caption) > * > * { border-color: var(--border); }
.table-striped > tbody > tr:nth-of-type(odd) > * { background: #fafbfc; }

/* Cartes */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: var(--card);
    transition: box-shadow .2s ease;
}
.card:hover { box-shadow: var(--shadow-hover); }
.card .card { box-shadow: none; }
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: .95rem;
    padding: 14px 18px;
    border-radius: var(--radius) var(--radius) 0 0 !important;
}
.card-body { padding: 18px; }

/* Boutons */
.btn { border-radius: var(--radius-sm); font-weight: 600; padding: 9px 16px; transition: transform .05s ease, filter .15s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn-primary:hover, .btn-primary:focus { background: var(--accent-600); border-color: var(--accent-600); color: var(--accent-ink); }
.btn-success { background: var(--success); border-color: var(--success); }
.btn-success:hover { background: var(--success-600); border-color: var(--success-600); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-600); border-color: var(--danger-600); }
.btn-outline-primary { color: var(--accent-ink); border-color: var(--accent); }
.btn-outline-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-lg, #playBtn, #stopBtn { font-size: 1.05rem; padding: 12px 18px; }

/* Champs */
.form-select, .form-control {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    padding: 10px 12px;
    background-color: #fcfcfe;
}
.form-select:focus, .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(238,196,30,.28);
}
label { font-weight: 600; font-size: .88rem; color: #39414f; margin-bottom: 4px; }

/* Listes / historiques */
.list-group-item { border-color: var(--border); padding: 11px 16px; }
.list-group-flush > .list-group-item:first-child { border-top: 0; }

/* Badges */
.badge { font-weight: 600; border-radius: 999px; padding: .4em .7em; }
.badge.bg-secondary { background: #eceef2 !important; color: #4b5563; }
.badge.bg-success { background: rgba(22,163,74,.14) !important; color: #15803d; }

/* Résultat d'impro (durée / thème / chrono) */
#result h3, #result h4 { font-weight: 700; letter-spacing: -.01em; }
#result h3 { font-size: 1.05rem; color: var(--muted); }
#result h4 { font-size: 1.15rem; }
#chrono {
    font-weight: 800; letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
    color: var(--accent-ink);
}

.alert { border-radius: var(--radius-sm); }

audio { border-radius: 10px; }

/* Musique : onglets Local / Spotify */
.music-tabs { display: inline-flex; background: #eef0f3; border-radius: 999px; padding: 3px; gap: 2px; }
.music-tabs button { border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: .82rem; padding: 4px 12px; border-radius: 999px; }
.music-tabs button.active { background: #fff; color: var(--accent-ink); box-shadow: 0 1px 3px rgba(16,24,40,.12); }
.music-tabs button[data-music-tab="spotify"].active { color: #128a3e; }

/* Mini-lecteur Spotify */
.sp-off { text-align: center; color: var(--muted); font-size: .9rem; }
.sp-off p { margin-bottom: 10px; }
.sp-small { font-size: .8rem; color: var(--muted); }
.sp-small a, a.sp-small { color: var(--muted); }
.sp-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px; }
.sp-empty { text-align: center; color: var(--muted); font-size: .85rem; padding: 18px 8px; }
.sp-track { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; text-align: left; padding: 6px; border-radius: 8px; color: var(--text); }
.sp-track:hover { background: #f3f4f6; }
.sp-track.playing { background: rgba(29,185,84,.12); }
.sp-track.playing .sp-t { color: #128a3e; }
.sp-track img, .sp-noimg { width: 36px; height: 36px; border-radius: 5px; object-fit: cover; background: #e5e7eb; flex: 0 0 auto; }
.sp-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sp-t { font-weight: 600; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-a { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-d { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.sp-msg { margin-top: 8px; font-size: .82rem; color: #9a3412; background: #fff7ed; border-radius: 8px; padding: 6px 10px; }
.sp-player { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.sp-now { display: flex; align-items: center; gap: 10px; }
.sp-now img { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: #e5e7eb; flex: 0 0 auto; }
.sp-btns { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.sp-btns button { border: 0; background: transparent; font-size: 1.05rem; width: 34px; height: 34px; border-radius: 50%; color: var(--accent-ink); }
.sp-btns button:hover { background: #f3f4f6; }
.sp-btns .sp-play { background: #1db954; color: #fff; width: 40px; height: 40px; }
.sp-btns .sp-play:hover { background: #1ed760; }
.sp-seek { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.sp-seek input, .sp-vol input { flex: 1; accent-color: #1db954; min-width: 0; }
.sp-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.sp-vol { display: flex; align-items: center; gap: 6px; width: 130px; font-size: .85rem; }

/* Raccourcis clavier */
.key-flash { outline: 3px solid var(--accent); outline-offset: 2px; }
#keyToast {
    position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 10px);
    background: var(--accent-ink); color: #fff; font-weight: 600; font-size: .9rem;
    padding: 8px 16px; border-radius: 999px; box-shadow: var(--shadow-hover);
    opacity: 0; pointer-events: none; transition: opacity .15s ease, transform .15s ease; z-index: 2000;
}
#keyToast.show { opacity: 1; transform: translate(-50%, 0); }
.keys-help { border-radius: var(--radius); }
.keys-help h6 { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 14px 0 6px; }
.keys-help h6:first-child { margin-top: 0; }
.keys-help dl { display: grid; grid-template-columns: 90px 1fr; gap: 6px 12px; margin: 0; font-size: .9rem; }
.keys-help dt { font-weight: 400; white-space: nowrap; }
.keys-help dd { margin: 0; }
.keys-help kbd { background: #f3f4f6; color: var(--accent-ink); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: 1px 7px; font-family: inherit; font-size: .8rem; font-weight: 600; }
.keys-note { margin: 14px 0 0; font-size: .8rem; color: var(--muted); }

/* Séquences (régie) */
.seq-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.seq-empty { grid-column: 1 / -1; color: var(--muted); font-size: .9rem; text-align: center; padding: 10px; }
.seq-btn {
    display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
    min-height: 62px; padding: 10px 12px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: #f8f9fb; color: var(--text); font-weight: 600;
    transition: background .15s ease, border-color .15s ease;
}
.seq-btn:hover { background: #fdf7db; border-color: #ecd77a; }
.seq-btn.running { background: var(--accent); border-color: var(--accent-600); color: var(--accent-ink); }
.seq-name { font-size: .92rem; line-height: 1.2; }
.seq-badges { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.seq-badges kbd, .seq-badge {
    font-family: inherit; font-size: .7rem; font-weight: 600; border-radius: 6px; padding: 1px 6px;
    background: #fff; color: var(--muted); border: 1px solid var(--border);
}
.seq-status { margin-top: 12px; }
.seq-progress { height: 4px; border-radius: 999px; background: #eceef2; overflow: hidden; }
#seqBar { height: 100%; width: 0; background: var(--accent); transition: width .2s ease; }
.seq-now { font-size: .85rem; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#seqGo.waiting { animation: seq-pulse 1s ease-in-out infinite; }
@keyframes seq-pulse { 50% { box-shadow: 0 0 0 5px rgba(238,196,30,.35); } }
@media (prefers-reduced-motion: reduce) { #seqGo.waiting { animation: none; outline: 3px solid var(--accent-ink); } }

/* Séquences (éditeur admin) */
.seq-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.seq-step { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: #fafbfc; }
.seq-step-num { flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: .8rem; display: flex; align-items: center; justify-content: center; margin-top: 4px; }
.seq-step-body { flex: 1; min-width: 0; }
.seq-step-title { font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.seq-step-fields { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; }
.seq-step-fields label { font-size: .78rem; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.seq-step-fields .form-control, .seq-step-fields .form-select { padding: 5px 8px; font-size: .88rem; }
.seq-step-fields .form-check-label { flex-direction: row; gap: 6px; align-items: center; padding-bottom: 6px; }
.seq-step-actions { display: flex; flex-direction: column; gap: 4px; }
.seq-step-actions .btn { padding: 2px 8px; }
.seq-swatches { display: flex; gap: 4px; align-items: center; }
.seq-swatch { width: 30px; height: 30px; border-radius: 7px; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); padding: 0; }
.seq-swatch.active { border-color: var(--accent-ink); }
.seq-swatches input[type=color] { width: 34px; height: 30px; padding: 2px; border-radius: 7px; border: 1px solid var(--border); background: #fff; }

/* Dock Mirabox : aperçu des touches */
#dockBtn.dock-on { background: var(--success); border-color: var(--success); color: #fff; }
.dock-grid { display: grid; grid-template-columns: repeat(5, 86px) 110px; gap: 10px; justify-content: center;
    background: #1d2228; padding: 16px; border-radius: 18px; }
.dock-key { width: 86px; height: 86px; padding: 0; border: 2px solid #3a424b; border-radius: 12px; overflow: hidden;
    background: #000; transition: transform .08s, border-color .15s; }
.dock-key img { width: 100%; height: 100%; display: block; }
.dock-side { height: 86px; border: 2px solid #3a424b; border-radius: 12px; background: #2a3038; color: #cfd6dd;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: .75rem; padding: 4px; }
.dock-side-dot { width: 26px; height: 26px; border-radius: 50%; background: #11161b; box-shadow: inset 0 0 0 2px #4a535d; }
.dock-side-lbl { line-height: 1.15; text-align: center; overflow: hidden; max-height: 2.4em; }
.dock-key.selected, .dock-side.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(238,196,30,.35); }
.dock-key.pressed, .dock-side.pressed { transform: scale(.92); border-color: #fff; }

/* --- Ambiance --- */
.amb-sugg { display:flex; gap:6px; flex-wrap:wrap; margin-top:4px; }
.amb-sugg:empty, .amb-msg:empty { display:none; }
.amb-sugg .btn.active { background:#38424d; color:#fff; }
.amb-msg { font-size:.85rem; color:#6c757d; min-height:1.2em; margin-top:4px; }
.amb-msg--warn { color:#a86b00; } .amb-msg--err { color:#c0392b; }
.amb-now__name { font-weight:700; font-size:1rem; display:inline-block; margin-right:8px; }
.amb-now__info { font-size:.85rem; color:#6c757d; }
.amb-sw { display:inline-flex; gap:3px; vertical-align:middle; }
.amb-sw i { width:14px; height:14px; border-radius:50%; border:1px solid rgba(0,0,0,.2); display:inline-block; }
.amb-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(160px, 1fr)); gap:6px; margin-top:8px; }
.amb-chip { display:flex; align-items:center; gap:6px; text-align:left; font-size:.88rem; padding:7px 9px;
    border:1px solid #dee2e6; border-radius:9px; background:#f6f7f9; }
.amb-chip:hover { border-color:#adb5bd; }
.amb-chip .amb-sw { margin-left:auto; } .amb-chip .amb-sw i { width:10px; height:10px; }
.amb-chip--learned { border-style:dashed; }


/* Musique : curseur de volume vertical (même gabarit que l'intensité DMX) */
.music-main { display:flex; gap:12px; align-items:stretch; }
.music-sources { flex:1 1 auto; min-width:0; }
.sp-vol { display:none !important; } /* remplacé par #musicVol */
.music-fader { flex:0 0 auto; display:flex; flex-direction:column; align-items:center; min-width:70px;
    padding:8px 6px; border:1px solid #dee2e6; border-radius:12px; background:#f6f7f9; }
.music-fader__title { font-weight:800; font-size:.72rem; text-transform:uppercase; letter-spacing:.05em; color:#51657f; }
.music-fader__level { font-size:1.05rem; font-weight:700; font-variant-numeric:tabular-nums; margin-bottom:6px; }
.v-fader { -webkit-appearance:none; appearance:none; writing-mode:vertical-rl; direction:rtl;
    width:56px; min-height:150px; flex:1 1 auto; background:transparent; cursor:pointer; }
.v-fader::-webkit-slider-runnable-track { width:22px; border-radius:12px;
    background:linear-gradient(to top,#38424d 0%,#1db954 100%); border:1px solid rgba(0,0,0,.2); }
.v-fader::-webkit-slider-thumb { -webkit-appearance:none; width:50px; height:28px; margin-right:-15px;
    border-radius:9px; background:#fff; border:2px solid #1db954; box-shadow:0 2px 6px rgba(0,0,0,.35); }
.v-fader::-moz-range-track { width:22px; border-radius:12px; background:linear-gradient(to top,#38424d,#1db954); border:1px solid rgba(0,0,0,.2); }
.v-fader::-moz-range-thumb { width:50px; height:28px; border-radius:9px; background:#fff; border:2px solid #1db954; }
.music-sources .music-player-block { padding:12px; }
.music-sources #musicPlayer { display:block; min-width:0; width:100%; }
.music-main { gap:8px; }
.music-fader { min-width:62px; }
.music-fader__btn { margin-top:8px; padding:2px 10px; }
.v-fader--amb::-webkit-slider-runnable-track { background:linear-gradient(to top,#38424d 0%,#8e5cd9 100%); }
.v-fader--amb::-webkit-slider-thumb { border-color:#8e5cd9; }
.v-fader--amb::-moz-range-track { background:linear-gradient(to top,#38424d,#8e5cd9); }
.v-fader--amb::-moz-range-thumb { border-color:#8e5cd9; }
.music-fader:not(.music-fader--amb)::after { content:""; display:block; height:37px; flex:0 0 auto; }
