/* Main container styling for kalender */
.container {
    max-width: 600px;
    margin: 24px auto;
    padding: 28px;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
    transition: box-shadow 0.2s ease;
    position: relative;
}

.container:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}


.container.year-view {
    max-width: none;
    width: 100%;
    padding: 20px;
}

.year-container {
    display: none;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.month-wrapper {
    background: var(--card-bg);
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    padding: 12px 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
}

.month-wrapper:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.month-wrapper h3 {
    text-align: center;
    margin: 0 0 10px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
    letter-spacing: 0.01em;
}

/* Styling for ukedagene */
.weekday-row {
    display: grid;
    grid-template-columns: 40px repeat(7, 1fr);
    text-align: center;
    font-weight: 600;
    margin-bottom: 12px;
    padding: 6px 0;
    background: #fafafa;
    border-radius: 6px;
    border: none;
}

.weekday {
    padding: 4px 0;
    color: #666;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

/* Year view specific weekday styling - more compact and discrete */
.year-container .weekday-row {
    grid-template-columns: 28px repeat(7, 1fr);
    margin-bottom: 8px;
    padding: 4px 0;
    background: #fafafa;
    border: none;
    border-radius: 4px;
}

.year-container .weekday {
    padding: 2px 0;
    font-size: 0.65rem;
    font-weight: 500;
    color: #888;
    letter-spacing: 0.02em;
}

.calendar-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 20px 0;
    margin-bottom: 20px;
}

/* Rad 1: Måned/År - stor og tydelig */
.month-year-display {
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
}

.month-year-display h2 {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
    line-height: 1.2;
    /* Fjern gradient fra h2 for å unngå at barn arver transparent text */
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    -webkit-text-fill-color: unset;
}

.month-name {
    font-weight: 700;
    font-size: 1.8rem;
    color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.year-name {
    font-weight: 400;
    font-size: 1.2rem;
    opacity: 0.6;
    color: #666 !important; /* Mørk grå farge for å være synlig på hvit bakgrunn */
    -webkit-text-fill-color: #666 !important; /* Overstyr gradient fra page-title */
    background: none !important; /* Fjern gradient bakgrunn */
    -webkit-background-clip: unset !important;
    background-clip: unset !important;
}

/* Year view: hide month, make year same style as month */
.year-view-active .month-name {
    display: none;
}

.year-view-active .year-name {
    font-weight: 700;
    font-size: 1.8rem;
    opacity: 1;
    color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Rad 2: Symmetrisk 4-knapp layout */
.calendar-controls-unified {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 12px;
}

.unified-nav-button {
    flex: 1;
    min-width: 0;
    height: 48px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--input-bg);
    color: var(--text-color);
    border: 1.5px solid var(--input-border);
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    font-family: var(--font-family);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Forrige knapp - grå */
#prev-month {
    background: var(--input-bg);
    color: var(--text-color);
    border: 1.5px solid var(--input-border);
}

#prev-month:hover {
    background: #f5f5f5;
    border-color: var(--secondary-color);
}

/* I dag knapp - oransje */
#today-button {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-color-dark) 100%);
    color: var(--light-color);
    border: none;
    box-shadow: 0 3px 10px rgba(244, 163, 0, 0.3);
}

#today-button:hover {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-color-dark) 100%);
    border: 1.5px solid var(--accent-color);
    box-shadow: 0 5px 16px rgba(244, 163, 0, 0.4);
}

/* År/Måned knapp - grå */
.view-toggle-unified {
    background: var(--input-bg);
    color: var(--text-color);
    border: 1.5px solid var(--input-border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.view-toggle-unified:hover {
    background: #f5f5f5;
    border-color: var(--secondary-color);
}

/* Neste knapp - oransje */
#next-month {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-color-dark) 100%);
    color: var(--light-color);
    border: none;
    box-shadow: 0 3px 10px rgba(244, 163, 0, 0.3);
}

#next-month:hover {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-color-dark) 100%);
    border: 1.5px solid var(--accent-color);
    box-shadow: 0 5px 16px rgba(244, 163, 0, 0.4);
}

.unified-nav-button:hover {
    background: #f5f5f5;
    border-color: var(--accent-color);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(244, 163, 0, 0.2);
}

.unified-nav-button:active {
    transform: translateY(0);
}

/* Share section styling - under calendar and above colleague list */
.share-section {
    margin: 10px 0 16px;
    padding: 12px;
    border: 1px solid #e8e8e8;
    border-radius: var(--border-radius);
    background: var(--card-bg);
    box-shadow: var(--box-shadow);
}

.share-description {
    font-size: 0.88rem;
    color: var(--text-color);
    margin: 0 0 12px 0;
    text-align: center;
    font-weight: 600;
}

.share-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.share-actions.share-actions-single {
    grid-template-columns: 1fr;
}

.share-button-full {
    width: 100%;
    height: 42px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-color-dark) 100%);
    color: var(--light-color);
    border: none;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(244, 163, 0, 0.3);
    font-family: var(--font-family);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.share-button-full:hover {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-color-dark) 100%);
    border: 1.5px solid var(--accent-color);
    box-shadow: 0 5px 16px rgba(244, 163, 0, 0.4);
    transform: translateY(-1px);
}

.share-button-full:active {
    transform: translateY(0);
}

