/* ============================================================
   BoaTech CI — Dashboard CSS (Admin + Tech)
   Design professionnel, responsive mobile/tablette/desktop
============================================================ */

/* ============================================================
   LAYOUT GLOBAL
============================================================ */
body.dashboard-body {
    margin: 0;
    padding: 0;
    background: #F1F5F9;
    font-family: var(--font-body, 'DM Sans', sans-serif);
    overflow-x: hidden;
}

body.dashboard-body *,
body.dashboard-body *::before,
body.dashboard-body *::after {
    box-sizing: border-box;
}

/* ============================================================
   SIDEBAR
============================================================ */
.dash-sidebar {
    background: #0F172A;
    width: 260px;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 300;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}

.dash-logo {
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.dash-logo img { height: 36px; border-radius: 6px; flex-shrink: 0; }
.dash-logo-text {
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.3;
}
.dash-logo-text small {
    display: block;
    color: #F97316;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Bouton fermer sidebar (mobile) */
.dash-sidebar-close {
    display: none;
    margin-left: auto;
    background: rgba(255,255,255,0.07);
    border: none;
    color: rgba(255,255,255,0.5);
    width: 28px; height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}
.dash-sidebar-close:hover { background: rgba(255,255,255,0.12); color: white; }

.dash-menu { flex: 1; padding: 16px 12px; overflow-y: auto; }
.dash-menu-section { margin-bottom: 24px; }
.dash-menu-label {
    color: rgba(255,255,255,0.28);
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    padding: 0 10px;
    margin-bottom: 6px;
    display: block;
}
.dash-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    color: rgba(255,255,255,0.55);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.18s;
    margin-bottom: 1px;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
}
.dash-menu a i {
    width: 18px;
    font-size: 0.95rem;
    flex-shrink: 0;
    text-align: center;
}
.dash-menu a:hover {
    background: rgba(255,255,255,0.07);
    color: white;
}
.dash-menu a.active {
    background: linear-gradient(90deg, rgba(91,33,182,0.9), rgba(91,33,182,0.7));
    color: white;
    box-shadow: 0 2px 8px rgba(91,33,182,0.35);
}
.dash-menu a.active i { color: #C4B5FD; }
.dash-menu .badge-count {
    margin-left: auto;
    background: #F97316;
    color: white;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    font-size: 0.68rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    flex-shrink: 0;
}

.dash-user {
    padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.dash-avatar {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, #5B21B6, #7C3AED);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.dash-user-info { flex: 1; min-width: 0; }
.dash-user-name {
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-user-role { color: rgba(255,255,255,0.38); font-size: 0.72rem; }
.dash-logout {
    color: rgba(255,255,255,0.3);
    transition: color 0.2s;
    padding: 4px;
    flex-shrink: 0;
    text-decoration: none;
}
.dash-logout:hover { color: #EF4444; }

/* ============================================================
   MAIN AREA
============================================================ */
.dash-main {
    margin-left: 260px;
    min-height: 100vh;
    background: #F1F5F9;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ============================================================
   TOPBAR
============================================================ */
.dash-topbar {
    background: white;
    border-bottom: 1px solid #E2E8F0;
    padding: 0 28px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}
.dash-topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.dash-page-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0F172A;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-burger {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #334155;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    flex-shrink: 0;
    line-height: 1;
}
.dash-burger:hover { background: #F1F5F9; }

.dash-topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    min-width: 0;
}
.dash-notif-btn {
    position: relative;
    width: 36px; height: 36px;
    border-radius: 8px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    display: flex; align-items: center; justify-content: center;
    color: #64748B;
    transition: all 0.2s;
    text-decoration: none;
    font-size: 0.9rem;
}
.dash-notif-btn:hover { background: #EDE9FE; border-color: #5B21B6; color: #5B21B6; }
.notif-dot {
    position: absolute;
    top: 5px; right: 5px;
    width: 7px; height: 7px;
    background: #F97316;
    border-radius: 50%;
    border: 1.5px solid white;
}
.dash-user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 5px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    text-decoration: none;
    transition: all 0.2s;
}
.dash-user-pill:hover { background: #EDE9FE; border-color: #5B21B6; color: #5B21B6; }
.dash-user-pill .pill-avatar {
    width: 26px; height: 26px;
    background: linear-gradient(135deg, #5B21B6, #7C3AED);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.75rem;
}
.dash-user-pill .pill-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-amount-pill {
    max-width: min(100%, 180px);
    overflow: hidden;
}
.dash-amount-pill .pill-name {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================
   CONTENT AREA
============================================================ */
.dash-content {
    padding: 28px 32px;
    flex: 1;
    min-width: 0;
}

/* ============================================================
   FLASH MESSAGES
============================================================ */
.flash {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    border-left: 4px solid;
}
.flash-success { background: #F0FDF4; border-color: #10B981; color: #065F46; }
.flash-error   { background: #FEF2F2; border-color: #EF4444; color: #991B1B; }
.flash-warning { background: #FFFBEB; border-color: #F59E0B; color: #92400E; }
.flash-info    { background: #EFF6FF; border-color: #3B82F6; color: #1E40AF; }

/* ============================================================
   STAT CARDS
============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px 22px;
    border: 1px solid #E2E8F0;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    min-width: 0;
}
.stat-card > div:last-child {
    min-width: 0;
    flex: 1;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px;
    height: 100%;
}
.stat-card:has(.stat-icon.violet)::before { background: #5B21B6; }
.stat-card:has(.stat-icon.orange)::before { background: #EA580C; }
.stat-card:has(.stat-icon.green)::before  { background: #10B981; }
.stat-card:has(.stat-icon.blue)::before   { background: #3B82F6; }
.stat-card:has(.stat-icon.red)::before    { background: #EF4444; }
.stat-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}
.stat-icon {
    width: 48px; height: 48px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.stat-icon.violet { background: #EDE9FE; color: #5B21B6; }
.stat-icon.orange { background: #FEF3C7; color: #EA580C; }
.stat-icon.green  { background: #D1FAE5; color: #10B981; }
.stat-icon.blue   { background: #DBEAFE; color: #3B82F6; }
.stat-icon.red    { background: #FEE2E2; color: #EF4444; }
.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0F172A;
    line-height: 1.1;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}
.stat-value.stat-montant {
    font-size: clamp(0.85rem, 1.8vw, 1.15rem);
    white-space: nowrap;
}
.stat-label { font-size: 0.8rem; color: #64748B; font-weight: 500; }
.stat-change {
    font-size: 0.75rem;
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 3px;
    flex-wrap: wrap;
}
.stat-change.up { color: #10B981; }
.stat-change.down { color: #EF4444; }

/* ============================================================
   CHART CARDS
============================================================ */
.chart-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    padding: 22px 24px;
    min-width: 0;
}
.chart-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0F172A;
    margin: 0 0 18px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================================
   DATA TABLES
============================================================ */
.data-table-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    overflow: hidden;
    min-width: 0;
    max-width: 100%;
}
.data-table-header {
    padding: 16px 22px;
    border-bottom: 1px solid #F1F5F9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.data-table-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0F172A;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.data-table thead th {
    background: #F8FAFC;
    padding: 11px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.78rem;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 1px solid #E2E8F0;
    white-space: nowrap;
}
.data-table tbody td {
    padding: 13px 16px;
    border-bottom: 1px solid #F8FAFC;
    color: #334155;
    vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #FAFBFF; }

/* ============================================================
   BADGES
============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.73rem;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.2px;
}
.badge-purple    { background: #EDE9FE; color: #5B21B6; }
.badge-success   { background: #D1FAE5; color: #065F46; }
.badge-danger    { background: #FEE2E2; color: #991B1B; }
.badge-warning   { background: #FEF3C7; color: #92400E; }
.badge-info      { background: #DBEAFE; color: #1E40AF; }
.badge-secondary { background: #F1F5F9; color: #475569; }

/* ============================================================
   BOUTONS
============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}
.btn-primary   { background: #5B21B6; color: white; }
.btn-primary:hover { background: #4C1D95; box-shadow: 0 4px 12px rgba(91,33,182,0.3); }
.btn-secondary { background: #F1F5F9; color: #475569; border: 1px solid #E2E8F0; }
.btn-secondary:hover { background: #E2E8F0; color: #334155; }
.btn-danger    { background: #FEE2E2; color: #991B1B; }
.btn-danger:hover { background: #FECACA; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; border-radius: 6px; }

/* ============================================================
   FORMULAIRES DASHBOARD
============================================================ */
.dash-form-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    padding: 24px 28px;
}
.dash-form-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0F172A;
    margin: 0 0 20px 0;
}
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}
.form-control {
    width: 100%;
    padding: 9px 13px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #111827;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}
.form-control:focus {
    outline: none;
    border-color: #5B21B6;
    box-shadow: 0 0 0 3px rgba(91,33,182,0.12);
}
.form-control::placeholder { color: #9CA3AF; }
textarea.form-control { resize: vertical; min-height: 100px; }

.dash-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.dash-form-full { grid-column: 1 / -1; }

/* ============================================================
   PAGINATION
============================================================ */
.pagination {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748B;
    background: white;
    border: 1px solid #E2E8F0;
    text-decoration: none;
    transition: all 0.18s;
}
.pagination a:hover { border-color: #5B21B6; color: #5B21B6; }
.pagination a.current { background: #5B21B6; border-color: #5B21B6; color: white; }

/* ============================================================
   EMPTY STATE
============================================================ */
.empty-state {
    text-align: center;
    color: #94A3B8;
    padding: 48px 24px;
}
.empty-state i { font-size: 2.5rem; margin-bottom: 12px; display: block; opacity: 0.4; }
.empty-state p { font-size: 0.9rem; margin: 0; }

/* ============================================================
   ALERT BOXES
============================================================ */
.alert {
    padding: 13px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    border: 1px solid;
}
.alert-info    { background: #EFF6FF; color: #1E40AF; border-color: #BFDBFE; }
.alert-success { background: #F0FDF4; color: #065F46; border-color: #A7F3D0; }
.alert-warning { background: #FFFBEB; color: #92400E; border-color: #FDE68A; }
.alert-danger  { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }

/* ============================================================
   OVERLAYS / STATUS
============================================================ */
.status-dot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}
.status-dot::before {
    content: '';
    width: 7px; height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.status-dot.online::before  { background: #10B981; }
.status-dot.offline::before { background: #EF4444; }
.status-dot.warning::before { background: #F59E0B; }

/* ============================================================
   ACTION BUTTONS dans tables
============================================================ */
.btn-action {
    width: 30px; height: 30px;
    border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.8rem;
    transition: all 0.18s;
    border: 1px solid #E2E8F0;
    color: #64748B;
    background: white;
    cursor: pointer;
    text-decoration: none;
}
.btn-action:hover { border-color: #5B21B6; color: #5B21B6; background: #EDE9FE; }
.btn-action.delete:hover { border-color: #EF4444; color: #EF4444; background: #FEE2E2; }
.btn-action.approve:hover { border-color: #10B981; color: #10B981; background: #D1FAE5; }

/* ============================================================
   PRODUCT THUMB (tables)
============================================================ */
.product-thumb {
    width: 44px; height: 44px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #E2E8F0;
}
.product-thumb-placeholder {
    width: 44px; height: 44px;
    border-radius: 8px;
    background: #EDE9FE;
    display: flex; align-items: center; justify-content: center;
    color: #5B21B6;
    font-size: 1rem;
}

/* ============================================================
   COMMISSION STATS (Tech)
============================================================ */
.commission-highlight {
    background: linear-gradient(135deg, #1E1B4B 0%, #312E81 50%, #4C1D95 100%);
    border-radius: 16px;
    padding: 32px;
    color: white;
    text-align: center;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}
.commission-highlight::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 160px; height: 160px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
}
.commission-highlight .amount {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    color: #FCD34D;
    display: block;
    letter-spacing: -1px;
    margin-bottom: 6px;
    overflow-wrap: anywhere;
}
.commission-highlight .label { font-size: 0.9rem; opacity: 0.7; }
.commission-mini-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 20px;
}
.commission-mini {
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.08);
}
.commission-mini .val { font-size: 1.3rem; font-weight: 800; color: white; }
.commission-mini .lbl { font-size: 0.7rem; opacity: 0.6; margin-top: 2px; }

/* ============================================================
   QUICK ACTIONS
============================================================ */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}
.quick-action {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 18px 14px;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: #334155;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.quick-action:hover {
    border-color: #5B21B6;
    background: #FAFBFF;
    color: #5B21B6;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(91,33,182,0.12);
}
.quick-action i { font-size: 1.4rem; color: #5B21B6; }
.quick-action span { font-size: 0.82rem; font-weight: 600; }

/* ============================================================
   CHARTS GRID
============================================================ */
.charts-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 18px;
    margin-bottom: 28px;
}

.dashboard-section { margin-bottom: 24px; }
.dashboard-split-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 20px;
    min-width: 0;
}
.dashboard-side-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}
.dashboard-info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.dashboard-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px;
    background: var(--grey-light);
    border-radius: 8px;
    font-size: 0.85rem;
}
.dashboard-info-row span:last-child {
    text-align: right;
    min-width: 0;
}

/* ============================================================
   TABS
============================================================ */
.dash-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #E2E8F0;
    margin-bottom: 22px;
    overflow-x: auto;
    scrollbar-width: none;
}
.dash-tabs::-webkit-scrollbar { display: none; }
.dash-tab {
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748B;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.18s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 7px;
}
.dash-tab:hover { color: #5B21B6; }
.dash-tab.active { color: #5B21B6; border-bottom-color: #5B21B6; }

/* ============================================================
   OVERLAY (mobile)
============================================================ */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 250;
    display: none;
    backdrop-filter: blur(2px);
}
.overlay.show { display: block; }

/* ============================================================
   RESPONSIVE — TABLETTE (≤1200px)
============================================================ */
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .charts-grid { grid-template-columns: 1fr; }
    .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================================
   RESPONSIVE — TABLETTE (≤1024px) — sidebar off-canvas
============================================================ */
@media (max-width: 1024px) {
    .dash-sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }
    .dash-sidebar.open {
        transform: translateX(0);
        box-shadow: 8px 0 40px rgba(0,0,0,0.25);
    }
    .dash-sidebar-close { display: flex; }
    .dash-main { margin-left: 0; }
    .dash-burger { display: flex; }

    .dash-form-grid { grid-template-columns: 1fr; }
    .dashboard-split-grid { grid-template-columns: 1fr; }
    .commission-mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================================
   RESPONSIVE — MOBILE (≤768px)
============================================================ */
@media (max-width: 768px) {
    .dash-content { padding: 16px; }
    .dash-topbar  {
        padding: 12px 16px;
        min-height: 54px;
        height: auto;
        align-items: flex-start;
        flex-wrap: wrap;
    }
    .dash-topbar-left,
    .dash-topbar-actions { width: 100%; }
    .dash-topbar-actions {
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    /* Colonnes tableau masquées sur mobile */
    .col-img, .col-cat, .col-statut { display: none !important; }
    .col-cat-inline { display: block !important; }
    .col-hide-mobile { display: none !important; }
    .col-show-mobile { display: block !important; }
    .dash-user-pill .pill-name { display: none; }
    .dash-topbar-actions { gap: 4px; }

    /* Stats 2 colonnes */
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
    .stat-card { padding: 14px 16px; gap: 12px; }
    .stat-icon { width: 40px; height: 40px; font-size: 1rem; }
    .stat-value { font-size: 1.3rem; }
    .stat-value.stat-montant { font-size: clamp(0.78rem, 3.5vw, 1rem); }
    .stat-label { font-size: 0.75rem; }

    /* Quick actions 2x2 */
    .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .quick-action { padding: 14px 10px; }

    /* Topbar actions: cacher le nom */
    .dash-user-pill .pill-name { display: none; }
    .dash-user-pill { padding: 4px; border-radius: 50%; width: 34px; height: 34px; justify-content: center; }
    .dash-amount-pill {
        max-width: 140px;
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Tables scroll horizontal */
    .data-table-card { overflow-x: auto; }
    .data-table { min-width: 600px; }

    /* Charts */
    .commission-mini-stats { grid-template-columns: 1fr; }
    .commission-highlight { padding: 22px 18px; }
    .commission-highlight .amount { font-size: 2.2rem; }
    .dashboard-info-row {
        align-items: flex-start;
        flex-direction: column;
    }
    .dashboard-info-row span:last-child { text-align: left; }

    /* Formulaires */
    .dash-form-card { padding: 18px 16px; }
    .dash-form-grid { grid-template-columns: 1fr; gap: 12px; }

    /* Inline rapports grids → stack */
    [style*="grid-template-columns:1fr 340px"],
    [style*="grid-template-columns: 1fr 340px"],
    [style*="grid-template-columns:1fr 300px"],
    [style*="grid-template-columns: 1fr 300px"] {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================================
   RESPONSIVE — PETIT MOBILE (≤480px)
============================================================ */
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .quick-actions { grid-template-columns: 1fr 1fr; }
    .dash-page-title { font-size: 0.9rem; }
    .dash-topbar-actions { justify-content: flex-start; }
    .dash-notif-btn,
    .dash-user-pill { width: 34px; height: 34px; }
    .dash-amount-pill {
        width: auto;
        max-width: 120px;
    }
    .data-table thead th,
    .data-table tbody td { padding: 10px 12px; }
    .badge { font-size: 0.7rem; padding: 2px 8px; }
}
