/* Grundinställningar */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    display: flex;
    background-color: #1a1d20;
    color: #f8f9fa;
    min-height: 100vh;
}

/* Sidomeny */
.sidebar {
    width: 260px;
    background-color: #111315;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid #2a2e33;
    position: fixed;
    height: 100vh;
}

.sidebar-brand {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid #2a2e33;
}

.sidebar-brand h2 {
    font-size: 1.4rem;
    color: #0d6efd; /* Snygg blå accentfärg */
    letter-spacing: 1px;
}

.sidebar-brand span {
    font-size: 0.8rem;
    color: #6c757d;
}

.nav-links {
    list-style: none;
    padding: 1.5rem 0;
    flex-grow: 1;
}

.nav-links li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 1.5rem;
    color: #adb5bd;
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-links li a:hover, .nav-links li a.active {
    color: #fff;
    background-color: #1a1d20;
    border-left: 4px solid #0d6efd;
}

/* Användarstatus i menyn */
.sidebar-user {
    padding: 1.5rem;
    background-color: #0e1011;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #2a2e33;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info i {
    font-size: 1.5rem;
    color: #6c757d;
}

.user-name {
    font-size: 0.9rem;
    font-weight: bold;
}

.user-status {
    font-size: 0.75rem;
    color: #6c757d;
}

.login-btn {
    color: #0d6efd;
    font-size: 1.2rem;
    transition: color 0.2s;
}

.login-btn:hover {
    color: #0a58ca;
}

/* Huvudinnehåll */
.main-content {
    margin-left: 260px; /* Lämnar plats för menyn */
    padding: 3rem;
    width: calc(100% - 260px);
}

.top-header {
    margin-bottom: 3rem;
}

.top-header h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.top-header p {
    color: #6c757d;
}

/* Grid och Kort (Cards) */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
    background-color: #212529;
    border: 1px solid #2a2e33;
    border-radius: 8px;
    padding: 1.5rem;
    position: relative;
    transition: transform 0.2s;
}

.card h3 {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #e9ecef;
}

.card p {
    color: #adb5bd;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Stil för låsta sektioner */
.card.locked {
    opacity: 0.6;
    border-style: dashed;
}

.lock-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: #dc3545;
    color: white;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
}

/* ==========================================================================
   Inloggningssida (login.html)
   ========================================================================== */

/* Centrerar hela sidan på skärmen */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #111315; /* Något mörkare bakgrund här för kontrast */
    min-height: 100vh;
    padding: 20px;
}

/* Centrerar inloggningsboxen på den tillgängliga ytan till höger om sidebaren */
.login-page-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 6rem); /* Tar hänsyn till paddings på main-content */
}

.login-container {
    background-color: #212529;
    border: 1px solid #2a2e33;
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    color: #0d6efd;
    font-size: 2rem;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

.login-header p {
    color: #6c757d;
    font-size: 0.85rem;
}

/* Formulär och inmatning */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.85rem;
    color: #adb5bd;
    font-weight: 500;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 1rem;
    color: #495057;
    font-size: 1rem;
}

.input-wrapper input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.8rem;
    background-color: #1a1d20;
    border: 1px solid #2a2e33;
    border-radius: 6px;
    color: #fff;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

/* Logga in-knapp */
.btn-login {
    background-color: #0d6efd;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.9rem;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: background-color 0.2s;
    margin-top: 0.5rem;
}

.btn-login:hover {
    background-color: #0b5ed7;
}

/* Länk tillbaka */
.login-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #2a2e33;
}

.login-footer a {
    color: #6c757d;
    text-decoration: none;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s;
}

.login-footer a:hover {
    color: #adb5bd;
}

.login-error {
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid #dc3545;
    color: #ea868f;
    padding: 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Styling för länk-korten */
.service-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 1.8rem;
}