.share-button-full svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.share-button-full:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.share-button-full.hidden {
    display: none;
}

a.share-button-full {
    text-decoration: none;
    box-sizing: border-box;
}

.share-button-secondary {
    background: var(--input-bg);
    color: var(--text-color);
    border: 1.5px solid var(--input-border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.share-button-secondary:hover {
    background: #f5f5f5;
    border-color: var(--accent-color);
    box-shadow: 0 3px 8px rgba(244, 163, 0, 0.2);
}

.share-hint {
    margin: 8px 0 0 0;
    font-size: 0.72rem;
    line-height: 1.35;
    color: var(--text-secondary);
    text-align: center;
}

.share-section.hidden {
    display: none;
}

/* Kompakt «Del og eksporter»-stripe under kalenderen */
.share-section.share-strip {
    margin: 8px 0 12px;
    padding: 10px 10px 8px;
    border-top: 2px solid rgba(244, 163, 0, 0.35);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.share-strip-title {
    margin: 0 0 8px 0;
    padding: 0;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-color);
    letter-spacing: 0.02em;
}

.share-section.share-strip .share-actions.share-actions-compact {
    gap: 6px;
}

.share-section.share-strip .share-button-full {
    height: 40px;
    min-height: 40px;
    padding: 0 6px;
    font-size: 0.78rem;
    border-radius: 20px;
}

.share-section.share-strip .share-button-full svg {
    width: 16px;
    height: 16px;
}

.share-wallpaper-help {
    margin: 6px 0 0 0;
    border: none;
    padding: 0;
    font-size: 0.72rem;
    line-height: 1.35;
    color: var(--text-secondary);
}

.share-wallpaper-help summary {
    list-style: none;
    cursor: pointer;
    text-align: center;
    font-weight: 500;
    color: var(--accent-color);
    padding: 4px 0 2px;
    user-select: none;
}

.share-wallpaper-help summary::-webkit-details-marker {
    display: none;
}

.share-wallpaper-help summary::after {
    content: ' ▾';
    font-size: 0.65rem;
    opacity: 0.85;
}

.share-wallpaper-help[open] summary::after {
    content: ' ▴';
}

.share-wallpaper-help .share-hint {
    margin: 6px 0 0 0;
    text-align: center;
    font-size: inherit;
}

/* Print layout helpers for generated cards */
.print-layout {
    display: none;
}

.print-layout.active {
    display: block;
}

.print-page {
    width: 210mm;
    min-height: 297mm;
    padding: 14mm 10mm;
    box-sizing: border-box;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 6mm;
}

.print-card {
    width: 85.6mm;
    height: 53.98mm;
    border: 0.25mm solid #222;
    border-radius: 2mm;
    padding: 1.8mm;
    box-sizing: border-box;
    background: #fff;
    color: #111;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.print-card-title {
    font-size: 3.2mm;
    font-weight: 700;
    text-align: center;
    margin: 0 0 1.1mm 0;
}

.print-month-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8mm;
    flex: 1;
    min-height: 0;
}

.print-mini-month {
    display: flex;
    flex-direction: column;
    border: 0.2mm solid #ddd;
    border-radius: 1mm;
    padding: 0.45mm;
    overflow: hidden;
    min-height: 0;
}

.print-mini-month h4 {
    margin: 0 0 0.25mm 0;
    text-align: center;
    font-size: 1.5mm;
    line-height: 1.2;
    flex: 0 0 auto;
}

.print-mini-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 0.16mm;
    height: 100%;
    min-height: 0;
    flex: 1 1 auto;
}

