/* ============================================================
   OZAK PLATFORM - Stylesheet Principal
   Thème : Blanc / Rouge / Noir | Style épuré premium
   Police : Rajdhani (display) + DM Sans (corps)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&display=swap');

/* ============================================================
   CSS VARIABLES - Design Tokens
   ============================================================ */
:root {
    /* Palette principale */
    --c-red:         #E8001D;
    --c-red-dark:    #B5001A;
    --c-red-light:   #FF1A35;
    --c-red-subtle:  rgba(232, 0, 29, 0.08);
    --c-red-glow:    rgba(232, 0, 29, 0.25);

    --c-black:       #0A0A0C;
    --c-black-soft:  #111114;
    --c-grey-900:    #1A1A1F;
    --c-grey-800:    #242429;
    --c-grey-700:    #35353D;
    --c-grey-600:    #4F4F5A;
    --c-grey-400:    #8E8E9E;
    --c-grey-200:    #C8C8D4;
    --c-grey-100:    #EBEBF0;
    --c-grey-50:     #F5F5F8;
    --c-white:       #FFFFFF;

    /* Sémantique */
    --c-bg:          var(--c-grey-50);
    --c-bg-card:     var(--c-white);
    --c-sidebar-bg:  var(--c-black);
    --c-sidebar-txt: rgba(255,255,255,0.7);
    --c-sidebar-active-bg: rgba(232, 0, 29, 0.12);
    --c-text-primary:   var(--c-grey-900);
    --c-text-secondary: var(--c-grey-600);
    --c-text-muted:     var(--c-grey-400);
    --c-border:         var(--c-grey-100);
    --c-border-dark:    var(--c-grey-200);

    --c-success:     #00B37E;
    --c-warning:     #F79009;
    --c-danger:      var(--c-red);
    --c-info:        #0EA5E9;

    /* Typographie */
    --font-display: 'Rajdhani', sans-serif;
    --font-body:    'DM Sans', sans-serif;

    /* Espacements */
    --sidebar-width:   260px;
    --sidebar-width-c: 72px;  /* collapsed */
    --topbar-height:   64px;
    --radius-sm:       6px;
    --radius:          10px;
    --radius-lg:       16px;
    --radius-xl:       24px;

    /* Ombres */
    --shadow-sm:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow:     0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
    --shadow-lg:  0 12px 32px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.06);
    --shadow-red: 0 4px 20px var(--c-red-glow);

    /* Transitions */
    --trans-fast:   all 0.15s ease;
    --trans:        all 0.25s ease;
    --trans-slow:   all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
    font-family: var(--font-body);
    background: var(--c-bg);
    color: var(--c-text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--c-red); text-decoration: none; transition: var(--trans-fast); }
a:hover { color: var(--c-red-light); }

img { max-width: 100%; display: block; }
ul { list-style: none; }
button { cursor: pointer; font-family: var(--font-body); border: none; outline: none; }
input, select, textarea { font-family: var(--font-body); outline: none; }

/* ============================================================
   LAYOUT DASHBOARD
   ============================================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--c-sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.sidebar.collapsed { width: var(--sidebar-width-c); }

.sidebar-logo {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.sidebar-logo img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-logo-text {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--c-white);
    letter-spacing: 2px;
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.sidebar.collapsed .sidebar-logo-text { opacity: 0; pointer-events: none; }

/* Navigation */
.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 99px; }

.nav-section-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.2);
    padding: 12px 20px 6px;
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.2s;
}
.sidebar.collapsed .nav-section-label { opacity: 0; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--c-sidebar-txt);
    border-radius: 0;
    margin: 2px 10px;
    border-radius: var(--radius-sm);
    transition: var(--trans-fast);
    white-space: nowrap;
    position: relative;
}

.nav-item:hover {
    background: rgba(255,255,255,0.06);
    color: var(--c-white);
}

.nav-item.active {
    background: var(--c-sidebar-active-bg);
    color: var(--c-white);
    border-left: 2px solid var(--c-red);
}

.nav-item.active .nav-icon { color: var(--c-red); }

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: var(--trans-fast);
}

.nav-label {
    font-size: 14px;
    font-weight: 500;
    opacity: 1;
    transition: opacity 0.2s;
}
.sidebar.collapsed .nav-label { opacity: 0; pointer-events: none; }

/* Badge */
.nav-badge {
    margin-left: auto;
    background: var(--c-red);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 99px;
    transition: opacity 0.2s;
}
.sidebar.collapsed .nav-badge { opacity: 0; }

/* Sidebar bottom */
.sidebar-bottom {
    padding: 16px 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius);
    transition: var(--trans-fast);
    cursor: pointer;
}
.sidebar-user:hover { background: rgba(255,255,255,0.06); }

.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--c-red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.user-info {
    opacity: 1;
    transition: opacity 0.2s;
    overflow: hidden;
}
.sidebar.collapsed .user-info { opacity: 0; }

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--c-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-plan {
    font-size: 11px;
    color: rgba(255,255,255,0.35);
    white-space: nowrap;
}

