/* Wrapper */
.mk-calendar-wrapper {
    border: 1px solid #e1e1e1;
    padding: 15px;
    border-radius: 8px;
    background: #fafafa;
    font-size: 13px;
}

/* topbar */
.mk-kalender-topbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.mk-kalender-filters label {
    margin-right: 10px;
    font-size: 13px;
}

.mk-kalender-filters select {
    min-width: 140px;
}

.mk-own-toggle {
    margin-left: 10px;
}

.mk-kalender-viewtoggle .mk-view-btn.active {
    background: #2271b1;
    color: #fff;
}

/* calendar */
#mk-calendar {
    margin-top: 5px;
}

.mk-cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.mk-cal-header-title {
    font-weight: 600;
    font-size: 15px;
}

.mk-cal-header-buttons .mk-nav-btn {
    margin-left: 4px;
}

.mk-cal-grid {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
}

.mk-cal-grid th,
.mk-cal-grid td {
    border: 1px solid #eee;
    vertical-align: top;
    padding: 3px;
}

.mk-cal-grid th {
    background: #f4f4f4;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
}

.mk-cal-grid td {
    height: 80px;
}

.mk-cal-grid td.mk-empty {
    background: #fafafa;
}

.mk-cal-day-number {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 2px;
}

.mk-cal-day-number.mk-today {
    color: #d63638;
}

/* events */
.mk-cal-event {
    margin: 1px 0;
    padding: 1px 3px;
    border-radius: 3px;
    color: #fff;
    font-size: 11px;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    border: 1px solid rgba(0,0,0,0.1);
}

.mk-ev-type {
}

/* Legend */
.mk-legend {
    margin-top: 8px;
    font-size: 11px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.mk-legend-title {
    font-weight: 600;
}

.mk-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.mk-legend-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.mk-legend-sep {
    margin: 0 4px;
}

/* listevisning */
#mk-calendar-list {
    margin-top: 10px;
}

.mk-list-title {
    margin: 5px 0;
    font-size: 14px;
    font-weight: 600;
}

.mk-list-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mk-list-item {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-left-width: 4px;
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mk-list-item:hover {
    background: #f7fbff;
}

.mk-list-date {
    font-size: 11px;
    color: #666;
}

.mk-list-title-text {
    font-size: 13px;
    font-weight: 600;
}

.mk-list-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}

.mk-pill {
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 10px;
    border: 1px solid #ccc;
    background: #f5f5f5;
}

.mk-pill-medarb {
    background: #edf5ff;
}

.mk-pill-type {
    background: #fff7e6;
}

/* form card */
.mk-form-card {
    margin-top: 15px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e1e1e1;
    padding: 12px 15px;
}

.mk-form-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.mk-form-col {
    flex: 1 1 220px;
}

.mk-form-col input[type="text"],
.mk-form-col input[type="date"],
.mk-form-col select {
    width: 100%;
    max-width: 260px;
}

.mk-form-buttons {
    margin-top: 8px;
}

.mk-form-buttons .button {
    margin-right: 5px;
}

.mk-form-tip {
    margin-top: 5px;
    font-size: 11px;
    color: #666;
}

/* sync wrapper / notice */
.mk-sync-wrapper {
    margin: 10px 0;
}
.mk-sync-notice {
    margin: 5px 0 10px;
}

/* responsive */

/* Modal */
.mk-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
}

.mk-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
}

.mk-modal-dialog {
    position: relative;
    max-width: 720px;
    margin: 60px auto;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    padding: 16px 18px;
}

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

.mk-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.mk-modal-close {
    border: none;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.mk-modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .mk-kalender-topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .mk-cal-grid th,
    .mk-cal-grid td {
        padding: 2px;
    }

    .mk-cal-grid td {
        height: 70px;
    }
}