.print-mini-day {
    font-size: 1.12mm;
    line-height: 1;
    text-align: center;
    border-radius: 0.5mm;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.print-mini-day.off {
    color: #b3b3b3;
}

.print-mini-day.work {
    color: #0f172a !important;
    font-weight: 700;
    background: #bfe3ff;
    border: 0.08mm solid #8fc8f2;
    border-radius: 0.42mm;
    text-shadow: none;
}

.print-mini-day.work-d {
    background: #93c5fd !important;
    border-color: #60a5fa !important;
}

.print-mini-day.work-k,
.print-mini-day.work-m1 {
    background: #fbbf24 !important;
    border-color: #f59e0b !important;
}

.print-mini-day.work-n {
    background: #a78bfa !important;
    border-color: #8b5cf6 !important;
}

@media (max-width: 600px) {
    .share-actions {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .share-button-full {
        height: 40px;
        font-size: 0.82rem;
    }
    
    .share-button-full svg {
        width: 16px;
        height: 16px;
    }
}

@media print {
    @page {
        size: A4 portrait;
        margin: 0;
    }

    body * {
        visibility: hidden !important;
    }
    
    .print-layout,
    .print-layout * {
        visibility: visible !important;
    }
    
    .print-layout {
        position: fixed;
        inset: 0;
        background: #fff;
    }
    
    .print-page {
        page-break-inside: avoid;
    }
}

/* Behold gamle klasser for bakoverkompatibilitet hvis de brukes andre steder */
.calendar-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    margin-bottom: 12px;
    position: relative;
}

.today-control {
    width: 100%;
    text-align: center;
    margin-bottom: 8px;
}

.share-control {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 8px;
}

/* Swipe hint - veldig diskret */
.swipe-hint {
    display: none;
    font-size: 0.6rem;
    font-weight: 400;
    color: #bbb;
    opacity: 0.6;
    letter-spacing: 0.02em;
    line-height: 1.3;
    text-align: center;
    margin-top: 4px;
    width: 100%;
    /* Override any inherited styles */
    -webkit-text-fill-color: #bbb !important;
    background: transparent !important;
    -webkit-background-clip: unset !important;
    background-clip: unset !important;
}

/* Mobile responsive for unified buttons */
@media (max-width: 600px) {
    .calendar-controls-unified {
        gap: 6px;
    }
    
    .unified-nav-button {
        height: 44px;
        font-size: 0.8rem;
        padding: 0 8px;
    }
    
    .share-button-unified svg {
        width: 16px;
        height: 16px;
    }
    
    /* Behold gamle for bakoverkompatibilitet */
    .share-button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .share-button svg {
        width: 16px;
        height: 16px;
    }
}

/* Desktop styling */
@media (min-width: 601px) {
    .swipe-hint {
        display: none !important;
    }

    .month-year-display {
        margin-bottom: 24px;
    }

    .month-name {
        font-size: 2rem;
    }

    .year-name {
        font-size: 1.4rem;
    }
    
    .year-view-active .year-name {
        font-size: 2rem;
    }

    .calendar-controls {
        gap: 16px;
    }

    .calendar-controls .nav-prev,
    .calendar-controls .nav-next {
        width: 52px;
        height: 52px;
        font-size: 1.6rem;
    }

    .calendar-controls .view-toggle {
        padding: 14px 28px;
        font-size: 1rem;
        min-width: 120px;
    }

    .today-button {
        padding: 10px 24px;
        font-size: 0.9rem;
    }
}

/* Stor skjerm - flytt pilene ut til kanten */
@media (min-width: 900px) {
    .container {
        overflow: visible; /* Tillat at pilene kan være utenfor padding */
    }

    .calendar-header {
        position: relative;
        padding-left: 0;
        padding-right: 0;
    }

    .calendar-controls {
        justify-content: center;
        position: relative;
    }

    .calendar-controls .nav-prev {
        position: absolute;
        left: 0px;
        top: 86px;
    }

    .calendar-controls .nav-next {
        position: absolute;
        left: 484px;
        top: 88px;
    }

    /* Year view - plasser knappene helt ut til kantene */
    .container.year-view .calendar-controls .nav-prev {
        left: 0px;
        top: 86px;
    }

    .container.year-view .calendar-controls .nav-next {
        left: auto;
        right: 0px;
        top: 88px;
    }
}

/* Legacy support - hide old elements if they exist */
.calendar-nav,
.calendar-top,
.calendar-top-buttons {
    display: none;
}


/* Responsive grid for year view */
@media (min-width: 1200px) {
    .year-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .year-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 481px) and (max-width: 767px) {
    .year-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile styling */
@media (max-width: 600px) {
    .calendar-header {
        padding: 16px 0;
        margin-bottom: 20px;
    }

    .month-year-display {
        margin-bottom: 20px;
    }

    .month-name {
        font-size: 1.6rem;
    }

    .year-name {
        font-size: 1rem;
    }
    
    .year-view-active .year-name {
        font-size: 1.6rem;
    }

    /* Hide year on very small screens */
    @media (max-width: 400px) {
        .year-name {
            display: none;
        }
        
        .month-name {
            font-size: 1.5rem;
        }
    }

    .calendar-controls {
        gap: 10px;
        margin-bottom: 12px;
    }

    .calendar-controls .nav-prev,
    .calendar-controls .nav-next {
        width: 44px;
        height: 44px;
        font-size: 1.4rem;
    }

    .calendar-controls .view-toggle {
        padding: 11px 18px;
        font-size: 0.9rem;
        min-width: 90px;
    }

    .today-control {
        margin-bottom: 6px;
    }

    .today-button {
        padding: 7px 18px;
        font-size: 0.8rem;
    }

    .swipe-hint {
        display: block !important;
    }

    .container.year-view {
        max-width: 100%;
        padding: 12px;
    }

    .year-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}


/* Kalender rutenett */
.week-number {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    background: #f5f5f5;
    color: #888;
    border: none;
    border-radius: 4px;
    width: 40px;
    margin-right: 5px;
    font-size: 0.8rem;
}

/* Year view week number - smaller and more discrete */
.year-container .week-number {
    width: 28px;
    margin-right: 0;
    font-size: 0.65rem;
    font-weight: 500;
    background: #f5f5f5;
    border: none;
    border-radius: 2px;
    color: #999;
}
.calendar-grid {
    display: grid;
    grid-template-columns: 40px repeat(7, 1fr); /* Legg til plass til ukenummer */
    gap: 4px; /* Juster gap for konsistens */
}

/* Year view specific calendar grid - more compact */
.year-container .calendar-grid {
    grid-template-columns: 28px repeat(7, 1fr);
    gap: 3px;
}


.day {
    position: relative;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #f0f0f0;
    background: #fafafa;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
}

.day:hover {
    border-color: #ddd;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    background: #f5f5f5;
    transform: none;
}

/* Year view specific day cell styling - compact and subtle */
.year-container .day {
    border: 1px solid #f0f0f0;
    background: #fafafa;
    border-radius: 3px;
    min-height: 24px;
}

.year-container .day:hover {
    border-color: #ddd;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transform: none;
    background: #f5f5f5;
}

/* Blank/empty days in year view - visually quiet */
.year-container .day:empty {
    background: transparent;
    border-color: transparent;
    cursor: default;
}

.year-container .day:empty:hover {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.shift-container {
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    z-index: 1;
    pointer-events: none; /* Tillat klikk gjennom til day-elementet */
    justify-content: flex-start;
    align-content: flex-start;
    align-items: flex-start;
}

/* Year view shift container - more compact */
.year-container .shift-container {
    top: 2px;
    left: 2px;
    right: 2px;
    gap: 1px;
}


.day .day-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 500;
    font-size: 0.85rem;
    z-index: 2; /* Sørger for at datoen alltid er synlig */
    pointer-events: none; /* Tillat klikk gjennom til day-elementet */
}

/* Year view day text - smaller and more compact */
.year-container .day .day-text {
    font-size: 0.7rem;
    font-weight: 500;
}

.shift-box {
    flex: 0 0 calc(25% - 2px); /* Fire prikker per rad */
    aspect-ratio: 1 / 1;
    border-radius: 50%;
}

/* Mønsterskift (T/D/K/N/M): bokstav inni prikk (samme farge som profil; bokstav skiller type) */
.shift-box.shift-box--coded {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.shift-box-letter {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-weight: 900;
    line-height: 1;
    pointer-events: none;
    user-select: none;
    color: #fff;
    text-shadow:
        0 0 1px #000,
        0 1px 2px rgba(0, 0, 0, 0.85);
    /* Viktig: ikke bruk cqmin alene — kan bli 0px i noen nettlesere → usynlig tekst */
    font-size: clamp(9px, 1.2vw, 13px);
}

.shift-box.shift-box-mine.shift-box--coded .shift-box-letter,
.shift-box.shift-box-large.shift-box--coded .shift-box-letter {
    font-size: clamp(12px, 1.5vw, 16px);
}

.shift-box-large.shift-box--coded .shift-box-letter {
    font-size: clamp(12px, 3.2vmin, 20px);
}

.year-container .shift-box.shift-box--coded .shift-box-letter {
    font-size: clamp(7px, 0.95vw, 10px);
}

/* Større bokstav i årsvisning når én stor skiftboks (egen turnus) */
.year-container .shift-box-large.shift-box--coded .shift-box-letter {
    font-size: clamp(8px, 1.1vw, 12px);
}

/* Egen turnus når flere vises: større, tynn ring, diskret glød (først i rekkefølge via getShiftsForDate) */
.shift-box.shift-box-mine {
    position: relative;
    z-index: 2;
    flex: 0 0 calc(28% - 2px);
    min-width: 7px;
    min-height: 7px;
    transform: scale(1.14);
    transform-origin: center center;
    box-shadow:
        0 0 0 1.5px rgba(255, 255, 255, 0.94),
        0 0 0 2.5px rgba(0, 0, 0, 0.12),
        0 2px 10px rgba(0, 0, 0, 0.18);
}

.shift-box.shift-box-mine.shift-deviation {
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.88),
        0 0 0 2px rgba(0, 0, 0, 0.14),
        0 2px 10px rgba(0, 0, 0, 0.18);
}

/* Year view shift box - smaller dots */
.year-container .shift-box {
    flex: 0 0 calc(25% - 1px);
    min-width: 4px;
    min-height: 4px;
}

.year-container .shift-box.shift-box-mine {
    flex: 0 0 calc(27% - 1px);
    min-width: 5px;
    min-height: 5px;
    transform: scale(1.12);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.92),
        0 0 0 1.5px rgba(0, 0, 0, 0.11),
        0 1px 5px rgba(0, 0, 0, 0.16);
}

.year-container .shift-box.shift-box--coded {
    transform: scale(1.08);
}

.year-container .shift-box.shift-box-mine.shift-box--coded {
    transform: scale(1.12);
}

.year-container .shift-box.shift-box-mine.shift-deviation {
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.85),
        0 0 0 1.5px rgba(0, 0, 0, 0.12),
        0 1px 5px rgba(0, 0, 0, 0.16);
}