/* Toggle button */
.sidebar-toggle {
    position: absolute;
    top: 50%;
    right: -13px;
    transform: translateY(-50%);
    width: 26px; height: 26px;
    background: var(--c-white);
    border: 1.5px solid var(--c-border-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--trans-fast);
    z-index: 101;
    color: var(--c-grey-600);
    font-size: 12px;
}
.sidebar-toggle:hover { background: var(--c-red); color: white; border-color: var(--c-red); }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar.collapsed ~ .main-content { margin-left: var(--sidebar-width-c); }

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
    height: var(--topbar-height);
    background: var(--c-white);
    border-bottom: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    padding: 0 28px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--c-text-primary);
    flex: 1;
}

.topbar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--c-grey-50);
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius);
    padding: 8px 14px;
    width: 240px;
    transition: var(--trans-fast);
}
.topbar-search:focus-within {
    border-color: var(--c-red);
    background: white;
    box-shadow: 0 0 0 3px var(--c-red-subtle);
}
.topbar-search input {
    border: none;
    background: transparent;
    font-size: 13.5px;
    color: var(--c-text-primary);
    width: 100%;
}
.topbar-search input::placeholder { color: var(--c-text-muted); }
.topbar-search-icon { color: var(--c-text-muted); font-size: 15px; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.topbar-btn {
    width: 38px; height: 38px;
    border-radius: var(--radius);
    background: transparent;
    border: 1.5px solid var(--c-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-text-secondary);
    font-size: 16px;
    transition: var(--trans-fast);
    position: relative;
}
.topbar-btn:hover { border-color: var(--c-red); color: var(--c-red); background: var(--c-red-subtle); }

.topbar-notif-dot {
    position: absolute;
    top: 7px; right: 7px;
    width: 7px; height: 7px;
    background: var(--c-red);
    border-radius: 50%;
    border: 1.5px solid white;
}

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-content {
    padding: 28px;
    flex: 1;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px;
}

.page-header-left {}

.page-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--c-text-primary);
    line-height: 1.2;
}

.page-subtitle {
    font-size: 14px;
    color: var(--c-text-muted);
    margin-top: 4px;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--c-bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--c-border);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    transition: var(--trans);
}

.card:hover { box-shadow: var(--shadow); }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--c-text-primary);
}

.card-subtitle { font-size: 13px; color: var(--c-text-muted); margin-top: 2px; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--c-bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--c-border);
    padding: 22px 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: var(--trans);
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: transparent;
    transition: var(--trans);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-card:hover::after { background: var(--c-red); }

.stat-icon {
    width: 46px; height: 46px;
    border-radius: var(--radius);
    background: var(--c-red-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-red);
    font-size: 20px;
    flex-shrink: 0;
}

.stat-icon.green  { background: rgba(0,179,126,0.1); color: var(--c-success); }
.stat-icon.orange { background: rgba(247,144,9,0.1);  color: var(--c-warning); }
.stat-icon.blue   { background: rgba(14,165,233,0.1); color: var(--c-info); }

.stat-body {}
.stat-value {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--c-text-primary);
    line-height: 1;
}
.stat-label { font-size: 13px; color: var(--c-text-muted); margin-top: 4px; }
.stat-trend {
    font-size: 12px;
    font-weight: 600;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 3px;
}
.stat-trend.up   { color: var(--c-success); }
.stat-trend.down { color: var(--c-danger); }

/* ============================================================
   MODULES GRID
   ============================================================ */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.module-card {
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 22px;
    transition: var(--trans);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
}
.module-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: var(--c-red); }

.module-card-icon {
    width: 52px; height: 52px;
    border-radius: var(--radius);
    background: var(--c-grey-50);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: var(--trans-fast);
}
.module-card:hover .module-card-icon { background: var(--c-red-subtle); }

.module-card-title {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    color: var(--c-text-primary);
}
.module-card-desc { font-size: 13px; color: var(--c-text-muted); line-height: 1.5; }
.module-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

/* Module Add Card */
.module-add-card {
    border: 2px dashed var(--c-border-dark);
    border-radius: var(--radius-lg);
    padding: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: var(--trans);
    background: transparent;
    min-height: 180px;
    text-align: center;
}
.module-add-card:hover {
    border-color: var(--c-red);
    background: var(--c-red-subtle);
}
.module-add-card .add-icon {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--c-grey-50);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--c-text-muted);
    transition: var(--trans-fast);
}
.module-add-card:hover .add-icon { background: var(--c-red); color: white; }
.module-add-text { font-size: 13.5px; font-weight: 500; color: var(--c-text-muted); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    transition: var(--trans-fast);
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--c-red);
    color: white;
    box-shadow: var(--shadow-red);
}
.btn-primary:hover {
    background: var(--c-red-dark);
    box-shadow: 0 6px 24px var(--c-red-glow);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: var(--c-grey-50);
    color: var(--c-text-primary);
    border: 1.5px solid var(--c-border-dark);
}
.btn-secondary:hover { background: var(--c-grey-100); border-color: var(--c-grey-400); }