.card-icon {
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-info h3 {
    margin-bottom: 0;
    font-size: 1.2rem;
}

.card-info p {
    font-size: 0.85rem;
    color: #6c757d;
}

.service-link {
    color: #0d6efd;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.1s;
}

.service-link:hover {
    color: #0b5ed7;
    text-decoration: underline;
}

/* Styling för Lego-sidan */
.lego-inline-form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.lego-inline-form input, .lego-inline-form select {
    background-color: #1a1d20;
    border: 1px solid #2a2e33;
    border-radius: 6px;
    color: #fff;
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
    flex: 1;
    min-width: 150px;
}

.lego-inline-form input:focus, .lego-inline-form select:focus {
    outline: none;
    border-color: #0d6efd;
}

/* Listor */
.lego-list {
    list-style: none;
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lego-list li {
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: #1a1d20;
    padding: 0.7rem 1rem;
    border-radius: 6px;
    border: 1px solid #2a2e33;
}

.set-badge {
    background-color: #ffc107;
    color: #000;
    font-weight: bold;
    font-size: 0.8rem;
    padding: 3px 8px;
    border-radius: 4px;
    min-width: 60px;
    text-align: center;
}

.set-badge.built {
    background-color: #198754;
    color: #fff;
}

.car-title {
    color: #f8f9fa;
    font-size: 0.95rem;
}

.no-data {
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* Meddelanden */
.alert {
    padding: 0.8rem;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-top: 1rem;
}
.alert-success { background-color: rgba(25, 135, 84, 0.1); border: 1px solid #198754; color: #a3cfbb; }
.alert-danger { background-color: rgba(220, 53, 69, 0.1); border: 1px solid #dc3545; color: #ea868f; }

/* Struktur för raderna i listan */
.lego-list li {
    display: flex;
    justify-content: space-between; /* Skjuter knapparna till höger */
    align-items: center;
    gap: 15px;
}

.lego-item-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.lego-actions {
    display: flex;
    gap: 6px;
}

/* Små funktionsknappar */
.action-btn {
    background-color: #2a2e33;
    border: none;
    color: #0d6efd;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.2s, color 0.2s;
}

.action-btn:hover {
    background-color: #0d6efd;
    color: #fff;
}

.action-btn.check {
    color: #198754;
}
.action-btn.check:hover {
    background-color: #198754;
    color: #fff;
}

.action-btn.delete {
    color: #dc3545;
}
.action-btn.delete:hover {
    background-color: #dc3545;
    color: #fff;
}

/* Färgjusteringar på brickorna */
.set-badge.buy { background-color: #ea868f; color: #000; }
.set-badge.todo { background-color: #ffc107; color: #000; }
.set-badge.built { background-color: #198754; color: #fff; }

/* Styling för bildväljarknappen */
.file-upload-wrapper {
    display: inline-block;
}

.file-label {
    display: inline-block;
    background-color: #1a1d20;
    border: 1px solid #2a2e33;
    border-radius: 6px;
    color: #f8f9fa;
    padding: 0.7rem 1.2rem;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.file-label:hover {
    border-color: #0d6efd;
    color: #0d6efd;
}

/* Miniatyrbilder i listan */
.lego-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover; /* Ser till att bilden inte blir utsträckt */
    border-radius: 6px;
    border: 1px solid #2a2e33;
}

.lego-thumb-placeholder {
    width: 50px;
    height: 50px;
    background-color: #2a2e33;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 1.2rem;
    border: 1px solid #343a40;
}

/* ==========================================================================
   Mobilanpassning (Responsiv design)
   ========================================================================== */

/* Göm mobil-headern på datorer som standard */
.mobile-header {
    display: none;
}
.menu-toggle {
    display: none;
}

@media (max-width: 768px) {
    body {
        flex-direction: column; /* Stapla innehållet vertikalt */
    }

    /* Visa den mobila toppmenyn */
    .mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background-color: #111315;
        padding: 1rem 1.5rem;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 60px;
        z-index: 1000;
        border-bottom: 1px solid #2a2e33;
    }

    .mobile-logo {
        font-size: 1.2rem;
        font-weight: bold;
        color: #0d6efd;
    }

    .menu-icon {
        font-size: 1.5rem;
        color: #adb5bd;
        cursor: pointer;
    }

    /* Gör om sidebaren till en meny som glider in/ner */
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 0; /* Göm menyn helt från början */
        overflow: hidden;
        position: fixed;
        top: 60px; /* Starta precis under mobil-headern */
        left: 0;
        z-index: 999;
        border-right: none;
        border-bottom: 1px solid #2a2e33;
        transition: max-height 0.3s ease-in-out;
    }

    /* När man klickar på hamburgarknappen (checkboxen blir markerad) */
    .menu-toggle:checked ~ .sidebar {
        max-height: 100vh; /* Fäll ut menyn */
    }

    /* Justera huvudinnehållet så det inte hamnar bakom den fasta menyn */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 5rem 1.5rem 2rem 1.5rem; /* Mer padding i toppen (5rem) på grund av mobilmenyn */
    }

    .top-header h1 {
        font-size: 1.8rem;
    }

    /* Gör så att korten (grids) blir en enda kolumn på mobilen */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Justera inloggningssidan på mobilen */
    .login-page-wrapper {
        min-height: calc(100vh - 60px); /* Justera höjden baserat på mobilmenyn (60px) */
        
        /* ÄNDRA FRÅN flex-start TILL center */
        display: flex;
        align-items: center; /* Detta centrerar boxen vertikalt */
        justify-content: center; /* Detta centrerar boxen horisontellt */
        
        /* LÄGG TILL PADDING */
        padding: 2rem 1rem; /* Ger andrum runt boxen så den inte tar i kanterna */
    }

    /* LÄGG TILL DENNA REGEL FÖR ATT VARA SÄKER */
    .login-container {
        /* Se till att boxen inte krockar med menyraden i toppen */
        margin-top: 0; 
        width: 100%;
        max-width: 400px; /* Begränsa bredden lite för snyggare look */
    }
}

/* Lightbox bakgrund (mörknar ner resten av sidan) */
.lightbox {
    display: none; 
    position: fixed;
    z-index: 9999; /* Lägger sig över absolut allt annat */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* Svart med 90% opacitet */
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: fadeIn 0.2s ease-in-out;
}

/* Själva den stora bilden */
.lightbox-content {
    max-width: 85%;
    max-height: 85%;
    border-radius: 8px;
    box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid #2a2e33;
    cursor: default;
    animation: zoomIn 0.2s ease-in-out;
}

/* Stängknappen (krysset uppe till höger) */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.lightbox-close:hover {
    color: #dc3545;
}

/* Snygga animationer för öppning */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { transform: scale(0.95); }
    to { transform: scale(1); }
}

.todo-grid {
    display: grid;
    /* Ändrat auto-fit till auto-fill, och satt ett fast tak på max 360px istället för 1fr */
    grid-template-columns: repeat(auto-fill, minmax(320px, 360px));
    gap: 1.5rem;
    margin-top: 2rem;
    align-items: start;
}

.todo-card {
    background-color: #1a1d20;
    border-radius: 8px;
    padding: 1.2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
    border-top: 4px solid #0d6efd;
    
    /* Säkerhetsspärr för mobiler så kortet inte blir bredare än skärmen */
    width: 100%; 
    box-sizing: border-box;
}
.todo-list-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #2a2e33;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    color: #fff;
}
.todo-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #22252a;
}
.todo-item-left {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    cursor: pointer;
    color: #cfd2d6;
    text-decoration: none;
    flex-grow: 1;
}
.todo-item-left.completed {
    text-decoration: line-through;
    color: #6c757d;
}
.todo-item-left i {
    font-size: 1.1rem;
}
.input-inline-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}
.input-inline-group input {
    flex-grow: 1;
    padding: 0.5rem;
    border: 1px solid #2a2e33;
    background-color: #111315;
    color: #fff;
    border-radius: 4px;
}
.btn-todo-add {
    background-color: #0d6efd;
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}
.btn-todo-add:hover {
    background-color: #0b5ed7;
}

.todo-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3) !important;
}

