/* --- KOMPLETTA STILAR (MED KORRIGERINGAR OCH NYA STILAR FÖR POPUP) --- */
.kunder-calendar-wrapper { max-width: 100%; margin: 20px 0; font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.fc { background: #fff; border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,0.08); overflow: hidden; font-family: "Poppins", sans-serif; }
.fc-toolbar { padding: 20px; background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%); border-bottom: 1px solid #e9ecef; }
.fc-toolbar-title { font-size: 24px; font-weight: 600; color: #2c3e50; font-family: "Poppins", sans-serif; text-transform: capitalize; }
.fc-button { background: #667eea; border: none; color: white; padding: 10px 20px; border-radius: 8px; font-weight: 500; transition: all 0.3s ease; font-family: "Poppins", sans-serif; text-transform: none; font-size: 14px; }
.fc-button:hover { background: #5a67d8; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3); }
.fc-button-active { background: #5a67d8 !important; box-shadow: inset 0 3px 5px rgba(0,0,0,0.1); }
.fc-button:focus { box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3); }
.fc-daygrid-day-number { color: black; font-weight: 600; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; margin: 4px; text-decoration: none !important; }
.fc-daygrid-day-number:hover { background: #667eea; color: white; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.fc-event { border: none; padding: 6px 10px; border-radius: 6px; cursor: pointer; transition: all 0.2s ease; font-size: 13px; font-weight: 500; margin: 2px 0; box-shadow: 0 2px 4px rgba(0,0,0,0.1); color: white; }
.fc-event:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.15); color: white !important; }
.fc-event-time { font-weight: 600; margin-right: 4px; }
.fc-event.kunder-event { background: linear-gradient(135deg, #48bb78 0%, #38a169 100%); }
.fc-event.notis-event { background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%); }
.fc-daygrid-event { white-space: normal; overflow: hidden; font-size: 10px; }
.fc-day-today { background: #f0f9ff !important; }
.fc-day-today .fc-daygrid-day-number { background: #667eea; color: white; font-weight: 600; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; margin: 4px; }
.fc-day-sat, .fc-day-sun { background: #f8fafc; }
.holiday { background: #fef3c7 !important; }
.holiday .fc-daygrid-day-number { background: white; color: #d97706; font-weight: 600; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; margin: 4px; }
.fc-col-header-cell.holiday { background: #fef3c7 !important; }
.fc-col-header-cell.holiday .fc-col-header-cell-cushion { color: #d97706; }
.fc-daygrid-day.holiday { position: relative; }
.fc-daygrid-day.holiday::before { content: attr(data-holiday); position: absolute; top: 2px; left: 2px; font-size: 10px; color: #d97706; background: rgba(255, 255, 255, 0.9); padding: 2px 6px; border-radius: 4px; pointer-events: none; max-width: calc(100% - 40px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; font-family: "Poppins", sans-serif; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* --- BÖRJAN: UPPDATERADE STILAR FÖR POPUP/MODAL --- */
.event-editor {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: white; padding: 0; border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15); z-index: 1000;
    min-width: 420px; max-height: 90vh; overflow: hidden;
    font-family: "Poppins", sans-serif;
    display: flex; /* För tvåkolumnslayout i Kunder */
}
.event-editor.notis-editor-modal { display: block; padding: 32px; } /* Ursprunglig stil för Notis */
.event-editor.kunder-editor-modal { min-width: 850px; } /* Bredare för Kunder */

/* Vänsterkolumn (Infopanel) */
.kunder-info-panel {
    flex: 0 0 45%;
    padding: 32px;
    background: #f8fafc;
    border-right: 1px solid #e9ecef;
    overflow-y: auto;
}
.kunder-info-panel h4 {
    font-size: 16px; font-weight: 600; color: #2c3e50;
    border-bottom: 2px solid #667eea; padding-bottom: 8px;
    margin-top: 0; margin-bottom: 20px;
}
.info-group { margin-bottom: 24px; }
.info-field { margin-bottom: 12px; }
.info-field strong {
    display: block; color: #4a5568; font-size: 13px;
    font-weight: 600; margin-bottom: 4px; text-transform: uppercase;
}
.info-field span { color: #2d3748; font-size: 15px; }
.status-warning {
    padding: 12px; border-radius: 8px; background: #fffaf0;
    border: 1px solid #fed7a9; color: #c05621;
    font-size: 13px; margin-top: 8px;
}

/* Högerkolumn (Redigerare) */
.kunder-editor-content { flex: 1 1 55%; padding: 32px; overflow-y: auto; }
.kunder-editor-content h3, .notis-editor-modal h3 { margin: 0 0 24px 0; font-size: 24px; font-weight: 600; color: #2c3e50; font-family: "Poppins", sans-serif; }
.event-editor label { display: block; margin-top: 16px; margin-bottom: 8px; font-weight: 500; color: #4a5568; font-size: 14px; font-family: "Poppins", sans-serif; }
.event-editor input, .event-editor select { width: 100%; padding: 12px 16px; border: 2px solid #e2e8f0; border-radius: 8px; font-size: 14px; font-family: "Poppins", sans-serif; transition: all 0.2s ease; box-sizing: border-box; }
.event-editor input:focus, .event-editor select:focus { outline: none; border-color: #667eea; box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1); }
.event-editor .checkbox-group { display: flex; align-items: center; margin: 20px 0; padding: 16px; background: #f7fafc; border-radius: 8px; transition: all 0.2s ease; }
.event-editor .checkbox-group:hover { background: #edf2f7; }
.event-editor input[type="checkbox"] { width: 20px; height: 20px; margin-right: 12px; cursor: pointer; }
.event-editor .checkbox-group label { margin: 0; cursor: pointer; }
.event-editor .time-group { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.event-editor .button-group { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; padding-top: 24px; border-top: 1px solid #e2e8f0; }
.event-editor button, 
.event-editor a.view-kundkort-btn { /* <-- LÍNEA MODIFICADA */
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    font-family: "Poppins", sans-serif;
    transition: all 0.2s ease;
    flex-grow: 1;
    display: inline-block; /* Ayuda a que el padding y otras propiedades se apliquen correctamente */
    text-align: center; /* Centra el texto como en un botón */
    text-decoration: none; /* <-- LÍNEA AÑADIDA para quitar el subrayado */
}
.event-editor button:hover { background: #5a67d8; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3); }
.event-editor .view-kundkort-btn { background: #3182ce; }
.event-editor .view-kundkort-btn:hover { background: #2b6cb0; box-shadow: 0 4px 12px rgba(49, 130, 206, 0.3); }
.event-editor .delete-btn { background: #f56565; }
.event-editor .delete-btn:hover { background: #e53e3e; box-shadow: 0 4px 12px rgba(245, 101, 101, 0.3); }
.event-editor .cancel-btn { background: #718096; }
.event-editor .cancel-btn:hover { background: #4a5568; box-shadow: 0 4px 12px rgba(113, 128, 150, 0.3); }
.event-editor .hide-btn { background: #ed8936; }
.event-editor .hide-btn:hover { background: #dd6b20; box-shadow: 0 4px 12px rgba(237, 137, 54, 0.3); }
/* --- SLUT: POPUP-STILAR --- */

.event-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 999; backdrop-filter: blur(4px); animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 24px; margin-bottom: 20px; padding: 16px; background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%); border-radius: 8px; font-size: 14px; font-family: "Poppins", sans-serif; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.legend-item { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.legend-color { width: 20px; height: 20px; border-radius: 4px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.event-info { background: linear-gradient(135deg, #e0e7ff 0%, #e0f2fe 100%); padding: 16px 20px; margin-bottom: 20px; border-radius: 8px; font-size: 14px; color: #4a5568; font-family: "Poppins", sans-serif; box-shadow: 0 2px 8px rgba(0,0,0,0.05); border-left: 4px solid #667eea; }
.notification { position: fixed; top: 24px; right: 24px; padding: 16px 24px; background: #48bb78; color: white; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.15); z-index: 10000; animation: slideInRight 0.3s ease; font-family: "Poppins", sans-serif; font-weight: 500; }
.notification.error { background: #f56565; }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.fc-daygrid-event-dot { display: none; }
.fc-col-header-cell { font-weight: 600; color: #4a5568; }
.fc-daygrid-more-link { color: #667eea; font-weight: 500; }
.fc-daygrid-more-link:hover { color: #5a67d8; text-decoration: none; }

/* --- BÖRJAN: STILAR FÖR FÄRGVÄLJARE --- */
.event-editor .color-selector { margin-top: 20px; padding: 16px; background: #f7fafc; border-radius: 8px; }
.event-editor .color-selector label { margin-top: 0; margin-bottom: 12px; }
.event-editor .color-options { display: flex; gap: 12px; justify-content: flex-start; }
.event-editor .color-option { position: relative; }
.event-editor .color-option input[type="radio"] { opacity: 0; position: absolute; width: 32px; height: 32px; cursor: pointer; }
.event-editor .color-option .swatch { width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: block; border: 3px solid transparent; transition: all 0.2s ease; }
.event-editor .color-option input[type="radio"]:checked + .swatch { border-color: #fff; box-shadow: 0 0 0 3px #667eea; transform: scale(1.1); }
.event-editor .color-option input[type="radio"]:focus + .swatch { box-shadow: 0 0 0 3px #667eea; }
.swatch.color-default-kunder { background: linear-gradient(135deg, #48bb78 0%, #38a169 100%); }
.swatch.color-default-notis { background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%); }
.swatch.color-red { background: #f56565; }
.swatch.color-yellow { background: #ECC94B; }
.swatch.color-purple { background: #805AD5; }
/* --- SLUT: NYA STILAR --- */

@media (max-width: 900px) {
    .event-editor.kunder-editor-modal {
        flex-direction: column;
        min-width: 90%;
        max-width: 90%;
    }
    .kunder-info-panel {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }
}
@media (max-width: 768px) {
    .fc-toolbar { flex-direction: column; padding: 16px; }
    .fc-toolbar-chunk { margin: 8px 0; display: flex; justify-content: center; }
    .event-editor { min-width: 90%; max-width: 90%; padding: 24px; }
    .event-editor button { flex-basis: 100%; }
    .calendar-legend { flex-wrap: wrap; gap: 12px; }
    .fc-daygrid-day.holiday::before { font-size: 8px; padding: 1px 4px; }
}