/* ================================================================
   STOCKMASTER PRO v4.0 — REFONTE DESIGN COMPLÈTE
   Fichier de surcharge pour un design unifié, moderne et professionnel
   ================================================================ */

/* ══════════════════════════════════════════════════════════════
   1. VARIABLES AMÉLIORÉES
   ══════════════════════════════════════════════════════════════ */

:root,
[data-theme="dark"] {
    /* Couleurs primaires améliorées */
    --primary: #00b4d8;
    --primary-hover: #00c9f0;
    --primary-bg: rgba(0, 180, 216, 0.1);
    --primary-border: rgba(0, 180, 216, 0.3);
    
    /* Couleurs sémantiques */
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    
    /* Surfaces améliorées */
    --surface-1: #0d1117;
    --surface-2: #161b22;
    --surface-3: #21262d;
    --surface-hover: #30363d;
    
    /* Texte */
    --text-1: #f0f6fc;
    --text-2: #8b949e;
    --text-3: #6e7681;
    
    /* Bordures */
    --border-1: #30363d;
    --border-2: #21262d;
    
    /* Ombres */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 0 3px rgba(0, 180, 216, 0.2);
    
    /* Espacements standardisés */
    --sp-xs: 4px;
    --sp-sm: 8px;
    --sp-md: 12px;
    --sp-lg: 16px;
    --sp-xl: 24px;
    --sp-2xl: 32px;
    
    /* Rayons standardisés */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition: 200ms ease;
    --transition-fast: 150ms ease;
}

