/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px 30px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.header h1 {
    color: #4a5568;
    font-size: 1.8rem;
    font-weight: 600;
}

.header h1 i {
    color: #667eea;
    margin-right: 10px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #48bb78;
    font-weight: 500;
}

.status-indicator i {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Navigation */
.nav-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #718096;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.tab-btn.active {
    background: #667eea;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Contenu des onglets */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.dashboard-grid .card:last-child {
    grid-column: 1 / -1;
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
}

.card-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

.card-header i {
    margin-right: 10px;
}

.card-body {
    padding: 20px;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    color: #718096;
    font-size: 0.9rem;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.section-header h2 {
    color: #4a5568;
    font-size: 1.5rem;
}

.section-header h2 i {
    color: #667eea;
    margin-right: 10px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.btn-danger {
    background: #f56565;
    color: white;
}

.btn-danger:hover {
    background: #e53e3e;
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
}

.btn-test {
    background: #ed8936;
    color: white;
}

.btn-test:hover {
    background: #dd6b20;
}

/* Lists */
.appointments-list, .memos-list {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.appointment-item, .memo-item {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
}

.appointment-item:hover, .memo-item:hover {
    background: rgba(102, 126, 234, 0.05);
}

.appointment-item:last-child, .memo-item:last-child {
    border-bottom: none;
}

.item-info {
    flex: 1;
}

.item-title {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 5px;
}

.item-datetime {
    color: #667eea;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.item-description {
    color: #718096;
    font-size: 0.9rem;
}

.item-actions {
    display: flex;
    gap: 10px;
}

.item-actions .btn {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Priority badges */
.priority-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.priority-low {
    background: #c6f6d5;
    color: #22543d;
}

.priority-normal {
    background: #bee3f8;
    color: #2a4365;
}

.priority-high {
    background: #fed7d7;
    color: #742a2a;
}

.completed {
    opacity: 0.6;
    text-decoration: line-through;
}

/* Filters */
.memo-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.filter-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    opacity: 0.7;
}

/* Forms */
form {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #4a5568;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
}

.toast {
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #48bb78;
    animation: toastSlideIn 0.3s ease;
    max-width: 300px;
}

.toast.error {
    border-left-color: #f56565;
}

.toast.warning {
    border-left-color: #ed8936;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #718096;
}

.upcoming-list {
    max-height: 300px;
    overflow-y: auto;
}

.upcoming-item {
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.upcoming-item:last-child {
    border-bottom: none;
}

.upcoming-info {
    flex: 1;
}

.upcoming-title {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 5px;
}

.upcoming-time {
    color: #667eea;
    font-size: 0.9rem;
}

.upcoming-badge {
    padding: 4px 8px;
    background: #667eea;
    color: white;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .section-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .nav-tabs {
        flex-direction: column;
    }
    
    .memo-filters {
        flex-wrap: wrap;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .appointment-item,
    .memo-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .item-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Calendrier */
.calendar-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-header h3 {
    margin: 0;
    color: #4a5568;
    font-size: 1.5rem;
    font-weight: 600;
}

.calendar-header .btn {
    padding: 8px 12px;
    border-radius: 8px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.calendar-day-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.calendar-day {
    background: white;
    min-height: 80px;
    padding: 8px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.calendar-day:hover {
    background: rgba(102, 126, 234, 0.05);
    transform: scale(1.02);
}

.calendar-day.other-month {
    background: #f8f9fa;
    color: #adb5bd;
}

.calendar-day.today {
    background: #e3f2fd;
    border: 2px solid #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.calendar-day.has-appointments {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
}

.calendar-day.today.has-appointments {
    background: linear-gradient(135deg, #e3f2fd, #fff3cd);
    border: 2px solid #667eea;
    border-left: 4px solid #ffc107;
}

.calendar-day-number {
    font-weight: 600;
    margin-bottom: 4px;
    color: #2d3748;
}

.calendar-appointments {
    font-size: 0.75rem;
}

.calendar-appointment {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    margin: 2px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.7rem;
}

.calendar-appointment:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
    transform: scale(1.05);
}

.appointments-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.appointments-section h3 {
    margin: 0 0 20px 0;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 600;
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a67d8;
}

/* Responsive pour le calendrier */
@media (max-width: 768px) {
    .calendar-container {
        padding: 10px;
        margin-bottom: 20px;
    }
    
    .calendar-header {
        margin-bottom: 15px;
    }
    
    .calendar-header h3 {
        font-size: 1.1rem;
    }
    
    .calendar-header .btn {
        padding: 6px 10px;
        font-size: 0.9rem;
    }
    
    .calendar-grid {
        gap: 0;
        border-radius: 8px;
    }
    
    .calendar-day-header {
        padding: 6px 2px;
        font-size: 0.7rem;
        font-weight: 600;
    }
    
    .calendar-day {
        min-height: 50px;
        padding: 3px 2px;
        font-size: 0.85rem;
    }
    
    .calendar-day-number {
        font-size: 0.85rem;
        margin-bottom: 2px;
    }
    
    .calendar-appointment {
        font-size: 0.55rem;
        padding: 1px 2px;
        margin: 1px 0;
        border-radius: 2px;
    }
    
    .calendar-appointments {
        font-size: 0.65rem;
    }
    
    /* Réduire l'échelle au hover sur mobile pour éviter les débordements */
    .calendar-day:hover {
        transform: scale(1);
    }
    
    .calendar-appointment:hover {
        transform: scale(1);
    }
}

/* Responsive pour très petits écrans */
@media (max-width: 480px) {
    .calendar-container {
        padding: 8px;
    }
    
    .calendar-header h3 {
        font-size: 1rem;
    }
    
    .calendar-header .btn {
        padding: 5px 8px;
    }
    
    .calendar-day-header {
        padding: 5px 1px;
        font-size: 0.65rem;
    }
    
    .calendar-day {
        min-height: 45px;
        padding: 2px 1px;
    }
    
    .calendar-day-number {
        font-size: 0.8rem;
    }
    
    .calendar-appointment {
        font-size: 0.5rem;
        padding: 1px;
    }
}

/* Configuration Page */
.config-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.config-card {
    grid-column: span 1;
}

.config-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

.info-box {
    grid-column: 1 / -1;
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 15px 20px;
    border-radius: 8px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.info-box i {
    color: #2196f3;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.info-box div {
    color: #1565c0;
    line-height: 1.6;
}

.info-box strong {
    color: #0d47a1;
}

/* Switch Toggle */
.switch-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.switch-input {
    position: relative;
    width: 50px;
    height: 26px;
    appearance: none;
    background: #cbd5e0;
    border-radius: 50px;
    outline: none;
    cursor: pointer;
    transition: background 0.3s ease;
}

.switch-input:checked {
    background: #48bb78;
}

.switch-input::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.switch-input:checked::before {
    transform: translateX(24px);
}

.switch-text {
    font-weight: 500;
    color: #4a5568;
}

.form-help {
    display: block;
    margin-top: 5px;
    color: #718096;
    font-size: 0.85rem;
    font-style: italic;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1.05rem;
    font-weight: 600;
}

/* Responsive pour la configuration */
@media (max-width: 768px) {
    .config-container {
        grid-template-columns: 1fr;
    }
    
    .config-card {
        grid-column: span 1;
    }
    
    .config-actions {
        flex-direction: column;
    }
    
    .config-actions .btn-lg {
        width: 100%;
    }
    
    .info-box {
        flex-direction: column;
    }
}

/* ==================== STYLES NOTES ==================== */

/* Barre d'outils des notes */
.notes-toolbar {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 12px;
    color: #718096;
}

.search-box input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.notes-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-select {
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.filter-select:hover {
    border-color: #667eea;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Grille de notes */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Carte de note */
.note-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.note-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.note-card.pinned {
    border-color: #ffc107;
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
}

.note-card.pinned::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 40px 40px 0;
    border-color: transparent #ffc107 transparent transparent;
}

.note-card.pinned::after {
    content: '\f08d';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 5px;
    right: 5px;
    color: white;
    font-size: 0.7rem;
}

.note-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 10px;
}

.note-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
    flex: 1;
    word-break: break-word;
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    color: #718096;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.btn-icon.active {
    color: #ffc107;
}

.note-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    align-items: center;
}

.note-category {
    padding: 4px 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.note-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.note-tag {
    padding: 3px 8px;
    background: #e2e8f0;
    color: #4a5568;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 500;
}

.note-card-content {
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.note-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.note-card-actions {
    display: flex;
    gap: 8px;
}

.text-muted {
    color: #718096;
    font-size: 0.8rem;
}

/* Modal large pour les notes */
.modal-large {
    max-width: 700px;
}

/* Optimisation tablette (entre 481px et 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .modal-large {
        max-width: 90%;
        margin: 3% auto;
    }
    
    .modal-large #noteContent {
        min-height: 180px;
        max-height: 300px;
    }
}

/* Optimisation paysage mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-large {
        max-height: 95vh;
        margin: 2.5vh auto;
    }
    
    .modal-large #noteContent {
        min-height: 100px;
        max-height: 150px;
    }
    
    .modal-large .form-group {
        margin-bottom: 10px;
    }
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
}

.checkbox-label span {
    font-weight: 500;
    color: #4a5568;
}

.note-dates {
    padding: 12px;
    background: #f7fafc;
    border-radius: 8px;
    margin-bottom: 15px;
}

/* Filtres des rendez-vous */
.appointment-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.archived-badge {
    padding: 4px 8px;
    background: #e2e8f0;
    color: #4a5568;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 8px;
}

.appointment-item.archived {
    opacity: 0.7;
    background: #f7fafc;
}

/* Statistiques avec 4 colonnes */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Responsive pour les notes */
@media (max-width: 768px) {
    .notes-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        min-width: 100%;
    }
    
    .notes-filters {
        justify-content: center;
    }
    
    .notes-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-large {
        max-width: 95%;
        margin: 2% auto;
        max-height: 96vh;
        overflow-y: auto;
    }
    
    .modal-large .modal-header {
        padding: 15px;
        position: sticky;
        top: 0;
        z-index: 10;
    }
    
    .modal-large .modal-header h3 {
        font-size: 1.1rem;
    }
    
    .modal-large form {
        padding: 15px;
    }
    
    .modal-large .form-group {
        margin-bottom: 15px;
    }
    
    .modal-large .form-group label {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .modal-large .form-group input,
    .modal-large .form-group textarea {
        padding: 10px;
        font-size: 0.95rem;
    }
    
    .modal-large #noteContent {
        min-height: 150px;
        max-height: 250px;
        resize: vertical;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .modal-large .form-actions {
        padding-top: 15px;
        margin-top: 15px;
        position: sticky;
        bottom: 0;
        background: white;
        z-index: 10;
    }
    
    .modal-large .form-actions .btn {
        padding: 12px 20px;
        font-size: 0.95rem;
    }
    
    .note-card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .note-card-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .appointment-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .appointment-filters .filter-btn,
    .appointment-filters .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .note-card {
        padding: 15px;
    }
    
    .note-card-title {
        font-size: 1rem;
    }
    
    .note-card-content {
        font-size: 0.85rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    /* Optimisations supplémentaires pour très petits écrans */
    .modal-large {
        max-width: 98%;
        margin: 1% auto;
        max-height: 98vh;
    }
    
    .modal-large .modal-header {
        padding: 12px;
    }
    
    .modal-large .modal-header h3 {
        font-size: 1rem;
    }
    
    .modal-large form {
        padding: 12px;
    }
    
    .modal-large .form-group {
        margin-bottom: 12px;
    }
    
    .modal-large .form-group label {
        font-size: 0.85rem;
        margin-bottom: 5px;
    }
    
    .modal-large .form-group input,
    .modal-large .form-group textarea {
        padding: 8px;
        font-size: 0.9rem;
    }
    
    .modal-large #noteContent {
        min-height: 120px;
        max-height: 200px;
    }
    
    .modal-large .form-actions {
        padding-top: 12px;
        margin-top: 12px;
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-large .form-actions .btn {
        width: 100%;
        padding: 10px 16px;
        font-size: 0.9rem;
        justify-content: center;
    }
    
    .checkbox-label {
        font-size: 0.9rem;
    }
    
    .checkbox-label input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }
    
    .note-dates {
        padding: 10px;
        font-size: 0.8rem;
    }
}

/* Animation pour les cartes de notes */
@keyframes noteCardIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.note-card {
    animation: noteCardIn 0.3s ease;
}

/* Amélioration du bouton épingler */
.btn-icon i {
    transition: transform 0.3s ease;
}

.btn-icon:hover i {
    transform: rotate(15deg);
}

.btn-icon.active i {
    transform: rotate(45deg);
}

/* ==================== STYLES VISUALISATION MÉMO ==================== */

/* Bouton Voir */
.btn-info {
    background: #4299e1;
    color: white;
}

.btn-info:hover {
    background: #3182ce;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

/* Modal de visualisation du mémo */
.memo-view-container {
    padding: 0;
}

.memo-view-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.memo-view-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
    flex: 1;
    word-break: break-word;
    line-height: 1.3;
}

.memo-view-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f7fafc;
    border-radius: 10px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #4a5568;
    font-size: 0.95rem;
}

.info-item i {
    color: #667eea;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.memo-view-content {
    margin-bottom: 20px;
}

.memo-view-content h4 {
    color: #4a5568;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.memo-view-content h4 i {
    color: #667eea;
}

.content-display {
    background: #f7fafc;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    color: #2d3748;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.95rem;
}

.memo-view-meta {
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.memo-view-meta .text-muted {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #718096;
    font-size: 0.85rem;
}

.memo-view-meta i {
    color: #667eea;
}

.modal-body {
    padding: 25px;
}

/* Responsive pour la modal de visualisation */
@media (max-width: 768px) {
    .memo-view-title {
        font-size: 1.2rem;
    }
    
    .memo-view-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .memo-view-info {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .info-item {
        font-size: 0.9rem;
    }
    
    .content-display {
        font-size: 0.9rem;
        padding: 12px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .memo-view-title {
        font-size: 1.1rem;
    }
    
    .memo-view-content h4 {
        font-size: 1rem;
    }
    
    .info-item {
        font-size: 0.85rem;
    }
    
    .content-display {
        font-size: 0.85rem;
        padding: 10px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .item-actions {
        flex-wrap: wrap;
    }
    
    .item-actions .btn {
        flex: 1 1 calc(50% - 5px);
        min-width: 0;
        padding: 8px 10px;
        font-size: 0.75rem;
    }
    
    .item-actions .btn i {
        margin-right: 4px;
    }
}

/* Animation pour la modal de visualisation */
@keyframes memoViewFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

#memoViewModal .modal-content {
    animation: memoViewFadeIn 0.3s ease;
}
