/* ── THÈME (unique : sombre, violet/rose) ───────────────────── */
:root {
	--bg-color:   #170f22;
	--text-color: #f3e8fb;

	--bs-body-bg:          #170f22;
	--bs-body-bg-rgb:      23, 15, 34;
	--bs-body-color:       #f3e8fb;
	--bs-body-color-rgb:   243, 232, 251;
	--bs-emphasis-color:   #ffffff;
	--bs-emphasis-color-rgb: 255, 255, 255;
	--bs-secondary-color:  #b79ad1;
	--bs-secondary-color-rgb: 183, 154, 209;
	--bs-secondary-bg:     #241531;
	--bs-secondary-bg-rgb: 36, 21, 49;
	--bs-tertiary-bg:      #2d1b3d;
	--bs-tertiary-bg-rgb:  45, 27, 61;
	--bs-border-color:     #3f2a52;

	--bs-primary:     #d946ef;
	--bs-primary-rgb: 217, 70, 239;
	--bs-link-color:       #e879f9;
	--bs-link-color-rgb:   232, 121, 249;
	--bs-link-hover-color: #f0abfc;

	--bs-form-check-input-checked-bg-color:     #d946ef;
	--bs-form-check-input-checked-border-color: #d946ef;
	--bs-btn-close-focus-shadow: 0 0 0 .25rem rgba(217, 70, 239, .25);
}

/* Bootstrap fige aussi la couleur de focus et de case cochée (bleu, pas une variable) */
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
	border-color: #d946ef;
	box-shadow: 0 0 0 .25rem rgba(217, 70, 239, .25);
}
.form-check-input:checked {
	background-color: #d946ef;
	border-color: #d946ef;
}

html, body {
	background-color: var(--bg-color);
	color: var(--text-color);
}

/* Bootstrap fige les couleurs de .btn-primary à la compilation (CDN, pas de
   build Sass ici) : on les redéfinit à la main pour rester dans la palette. */
.btn-primary {
	--bs-btn-color: #1a0625;
	--bs-btn-bg: #d946ef;
	--bs-btn-border-color: #d946ef;
	--bs-btn-hover-color: #1a0625;
	--bs-btn-hover-bg: #e879f9;
	--bs-btn-hover-border-color: #e879f9;
	--bs-btn-active-bg: #c026d3;
	--bs-btn-active-border-color: #c026d3;
	--bs-btn-disabled-bg: #d946ef;
	--bs-btn-disabled-border-color: #d946ef;
	--bs-btn-focus-shadow-rgb: 217, 70, 239;
}
.btn-outline-primary {
	--bs-btn-color: #e879f9;
	--bs-btn-border-color: #e879f9;
	--bs-btn-hover-color: #1a0625;
	--bs-btn-hover-bg: #e879f9;
	--bs-btn-hover-border-color: #e879f9;
	--bs-btn-active-bg: #d946ef;
	--bs-btn-active-border-color: #d946ef;
	--bs-btn-focus-shadow-rgb: 217, 70, 239;
}

/* ── SIDEBAR — STRUCTURE ─────────────────────────────────── */
nav#sidebarMenu {
    display: flex;
    flex-direction: column;
    background: #1c1128;
    border-right: 1px solid #3f2a52;
}
.sidebar-top { flex-shrink: 0; }