[data-theme="light"] {
    --surface-1: #ffffff;
    --surface-2: #f6f8fa;
    --surface-3: #eaeef2;
    --surface-hover: #f3f4f6;
    
    --text-1: #1f2328;
    --text-2: #656d76;
    --text-3: #8c959f;
    
    --border-1: #d0d7de;
    --border-2: #d8dee4;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

/* ══════════════════════════════════════════════════════════════
   2. STRUCTURE DE PAGE UNIFIÉE
   ══════════════════════════════════════════════════════════════ */

/* Container principal de chaque page */
.pg,
.page-body,
section[class^="pg-"] {
    padding: var(--sp-xl) !important;
    max-width: 1600px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .pg,
    .page-body,
    section[class^="pg-"] {
        padding: var(--sp-lg) !important;
    }
}

/* ══════════════════════════════════════════════════════════════
   3. HEADER DE PAGE UNIFIÉ
   ══════════════════════════════════════════════════════════════ */

.page-header,
.sect-toolbar,
.mv-header,
.toolbar {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-lg);
    margin-bottom: var(--sp-xl) !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

.sect-toolbar-left,
.toolbar-left,
.page-header-left {
    display: flex;
    align-items: center;
    gap: var(--sp-md);
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.sect-toolbar-right,
.toolbar-right,
.page-header-right {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════
   4. BARRE DE FILTRES UNIFIÉE
   ══════════════════════════════════════════════════════════════ */

.filters-bar,
.mv-filters-row,
.report-filters {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-md) !important;
    padding: var(--sp-lg) !important;
    background: var(--surface-2) !important;
    border: 1px solid var(--border-1) !important;
    border-radius: var(--radius-lg) !important;
    margin-bottom: var(--sp-lg) !important;
}

/* ══════════════════════════════════════════════════════════════
   5. INPUTS & SELECTS UNIFIÉS
   ══════════════════════════════════════════════════════════════ */

.inp,
.sel,
input[type="text"],
input[type="date"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="search"],
select,
textarea {
    width: auto;
    min-width: 0;
    padding: 10px 14px !important;
    background: var(--surface-1) !important;
    border: 1px solid var(--border-1) !important;
    border-radius: var(--radius-md) !important;
    color: var(--text-1) !important;
    font-size: 14px !important;
    font-family: 'Inter', sans-serif !important;
    transition: all var(--transition-fast) !important;
}

.inp:focus,
.sel:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none !important;
    border-color: var(--primary) !important;
    box-shadow: var(--shadow-glow) !important;
}

.inp::placeholder,
input::placeholder {
    color: var(--text-3) !important;
}

/* Search input avec icône */
.inp-search,
.inp.inp-search,
input[type="search"],
.search-box input,
[id$="Search"] {
    min-width: 280px;
    padding-left: 14px !important;
}

/* Selects */
select,
.sel {
    min-width: 150px;
    padding-right: 36px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    cursor: pointer;
}

/* Date inputs */
input[type="date"] {
    min-width: 140px;
}

/* ══════════════════════════════════════════════════════════════
   6. BOUTONS UNIFIÉS
   ══════════════════════════════════════════════════════════════ */

.btn,
button[class*="btn"] {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: var(--sp-sm);
    padding: 10px 18px !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.4;
    border: 1px solid transparent !important;
    border-radius: var(--radius-md) !important;
    cursor: pointer;
    transition: all var(--transition-fast) !important;
    white-space: nowrap;
    text-decoration: none;
}

.btn svg,
button svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

/* Primary */
.btn-primary {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover) !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Success */
.btn-success,
.btn-add,
.btn.btn-success {
    background: var(--success) !important;
    color: white !important;
    border-color: var(--success) !important;
}

.btn-success:hover:not(:disabled),
.btn-add:hover:not(:disabled) {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* Danger */
.btn-danger,
.btn-remove,
.btn.btn-danger {
    background: var(--danger) !important;
    color: white !important;
    border-color: var(--danger) !important;
}

.btn-danger:hover:not(:disabled),
.btn-remove:hover:not(:disabled) {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* Secondary / Outline */
.btn-secondary,
.btn-outline,
.btn-transfer,
.btn.btn-secondary {
    background: transparent !important;
    color: var(--text-2) !important;
    border-color: var(--border-1) !important;
}

.btn-secondary:hover:not(:disabled),
.btn-outline:hover:not(:disabled),
.btn-transfer:hover:not(:disabled) {
    background: var(--surface-hover) !important;
    border-color: var(--border-1) !important;
    color: var(--text-1) !important;
}

/* Ghost */
.btn-ghost {
    background: transparent !important;
    color: var(--text-2) !important;
    border-color: transparent !important;
}

.btn-ghost:hover:not(:disabled) {
    background: var(--surface-hover) !important;
    color: var(--text-1) !important;
}

/* Sizes */
.btn-sm {
    padding: 6px 12px !important;
    font-size: 13px !important;
}

.btn-lg {
    padding: 12px 24px !important;
    font-size: 15px !important;
}

/* Icon button */
.btn-icon {
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
}

.btn-icon.btn-sm {
    width: 28px !important;
    height: 28px !important;
}

/* ══════════════════════════════════════════════════════════════
   7. CARTES UNIFIÉES
   ══════════════════════════════════════════════════════════════ */

.card,
.card-full,
[class*="-card"] {
    background: var(--surface-2) !important;
    border: 1px solid var(--border-1) !important;
    border-radius: var(--radius-lg) !important;
    overflow: hidden;
}

.card-hd,
.card-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-md);
    padding: var(--sp-lg) var(--sp-xl) !important;
    border-bottom: 1px solid var(--border-2) !important;
    background: transparent !important;
}

.card-hd h4,
.card-header h4,
.card-title {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: var(--text-1) !important;
    margin: 0 !important;
}

.card-body {
    padding: var(--sp-xl) !important;
}

/* ══════════════════════════════════════════════════════════════
   8. TABLEAUX UNIFIÉS
   ══════════════════════════════════════════════════════════════ */

.tbl-wrap,
.table-container {
    overflow-x: auto;
    background: var(--surface-2);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-lg);
}

table,
.data-table,
.mv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px !important;
}

table th,
thead th {
    padding: 12px 16px !important;
    text-align: left;
    font-size: 11px !important;
    font-weight: 600 !important;
    color: var(--text-3) !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--surface-3) !important;
    border-bottom: 1px solid var(--border-1) !important;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

table td,
tbody td {
    padding: 12px 16px !important;
    color: var(--text-2) !important;
    border-bottom: 1px solid var(--border-2) !important;
    vertical-align: middle;
}

table tbody tr {
    transition: background var(--transition-fast);
}

table tbody tr:hover {
    background: var(--surface-hover) !important;
}

table tbody tr:last-child td {
    border-bottom: none !important;
}

/* Cellules spéciales */
td.cell-primary,
td strong,
.mv-table td:nth-child(3) {
    color: var(--text-1) !important;
    font-weight: 500;
}

td.cell-mono,
.col-mono,
td:has(.badge) + td {
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 12px !important;
    color: var(--primary) !important;
}