@supports (color: color-mix(in srgb, red, blue)) {
    .shift-box.shift-box-mine {
        box-shadow:
            0 0 0 1.5px rgba(255, 255, 255, 0.94),
            0 0 0 2.5px rgba(0, 0, 0, 0.12),
            0 2px 8px rgba(0, 0, 0, 0.16),
            0 0 14px color-mix(in srgb, var(--mine-shift-fill, #888888) 38%, transparent);
    }

    .shift-box.shift-box-mine.shift-deviation {
        box-shadow:
            0 0 0 1px rgba(255, 255, 255, 0.88),
            0 0 0 2px rgba(0, 0, 0, 0.14),
            0 2px 8px rgba(0, 0, 0, 0.16),
            0 0 12px color-mix(in srgb, var(--mine-shift-fill, #888888) 35%, transparent);
    }

    .year-container .shift-box.shift-box-mine {
        box-shadow:
            0 0 0 1px rgba(255, 255, 255, 0.92),
            0 0 0 1.5px rgba(0, 0, 0, 0.11),
            0 1px 4px rgba(0, 0, 0, 0.14),
            0 0 8px color-mix(in srgb, var(--mine-shift-fill, #888888) 32%, transparent);
    }

    .year-container .shift-box.shift-box-mine.shift-deviation {
        box-shadow:
            0 0 0 1px rgba(255, 255, 255, 0.85),
            0 0 0 1.5px rgba(0, 0, 0, 0.12),
            0 1px 4px rgba(0, 0, 0, 0.14),
            0 0 6px color-mix(in srgb, var(--mine-shift-fill, #888888) 30%, transparent);
    }
}

/* Større visning når kun brukerens egen turnus er synlig: kompakt merke, ikke full bredde */
.shift-box-large {
    flex: 0 0 auto !important;
    aspect-ratio: auto;
    min-width: 1.55rem;
    min-height: 1.35rem;
    width: auto;
    max-width: calc(100% - 6px);
    border-radius: var(--border-radius-sm) !important;
    box-sizing: border-box;
}

.shift-box-large.shift-box--coded {
    padding: 1px 4px;
    border-radius: 5px !important;
}

/*
 * Dato midt i cellen; skift (D/K/N …) øverst til venstre (index + planlegg-forhåndsvisning).
 */
.day:has(.shift-box-large) .day-text {
    top: 50%;
    left: 50%;
    bottom: auto;
    transform: translate(-50%, -50%);
    z-index: 3;
    font-weight: 600;
    text-shadow:
        0 0 3px rgba(255, 255, 255, 0.95),
        0 0 6px rgba(255, 255, 255, 0.85);
}

.day:has(.shift-box-large) .shift-container {
    top: 3px;
    left: 3px;
    right: auto;
    bottom: auto;
    width: auto;
    max-width: 48%;
}

/* Year view: kompakt merke + lesbar dato */
.year-container .shift-box-large {
    min-height: 10px;
    min-width: 12px;
    padding: 0 2px;
    border-radius: 3px !important;
}

.year-container .day:has(.shift-box-large) .day-text {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.74rem;
    font-weight: 600;
}

.year-container .day:has(.shift-box-large) .shift-container {
    top: 2px;
    left: 2px;
    max-width: 46%;
}

.shift-deviation {
    border: 2px solid #000;
    position: relative;
}

.shift-deviation::after {
    content: "";
    position: absolute;
    top: -4px;
    right: -4px;
    width: 6px;
    height: 6px;
    background-color: #000;
    border-radius: 50%;
}

.container.year-view .shift-deviation {
    border-width: 1px;
}
.container.year-view .shift-deviation::after {
    top: -2px;
    right: -2px;
    width: 4px;
    height: 4px;
}

@media (max-width: 600px) {
    .shift-deviation {
        border-width: 1px;
    }
    .shift-deviation::after {
        top: -2px;
        right: -2px;
        width: 4px;
        height: 4px;
    }
}


.today {
    background: rgba(244, 163, 0, 0.12);
    color: var(--primary-color);
    font-weight: 600;
    box-shadow: 0 0 0 2px var(--accent-color);
    border: none;
}

/* Year view today - more subtle highlight */
.year-container .today {
    background: rgba(244, 163, 0, 0.15);
    color: var(--primary-color);
    font-weight: 600;
    box-shadow: 0 0 0 1.5px var(--accent-color);
    border: none;
}

/* Shift mark styling */
.shift-mark {
    position: absolute;
    height: 100%;
    background-color: red;
    border-radius: 8px 0 0 8px;
    top: 0;
    left: 0;
    width: 8px;
    z-index: 0;
}

.day-text {
    position: relative;
    z-index: 1;
}

.red-day {
    background: rgba(255, 240, 240, 0.5);
}

.red-day .day-text {
    color: #cc0000; /* Rød tekst for datoen */
    font-weight: 500;
}

/* Year view red day - subtle background wash */
.year-container .red-day {
    background: rgba(255, 240, 240, 0.6);
}

.year-container .red-day .day-text {
    color: #cc0000;
    font-weight: 500;
}

.holiday-text {
    display: none; /* Skjul tekst - informasjon finnes i popup når man trykker */
    position: absolute;
    bottom: 2px;
    left: 2px;
    right: 2px;
    font-size: 0.35rem;
    line-height: 1;
    color: #ff0000; /* Rød tekst for helligdager */
    font-style: italic;
    z-index: 2;
    white-space: normal;
    overflow: visible;
}

.special-text {
    display: none; /* Skjul tekst - informasjon finnes i popup når man trykker */
    position: absolute;
    bottom: 2px;
    left: 2px;
    right: 2px;
    font-size: 0.35rem;
    line-height: 1;
    color: #555; /* Grå tekst for subtil forskjell */
    font-style: italic;
    z-index: 2;
    white-space: normal;
    overflow: visible;
}

.container.year-view .holiday-text,
.container.year-view .special-text {
    display: none;
}


.day {
    position: relative;
}

/* «Prøv turnus i kalenderen» – kun når bruker ikke er innlogget (styres av session.js / kalender.js) */
#guest-manual-shift-section {
    display: none;
}

body.minturnus-guest #guest-manual-shift-section {
    display: block;
}

body.minturnus-logged-in #guest-manual-shift-section {
    display: none !important;
}

/* Start - Styling for hver rad i turnuslisten */
.shift-form {
    margin: 24px 0;
    padding: 24px;
    text-align: left;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    border: 1px solid #f0f0f0;
    box-shadow: var(--box-shadow);
}

.shift-form h3 {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.guest-manual-shift .guest-shift-lede {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0 0 12px 0;
}

.guest-manual-shift .guest-shift-lede--secondary {
    margin-bottom: 18px;
    font-size: 0.85rem;
}

.guest-manual-shift .guest-shift-lede a {
    color: var(--accent-color);
    text-decoration: underline;
    font-weight: 600;
}

.guest-register-hint {
    margin: 18px 0 0 0;
    padding-top: 16px;
    border-top: 1px solid #eee;
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.guest-register-hint a {
    color: var(--accent-color);
    font-weight: 600;
    text-decoration: underline;
}

.shift-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    transition: var(--transition);
    background: var(--light-color);
    margin-bottom: 8px;
    border-radius: var(--border-radius-sm);
}

.shift-item:hover {
    background: #fafafa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.shift-item > * {
    text-align: center;
    flex: 1;
}

.shift-item input[type="checkbox"] {
    flex: 0.5;
    margin-right: 10px;
}

.shift-item span {
    flex: 2;
}

.shift-item span:nth-child(3) {
    flex: 1;
}

.shift-item button {
    flex: 0.8;
    background: linear-gradient(135deg, var(--secondary-color) 0%, #b8b8b8 100%);
    color: var(--primary-color);
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.shift-item button:hover {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-color-dark) 100%);
    color: var(--light-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 163, 0, 0.3);
}
/* Slutt - Styling for hver rad i turnuslisten */

/* Start - Styling for tittelrad i turnuslisten */
.shift-list-header {
    display: flex;
    justify-content: space-between;
    padding: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, #f8f8f8 0%, #f0f0f0 100%);
    border-bottom: 2px solid var(--accent-color);
    text-align: left;
    margin-top: 24px;
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
    color: var(--primary-color);
}

.shift-header {
    flex: 1;
    padding: 5px;
    color: var(--primary-color);
    text-align: center;
}

.shift-header:first-child {
    flex: 0.5;
    text-align: left;
}

.shift-header:nth-child(2) {
    flex: 2;
}

.shift-header:last-child {
    flex: 0.8;
}
/* Slutt - Styling for tittelrad i turnuslisten */

/* Form styling */
.shift-form label {
    display: block;
    font-weight: 600;
    margin: 16px 0 8px;
    font-size: 0.95rem;
    color: var(--primary-color);
}

.shift-form input, .shift-form select {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 12px;
    border: 2px solid var(--input-border);
    border-radius: var(--border-radius-sm);
    font-size: 0.95rem;
    background: var(--input-bg);
    transition: var(--transition);
    font-family: var(--font-family);
}

.shift-form input:focus, .shift-form select:focus {
    border-color: var(--accent-color);
    outline: none;
    background: var(--light-color);
    box-shadow: 0 0 0 3px rgba(244, 163, 0, 0.1);
}

.shift-form button {
    width: 100%;
    margin-bottom: 12px;
}

.turnus-oversikt {
    margin-top: 24px;
    padding: 20px;
    border: 1px solid #f0f0f0;
    border-radius: var(--border-radius);
    background: linear-gradient(135deg, #f9f9f9 0%, #ffffff 100%);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    box-shadow: var(--box-shadow);
}

.turnus-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background: var(--light-color);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    min-width: 120px;
    flex: 1 1 calc(33.33% - 12px);
    max-width: calc(33.33% - 12px);
    box-sizing: border-box;
    transition: var(--transition);
    border: 1px solid #f0f0f0;
}

.turnus-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.turnus-item .color-box {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border-radius: 4px;
}

@media (max-width: 600px) {
    #turnus-oversikt {
        gap: 5px; /* Mindre avstand mellom elementer */
    }

    .shift-form {
        padding: 10px;
        margin: 15px 0;
    }

    .turnus-item {
        font-size: 12px; /* Mindre skriftstørrelse */
        padding: 5px; /* Mindre padding */
    }

    .color-box {
        width: 15px; /* Mindre fargeboks */
        height: 15px;
    }

    .colleague-display {
        padding: 16px;
    }

    .colleague-chips {
        gap: 6px;
    }

    .colleague-chip {
        font-size: 0.8rem;
        padding: 5px 10px;
    }

    .colleague-selection-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .colleague-quick-select {
        width: 100% !important;
        flex-direction: column !important;
        gap: 8px;
        justify-content: flex-start;
        display: flex !important;
    }

    .quick-select-btn {
        flex: none !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        height: 48px !important;
        padding: 0 12px !important;
        font-size: 0.9rem !important;
        font-weight: 600 !important;
        background: var(--input-bg) !important;
        color: var(--text-color) !important;
        border: 1.5px solid var(--input-border) !important;
        border-radius: 24px !important;
        box-sizing: border-box !important;
        text-align: center !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        transition: all 0.2s ease !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08) !important;
        font-family: var(--font-family) !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .quick-select-btn:hover {
        background: #f5f5f5 !important;
        border-color: var(--accent-color) !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 3px 8px rgba(244, 163, 0, 0.2) !important;
    }

    .quick-select-btn:active {
        transform: translateY(0) !important;
    }

    .quick-select-btn.active {
        background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-color-dark) 100%) !important;
        color: var(--light-color) !important;
        border: none !important;
        box-shadow: 0 3px 10px rgba(244, 163, 0, 0.3) !important;
    }

    .quick-select-btn.active:hover {
        background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-color-dark) 100%) !important;
        border: 1.5px solid var(--accent-color) !important;
        box-shadow: 0 5px 16px rgba(244, 163, 0, 0.4) !important;
    }

    .colleague-panel-btn {
        flex: none !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        height: 48px !important;
        padding: 0 12px !important;
        font-size: 0.9rem !important;
        font-weight: 600 !important;
        background: var(--input-bg) !important;
        color: var(--text-color) !important;
        border: 1.5px solid var(--input-border) !important;
        border-radius: 24px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        transition: all 0.2s ease !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08) !important;
        font-family: var(--font-family) !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        margin-bottom: 0 !important;
    }

    .colleague-panel-btn:hover {
        background: #f5f5f5 !important;
        border-color: var(--accent-color) !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 3px 8px rgba(244, 163, 0, 0.2) !important;
    }

    .colleague-panel-btn:active {
        transform: translateY(0) !important;
    }

    .colleague-selection-panel {
        width: 95%;
        max-height: 90vh;
        padding: 24px;
    }

    .colleague-shortcuts {
        flex-direction: column;
    }

    .shortcut-btn {
        width: 100%;
    }

    .colleague-panel-list {
        max-height: 280px;
    }
    
    .user-shift-toggle {
        display: none !important;
    }
}

