/* Reset et variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #546e7a;
    --success-color: #4caf50;
    --danger-color: #e57373;
    --warning-color: #ffb74d;
    --dark-bg: #263238;
    --light-bg: #f5f7fa;
    --card-bg: #ffffff;
    --text-dark: #1a2332;
    --text-light: #ffffff;
    --border-color: #e0e4e8;
    --hover-bg: #eceff1;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--light-bg);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-dark);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 8px;
    padding: 30px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

header h1 {
    color: var(--text-dark);
    font-size: 2rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.subtitle {
    color: #7a8a99;
    font-size: 1rem;
    font-weight: 400;
}

/* Tabs */
.tabs-container {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.tabs-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
}

.tab {
    padding: 10px 18px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.tab:hover {
    background: var(--hover-bg);
    border-color: var(--secondary-color);
}

.tab.active {
    background: var(--primary-color);
    color: var(--text-light);
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.tab-badge {
    background: var(--light-bg);
    color: var(--text-dark);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
}

.tab.active .tab-badge {
    background: rgba(255, 255, 255, 0.25);
    color: var(--text-light);
}

/* Controls */
.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

/* Boutons */
.btn {
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow);
}

.btn:hover {
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary-color);
    color: var(--text-light);
}

.btn-primary:hover {
    background: #1a252f;
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--text-light);
}

.btn-secondary:hover {
    background: #455a64;
}

.btn-info {
    background: #2196f3;
    color: var(--text-light);
    font-size: 0.9rem;
}

.btn-info:hover {
    background: #1976d2;
}

.btn-success {
    background: var(--success-color);
    color: var(--text-light);
}

.btn-success:hover {
    background: #43a047;
}

.btn-danger {
    background: var(--danger-color);
    color: var(--text-light);
}

.btn-danger:hover {
    background: #ef5350;
}

.btn-warning {
    background: var(--warning-color);
    color: var(--text-dark);
}

.btn-warning:hover {
    background: #ffa726;
}

.btn-small {
    padding: 6px 14px;
    font-size: 0.875rem;
}

.btn-icon {
    font-size: 1.1rem;
}

/* Table */
.table-wrapper {
    overflow-x: auto;
    margin-bottom: 20px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
}

thead {
    background: var(--primary-color);
    color: var(--text-light);
}

thead th {
    padding: 14px 15px;
    text-align: left;
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    min-width: 150px;
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background-color: var(--hover-bg);
}

tbody tr:last-child {
    border-bottom: none;
}

tbody td {
    padding: 15px;
    min-width: 150px;
    vertical-align: top;
}

/* Inputs dans le tableau */
.input-field {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    line-height: 1.5;
    transition: all 0.2s ease;
    font-family: inherit;
    background: white;
    color: var(--text-dark);
    min-height: 48px;
    box-sizing: border-box;
}

/* Auto-resize pour les textareas */
.auto-resize-textarea {
    resize: none;
    overflow-y: hidden;
    min-height: 80px;
    transition: height 0.1s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.15);
    background: #fafbfc;
}

textarea.input-field {
    min-height: 80px;
    resize: none;
    font-family: inherit;
    line-height: 1.6;
    padding: 12px 14px;
}

/* Signature preview */
.signature-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.signature-img {
    max-width: 150px;
    max-height: 80px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: white;
    display: block;
}

.signature-empty {
    color: #7a8a99;
    font-style: italic;
    font-size: 0.9rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    animation: fadeIn 0.2s ease;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--card-bg);
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow: auto;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    animation: slideUp 0.2s ease;
}

.modal-content.modal-large {
    max-width: 900px;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    background: var(--light-bg);
}

.modal-header h2 {
    color: var(--text-dark);
    font-size: 1.3rem;
    font-weight: 600;
}

.close {
    font-size: 2rem;
    font-weight: bold;
    color: #adb5bd;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.close:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 25px;
    display: flex;
    justify-content: center;
}

#signatureCanvas {
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: crosshair;
    background: white;
    touch-action: none;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.modal-footer {
    display: flex;
    gap: 10px;
    padding: 20px 25px;
    border-top: 1px solid var(--border-color);
    justify-content: flex-end;
    flex-wrap: wrap;
    background: var(--light-bg);
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
    width: 100%;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 1rem;
    word-wrap: break-word;
}