/* ══════════════════════════════════════════════════════════════
   9. BADGES UNIFIÉS
   ══════════════════════════════════════════════════════════════ */

.badge,
[class*="badge-"],
.type-badge {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    padding: 4px 10px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    border-radius: var(--radius-full) !important;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-blue,
.badge-primary,
.badge[data-type="transfer"],
.badge[data-type="entry"] {
    background: var(--primary-bg) !important;
    color: var(--primary) !important;
}

.badge-green,
.badge-success,
.badge[data-type="add"] {
    background: var(--success-bg) !important;
    color: var(--success) !important;
}

.badge-orange,
.badge-warning,
.badge[data-type="inventory"] {
    background: var(--warning-bg) !important;
    color: var(--warning) !important;
}

.badge-red,
.badge-danger,
.badge[data-type="remove"] {
    background: var(--danger-bg) !important;
    color: var(--danger) !important;
}

/* ══════════════════════════════════════════════════════════════
   10. KPI CARDS
   ══════════════════════════════════════════════════════════════ */

.kpi-row,
.kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    gap: var(--sp-lg) !important;
    margin-bottom: var(--sp-xl) !important;
}

.kpi-card {
    background: var(--surface-2) !important;
    border: 1px solid var(--border-1) !important;
    border-radius: var(--radius-lg) !important;
    padding: var(--sp-xl) !important;
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kpi-card.blue::before { background: var(--primary); }
.kpi-card.green::before { background: var(--success); }
.kpi-card.orange::before { background: var(--warning); }
.kpi-card.red::before { background: var(--danger); }

.kpi-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--sp-md);
}

.kpi-ico {
    width: 44px !important;
    height: 44px !important;
    border-radius: var(--radius-md) !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-card.blue .kpi-ico { background: var(--primary-bg); }
.kpi-card.green .kpi-ico { background: var(--success-bg); }
.kpi-card.orange .kpi-ico { background: var(--warning-bg); }
.kpi-card.red .kpi-ico { background: var(--danger-bg); }

.kpi-ico svg {
    width: 22px !important;
    height: 22px !important;
}

.kpi-card.blue .kpi-ico svg { stroke: var(--primary); }
.kpi-card.green .kpi-ico svg { stroke: var(--success); }
.kpi-card.orange .kpi-ico svg { stroke: var(--warning); }
.kpi-card.red .kpi-ico svg { stroke: var(--danger); }

.kpi-val {
    font-size: 28px !important;
    font-weight: 700 !important;
    color: var(--text-1) !important;
    line-height: 1.2;
    margin-top: var(--sp-sm);
}

.kpi-lbl {
    font-size: 12px !important;
    color: var(--text-3) !important;
    margin-top: var(--sp-xs);
}

/* ══════════════════════════════════════════════════════════════
   11. GRILLE DE PRODUITS
   ══════════════════════════════════════════════════════════════ */

.prod-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: var(--sp-lg) !important;
}

.prod-card {
    background: var(--surface-2) !important;
    border: 1px solid var(--border-1) !important;
    border-radius: var(--radius-lg) !important;
    padding: var(--sp-lg) !important;
    cursor: pointer;
    transition: all var(--transition);
}

