/* =============================================================================
   SortMail — « Registre postal »
   Encre + papier + cobalt ; rouge cachet réservé aux dangers/alertes.
   Titres : Bricolage Grotesque. Corps : Inter. Données : IBM Plex Mono.
   Les noms de variables sont utilisés par des styles inline dans les vues :
   ne pas renommer (--light, --border, --primary, --danger, --radius, …).
   ============================================================================= */

/* ===== Variables ===== */
:root {
    --primary: #2B4FD8;        /* cobalt : actions */
    --primary-dark: #2340B4;
    --primary-light: #E7ECFB;
    --secondary: #64748b;
    --success: #1F7A4B;
    --danger: #C0392E;         /* rouge cachet */
    --warning: #B26205;
    --info: #2779A7;
    --dark: #14213D;           /* encre */
    --ink-2: #1D2C4F;          /* encre éclaircie (survols sidebar) */
    --light: #F2F4F8;          /* papier */
    --white: #ffffff;
    --border: #E2E6EE;
    --text: #2A3446;
    --text-light: #808A9C;
    --sidebar-width: 260px;
    --header-height: 60px;
    --radius: 7px;
    --shadow: 0 1px 2px rgba(20,33,61,0.06), 0 1px 1px rgba(20,33,61,0.04);
    --shadow-lg: 0 12px 28px -8px rgba(20,33,61,0.18);
    --font-display: 'Bricolage Grotesque', 'Inter', sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
    /* Bande « par avion » : la signature de SortMail */
    --airmail: repeating-linear-gradient(
        -45deg,
        #C0392E 0 10px, #fff 10px 20px, #2B4FD8 20px 30px, #fff 30px 40px
    );
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--light);
    color: var(--text);
    line-height: 1.6;
    font-size: 14px;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }
ul { list-style: none; }

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.01em; }

code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 6px;
    color: var(--dark);
    word-break: break-all;
}
pre code { display: block; padding: 12px 14px; overflow-x: auto; word-break: normal; }

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 3px;
}

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

/* Sidebar — le meuble de tri */
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark);
    color: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s;
    border-top: 4px solid transparent;
    border-image: var(--airmail) 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.sidebar-header {
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.09);
    display: flex;
    align-items: center;
    gap: 14px;
}
/* Logo en timbre : fond papier, S rouge cachet, dentelure pointillée */
.sidebar-header .logo {
    width: 36px;
    height: 36px;
    background: var(--white);
    color: var(--danger);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 19px;
    outline: 1.5px dashed rgba(255,255,255,0.45);
    outline-offset: 3px;
    flex-shrink: 0;
}
.sidebar-header h1 { font-size: 18px; font-weight: 700; letter-spacing: 0.01em; }

.sidebar-nav { padding: 14px 0 28px; }
.sidebar-nav .nav-section {
    padding: 8px 20px 4px;
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    color: #6E7B96;
    margin-top: 10px;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 20px;
    color: #C4CCDC;
    font-size: 13.5px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    border-left: 3px solid transparent;
}
.sidebar-nav a:hover {
    background: var(--ink-2);
    color: var(--white);
}
.sidebar-nav a.active {
    background: var(--ink-2);
    color: var(--white);
    border-left-color: var(--danger);
    font-weight: 600;
}
.sidebar-nav a .icon { width: 20px; text-align: center; font-size: 15px; opacity: 0.9; }
.sidebar-nav a .badge { margin-left: auto; }

/* Badge générique (sidebar, cartes, états) */
.badge {
    display: inline-flex;
    align-items: center;
    background: var(--danger);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.6;
    padding: 1px 8px;
    border-radius: 99px;
    white-space: nowrap;
}

/* Main content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    min-width: 0;
}

/* Header */
.top-header {
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.top-header .search-bar {
    display: flex;
    align-items: center;
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 0 14px;
    width: 400px;
    max-width: 50%;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.top-header .search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    background: var(--white);
}
.top-header .search-bar input {
    border: none;
    background: transparent;
    padding: 8px;
    width: 100%;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    color: var(--text);
}
.top-header .user-menu { display: flex; align-items: center; gap: 14px; }
.top-header .user-menu .avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--dark);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
}

/* Page content */
.page-content { padding: 24px; max-width: 1500px; }
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.page-header h1, .page-header h2 {
    font-size: 23px;
    font-weight: 700;
    color: var(--dark);
}
.page-header p { width: 100%; }

/* ===== Cards — fiches du registre ===== */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card + .card { margin-top: 20px; }
/* Dans une grille ou imbriquées, l'espacement est géré par le conteneur */
.dashboard-grid .card, .contact-grid .card, .card .card { margin-top: 0; }
.card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    /* double filet de registre */
    box-shadow: 0 3px 0 -2px var(--border);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.card-header h2, .card-header h3 { font-size: 15.5px; font-weight: 650; color: var(--dark); }