@media (min-width: 768px) {
    nav#sidebarMenu {
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
    }
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 14px 12px;
    margin-bottom: 4px;
    border-bottom: 1px solid #3f2a52;
}
.sidebar-brand-icon { border-radius: 7px; flex-shrink: 0; }
.sidebar-brand-name { font-size: .88rem; font-weight: 700; line-height: 1.2; color: #fdf4ff; }
.sidebar-brand-sub  { font-size: .64rem; display: block; margin-top: 2px; color: #b79ad1; }

.sidebar-section {
    padding: 10px 14px 4px;
    font-size: .62rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    font-weight: 600;
    color: #8a6ba8;
}

.sidebar-nav { padding: 0 6px; gap: 1px; }
.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 10px 6px 12px;
    border-radius: 6px;
    font-size: .83rem;
    transition: background .15s, color .15s;
    border-left: 2px solid transparent;
    white-space: nowrap;
    color: #d7bce8;
}
.sidebar-nav .nav-link:hover  { color: #fff; background: rgba(217, 70, 239, .14); }
.sidebar-nav .nav-link.active { color: #fff; background: rgba(217, 70, 239, .24); border-left-color: #d946ef; }
.sidebar-nav .nav-link i { font-size: .92rem; width: 16px; text-align: center; flex-shrink: 0; }
.sidebar-nav button.nav-link { width: 100%; background: none; border: none; border-left: 2px solid transparent; cursor: pointer; }

/* ── TABLEAUX ────────────────────────────────────────────── */
.table {
    --bs-table-bg:            #241531;
    --bs-table-color:         #f3e8fb;
    --bs-table-border-color:  #3f2a52;
    --bs-table-striped-bg:    #2d1b3d;
    --bs-table-striped-color: #f3e8fb;
    --bs-table-hover-bg:      #2d1b3d;
    --bs-table-hover-color:   #ffffff;
}
.table thead th { color: #b79ad1; }
.table .btn-outline-secondary {
    --bs-btn-color: #b79ad1;
    --bs-btn-border-color: #4a3363;
    --bs-btn-hover-bg: #3f2a52;
    --bs-btn-hover-border-color: #4a3363;
}
.table .btn-outline-danger {
    --bs-btn-color: #fb7185;
    --bs-btn-border-color: #7f1d3d;
}
.table .btn-outline-success {
    --bs-btn-color: #4ade80;
    --bs-btn-border-color: #166534;
}

/* ── PEINTURES ───────────────────────────────────────────── */
.swatch {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,.35);
    flex-shrink: 0;
}

.niveau-pleine       { background: #16a34a20; color: #4ade80; border: 1px solid #16a34a50; }
.niveau-entamee      { background: #d946ef20; color: #e879f9; border: 1px solid #d946ef50; }
.niveau-presque_vide { background: #f59e0b20; color: #fbbf24; border: 1px solid #f59e0b50; }
.niveau-vide         { background: #ef444420; color: #f87171; border: 1px solid #ef444450; }

/* Sélecteur de priorité discret : pas de fond/bordure marqués, juste une
   teinte de texte, pour ne pas rivaliser visuellement avec le reste de la carte. */
.priorite-select {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    font-size: .78rem;
    padding-left: 0;
    background-image: none;
}
.priorite-select:focus { box-shadow: none !important; }
.priorite-haute   { color: #f87171; }
.priorite-moyenne { color: #fbbf24; }
.priorite-basse   { color: #b79ad1; }

/* ── PICTOGRAMMES DE NIVEAU (Ma collection) ─────────────────── */
.niveau-picker { display: flex; gap: 6px; }
.niveau-picto {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid transparent;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    opacity: .4;
    cursor: pointer;
    transition: opacity .15s, background .15s, border-color .15s;
}
.niveau-picto:hover  { opacity: .8; }
.niveau-picto.active { opacity: 1; }
.niveau-picto[data-niveau="pleine"]       { color: #4ade80; }
.niveau-picto[data-niveau="entamee"]      { color: #e879f9; }
.niveau-picto[data-niveau="presque_vide"] { color: #fbbf24; }
.niveau-picto[data-niveau="vide"]         { color: #f87171; }
.niveau-picto.active[data-niveau="pleine"]       { background: #16a34a20; border-color: #16a34a80; }
.niveau-picto.active[data-niveau="entamee"]      { background: #d946ef20; border-color: #d946ef80; }
.niveau-picto.active[data-niveau="presque_vide"] { background: #f59e0b20; border-color: #f59e0b80; }
.niveau-picto.active[data-niveau="vide"]         { background: #ef444420; border-color: #ef444480; }

/* Sur smartphone, la grille passe à une seule colonne : un séparateur très
   discret entre les cartes aide à distinguer chaque peinture. */
@media (max-width: 575.98px) {
    .collection-card { border-bottom: 1px solid rgba(255, 255, 255, .1); }
}

/* Sur ordinateur (grille multi-colonnes), un séparateur vertical discret
   entre les colonnes de chaque ligne. Bornes exactes pour ne pas cumuler
   plusieurs règles nth-child à la fois (2 col en sm/md, 3 col en lg, 4 col
   en xl+, cf. col-sm-6 col-lg-4 col-xl-3 sur les cartes). */
@media (min-width: 576px) and (max-width: 991.98px) {
    #vue-grille > [class*="col-"]:not(:nth-child(2n+1)) { border-left: 1px solid rgba(255, 255, 255, .1); }
}
@media (min-width: 992px) and (max-width: 1199.98px) {
    #vue-grille > [class*="col-"]:not(:nth-child(3n+1)) { border-left: 1px solid rgba(255, 255, 255, .1); }
}
@media (min-width: 1200px) {
    #vue-grille > [class*="col-"]:not(:nth-child(4n+1)) { border-left: 1px solid rgba(255, 255, 255, .1); }
}

/* ── BASCULE GRILLE / LISTE (Ma collection) ─────────────────── */
.vue-toggle-btn.active {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
}
#vue-liste { display: none; }
@media (min-width: 768px) {
    #collection-vues.vue-liste #vue-grille { display: none; }
    #collection-vues.vue-liste #vue-liste  { display: block; }
}

/* ── SÉLECTEUR DE PEINTURE AVEC PASTILLE (Figurines) ────────── */
.peinture-picker { position: relative; }
.peinture-picker-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    cursor: pointer;
}
.peinture-picker-label { display: flex; align-items: center; gap: 8px; overflow: hidden; }
.peinture-picker-label .swatch { flex-shrink: 0; }
.peinture-picker-label span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.peinture-picker-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    z-index: 20;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: #241531;
    border: 1px solid #3f2a52;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
    max-height: 280px;
}
.peinture-picker.open .peinture-picker-menu { display: flex; }
.peinture-picker-search { margin: 8px 8px 4px; width: calc(100% - 16px); }
.peinture-picker-options { overflow-y: auto; padding-bottom: 6px; }
.peinture-picker-group {
    padding: 6px 12px 2px;
    font-size: .66rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #8a6ba8;
    position: sticky;
    top: 0;
    background: #241531;
}
.peinture-picker-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    text-align: left;
    padding: 6px 12px;
    background: none;
    border: none;
    color: var(--bs-body-color);
    cursor: pointer;
    font-size: .85rem;
}
.peinture-picker-option:hover { background: rgba(217, 70, 239, .14); }
.peinture-picker-option.d-none,
.peinture-picker-group.d-none { display: none; }