/* Always hide user-shift-toggle in colleague selection panel */
#colleague-selection-modal .user-shift-toggle {
    display: none !important;
}
}

/* Ensure dropdown text is readable over colored backgrounds */
option {
    color: #000;
}

/* Kollegavisning på hovedsiden */
.colleague-display {
    margin: 24px 0;
    padding: 20px;
    border: 1px solid #e8e8e8;
    border-radius: var(--border-radius);
    background: var(--card-bg);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.colleague-display-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 500;
}

.colleague-help-text {
    margin: 12px 0;
    padding: 12px 16px;
    background: #f0f7ff;
    border-left: 4px solid var(--accent-color);
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--text-color);
    line-height: 1.5;
}

.colleague-help-text p {
    margin: 0;
}

.colleague-help-text a {
    color: var(--accent-color);
    text-decoration: underline;
    font-weight: 500;
}

.colleague-help-text a:hover {
    text-decoration: none;
}

.colleague-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    min-height: 32px;
}

.colleague-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    font-size: 0.85rem;
    transition: var(--transition);
    cursor: default;
}

.chip-color-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.chip-name {
    color: var(--text-color);
    font-weight: 500;
    display: inline-block;
}

/* Ensure chips are visible and not hidden by other CSS */
.colleague-chip {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.colleague-panel-btn {
    width: auto;
    padding: 10px 20px;
    font-size: 0.9rem;
    margin-top: 0;
    align-self: flex-start;
}

/* Kollegaval-kontroller med hurtigvalg */
.colleague-selection-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
}

