/* =========================================================
   EMPLOYEE CALENDAR (redesigned — compact dot grid + inline detail)
========================================================= */
.cal-month-nav{
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg, #fff);
    border-radius: var(--radius, 14px);
    padding: 5px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.cal-month-btn{
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
    text-decoration: none;
    transition: background 0.15s;
}
.cal-month-btn:hover{ background: rgba(0,122,255,0.06); }
.cal-month-btn:active{ transform: scale(0.9); }
.cal-month-label{
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -0.3px;
    cursor: default;
}
.cal-legend{
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
    padding: 0 2px;
    flex-wrap: wrap;
}
.cal-legend-item{
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: var(--font-xs);
    color: var(--text-secondary, #6b7280);
    font-weight: 500;
}
.cal-legend-dot{
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.cal-dot-work{ background: var(--primary); }
.cal-dot-leave{ background: #ff3b30; }
.cal-dot-sickness{ background: #ff9500; }
.cal-dot-free{ background: #d1d5db; }

.cal-card{
    background: var(--card-bg, #fff);
    border-radius: var(--radius, 14px);
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.cal-weekdays{
    display: grid;
    grid-template-columns: 32px repeat(7, 1fr);
    gap: 3px;
    margin-bottom: 4px;
}
.cal-wkday{
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted, #9ca3af);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 0;
}
.cal-wk-num{
    font-size: 9px;
    display: flex; align-items: center; justify-content: center;
}
.cal-grid{
    display: grid;
    grid-template-columns: 32px repeat(7, 1fr);
    gap: 3px;
}
.cal-week-num{
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted, #9ca3af);
    display: flex;
    align-items: center;
    justify-content: center;
}
.cal-day{
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1.5px solid transparent;
    background: transparent;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    min-width: 0;
}
.cal-day:active{ transform: scale(0.92); }

.cal-day-num{
    font-size: 14px;
    font-weight: 600;
    color: var(--text, #1a1a2e);
    line-height: 1;
    position: relative;
    z-index: 1;
}
.cal-day-dot{
    width: 5px; height: 5px;
    border-radius: 50%;
}

/* Status colors — clean dots, no background fill */
.cal-day--work .cal-day-dot{ background: var(--primary); }
.cal-day--leave .cal-day-dot{ background: #ff3b30; }
.cal-day--sickness .cal-day-dot{ background: #ff9500; }
.cal-day--free .cal-day-num{ color: var(--text-muted, #9ca3af); }

/* Outside month */
.cal-day--outside{
    opacity: 0.25;
    pointer-events: none;
}

/* Today */
.cal-day--today .cal-day-num{
    background: var(--primary);
    color: #fff;
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
}

/* Selected */
.cal-day--selected{
    border-color: var(--primary);
    background: rgba(0,122,255,0.06);
    box-shadow: 0 0 0 2px rgba(0,122,255,0.12);
}
.cal-day--selected.cal-day--leave{
    border-color: #ff3b30;
    background: rgba(255,59,48,0.06);
    box-shadow: 0 0 0 2px rgba(255,59,48,0.10);
}
.cal-day--selected.cal-day--sickness{
    border-color: #ff9500;
    background: rgba(255,149,0,0.06);
    box-shadow: 0 0 0 2px rgba(255,149,0,0.10);
}

/* ── Inline detail expansion ── */
.cal-detail{
    grid-column: 1 / -1;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease,
                margin 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0;
}
.cal-detail--open{
    max-height: 160px;
    opacity: 1;
    margin: 4px 0 6px;
}
.cal-detail-inner{
    background: var(--bg, #f2f2f7);
    border-radius: 10px;
    padding: 12px 14px;
    position: relative;
}
.cal-detail-inner::before{
    content: '';
    position: absolute;
    top: -5px;
    width: 10px; height: 10px;
    background: var(--bg, #f2f2f7);
    transform: rotate(45deg);
    border-radius: 2px;
    left: var(--cal-ptr, 50%);
    margin-left: -5px;
}
.cal-detail-date{
    font-weight: 700;
    font-size: var(--font-body, 15px);
    color: var(--text, #1a1a2e);
    margin-bottom: 8px;
}
.cal-detail-status{
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
}
.cal-detail-dot{
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.cal-detail-label{
    font-size: var(--font-sm, 13px);
    font-weight: 600;
    color: var(--text, #1a1a2e);
}
.cal-detail-note{
    font-size: var(--font-xs, 11px);
    color: var(--text-secondary, #6b7280);
    margin-top: 2px;
}
.cal-detail-hotel{
    font-size: var(--font-xs, 11px);
    color: var(--text-secondary, #6b7280);
    margin-top: 4px;
    font-style: italic;
}

/* ── Subscribe button (mobile) ── */
.cal-subscribe-btn{
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    background: var(--card-bg, #fff);
    border-radius: var(--radius, 14px);
    border: 1.5px solid var(--border, #e5e7eb);
    color: var(--primary);
    font-weight: 600;
    font-size: var(--font-body, 15px);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    text-decoration: none;
    width: 100%;
}
.cal-subscribe-btn:hover{
    border-color: var(--primary);
    background: rgba(0,122,255,0.04);
}

/* Desktop: wider grid, keep week number */
@media (min-width: 1201px){
    .cal-weekdays, .cal-grid{
        grid-template-columns: 40px repeat(7, 1fr);
        gap: 6px;
    }
    .cal-day{ aspect-ratio: auto; min-height: 44px; }
}

.calendar-nav{
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
}
.calendar-nav.desktop-only{ display:flex; }
.calendar-nav.mobile-only{ display:none; }
@media(max-width:768px){
    .calendar-nav.desktop-only{ display:none; }
    .calendar-nav.mobile-only{ display:flex; }
}
.calendar-clickable .calendar-day[data-date]{
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.calendar-clickable .calendar-day[data-date]:hover{
    border-color: #2563eb;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12);
    transform: translateY(-1px);
}

@media (max-width: 1200px){
    .calendar-grid{
        gap: 6px;
    }
    .calendar-day{
        min-height: 64px;
        padding: 6px;
        border-radius: 10px;
    }
    .calendar-weekdays{
        font-size: var(--font-xs);
    }
    .calendar-weekday .weekday-full{ display: none; }
    .calendar-weekday .weekday-short{ display: inline; }
    .calendar-actions-desktop{ display: none !important; }
    .calendar-actions-mobile{ display: block !important; }
    .calendar-day .status{ display: none; }
    .calendar-day .day-note{ display: none; }
    .calendar-month-title{
        font-size: var(--font-sm);
    }
    .calendar-day .status{
        font-size: var(--font-xs);
    }
    .calendar-weekdays.calendar-with-weeks,
    .calendar-grid.calendar-with-weeks{
        grid-template-columns: 32px repeat(7, minmax(0, 1fr));
    }
    .calendar-week-number{
        border-radius: 10px;
        font-size: var(--font-xs);
    }
    .calendar-availability .calendar-employee{
        white-space: nowrap;
        word-break: normal;
    }
    .calendar-availability .calendar-employee-name-short{
        white-space: nowrap;
    }
    .calendar-employee-name-full{
        display: none;
    }
    .calendar-employee-name-short{
        display: inline;
    }
}

/* =========================================================
   SWIMLANE AVAILABILITY VIEW
========================================================= */

/* ── Måned-titel over tabel ────────────────────────── */
.swimlane-month-title {
    text-align: center;
    margin-bottom: 10px;
    font-size: var(--font-lg);
    font-weight: 700;
    color: #0f172a;
}

/* ── Tabel-wrapper (ingen scroll) ──────────────────── */
.swimlane-wrap {
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    overflow: visible;
}

.swimlane-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    table-layout: fixed;
    font-size: var(--font-xs);
}

/* ── Navn-kolonne ──────────────────────────────────── */
.swimlane-name-col {
    background: #fff;
    width: 130px;
    padding: 4px 8px;
    border-right: 2px solid #e2e8f0;
    white-space: nowrap;
    text-align: left;
    font-weight: 600;
    font-size: var(--font-xs);
    color: #0f172a;
    position: relative;
}

thead .swimlane-name-col {
    background: #f8fafc;
}

/* ── Uge-header (colspan) ──────────────────────────── */
.swimlane-week-header {
    background: #f1f5f9;
    font-weight: 700;
    font-size: var(--font-xs);
    color: #475569;
    text-align: center;
    padding: 4px 2px;
    border-bottom: 1px solid #e2e8f0;
    border-right: 1px solid #cbd5e1;
}
.swimlane-week-header:last-child { border-right: none; }

/* ── Dag-headers ───────────────────────────────────── */
.swimlane-daynum-row th:not(.swimlane-name-col) {
    background: #f8fafc;
    font-size: var(--font-xs);
    font-weight: 700;
    color: #0f172a;
    text-align: center;
    padding: 4px 1px;
    border-bottom: 2px solid #cbd5e1;
}

/* Today */
.swimlane-day-header.is-today {
    color: #2563eb !important;
    background: #eff6ff !important;
}

/* Outside month */
.swimlane-day-header.is-outside { opacity: 0.4; }

/* Weekend */
.swimlane-day-header.is-weekend { color: #94a3b8; }
/* Helligdag */
.swimlane-day-header.is-holiday { color: #c62828; font-weight: 600; }
.swimlane-cell.is-holiday:not(.swimlane-booked):not(.swimlane-leave):not(.swimlane-sickness):not(.swimlane-booked-other) { background: #fce4ec; }
.calendar-day.is-holiday .day-number,
.cal-day.is-holiday .cal-day-num { color: #c62828; font-weight: 600; }

/* ── Data-celler ───────────────────────────────────── */
.swimlane-cell {
    height: 32px;
    padding: 2px;
    border-right: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
}

/* Status-farver (tydelige) */
.swimlane-free         { background: #d1fae5; }
.swimlane-booked       { background: #c7d2fe; }
.swimlane-leave        { background: #fecdd3; }
.swimlane-sickness     { background: #fde68a; }
.swimlane-booked-other { background: #e5e7eb; }

/* Today-kolonne */
.swimlane-cell.is-today { box-shadow: inset 0 0 0 2px #2563eb; }

/* Outside-month */
.swimlane-cell.is-outside { opacity: 0.35; }

/* Weekend subtil */
.swimlane-cell.is-weekend:not(.swimlane-booked):not(.swimlane-leave):not(.swimlane-sickness):not(.swimlane-booked-other) { background: #eaeff5; }

/* Række-hover — mørkere version af hver statusfarve */
.swimlane-row:hover .swimlane-free         { background: #a7f3d0; }
.swimlane-row:hover .swimlane-booked:not(.swimlane-overlap)       { background: #a5b4fc; }
.swimlane-row:hover .swimlane-leave:not(.swimlane-overlap)        { background: #fda4af; }
.swimlane-row:hover .swimlane-sickness:not(.swimlane-overlap)     { background: #fcd34d; }
.swimlane-row:hover .swimlane-booked-other { background: #d1d5db; }
.swimlane-row:hover .swimlane-overlap-booked-leave    { background: linear-gradient(135deg, #a5b4fc 50%, #fda4af 50%); }
.swimlane-row:hover .swimlane-overlap-booked-sickness { background: linear-gradient(135deg, #a5b4fc 50%, #fcd34d 50%); }
.swimlane-row:hover .swimlane-overlap-leave-sickness  { background: linear-gradient(135deg, #fda4af 50%, #fcd34d 50%); }
.swimlane-row:hover .swimlane-cell.is-weekend:not(.swimlane-booked):not(.swimlane-leave):not(.swimlane-sickness):not(.swimlane-booked-other) { background: #d5dce8; }
.swimlane-row:hover .swimlane-name-col { background: #e2e8f0; }
.swimlane-row:hover .swimlane-cell.is-today { box-shadow: inset 0 0 0 2px #2563eb; }

/* ── Navn-knap ─────────────────────────────────────── */
.swimlane-name-btn {
    display: block;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    font: inherit;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    text-align: left;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.swimlane-name-btn:hover { color: #2563eb; }
.swimlane-name-short { display: none; }

/* ── Klikbar måned-picker (skjult date-input) ─────── */
.swimlane-month-picker {
    display: inline-block;
    position: relative;
    cursor: pointer;
}
.swimlane-month-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* ── Desktop: skjul ekstra mobil-dage ── */
.swimlane-desktop-hide { display: none !important; }
/* ── Mobil: skjul uger der ikke er indeværende/næste ── */
@media (max-width: 1200px) {
    .swimlane-desktop-hide { display: table-cell !important; }
    .swimlane-mobile-hide { display: none !important; }
    .swimlane-name-col { width: 52px; padding: 3px 4px; font-size: var(--font-xs); }
    .swimlane-name-full { display: none; }
    .swimlane-name-short { display: inline; }
    .swimlane-cell { height: 24px; }
    .swimlane-daynum-row th:not(.swimlane-name-col) { font-size: 9px; padding: 3px 0; }
    .swimlane-week-header { font-size: 9px; padding: 3px 1px; }
    .swimlane-day-dow { font-size: 8px; }
}

/* ── Banner-rækker: skift mellem 1-måneds (medium) og 2-måneders (bred) banner ── */
/* Default (bred ≥ 2600px): 2-måneders banner */
.swimlane-banner-medium { display: none !important; }
.swimlane-banner-wide { display: table-row; }
/* Medium (1201-2599px): 1-måneds banner */
@media (max-width: 2599px) {
    .swimlane-banner-medium { display: table-row !important; }
    .swimlane-banner-wide { display: none !important; }
}
/* Mobil/tablet (≤1200px): skjul begge bannere — uge-navigation findes ovenfor */
@media (max-width: 1200px) {
    .swimlane-banner-medium,
    .swimlane-banner-wide { display: none !important; }
}

/* ── Mellem-bredder: skjul dage/uger der ligger uden for måned-1's fulde kalendergrid ── */
@media (min-width: 1201px) and (max-width: 2599px) {
    .swimlane-medium-hide { display: none !important; }
    /* Dage i måned-2 (fx Aug 1-2 i juli-grid) dæmpes ved 1-måneds visning */
    .swimlane-day-header.swimlane-month-2 { opacity: 0.4; }
    .swimlane-cell.swimlane-month-2 { opacity: 0.35; }
}

/* ── Måned-banner over uge-headers ── */
.swimlane-month-banner {
    background: #e2e8f0;
    color: #0f172a;
    text-align: center !important;
    font-weight: 700;
    font-size: var(--font-sm);
    padding: 6px 6px;
    border-bottom: 1px solid #cbd5e1;
}
.swimlane-month-banner .swimlane-month-picker {
    display: block;
    width: 100%;
    text-align: center;
    font-weight: 700;
}

/* ── Diskret vertikal opdeling mellem måneder ── */
.swimlane-table thead tr > :not(.swimlane-month-2) + .swimlane-month-2,
.swimlane-table tbody tr > :not(.swimlane-month-2) + .swimlane-month-2 {
    border-left: 1px solid #cbd5e1 !important;
}

/* ── Dag-header: dato (fed) + ugedag (normal) på hver sin linje ── */
.swimlane-daynum-row th .swimlane-day-num {
    font-weight: 700;
    line-height: 1.1;
}
.swimlane-daynum-row th .swimlane-day-dow {
    display: inline-block;
    font-size: 9px;
    font-weight: 400 !important;
    color: #94a3b8;
    line-height: 1;
    letter-spacing: 0.02em;
    margin-top: 2px;
}

/* ── Svejsecert-popup (desktop hover på navn) ─────── */
.swimlane-name-btn.has-welding { color: #c2410c; }
.swimlane-name-btn.has-welding:hover { color: #9a3412; }

.swimlane-cert-popup {
    position: absolute;
    top: calc(100% + 6px);
    left: 8px;
    z-index: 50;
    width: 240px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
    padding: 12px 14px;
    font-weight: 400;
    font-size: 12px;
    color: #0f172a;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.12s ease;
    white-space: normal;
}
.swimlane-name-col:hover .swimlane-cert-popup,
.swimlane-name-col:focus-within .swimlane-cert-popup {
    opacity: 1;
    visibility: visible;
}
.swimlane-cert-popup::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 18px;
    transform: rotate(45deg);
    width: 10px;
    height: 10px;
    background: #fff;
    border-left: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
}
.cert-popup-name {
    font-weight: 700;
    font-size: 13px;
    margin: 0 0 8px;
    padding: 0 0 6px;
    border-bottom: 1px solid #f1f5f9;
    color: #0f172a;
}
.cert-section { margin-top: 8px; }
.cert-section:first-of-type { margin-top: 0; }
.cert-section-label {
    text-transform: uppercase;
    font-size: 9.5px;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 2px;
}
.cert-section-value {
    font-size: 12px;
    color: #0f172a;
    line-height: 1.35;
}
.cert-section-value.empty { color: #cbd5e1; }
.cert-section.welding .cert-section-value:not(.empty) {
    color: #c2410c;
    font-weight: 600;
}

/* Skjul popup på mobil — kun farve-signal på navnet */
@media (max-width: 1200px) {
    .swimlane-cert-popup { display: none !important; }
}