/* CSS för Dashboard-layouten */
.welcome-section {
    margin-bottom: 2rem;
}
.welcome-section h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    color: #fff;
}
.welcome-section p {
    color: #a0a0a0;
    font-size: 1.1rem;
}

/* Grid-system för widgets */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.widget-card {
    background-color: #212529;
    border: 1px solid #2a2e33;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, border-color 0.2s;
}
.widget-card:hover {
    transform: translateY(-3px);
    border-color: #0d6efd;
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.widget-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}
.widget-header i {
    font-size: 1.4rem;
}

.widget-body {
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

.widget-footer {
    border-top: 1px solid #2a2e33;
    padding-top: 0.75rem;
    display: flex;
    justify-content: flex-end;
}
.widget-link {
    color: #0d6efd;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}
.widget-link:hover {
    text-decoration: underline;
}

/* Server-mätare (Progress bar) */
.progress-bar-bg {
    background-color: #1a1d20;
    border-radius: 4px;
    height: 12px;
    width: 100%;
    margin-top: 0.5rem;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease-in-out;
}

/* Snabblänkar list-styling */
.shortcut-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.shortcut-list li {
    margin-bottom: 0.75rem;
}
.shortcut-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #cfd2d6;
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 4px;
    background-color: #1a1d20;
}
.shortcut-list a:hover {
    background-color: #2a2e33;
    color: #fff;
}

/* CSS-justeringar för en mer kompakt och lättläst layout */
.sub-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 30px; 
    max-width: 1200px; 
    align-items: start; 
    margin: 0; /* Ändrat från margin: 0 auto till margin: 0 */
}
.sub-list { 
    background: #1a1d20; 
    padding: 20px; 
    border-radius: 8px; 
    border: 1px solid #2a2e33;
    width: 100%; /* Säkerställer att de fyller ut tillgänglig bredd */
    overflow-x: hidden; /* Förhindrar horisontell scroll */
}