.colleague-quick-select {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}

.quick-select-btn {
    padding: 8px 6px;
    background: var(--light-color);
    color: var(--primary-color);
    border: 2px solid var(--secondary-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: clamp(0.65rem, 2vw, 0.8rem);
    font-weight: 600;
    transition: var(--transition);
    font-family: var(--font-family);
    flex: 1 1 0;
    min-width: 0;
    white-space: nowrap;
    box-sizing: border-box;
    text-align: center;
}

.quick-select-btn:hover {
    background: var(--accent-color);
    color: var(--light-color);
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 163, 0, 0.2);
}

.quick-select-btn.active {
    background: var(--accent-color);
    color: var(--light-color);
    border-color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(244, 163, 0, 0.3);
}

.quick-select-btn.active:hover {
    background: var(--accent-color-dark);
    border-color: var(--accent-color-dark);
}

/* Quick toggle for egen turnus */
/* Skjul user-shift-quick-toggle siden vi bruker "Bare meg" knapp i stedet */
.user-shift-quick-toggle {
    display: none !important;
}

.user-shift-quick-toggle-old {
    margin: 0;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--input-border);
    width: 100%;
}

.user-shift-quick-toggle .quick-toggle-label {
    flex: 1;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    margin: 0;
}

.user-shift-quick-toggle input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Kollegaval-panel (modal) */
.colleague-selection-panel {
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.colleague-selection-panel h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
    font-weight: 700;
}