.prod-card:hover {
    border-color: var(--primary) !important;
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.prod-card-head {
    display: flex;
    gap: var(--sp-md);
    margin-bottom: var(--sp-md);
}

.prod-thumb {
    width: 64px !important;
    height: 64px !important;
    border-radius: var(--radius-md) !important;
    background: var(--surface-3) !important;
    border: 1px solid var(--border-2) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.prod-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.prod-thumb svg {
    width: 28px;
    height: 28px;
    color: var(--text-3);
}

.prod-card-info {
    flex: 1;
    min-width: 0;
}

.prod-card-info h4 {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--text-1) !important;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.prod-card-info .sku {
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 11px !important;
    color: var(--primary) !important;
}

/* Stock bar */
.stock-bar {
    height: 6px !important;
    background: var(--surface-3) !important;
    border-radius: var(--radius-full) !important;
    overflow: hidden;
    margin-top: var(--sp-md);
}

.stock-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.stock-bar-fill.ok { background: var(--success) !important; }
.stock-bar-fill.low { background: var(--warning) !important; }
.stock-bar-fill.crit { background: var(--danger) !important; }

/* ══════════════════════════════════════════════════════════════
   12. PAGINATION UNIFIÉE
   ══════════════════════════════════════════════════════════════ */

.pager,
.mv-pager,
.pagination-bar,
[id$="Pager"] {
    display: flex !important;
    align-items: center;
    justify-content: flex-end !important;
    gap: var(--sp-md) !important;
    padding: var(--sp-lg) !important;
    background: var(--surface-3) !important;
    border-top: 1px solid var(--border-2) !important;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    margin-top: 0 !important;
}

.btn-pager,
.pagination-btn,
[id$="Prev"],
[id$="Next"] {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 8px 14px !important;
    background: var(--surface-2) !important;
    border: 1px solid var(--border-1) !important;
    border-radius: var(--radius-md) !important;
    color: var(--text-2) !important;
    font-size: 13px !important;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-pager:hover:not(:disabled),
.pagination-btn:hover:not(:disabled),
[id$="Prev"]:hover:not(:disabled),
[id$="Next"]:hover:not(:disabled) {
    background: var(--surface-hover) !important;
    color: var(--text-1) !important;
}

.btn-pager:disabled,
.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pager-info,
[id$="PageInfo"] {
    font-size: 13px !important;
    color: var(--text-3) !important;
    padding: 0 var(--sp-sm);
}

/* ══════════════════════════════════════════════════════════════
   13. COMPTEURS / BADGES RÉSULTATS
   ══════════════════════════════════════════════════════════════ */

.toolbar-count,
.results-count,
[id$="Count"],
.mv-count {
    display: inline-flex !important;
    align-items: center;
    padding: 6px 14px !important;
    background: var(--primary-bg) !important;
    color: var(--primary) !important;
    border: 1px solid var(--primary-border) !important;
    border-radius: var(--radius-full) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
}

/* ══════════════════════════════════════════════════════════════
   14. MODALES AMÉLIORÉES
   ══════════════════════════════════════════════════════════════ */

.modal-overlay {
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(4px);
}

.modal {
    background: var(--surface-2) !important;
    border: 1px solid var(--border-1) !important;
    border-radius: var(--radius-xl) !important;
    box-shadow: var(--shadow-lg) !important;
    max-width: 560px;
    width: 100%;
}

.modal-hdr {
    padding: var(--sp-xl) !important;
    border-bottom: 1px solid var(--border-2) !important;
}

.modal-hdr h3 {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: var(--text-1) !important;
}

.modal-body {
    padding: var(--sp-xl) !important;
}

.modal-footer {
    padding: var(--sp-lg) var(--sp-xl) !important;
    border-top: 1px solid var(--border-2) !important;
    background: var(--surface-3) !important;
    display: flex;
    justify-content: flex-end;
    gap: var(--sp-sm);
}

/* ══════════════════════════════════════════════════════════════
   15. TOASTS AMÉLIORÉS
   ══════════════════════════════════════════════════════════════ */

.toast-wrap,
.toast-container {
    top: calc(60px + env(safe-area-inset-top)) !important;
}

.toast {
    background: var(--surface-2) !important;
    border: 1px solid var(--border-1) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-lg) !important;
    padding: var(--sp-lg) !important;
}

/* ══════════════════════════════════════════════════════════════
   16. ÉTATS VIDES
   ══════════════════════════════════════════════════════════════ */

.empty-state,
.act-empty,
.alerts-ok {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--sp-2xl) var(--sp-xl) !important;
    text-align: center;
    color: var(--text-3) !important;
}

/* ══════════════════════════════════════════════════════════════
   17. TABS DE RAPPORTS
   ══════════════════════════════════════════════════════════════ */

.report-tabs {
    display: flex !important;
    gap: var(--sp-sm) !important;
    margin-bottom: var(--sp-xl) !important;
    padding: var(--sp-sm);
    background: var(--surface-2);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-lg);
    overflow-x: auto;
}

