
.email-item {
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.email-item {
    display: flex;
    flex-direction: column;
    align-items: stretch !important;
}

.email-item:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.email-item.classified {
    border-left: 4px solid #10b981;
    background: #f0fdf4;
}

.email-item.blacklisted {
    border: 2px solid #dc2626;
    background: #fef2f2;
}

.email-item.blacklisted:hover {
    background: #fee2e2;
    border-color: #b91c1c;
}

.blacklist-indicator {
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    background-color: #dc2626;
    color: white;
}

.email-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.email-sender-time {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.email-sender {
    font-weight: 600;
    color: #1e293b;
}

.email-time {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.email-status-indicators {
    display: flex;
    gap: 8px;
    align-items: center;
}

.response-indicator {
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.response-indicator.responded {
    background-color: #e8f5e8;
    color: #2d5a2d;
}

.response-indicator.not-responded {
    background-color: #fff3cd;
    color: #856404;
}

.self-sender-indicator {
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    background-color: #e1f5fe;
    color: #0277bd;
}

.single-recipient-indicator {
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.labels-indicator {
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    background-color: #e0e7ff;
    color: #5b21b6;
}

.classified-badge {
    background: #10b981;
    color: white;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 12px;
    flex-shrink: 0;
}

.unclassified-badge {
    background: #f59e0b;
    color: white;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 12px;
    flex-shrink: 0;
}

.email-recipients {
    font-size: 13px;
    color: #6b7280;
    margin: 4px 0;
    font-style: italic;
    background: #f8fafc;
    padding: 4px 8px;
    border-radius: 4px;
    border-left: 3px solid #3b82f6;
}

.email-subject {
    font-size: 16px;
    color: #334155;
    margin-bottom: 8px;
}

.email-preview {
    font-size: 14px;
    color: #64748b;
    line-height: 1.4;
}

.task-preview {
    font-size: 14px;
    color: #64748b;
    line-height: 1.4;
    background: #f8fafc;
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid #3b82f6;
    margin-bottom: 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
}

.no-emails-message {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
    font-size: 16px;
    font-weight: 500;
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    border-radius: 8px;
    margin: 20px 0;
}

.date-selector-container {
    text-align: center;
    padding: 20px;
}

.date-selector-container h3 {
    margin-bottom: 30px;
    font-size: 24px;
    color: #1e293b;
}

.calendar-section {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
}

.calendar-section h4 {
    margin-bottom: 16px;
    color: #334155;
    font-size: 18px;
}

.calendar-input-container {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.custom-date-picker {
    padding: 12px 16px;
    border: 2px solid #3b82f6;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    background: white;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 160px;
}

.custom-date-picker:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.load-date-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 140px;
}

.load-date-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.date-hint {
    font-size: 14px;
    color: #64748b;
    margin: 0;
    font-style: italic;
}

.section-divider {
    position: relative;
    margin: 32px 0;
    text-align: center;
}

.section-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
    z-index: 1;
}

.section-divider span {
    background: white;
    padding: 0 20px;
    color: #64748b;
    font-size: 14px;
    position: relative;
    z-index: 2;
}

.recent-dates-section {
    background: #fefefe;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
}

.recent-dates-section h4 {
    margin-bottom: 20px;
    color: #334155;
    font-size: 18px;
}

.all-emails-section {
    background: #e0f2fe;
    border: 2px solid #0891b2;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
}

.all-emails-section h4 {
    margin-bottom: 16px;
    color: #0c4a6e;
    font-size: 18px;
}

.all-emails-controls {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.period-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.period-selector label {
    font-weight: 600;
    color: #0c4a6e;
    font-size: 14px;
}

.period-dropdown {
    padding: 10px 12px;
    border: 2px solid #0891b2;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    background: white;
    color: #0c4a6e;
    cursor: pointer;
    transition: all 0.2s;
}

.period-dropdown:focus {
    outline: none;
    border-color: #0e7490;
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.load-all-btn {
    background: #0891b2;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 180px;
}

.load-all-btn:hover {
    background: #0e7490;
    transform: translateY(-1px);
}

.all-emails-hint {
    font-size: 14px;
    color: #0891b2;
    margin: 0;
    font-style: italic;
    text-align: center;
}

.all-emails-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}

.all-emails-info {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.all-emails-actions {
    display: flex;
    gap: 8px;
}

.load-more-btn {
    background: #0891b2;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.load-more-btn:hover {
    background: #0e7490;
    transform: translateY(-1px);
}

.no-recent-emails {
    padding: 20px;
    color: #64748b;
    font-style: italic;
}

.date-button strong {
    display: block;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
    font-size: 16px;
}

.email-counts {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.count-item {
    font-size: 13px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.count-item.received {
    background: #dbeafe;
    color: #1e40af;
}

.count-item.sent {
    background: #fef3c7;
    color: #92400e;
}

.count-item.filtered {
    background: #f3f4f6;
    color: #374151;
}

.count-item.classified {
    background: #d1fae5;
    color: #059669;
}

.count-total {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid #e2e8f0;
}

.classification-section {
    padding: 24px;
    background: #f8fafc;
    display: none;
}

.classification-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
    text-align: center;
}

.action-buttons {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    justify-content: center;
    flex-wrap: wrap;
}

.form-container {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    display: none;
}

.form-container.active {
    display: block;
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

input[type="date"],
input[type="text"],
textarea {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

textarea {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.credentials-error-container,
.auth-required-container,
.no-emails-container {
    text-align: center;
    padding: 40px;
}

.credentials-error-container h3,
.auth-required-container h3,
.no-emails-container h3 {
    margin-bottom: 16px;
}

.credentials-error-container code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

/* Style pour les messages d'erreur améliorés */
.error-container {
    max-width: 600px;
    margin: 60px auto;
    padding: 40px;
    background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
    border: 2px solid #fee2e2;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.1);
    animation: slideInDown 0.4s ease-out;
}

.error-container.quota-error {
    background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
    border-color: #fed7aa;
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.1);
}

.error-container.quota-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #ffffff 100%);
    border-color: #fcd34d;
    box-shadow: 0 10px 25px rgba(251, 191, 36, 0.15);
}

.error-container .error-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: bounce 1s ease-in-out infinite;
}

.error-container h3 {
    font-size: 24px;
    font-weight: 600;
    color: #dc2626;
    margin: 0 0 16px 0;
}

.error-container.quota-error h3 {
    color: #d97706;
}

.error-container p {
    color: #64748b;
    font-size: 16px;
    line-height: 1.6;
    margin: 12px 0;
}

.error-container .error-detail {
    color: #94a3b8;
    font-size: 14px;
    margin: 8px 0 20px 0;
    padding: 12px;
    background: rgba(148, 163, 184, 0.1);
    border-radius: 8px;
}

.error-container .error-actions {
    margin-top: 24px;
}

.error-container .wait-hint {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 12px;
    font-style: italic;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.error-title {
    color: #ef4444;
}

.auth-button {
    background: #dc2626;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 20px;
    transition: background-color 0.2s;
}

.auth-button:hover {
    background: #b91c1c;
}

.auth-status {
    margin-top: 20px;
    display: none;
    padding: 15px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.auth-status.show {
    display: block;
}

.auth-status p {
    margin: 10px 0 0 0;
    color: #64748b;
}

.auth-status .small-text {
    margin: 5px 0 0 0;
    font-size: 14px;
    color: #94a3b8;
}

.auth-success {
    color: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-error {
    color: #ef4444;
    text-align: center;
}

.retry-button {
    background: #6b7280;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.2s;
}

.retry-button:hover {
    background: #4b5563;
}

.retry-button.warning {
    background: #f59e0b;
}

.retry-button.warning:hover {
    background: #d97706;
}

.button-primary {
    background: #3b82f6;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin: 10px;
    transition: background-color 0.2s;
}

.button-primary:hover {
    background: #2563eb;
}

.button-warning {
    background: #f59e0b;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin: 10px;
    transition: background-color 0.2s;
}

.button-warning:hover {
    background: #d97706;
}
/* ========================================
   GROUPEMENT PAR JOUR (ACCORDÉONS)
   ======================================== */

.day-group {
    margin-bottom: 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.day-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.day-header:hover {
    background: linear-gradient(135deg, #5568d3 0%, #5f3d87 100%);
}

.day-header:active {
    transform: scale(0.98);
}

.day-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.day-toggle-icon {
    font-size: 14px;
    transition: transform 0.2s ease;
    width: 20px;
    display: inline-block;
}

.day-label {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
}

.day-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

.day-emails {
    padding: 8px;
    background: #f9fafb;
}

.day-emails .email-item {
    margin-bottom: 8px;
    border-radius: 6px;
    padding: 12px;
    border: 1px solid #e5e7eb;
}

.day-emails .email-item:last-child {
    margin-bottom: 0;
}