.colleague-panel-search {
    margin-bottom: 16px;
}

.colleague-panel-search input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--input-border);
    border-radius: var(--border-radius-sm);
    font-size: 0.95rem;
    background: var(--input-bg);
    transition: var(--transition);
    font-family: var(--font-family);
}

.colleague-panel-search input:focus {
    border-color: var(--accent-color);
    outline: none;
    background: var(--light-color);
    box-shadow: 0 0 0 3px rgba(244, 163, 0, 0.1);
}

.colleague-shortcuts {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.shortcut-btn {
    flex: 0 1 auto;
    min-width: 100px;
    padding: 10px 16px;
    background: var(--light-color);
    color: var(--primary-color);
    border: 2px solid var(--secondary-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
}

.shortcut-btn:hover {
    background: var(--accent-color);
    color: var(--light-color);
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 163, 0, 0.2);
}

.colleague-panel-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 8px;
    max-height: 350px;
}

.colleague-panel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
    border: 2px solid var(--input-border);
    border-radius: var(--border-radius-sm);
    background: var(--light-color);
    cursor: pointer;
    transition: var(--transition);
}

.colleague-panel-item:hover {
    background: var(--input-bg);
    border-color: var(--accent-color);
    transform: translateX(4px);
}

.colleague-panel-item.selected {
    background: rgba(244, 163, 0, 0.1);
    border-color: var(--accent-color);
}