.card-body { padding: 20px; }
.card .card { box-shadow: none; }

/* ===== Dashboard ===== */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.stat-card .stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.stat-card .stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-card .stat-icon.green { background: #E1F1E8; color: var(--success); }
.stat-card .stat-icon.orange { background: #F7EBDA; color: var(--warning); }
.stat-card .stat-icon.red { background: #F8E5E3; color: var(--danger); }
.stat-card .stat-info h3 {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--dark);
    font-variant-numeric: tabular-nums;
}
.stat-card .stat-info p { font-size: 12.5px; color: var(--text-light); }

.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ===== Messages ===== */
.message-list { list-style: none; }
.message-item {
    display: flex;
    align-items: center;
    padding: 11px 20px;
    border-bottom: 1px solid var(--border);
    transition: background 0.12s;
    gap: 12px;
    cursor: pointer;
}
.message-item:hover { background: var(--light); }
.message-item.unread { background: #EDF1FC; font-weight: 600; }
.message-item.unread:hover { background: #E2E9FA; }
.message-item .msg-star {
    cursor: pointer;
    color: var(--text-light);
    font-size: 16px;
    transition: color 0.15s;
}
.message-item .msg-star.starred { color: #D99E00; }
.message-item .msg-sender {
    width: 180px;
    font-size: 13.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.message-item .msg-subject {
    flex: 1;
    font-size: 13.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.message-item .msg-subject .msg-preview { color: var(--text-light); font-weight: 400; margin-left: 8px; }
.message-item .msg-date {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-light);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.message-item .msg-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s; }
.message-item:hover .msg-actions { opacity: 1; }
.message-item:focus-within .msg-actions { opacity: 1; }

/* Message view */
.message-view { padding: 24px; }
.message-view .msg-header { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.message-view .msg-header h2 { font-size: 21px; margin-bottom: 8px; color: var(--dark); }
.message-view .msg-meta { display: flex; gap: 16px; font-size: 13px; color: var(--text-light); flex-wrap: wrap; }
.message-view .msg-body { font-size: 15px; line-height: 1.8; white-space: pre-wrap; }
.message-view .msg-toolbar { display: flex; gap: 8px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }

/* ===== Formulaires ===== */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}
.form-group small { display: inline-block; margin-top: 4px; line-height: 1.45; }
.form-control {
    width: 100%;
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
    background: var(--white);
    color: var(--text);
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.form-control::placeholder { color: #A6AFC0; }
textarea.form-control { min-height: 200px; resize: vertical; }
select.form-control {
    appearance: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23808A9C' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E") no-repeat right 12px center var(--white);
    padding-right: 36px;
}

/* Checkbox */
.form-check { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.form-check input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--primary); }
.form-check label { font-size: 14px; margin: 0; font-weight: 400; }
input[type="checkbox"] { accent-color: var(--primary); }

/* ===== Boutons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
    font-family: inherit;
    text-decoration: none;
    line-height: 1.45;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: white; box-shadow: inset 0 -1.5px 0 rgba(0,0,0,0.18); }
.btn-primary:hover { background: var(--primary-dark); color: white; }
.btn-secondary { background: var(--white); color: var(--text); border-color: var(--border); box-shadow: var(--shadow); }
.btn-secondary:hover { background: var(--light); color: var(--dark); border-color: #CBD2DE; }
.btn-danger { background: var(--danger); color: white; box-shadow: inset 0 -1.5px 0 rgba(0,0,0,0.18); }
.btn-danger:hover { background: #A93026; color: white; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #196540; color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 6px; }
.btn-icon {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--white);
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.15s;
}
.btn-icon:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }

/* ===== Alertes ===== */
.alert {
    padding: 11px 15px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid;
    border-left-width: 4px;
}
.alert-success { background: #EDF6F1; color: #175A38; border-color: #C4E0D0; border-left-color: var(--success); }
.alert-error { background: #FAEEEC; color: #8C2A22; border-color: #EFCDC9; border-left-color: var(--danger); }

/* ===== Contacts ===== */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}
.contact-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.contact-card:hover { box-shadow: var(--shadow-lg); border-color: #CBD2DE; }
.contact-card .contact-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.contact-card .contact-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--dark);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
}
.contact-card .contact-name { font-weight: 600; font-size: 15px; color: var(--dark); }
.contact-card .contact-email { font-size: 13px; color: var(--text-light); }
.contact-card .contact-details { font-size: 13px; color: var(--secondary); margin-top: 8px; }
.contact-card .contact-details span { display: block; margin-bottom: 4px; }
.contact-card .contact-actions { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.contact-group-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    color: white;
}

/* ===== Calendrier ===== */
.calendar-container { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 3px 0 -2px var(--border);
}
.calendar-header h3 { font-size: 17px; color: var(--dark); }
.calendar-nav { display: flex; gap: 8px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar-day-header {
    padding: 10px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border);
}
.calendar-day {
    min-height: 100px;
    padding: 8px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.12s;
}
.calendar-day:nth-child(7n) { border-right: none; }
.calendar-day:hover { background: var(--light); }
.calendar-day.today { background: var(--primary-light); }
.calendar-day.other-month { opacity: 0.4; }
.calendar-day .day-number { font-size: 13px; font-weight: 600; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.calendar-day .day-number.today-num {
    background: var(--primary);
    color: white;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.calendar-event {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: white;
    cursor: pointer;
}

/* ===== Règles ===== */
.rule-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    gap: 16px;
}
.rule-item .rule-status { font-size: 24px; cursor: pointer; }
.rule-item .rule-info { flex: 1; }
.rule-item .rule-info h4 { font-size: 15px; font-weight: 600; color: var(--dark); }
.rule-item .rule-info p { font-size: 13px; color: var(--text-light); }
.rule-item .rule-actions { display: flex; gap: 8px; }

/* ===== Archivage ===== */
.archive-settings .setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.archive-log-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    gap: 12px;
}

/* ===== Tables (registre) ===== */
.table, .data-table { width: 100%; border-collapse: collapse; }
.table th, .table td,
.data-table th, .data-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
    vertical-align: middle;
}
.table th, .data-table th {
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    background: var(--light);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.table td, .data-table td { font-variant-numeric: tabular-nums; }
.table tbody tr:hover, .data-table tbody tr:hover { background: var(--light); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ===== Modales ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20,33,61,0.55);
    z-index: 200;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--white);
    border-radius: 10px;
    width: 500px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
.modal-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 3px 0 -2px var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h3 { font-size: 17px; font-weight: 650; color: var(--dark); }
.modal-close { cursor: pointer; font-size: 24px; color: var(--text-light); background: none; border: none; line-height: 1; }
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 20px; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* ===== Auth — l'enveloppe ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dark);
    background-image: radial-gradient(ellipse at 50% -20%, #23345C 0%, var(--dark) 60%);
    padding: 24px;
}
.auth-card {
    background: var(--white);
    border-radius: 12px;
    padding: 44px 40px 40px;
    width: 420px;
    max-width: 92vw;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}
/* Liseré « par avion » en tête d'enveloppe */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--airmail);
}
.auth-card .auth-logo { text-align: center; margin-bottom: 30px; }
.auth-card .auth-logo .logo-icon {
    width: 54px;
    height: 54px;
    background: var(--white);
    color: var(--danger);
    border: 1px solid var(--border);
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 27px;
    font-weight: 800;
    margin-bottom: 14px;
    outline: 1.5px dashed #C6CDDB;
    outline-offset: 4px;
}
.auth-card .auth-logo h2 { font-size: 22px; color: var(--dark); font-weight: 700; }
.auth-card .auth-logo p { font-size: 14px; color: var(--text-light); }
.auth-footer { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-light); }

/* ===== État vide ===== */
.empty-state { text-align: center; padding: 56px 20px; color: var(--text-light); }
.empty-state .empty-icon { font-size: 44px; margin-bottom: 14px; opacity: 0.8; }
.empty-state h3 { font-size: 17px; color: var(--text); margin-bottom: 6px; }
.empty-state p { font-size: 14px; }

/* ===== Interrupteur ===== */
.toggle { position: relative; width: 46px; height: 25px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .slider {
    position: absolute;
    inset: 0;
    background: #C7CEDB;
    border-radius: 26px;
    cursor: pointer;
    transition: 0.25s;
}
.toggle .slider:before {
    content: '';
    position: absolute;
    width: 19px;
    height: 19px;
    background: white;
    border-radius: 50%;
    left: 3px;
    top: 3px;
    transition: 0.25s;
    box-shadow: 0 1px 3px rgba(20,33,61,0.3);
}
.toggle input:checked + .slider { background: var(--success); }
.toggle input:checked + .slider:before { transform: translateX(21px); }

/* ===== Responsive ===== */
.sidebar-toggle { display: none; background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text); }

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .main-content { margin-left: 0; }
    .sidebar-toggle { display: block; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .top-header { padding: 0 14px; }
    .top-header .search-bar { max-width: 200px; }
    .page-content { padding: 14px; }
    .message-item .msg-sender { width: 100px; }
    .contact-grid { grid-template-columns: 1fr; }
    .table, .data-table { display: block; overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ===== Utilitaires ===== */
.text-muted { color: var(--text-light); }
.text-sm { font-size: 13px; }
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.hidden { display: none; }