/* Columns List */
.columns-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    background: var(--light-bg);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.column-item {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.column-item input {
    flex: 1;
}

.column-item select {
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    background: white;
}

.column-item select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(44, 62, 80, 0.1);
}

.btn-remove {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 9px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn-remove:hover {
    background: #ef5350;
}

/* Info box */
.info-box {
    background: #e8f4f8;
    padding: 15px 20px;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
    border: 1px solid #d0e8f0;
    border-left: 3px solid var(--primary-color);
}

.info-box p {
    color: var(--text-dark);
    margin: 0;
    font-size: 0.95rem;
}

/* Actions column */
.actions-cell {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px;
        border-radius: 15px;
    }

    header {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }

    header h1 {
        font-size: 1.5rem;
        margin-bottom: 5px;
    }

    .subtitle {
        font-size: 0.9rem;
    }
    
    .app-header {
        gap: 10px;
    }
    
    .user-info {
        gap: 8px;
    }
    
    .user-badge {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    #adminPageBtn, #logoutBtn {
        padding: 6px 12px !important;
        font-size: 0.8rem !important;
    }

    .controls {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 10px;
    }

    /* Boutons des contrôles principaux plus compacts */
    .controls .btn {
        flex: 1 1 calc(50% - 5px);
        min-width: calc(50% - 5px);
        padding: 10px 10px;
        font-size: 0.8rem;
        justify-content: center;
        white-space: nowrap;
    }
    
    .controls .btn .btn-icon {
        font-size: 0.95rem;
    }

    /* IMPORTANT: Les boutons dans les cellules restent compacts */
    .actions-cell {
        flex-direction: row;
        justify-content: flex-start;
        gap: 6px;
    }

    .actions-cell .btn {
        width: auto;
        padding: 8px 12px;
        font-size: 0.85rem;
        flex: 0 1 auto;
    }

    .actions-cell .btn-small {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    /* Table responsive */
    .table-wrapper {
        border-radius: 8px;
    }

    table {
        font-size: 0.9rem;
    }

    thead th {
        padding: 12px 8px;
        font-size: 0.8rem;
        min-width: 120px;
    }

    tbody td {
        padding: 12px 8px;
        min-width: 120px;
    }

    /* Inputs dans le tableau - MEILLEURE VISIBILITÉ */
    .input-field {
        padding: 12px;
        font-size: 1rem;
        min-height: 48px;
        border: 2px solid var(--border-color);
        line-height: 1.5;
    }

    .input-field:focus {
        border: 2px solid var(--primary-color);
        box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.15);
    }

    textarea.input-field {
        min-height: 80px;
        line-height: 1.6;
    }

    .signature-img {
        max-width: 100px;
        max-height: 60px;
    }

    .modal-content {
        width: 95%;
        margin: 10px;
        max-height: 85vh;
    }

    .modal-body {
        padding: 20px;
        overflow-y: auto;
        max-height: 60vh;
    }

    .modal-header h2 {
        font-size: 1.1rem;
    }

    #signatureCanvas {
        max-width: 100%;
    }

    .modal-footer {
        flex-direction: row;
        padding: 15px 20px;
        gap: 10px;
        flex-wrap: wrap;
    }

    .modal-footer .btn {
        flex: 1 1 auto;
        min-width: 120px;
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    /* Boutons dans les modals beaucoup plus compacts */
    .modal-body .btn {
        width: auto;
        padding: 10px 20px;
        font-size: 0.9rem;
        display: inline-flex;
        margin-right: 10px;
        margin-bottom: 10px;
    }
    
    .modal-body .btn-small {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    /* Modal de gestion du tableau - encore plus compact sur mobile */
    #manageTableModal .modal-body .btn {
        padding: 6px 12px;
        font-size: 0.8rem;
        width: auto;
        min-width: auto;
        margin-right: 8px;
    }
    
    /* Séparateur HR plus compact */
    .modal-body hr {
        margin: 15px 0 !important;
    }
    
    /* Labels plus lisibles sur mobile */
    .form-group label {
        font-size: 0.95rem;
        line-height: 1.4;
    }
    
    /* Modal de création de tableau - optimisé pour mobile */
    #newTableModal .modal-content {
        max-width: 95%;
    }
    
    #newTableModal .modal-header h2 {
        font-size: 1rem;
    }
    
    #newTableModal .modal-body {
        padding: 15px;
    }
    
    #newTableModal .form-group {
        margin-bottom: 15px;
    }
    
    #newTableModal .form-group label {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    /* Liste des colonnes mieux organisée */
    .columns-list {
        max-height: 250px;
        padding: 8px;
        gap: 8px;
    }
    
    .column-item {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 10px;
    }
    
    .column-item input,
    .column-item select {
        width: 100%;
        font-size: 0.9rem;
    }
    
    .column-item .btn-remove {
        width: 100%;
        padding: 8px;
        font-size: 0.85rem;
    }
    
    /* Bouton "Ajouter une colonne" plus visible sur mobile */
    #newTableModal #addColumnBtn {
        width: 100%;
        padding: 10px;
        font-size: 0.9rem;
        justify-content: center;
    }
    
    /* Footer du modal de création de tableau */
    #newTableModal .modal-footer .btn {
        flex: 1 1 calc(50% - 5px);
        min-width: auto;
        padding: 10px;
        font-size: 0.9rem;
        justify-content: center;
    }

    /* Boutons dans tabs */
    .tabs-container {
        gap: 8px;
        margin-bottom: 15px;
    }
    
    .tabs-list {
        width: 100%;
        gap: 6px;
    }

    .tab {
        flex: 1 1 auto;
        min-width: 100px;
        max-width: 50%;
        justify-content: center;
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .tab-badge {
        padding: 2px 6px;
        font-size: 0.75rem;
    }
    
    /* Bouton nouveau tableau */
    .tabs-container > .btn {
        padding: 8px 14px;
        font-size: 0.85rem;
        width: 100%;
        margin-top: 8px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 8px;
    }

    .container {
        padding: 12px;
    }

    header {
        margin-bottom: 15px;
        padding-bottom: 12px;
    }

    header h1 {
        font-size: 1.3rem;
    }
    
    .subtitle {
        font-size: 0.85rem;
    }

    /* Contrôles sur 2 lignes pour très petits écrans */
    .controls {
        flex-wrap: wrap;
        gap: 6px;
        margin-bottom: 15px;
    }
    
    .controls .btn {
        flex: 1 1 calc(50% - 3px);
        min-width: calc(50% - 3px);
        padding: 9px 4px;
        font-size: 0.7rem;
        gap: 3px;
    }
    
    .controls .btn .btn-icon {
        font-size: 0.85rem;
    }
    
    /* Tabs encore plus compacts */
    .tabs-container {
        gap: 6px;
        margin-bottom: 12px;
    }
    
    .tab {
        padding: 7px 10px;
        font-size: 0.8rem;
        min-width: 90px;
    }
    
    /* Le bouton "Nouveau tableau" en pleine largeur */
    .tabs-container > .btn,
    .tabs-container .btn {
        width: 100%;
        margin-top: 8px;
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    table {
        font-size: 0.85rem;
    }

    thead th {
        padding: 10px 6px;
        font-size: 0.75rem;
        min-width: 100px;
    }

    tbody td {
        padding: 10px 6px;
        min-width: 100px;
    }

    /* Inputs encore plus visibles sur très petits écrans */
    .input-field {
        padding: 12px;
        font-size: 1rem;
        min-height: 50px;
        border: 2px solid var(--border-color);
        line-height: 1.5;
    }
    
    textarea.input-field {
        min-height: 120px;
        line-height: 1.6;
    }

    /* Boutons d'actions compacts mais cliquables */
    .actions-cell .btn {
        padding: 8px 10px;
        font-size: 0.8rem;
        min-width: 60px;
    }

    .btn-small {
        padding: 7px 10px;
        font-size: 0.8rem;
    }
    
    /* Modals encore plus compacts sur très petits écrans */
    .modal-content {
        width: 98%;
        margin: 5px;
    }
    
    .modal-header {
        padding: 12px 15px;
    }
    
    .modal-header h2 {
        font-size: 0.95rem;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-body .btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
    
    /* Modal de gestion du tableau - très compact sur très petits écrans */
    #manageTableModal .modal-body .btn {
        padding: 6px 10px;
        font-size: 0.75rem;
        width: auto;
        min-width: auto;
        margin-right: 6px;
    }
    
    /* Modal de création de tableau - très petits écrans */
    #newTableModal .modal-content {
        width: 98%;
        max-height: 90vh;
    }
    
    #newTableModal .modal-header {
        padding: 10px 12px;
    }
    
    #newTableModal .modal-header h2 {
        font-size: 0.9rem;
    }
    
    #newTableModal .modal-body {
        padding: 12px;
        max-height: 65vh;
    }
    
    #newTableModal .form-group {
        margin-bottom: 12px;
    }
    
    #newTableModal .form-group label {
        font-size: 0.85rem;
        margin-bottom: 5px;
    }
    
    .columns-list {
        max-height: 200px;
        padding: 6px;
        gap: 6px;
    }
    
    .column-item {
        padding: 8px;
        gap: 6px;
    }
    
    .column-item input,
    .column-item select {
        font-size: 0.85rem;
        padding: 10px;
    }
    
    .column-item .btn-remove {
        padding: 8px;
        font-size: 0.8rem;
    }
    
    #newTableModal #addColumnBtn {
        width: 100%;
        padding: 10px;
        font-size: 0.85rem;
    }
    
    #newTableModal .modal-footer {
        padding: 10px 12px;
        gap: 6px;
    }
    
    #newTableModal .modal-footer .btn {
        flex: 1 1 calc(50% - 3px);
        padding: 10px 8px;
        font-size: 0.85rem;
    }
    
    .modal-footer {
        padding: 12px 15px;
        gap: 8px;
    }
    
    .modal-footer .btn {
        padding: 8px 12px;
        font-size: 0.85rem;
        min-width: 100px;
    }
}