.panel-color-indicator {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.panel-colleague-name {
    flex: 1;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
}

.panel-colleague-name:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.panel-checkmark {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--accent-color);
    color: var(--light-color);
    font-weight: bold;
    font-size: 1rem;
    flex-shrink: 0;
}

.colleague-panel-item:not(.selected) .panel-checkmark {
    background: var(--input-border);
    color: transparent;
}

.colleague-panel-actions {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--input-border);
}

.colleague-panel-actions .btn {
    width: 100%;
    margin-bottom: 0;
}

/* Legacy styles for backward compatibility */
.colleague-section {
    display: none;
}

.colleague-item {
    display: flex;
    align-items: center;
    padding: 5px 0;
    font-size: 0.9rem;
}

.colleague-name {
    color: var(--accent-color);
    text-decoration: underline;
    cursor: pointer;
}

/* Informational box for the shift form */
.info-box {
    background: linear-gradient(135deg, #fffbea 0%, #fff8dc 100%);
    border-left: 4px solid var(--accent-color);
    padding: 16px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(244, 163, 0, 0.1);
}

.info-box .info-icon {
    font-weight: bold;
    font-size: 1.2rem;
    line-height: 1;
}

.colleague-item input[type="checkbox"] {
    margin-right: 10px;
}

/* Popup when clicking a day */
.day-popup {
    position: absolute;
    background: var(--card-bg);
    border: 1px solid #f0f0f0;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    padding: 20px;
    z-index: 3000;
    max-width: 280px;
    min-width: 240px;
    animation: fadeIn 0.2s ease-out;
    display: flex;
    flex-direction: column;
}

.day-popup.mobile {
    position: fixed !important;
    top: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: calc(100% - 40px) !important;
    max-width: 400px !important;
    max-height: calc(100vh - 40px) !important;
    z-index: 3000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    /* Prevent touch events from reaching background */
    touch-action: none;
    /* Allow scrolling within popup */
    overflow: hidden;
    display: flex !important;
    flex-direction: column;
}

.day-popup.mobile .popup-header {
    flex-shrink: 0;
}

.day-popup.mobile .popup-day-info {
    flex-shrink: 0;
}

.day-popup.mobile .popup-person-list {
    /* Re-enable touch scrolling for the list */
    touch-action: pan-y;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0; /* Important for flex scrolling */
}

.day-popup .close-popup {
    position: absolute;
    top: 8px;
    right: 12px;
    cursor: pointer;
    font-weight: bold;
    font-size: 24px;
    line-height: 1;
    color: var(--text-secondary);
    transition: var(--transition);
    z-index: 10;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.day-popup .close-popup:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
}

/* Topp: Dato + ukedag */
.day-popup .popup-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

.day-popup .popup-date {
    font-weight: 700;
    font-size: 1.2rem;
    text-align: center;
    color: var(--primary-color);
    letter-spacing: -0.02em;
}

/* Midt: Informasjon om dagen (røddag/helligdag/merkedag) */
.day-popup .popup-day-info {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.day-popup .holiday-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.02em;
}

.day-popup .holiday-badge-red {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
    border: 1px solid #ef5350;
}

.day-popup .holiday-badge-special {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    color: #e65100;
    border: 1px solid #ff9800;
}

/* Nederst: Liste over personer som er på jobb */
.day-popup .popup-person-list {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    margin-right: -4px;
    /* Enable smooth scrolling on mobile */
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

/* Scrollbar styling for personliste */
.day-popup .popup-person-list::-webkit-scrollbar {
    width: 6px;
}

.day-popup .popup-person-list::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 3px;
}

.day-popup .popup-person-list::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 3px;
}

.day-popup .popup-person-list::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

.day-popup .popup-person-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: var(--light-color);
    border: 1px solid #f0f0f0;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    min-height: 44px;
}

.day-popup .popup-person-item:hover {
    background: #fafafa;
    border-color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transform: translateX(2px);
}

.day-popup .popup-person-item .color-box {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.day-popup .popup-person-name {
    font-size: 0.95rem;
    color: var(--text-color);
    font-weight: 500;
    line-height: 1.4;
    flex: 1;
}

/* Responsive styling */
@media (max-width: 600px) {
    .day-popup {
        padding: 16px;
        max-width: calc(100% - 40px);
    }
    
    .day-popup .popup-date {
        font-size: 1.1rem;
    }
    
    .day-popup.mobile {
        top: 20px !important;
        bottom: auto !important;
        max-height: calc(100vh - 40px) !important;
    }
    
    .day-popup.mobile .popup-person-list {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        max-height: none;
    }
    
    .day-popup .popup-person-item {
        padding: 12px;
        min-height: 48px;
    }
    
    .day-popup .popup-person-name {
        font-size: 1rem;
    }
}


