/* ════════════════════════════════════════════════════════
   DTISoft — Module Inventaires (groupes / campagnes)
   ════════════════════════════════════════════════════════ */
.inv-wrap { padding: 12px 16px; }
.inv-toolbar {
    display: flex; align-items: center; gap: 8px;
    border-bottom: 1px solid #e5e7eb; padding-bottom: 8px; margin-bottom: 12px;
}
.inv-tab {
    background: transparent; border: 0; cursor: pointer;
    padding: 6px 14px; font-size: 13px; color: #64748b;
    border-radius: 4px 4px 0 0; font-weight: 500;
}
.inv-tab:hover { background: #f1f5f9; color: #1e3a8a; }
.inv-tab-active { background: #fff; color: #1e3a8a; border-bottom: 2px solid #2563eb; font-weight: 600; }
.inv-duree-info { font-size: 11px; color: #94a3b8; }
.inv-content { min-height: 200px; }

/* Vue "En cours" : carte */
.inv-empty {
    text-align: center; padding: 40px 20px; color: #94a3b8;
}
.inv-empty i { font-size: 48px; margin-bottom: 12px; color: #cbd5e1; }
.inv-empty h3 { font-size: 16px; color: #475569; margin: 0 0 6px 0; }
.inv-empty p { font-size: 13px; margin: 0 0 14px 0; }

.inv-card {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 8px;
    padding: 18px 22px; max-width: 760px; margin: 0 auto;
    border-left: 6px solid #2563eb;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.inv-card-ok      { border-left-color: #16a34a; }
.inv-card-warn    { border-left-color: #d97706; }
.inv-card-expired { border-left-color: #dc2626; background: #fef2f2; }
.inv-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.inv-card-head h3 { font-size: 17px; margin: 0; color: #1e3a8a; font-weight: 700; }
.inv-group-id { color: #475569; font-weight: 800; }
.inv-magasin { font-size: 12px; color: #64748b; }
.inv-magasin i { margin-right: 4px; }

.inv-card-meta {
    display: flex; flex-wrap: wrap; gap: 18px;
    font-size: 12px; color: #475569;
    margin-bottom: 14px; padding-bottom: 14px;
    border-bottom: 1px solid #e5e7eb;
}
.inv-card-meta i { color: #94a3b8; margin-right: 4px; }
.inv-card-meta b { color: #111827; }
.inv-pill-danger {
    background: #fee2e2; color: #991b1b; padding: 1px 6px;
    border-radius: 3px; font-size: 10px; font-weight: 700;
    margin-left: 4px;
}

/* Progress bar */
.inv-progress-wrap { margin-bottom: 14px; }
.inv-progress-bar {
    height: 14px; background: #e2e8f0; border-radius: 7px; overflow: hidden;
    position: relative;
}
.inv-progress-fill {
    height: 100%; background: linear-gradient(90deg, #16a34a, #22c55e);
    transition: width .3s ease;
}
.inv-progress-lbl {
    font-size: 11px; color: #475569; margin-top: 4px;
    display: flex; justify-content: space-between;
}
.inv-progress-lbl b { color: #1e3a8a; font-size: 13px; }

/* Actions */
.inv-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.inv-btn {
    background: #fff; border: 1px solid #cbd5e1; cursor: pointer;
    padding: 7px 14px; border-radius: 4px; font-size: 13px; color: #475569;
    display: inline-flex; align-items: center; gap: 6px;
}
.inv-btn:hover { background: #f1f5f9; border-color: #94a3b8; }
.inv-btn-primary { background: #2563eb; color: #fff; border-color: #2563eb; }
.inv-btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.inv-btn-danger { background: #dc2626; color: #fff; border-color: #dc2626; }
.inv-btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.inv-btn-mini {
    background: transparent; border: 0; cursor: pointer;
    color: #94a3b8; padding: 4px 6px;
}
.inv-btn-mini:hover { color: #2563eb; }

/* Table historique */
.inv-table {
    width: 100%; border-collapse: collapse; font-size: 12.5px;
    background: #fff; border-radius: 4px; overflow: hidden;
}
.inv-table th, .inv-table td {
    padding: 6px 10px; border-bottom: 1px solid #f1f5f9; text-align: left;
}
.inv-table th { background: #f8fafc; color: #475569; font-weight: 600; font-size: 11px; }
.inv-table tbody tr:hover { background: #f8fafc; }
.inv-table-edit { font-size: 12px; }
.inv-table-edit input:focus { outline: 1px solid #2563eb; }
.inv-pct {
    background: #dbeafe; color: #1e3a8a; padding: 1px 6px;
    border-radius: 3px; font-weight: 600;
}
/* Mini progress bar pour l'historique */
.inv-mini-progress {
    display: flex; align-items: center; gap: 8px; min-width: 110px;
}
.inv-mini-progress-bar {
    flex: 1; height: 8px;
    background: #e2e8f0; border-radius: 4px; overflow: hidden;
}
.inv-mini-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #16a34a, #22c55e);
    transition: width .3s ease;
}
.inv-mini-progress-lbl {
    font-size: 11px; font-weight: 600; color: #1e3a8a;
    min-width: 32px; text-align: right;
}

/* Popup générique */
.inv-popup-overlay {
    position: fixed; inset: 0; z-index: 10500;
    background: rgba(15,23,42,.55); backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center;
}
.inv-popup {
    background: #fff; border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,.4);
    max-height: 86vh; display: flex; flex-direction: column; overflow: hidden;
}
.inv-popup-head {
    padding: 12px 18px; background: #1e3a8a; color: #fff;
    font-size: 14px; font-weight: 700;
    display: flex; justify-content: space-between; align-items: center;
}
.inv-popup-head i { margin-right: 6px; }
.inv-popup-close {
    background: rgba(255,255,255,.2); border: 0; color: #fff;
    cursor: pointer; padding: 4px 8px; border-radius: 3px;
}
.inv-popup-close:hover { background: rgba(255,255,255,.35); }
.inv-popup-body { padding: 16px 20px; overflow-y: auto; }

/* Cloture modes */
.inv-cloture-modes { display: flex; flex-direction: column; gap: 10px; }
.inv-cloture-mode {
    border: 1px solid #cbd5e1; border-radius: 6px;
    padding: 12px 14px; cursor: pointer; transition: all .12s;
    background: #fff;
}
.inv-cloture-mode:hover {
    border-color: #2563eb; background: #eff6ff;
    box-shadow: 0 4px 10px rgba(37,99,235,.12);
}
.inv-cloture-mode-h {
    font-weight: 700; font-size: 14px; color: #1e3a8a; margin-bottom: 4px;
}
.inv-cloture-mode-h i { margin-right: 6px; color: #2563eb; }
.inv-cloture-mode-d { font-size: 12px; color: #475569; line-height: 1.5; }

.inv-err { color: #b91c1c; padding: 12px; background: #fef2f2; border-radius: 4px; }

/* ─── Modal "Casier par casier" (fullscreen 2 colonnes) ───────── */
.inv-cbc-overlay {
    position: fixed; inset: 0; z-index: 10500;
    background: rgba(15,23,42,.55); backdrop-filter: blur(2px);
    display: flex; align-items: stretch; justify-content: stretch;
}
.inv-cbc-panel {
    flex: 1; background: #fff; margin: 16px;
    border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.4);
    display: flex; flex-direction: column; overflow: hidden;
}
.inv-cbc-head {
    padding: 12px 18px; background: #1e3a8a; color: #fff;
    font-size: 14px; font-weight: 700;
    display: flex; align-items: center; gap: 14px;
}
.inv-cbc-head i { margin-right: 6px; }
.inv-cbc-meta { font-weight: 400; font-size: 12px; color: #cbd5e1; flex: 1; }
.inv-cbc-close {
    background: rgba(255,255,255,.2); border: 0; color: #fff;
    cursor: pointer; padding: 4px 9px; border-radius: 3px;
}
.inv-cbc-close:hover { background: rgba(255,255,255,.35); }

.inv-cbc-body { flex: 1; display: flex; overflow: hidden; }
.inv-cbc-left {
    width: 30%; min-width: 280px;
    border-right: 1px solid #e5e7eb;
    display: flex; flex-direction: column; background: #f8fafc;
}
.inv-cbc-search {
    padding: 10px; display: flex; align-items: center; gap: 6px;
    border-bottom: 1px solid #e5e7eb; background: #fff;
    flex-wrap: wrap;
}
.inv-cbc-search i { color: #94a3b8; }
.inv-cbc-search input[type="text"] {
    flex: 1; min-width: 120px;
    padding: 5px 8px; border: 1px solid #cbd5e1; border-radius: 4px;
    font-size: 12px;
}
.inv-cbc-toggle {
    font-size: 11px; color: #64748b; display: flex; align-items: center; gap: 4px;
    width: 100%; margin-top: 4px;
}

.inv-cbc-list {
    flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 0;
}
.inv-cbc-item {
    padding: 7px 12px; cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    display: flex; align-items: center; gap: 8px;
    font-size: 12.5px; transition: background .1s;
}
.inv-cbc-item:hover { background: #eff6ff; }
.inv-cbc-selected { background: #dbeafe !important; border-left: 3px solid #2563eb; padding-left: 9px; }
.inv-cbc-flag { width: 16px; text-align: center; }
.inv-cbc-inv  .inv-cbc-flag { color: #16a34a; }
.inv-cbc-todo .inv-cbc-flag { color: #cbd5e1; }
.inv-cbc-code { flex: 1; color: #374151; }
.inv-cbc-nb {
    font-size: 10px; background: #e2e8f0; color: #475569;
    padding: 1px 6px; border-radius: 8px; font-weight: 600;
}
.inv-cbc-empty-list { padding: 20px; text-align: center; color: #94a3b8; font-style: italic; font-size: 12px; }

.inv-cbc-right { flex: 1; display: flex; flex-direction: column; background: #fff; overflow: hidden; }
.inv-cbc-empty {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    color: #94a3b8; font-size: 14px;
}
.inv-cbc-empty i { font-size: 48px; margin-bottom: 12px; color: #cbd5e1; }
.inv-cbc-loading { padding: 30px; text-align: center; color: #64748b; }
.inv-cbc-right-head {
    padding: 10px 16px; border-bottom: 1px solid #e5e7eb;
    background: #f8fafc; font-size: 13px;
    display: flex; align-items: center; justify-content: space-between;
}
.inv-cbc-right-head b { color: #1e3a8a; }
.inv-cbc-selall { font-size: 11px; color: #64748b; cursor: pointer; }
.inv-cbc-selall input { margin-right: 4px; }

.inv-cbc-table-wrap { flex: 1; overflow: auto; padding: 0 12px; }
.inv-cbc-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.inv-cbc-table th {
    padding: 6px 8px; background: #f8fafc; color: #475569;
    font-weight: 600; font-size: 11px; text-align: left;
    border-bottom: 2px solid #e5e7eb;
    position: sticky; top: 0; z-index: 1;
}
.inv-cbc-table td {
    padding: 5px 8px; border-bottom: 1px solid #f1f5f9;
    font-variant-numeric: tabular-nums;
}
.inv-cbc-table tbody tr:hover { background: #f8fafc; }
.inv-cbc-table tbody tr.inv-cbc-neg { background: #fef2f2; }
.inv-cbc-table tbody tr.inv-cbc-neg:hover { background: #fee2e2; }
.inv-cbc-def { color: #94a3b8; font-style: italic; font-size: 11px; }

.inv-cbc-foot {
    padding: 10px 16px; border-top: 1px solid #e5e7eb;
    background: #f8fafc;
    display: flex; align-items: center; justify-content: space-between;
}
.inv-cbc-cnt { font-size: 12px; color: #475569; font-weight: 600; }

/* ─── Rapport d'écarts (modal fullscreen) ────────────────────── */
.inv-ec-overlay {
    position: fixed; inset: 0; z-index: 10500;
    background: rgba(15,23,42,.55); backdrop-filter: blur(2px);
    display: flex; align-items: stretch; justify-content: stretch;
}
.inv-ec-panel {
    flex: 1; background: #fff; margin: 16px;
    border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.4);
    display: flex; flex-direction: column; overflow: hidden;
}
.inv-ec-head {
    padding: 12px 18px; background: #1e3a8a; color: #fff;
    font-size: 14px; font-weight: 700;
    display: flex; align-items: center; justify-content: space-between;
}
.inv-ec-head i { margin-right: 6px; }
.inv-ec-close {
    background: rgba(255,255,255,.2); border: 0; color: #fff;
    cursor: pointer; padding: 4px 9px; border-radius: 3px;
}
.inv-ec-close:hover { background: rgba(255,255,255,.35); }

/* Cartes résumé */
.inv-ec-cards {
    display: flex; gap: 12px; padding: 14px 18px;
    border-bottom: 1px solid #e5e7eb; background: #f8fafc;
    flex-wrap: wrap;
}
.inv-ec-card {
    flex: 1; min-width: 130px;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 6px;
    padding: 10px 14px; text-align: center;
}
.inv-ec-card-v { font-size: 19px; font-weight: 800; color: #1e3a8a; }
.inv-ec-card-l { font-size: 11px; color: #64748b; margin-top: 2px; text-transform: uppercase; letter-spacing: .3px; }
.inv-ec-card-pos .inv-ec-card-v { color: #15803d; }
.inv-ec-card-neg .inv-ec-card-v { color: #b91c1c; }
.inv-ec-card-net { border-width: 2px; border-color: #cbd5e1; }

/* Toolbar */
.inv-ec-toolbar {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 18px; border-bottom: 1px solid #e5e7eb;
}
.inv-ec-search { display: flex; align-items: center; gap: 6px; }
.inv-ec-search i { color: #94a3b8; }
.inv-ec-search input {
    padding: 5px 8px; border: 1px solid #cbd5e1; border-radius: 4px;
    font-size: 12px; width: 260px;
}
.inv-ec-toggle { font-size: 12px; color: #475569; display: flex; align-items: center; gap: 5px; cursor: pointer; }
.inv-ec-count { font-size: 12px; color: #64748b; font-weight: 600; }

/* Table */
.inv-ec-table-wrap { flex: 1; overflow: auto; padding: 0 18px 12px; min-height: 0; }
.inv-ec-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.inv-ec-table th {
    padding: 6px 8px; background: #f1f5f9; color: #475569;
    font-weight: 600; font-size: 11px; text-align: left;
    border-bottom: 2px solid #e5e7eb;
    position: sticky; top: 0; z-index: 1;
}
.inv-ec-table td {
    padding: 4px 8px; border-bottom: 1px solid #f1f5f9;
}
.inv-ec-table .inv-ec-r { text-align: right; font-variant-numeric: tabular-nums; }
.inv-ec-table tbody tr:hover { background: #f8fafc; }
.inv-ec-table tbody tr.inv-ec-neg { background: #fef2f2; }
.inv-ec-table tbody tr.inv-ec-neg:hover { background: #fee2e2; }
.inv-ec-table tbody tr.inv-ec-pos { background: #f0fdf4; }
.inv-ec-table tbody tr.inv-ec-pos:hover { background: #dcfce7; }
.inv-ec-table tbody tr.inv-ec-neg td:nth-child(8),
.inv-ec-table tbody tr.inv-ec-neg td:nth-child(10) { color: #b91c1c; }
.inv-ec-table tbody tr.inv-ec-pos td:nth-child(8),
.inv-ec-table tbody tr.inv-ec-pos td:nth-child(10) { color: #15803d; }
.inv-ec-empty { padding: 40px; text-align: center; color: #16a34a; font-size: 14px; }
.inv-ec-empty i { margin-right: 6px; }
.inv-ec-trunc {
    padding: 10px 14px; margin-top: 8px;
    background: #fffbeb; border: 1px solid #fde68a; border-radius: 4px;
    font-size: 12px; color: #92400e;
}
.inv-ec-trunc i { margin-right: 6px; }
.inv-ec-pu-manq { color: #b45309; font-style: italic; font-size: 11px; cursor: help; }