/* Flexbox-struktur för att få till punktlinjerna */
.sub-item { 
    display: flex; 
    align-items: center; 
    padding: 12px 0; 
    border-bottom: 1px solid #2a2e33; 
    flex-wrap: nowrap;
}
.sub-item:last-child { 
    border-bottom: none; 
}
.sub-name {
    display: flex;
    align-items: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 10px;
}
.sub-dots {
    flex-grow: 1;
    border-bottom: 2px dotted #3a3f45;
    margin: 0 10px;
    min-width: 10px; /* Gör att den kan krympa om det behövs */
}
.sub-price-actions {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.sub-total { 
    display: flex; 
    justify-content: space-between; 
    padding-top: 15px; 
    margin-top: 10px; 
    border-top: 2px solid #3a3f45; 
    font-weight: bold; 
    font-size: 1.1rem; 
    color: #fff; 
}

/* Formulär-styling */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; color: #a0a0a0; font-size: 0.9rem; }
.form-group input, .form-group select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.btn { background: #0d6efd; color: #fff; border: none; padding: 10px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; }
.btn:hover { background: #0b5ed7; }
.btn-danger { background: #dc3545; padding: 5px 10px; font-size: 0.8rem; text-decoration: none; border-radius: 4px; color: white; }
.btn-edit { background: #ffc107; color: #000; padding: 5px 10px; font-size: 0.8rem; text-decoration: none; border-radius: 4px; margin-right: 5px; }

@media (max-width: 480px) {
    .main-content {
        padding: 1.5rem !important; /* Minskar padding på mobilen för mer plats */
    }
    .sub-price-actions {
        flex-direction: column; /* Staplar knappar om det blir för trångt */
        align-items: flex-end;
    }
}

.calendar-wrapper {
    max-width: 1400px; 
    margin: 20px auto;
    padding: 20px;
}
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}
.calendar-header h2 {
    margin: 0;
    text-transform: capitalize;
    color: #ffc107;
}
.calendar-btn {
    background-color: #1a1d20;
    color: #fff;
    border: 1px solid #2a2e33;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
}
.calendar-btn:hover {
    background-color: #ffc107;
    color: #000;
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
    padding: 12px;
    background-color: #212529;
    border: 1px solid #2a2e33;
    border-radius: 6px;
}
.legend-item {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 500;
    color: #fff;
}
.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    display: inline-block;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    min-height: 650px; 
}
.weekday-header {
    background-color: #1a1d20;
    color: #fff;
    font-weight: bold;
    text-align: center;
    padding: 10px 0;
    border-radius: 4px;
    font-size: 0.9rem;
}

.calendar-day {
    background-color: #212529;
    border: 1px solid #2a2e33;
    height: 100%;
    min-height: 130px; 
    box-sizing: border-box;
    padding: 6px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.calendar-day.empty {
    background-color: transparent;
    border: none;
}
.calendar-day.today {
    border: 2px solid #ffc107;
    background: rgba(255, 193, 7, 0.02);
}
.day-number {
    font-weight: bold;
    color: #fff;
    font-size: 0.9rem;
    margin-bottom: 5px;
    flex-shrink: 0;
}

.job-container {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 2px;
}
.job-container::-webkit-scrollbar { width: 4px; }
.job-container::-webkit-scrollbar-thumb { background: #2a2e33; border-radius: 4px; }

/* NY UPPDATERAD STYLING MED TEXT-SHADOW */
.activity-item {
    font-size: 0.75rem;
    padding: 4px 6px;
    border-radius: 4px;
    margin-bottom: 4px;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    cursor: pointer;
    
    /* ÄNDRAT: Vit text med en mörk kontur/skugga runt bokstäverna */
    color: #ffffff; 
    font-weight: bold; 
    text-shadow: 
        -1px -1px 0 #000,  
         1px -1px 0 #000,
        -1px  1px 0 #000,
         1px  1px 0 #000,
         0px  2px 4px rgba(0,0,0,0.8); /* Ger extra djup och kontrast */
}
.activity-item:hover { opacity: 0.9; }

/* MODAL STYLING */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.modal-content {
    background-color: #212529;
    border: 1px solid #2a2e33;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    position: relative;
}
.modal-close {
    position: absolute;
    top: 15px; right: 20px;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
}
.modal-close:hover { color: #fff; }
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; margin-bottom: 0.5rem; color: #a0a0a0; font-size: 0.9rem; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 0.6rem; background-color: #1a1d20; border: 1px solid #2a2e33; border-radius: 4px; color: #fff;
}
.checkbox-group { display: flex; align-items: center; gap: 10px; margin-top: 0.5rem; }
.checkbox-group input { width: auto; }

/* MOBILANPASSNING */
@media (max-width: 768px) {
    .calendar-wrapper { padding: 10px; }
    .calendar-header h2 { font-size: 1.2rem; }
    .calendar-btn { padding: 6px 10px; font-size: 0.85rem; }
    .calendar-legend { gap: 10px; justify-content: flex-start; }
    .weekday-header { display: none; }
    .calendar-grid { grid-template-columns: 1fr; gap: 10px; min-height: auto; }
    .calendar-day.empty { display: none; }
    .calendar-day.hide-mobile { display: none; }
    
    .calendar-day {
        height: auto; min-height: 50px; flex-direction: row; align-items: flex-start; padding: 10px;
    }
    .day-number {
        width: 35px; height: 35px; background-color: #1a1d20; border-radius: 50%;
        display: flex; align-items: center; justify-content: center; margin-bottom: 0; margin-right: 12px; font-size: 1rem;
    }
    .job-container { flex-grow: 1; }
    .activity-item { font-size: 0.85rem; padding: 8px 10px; margin-bottom: 6px; white-space: normal; }
}