/* Modal de gestion du tableau - layout spécifique */
#manageTableModal .modal-body {
    padding: 25px;
    display: block;
}

/* Boutons dans le modal de gestion du tableau */
#manageTableModal .modal-body .btn {
    padding: 5px 10px;
    font-size: 0.8rem;
    display: inline-flex;
    width: auto;
    min-width: auto;
}

#manageTableModal .modal-body .btn-small {
    padding: 5px 10px;
    font-size: 0.8rem;
}

/* Scrollbar personnalisée */
.table-wrapper::-webkit-scrollbar {
    height: 6px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: var(--light-bg);
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

.columns-list::-webkit-scrollbar {
    width: 6px;
}

.columns-list::-webkit-scrollbar-track {
    background: var(--light-bg);
}

.columns-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.columns-list::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* ============================================
   PAGE D'ADMINISTRATION
   ============================================ */

.admin-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.admin-section h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--text-dark);
    font-size: 1.5rem;
}

/* Cartes utilisateurs */
.users-list {
    display: grid;
    gap: 15px;
}

.user-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--primary-color);
}

.user-card-info h4 {
    margin: 0 0 10px 0;
    color: var(--text-dark);
}

.user-card-info p {
    margin: 5px 0;
    font-size: 0.9rem;
    color: var(--text-dark);
}

/* Cartes d'affectation de tableaux */
.tables-assignments-list {
    display: grid;
    gap: 20px;
}

.table-assignment-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid #2196f3;
}

.table-assignment-card h3 {
    margin: 0 0 10px 0;
    color: var(--text-dark);
    font-size: 1.2rem;
}

.users-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid #e0e0e0;
}

.checkbox-label:hover {
    border-color: var(--primary-color);
    background: #f0f7ff;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label span {
    font-size: 0.95rem;
    color: var(--text-dark);
}

/* Statistiques */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    font-size: 2.5rem;
    margin: 0 0 10px 0;
    color: var(--primary-color);
}

.stat-card p {
    margin: 0;
    color: var(--text-dark);
    font-weight: 500;
}

/* Formulaire d'ajout */
.add-user-form {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin: 20px 0;
}

.add-user-form h3 {
    margin-top: 0;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-dark);
}

/* Responsive admin */
@media (max-width: 768px) {
    .admin-section {
        padding: 20px;
    }
    
    .user-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .users-checkboxes {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