.btn-outline {
    background: transparent;
    color: var(--c-red);
    border: 1.5px solid var(--c-red);
}
.btn-outline:hover { background: var(--c-red-subtle); }

.btn-ghost {
    background: transparent;
    color: var(--c-text-secondary);
    border: none;
    padding: 8px 12px;
}
.btn-ghost:hover { background: var(--c-grey-100); color: var(--c-text-primary); }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 13px 28px; font-size: 15px; border-radius: var(--radius-lg); }
.btn-icon { padding: 9px; gap: 0; }
.btn-icon.btn-sm { padding: 7px; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--c-text-secondary);
    margin-bottom: 7px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--c-white);
    border: 1.5px solid var(--c-border-dark);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--c-text-primary);
    transition: var(--trans-fast);
}
.form-control:focus { border-color: var(--c-red); box-shadow: 0 0 0 3px var(--c-red-subtle); }
.form-control::placeholder { color: var(--c-text-muted); }
.form-control.error { border-color: var(--c-danger); }

.form-hint { font-size: 12px; color: var(--c-text-muted); margin-top: 5px; }
.form-error { font-size: 12px; color: var(--c-danger); margin-top: 5px; font-weight: 500; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--c-border);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead th {
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--c-text-muted);
    background: var(--c-grey-50);
    border-bottom: 1px solid var(--c-border);
    text-align: left;
    white-space: nowrap;
}

.table tbody td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--c-text-primary);
    border-bottom: 1px solid var(--c-border);
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: var(--trans-fast); }
.table tbody tr:hover { background: var(--c-grey-50); }

/* ============================================================
   BADGES & STATUS
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success  { background: rgba(0,179,126,0.12); color: #00875A; }
.badge-warning  { background: rgba(247,144,9,0.12);  color: #B54708; }
.badge-danger   { background: rgba(232,0,29,0.1);    color: var(--c-red-dark); }
.badge-info     { background: rgba(14,165,233,0.12); color: #0369A1; }
.badge-neutral  { background: var(--c-grey-100);     color: var(--c-grey-600); }

.status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
}
.alert-success { background: rgba(0,179,126,0.08); border-left: 3px solid var(--c-success); color: #00875A; }
.alert-danger   { background: var(--c-red-subtle); border-left: 3px solid var(--c-red);     color: var(--c-red-dark); }
.alert-warning  { background: rgba(247,144,9,0.08); border-left: 3px solid var(--c-warning); color: #B54708; }
.alert-info     { background: rgba(14,165,233,0.08); border-left: 3px solid var(--c-info);   color: #0369A1; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10,10,12,0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
    background: var(--c-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 520px;
    padding: 32px;
    transform: scale(0.96) translateY(10px);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.modal-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.modal-close {
    width: 34px; height: 34px;
    border-radius: var(--radius-sm);
    background: var(--c-grey-100);
    color: var(--c-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--trans-fast);
    font-size: 16px;
    border: none;
}
.modal-close:hover { background: var(--c-red); color: white; }

/* ============================================================
   LOADER
   ============================================================ */
.spinner {
    width: 20px; height: 20px;
    border: 2.5px solid var(--c-grey-100);
    border-top-color: var(--c-red);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Page loader */
.page-loader {
    position: fixed;
    inset: 0;
    background: var(--c-white);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.4s ease;
}
.page-loader.hidden { opacity: 0; pointer-events: none; }

/* ============================================================
   UTILITIES
   ============================================================ */
.flex        { display: flex; }
.flex-col    { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4       { gap: 16px; }
.gap-2       { gap: 8px; }
.mt-4        { margin-top: 16px; }
.mb-4        { margin-bottom: 16px; }
.text-sm     { font-size: 13px; }
.text-muted  { color: var(--c-text-muted); }
.text-red    { color: var(--c-red); }
.text-success { color: var(--c-success); }
.font-display { font-family: var(--font-display); }
.font-bold   { font-weight: 700; }
.w-full      { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-3     { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.mobile-open { transform: translateX(0); }
    .main-content { margin-left: 0 !important; }
    .page-content { padding: 16px; }
    .topbar { padding: 0 16px; }
    .stats-grid { grid-template-columns: 1fr; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .topbar-search { display: none; }
    .modules-grid { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; }
}

/* ============================================================
   ANIMATIONS D'ENTRÉE
   ============================================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

.animate-in { animation: fadeInUp 0.4s ease forwards; }
.anim-delay-1 { animation-delay: 0.05s; opacity: 0; }
.anim-delay-2 { animation-delay: 0.1s;  opacity: 0; }
.anim-delay-3 { animation-delay: 0.15s; opacity: 0; }
.anim-delay-4 { animation-delay: 0.2s;  opacity: 0; }