.report-tab {
    padding: 10px 18px !important;
    background: transparent !important;
    border: none !important;
    border-radius: var(--radius-md) !important;
    color: var(--text-2) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.report-tab:hover {
    background: var(--surface-hover) !important;
    color: var(--text-1) !important;
}

.report-tab.active {
    background: var(--primary-bg) !important;
    color: var(--primary) !important;
    font-weight: 600 !important;
}

/* ══════════════════════════════════════════════════════════════
   18. SUMMARY CARDS (RAPPORTS)
   ══════════════════════════════════════════════════════════════ */

.report-summary {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
    gap: var(--sp-lg) !important;
    margin-bottom: var(--sp-xl) !important;
}

.summary-card {
    background: var(--surface-2) !important;
    border: 1px solid var(--border-1) !important;
    border-radius: var(--radius-lg) !important;
    padding: var(--sp-xl) !important;
    display: flex;
    align-items: center;
    gap: var(--sp-lg);
}

.summary-card.alert {
    border-color: var(--danger) !important;
    background: var(--danger-bg) !important;
}

.summary-icon {
    font-size: 28px;
}

.summary-value {
    font-size: 24px !important;
    font-weight: 700 !important;
    color: var(--text-1) !important;
    line-height: 1.2;
}

.summary-label {
    font-size: 12px !important;
    color: var(--text-3) !important;
}

/* ══════════════════════════════════════════════════════════════
   19. FORM LABELS
   ══════════════════════════════════════════════════════════════ */

.lbl,
label,
.form-label {
    display: block;
    margin-bottom: var(--sp-sm) !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    color: var(--text-2) !important;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ══════════════════════════════════════════════════════════════
   20. VIEW TOGGLE (Grille/Liste)
   ══════════════════════════════════════════════════════════════ */

.view-toggle {
    display: inline-flex !important;
    background: var(--surface-1) !important;
    border: 1px solid var(--border-1) !important;
    border-radius: var(--radius-md) !important;
    padding: 3px;
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 28px;
    border: none !important;
    background: transparent !important;
    color: var(--text-3);
    border-radius: var(--radius-sm) !important;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.view-toggle-btn:hover {
    color: var(--text-1);
}

.view-toggle-btn.active {
    background: var(--surface-2) !important;
    color: var(--primary) !important;
    box-shadow: var(--shadow-sm);
}

/* ══════════════════════════════════════════════════════════════
   21. RESPONSIVE
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .kpi-row,
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .prod-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .page-header,
    .sect-toolbar,
    .toolbar {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    .sect-toolbar-left,
    .sect-toolbar-right,
    .page-header-left,
    .page-header-right {
        width: 100%;
        justify-content: stretch;
    }
    
    .sect-toolbar-right,
    .page-header-right {
        flex-wrap: wrap;
    }
    
    .sect-toolbar-right .btn,
    .page-header-right .btn {
        flex: 1;
        justify-content: center;
    }
    
    .filters-bar,
    .mv-filters-row {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    .inp-search,
    .search-box input,
    [id$="Search"] {
        min-width: 0 !important;
        width: 100% !important;
    }
    
    select,
    .sel {
        min-width: 0 !important;
        width: 100% !important;
    }
    
    .pager,
    .mv-pager,
    .pagination-bar {
        flex-wrap: wrap;
        justify-content: center !important;
    }
    
    .report-summary {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .prod-grid {
        grid-template-columns: 1fr !important;
    }
    
    .kpi-row,
    .kpi-grid {
        grid-template-columns: 1fr !important;
    }
    
    .kpi-val {
        font-size: 24px !important;
    }
}

/* ══════════════════════════════════════════════════════════════
   22. ANIMATIONS
   ══════════════════════════════════════════════════════════════ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade { animation: fadeIn 0.2s ease; }
.animate-slide-up { animation: slideUp 0.2s ease; }

/* ══════════════════════════════════════════════════════════════
   23. UTILITAIRES
   ══════════════════════════════════════════════════════════════ */

.hidden { display: none !important; }
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-muted { color: var(--text-3) !important; }

.flex { display: flex !important; }
.flex-col { flex-direction: column !important; }
.items-center { align-items: center !important; }
.justify-between { justify-content: space-between !important; }
.justify-end { justify-content: flex-end !important; }
.gap-2 { gap: var(--sp-sm) !important; }
.gap-3 { gap: var(--sp-md) !important; }
.gap-4 { gap: var(--sp-lg) !important; }

.mt-2 { margin-top: var(--sp-sm) !important; }
.mt-4 { margin-top: var(--sp-lg) !important; }
.mb-2 { margin-bottom: var(--sp-sm) !important; }
.mb-4 { margin-bottom: var(--sp-lg) !important; }

.w-full { width: 100% !important; }
.font-medium { font-weight: 500 !important; }
.font-semibold { font-weight: 600 !important; }
.font-bold { font-weight: 700 !important; }
