:root {
    --surface: #ffffff;
    --header: #EDF2F7; /* Ljus blågrå */
    --border: #CBD5E0; /* Neutral gråblå */
    --input: #F7FAFC; /* Nästan vit */
    --text: #2D3748; /* Djup gråblå, bra kontrast */
    --subtext: #718096; /* Neutral textgrå */
    --highlight: #3182CE; /* Klar blå (används till knappar/länkar) */
    --danger: #E53E3E; /* Röd */
    --success: #38A169; /* Grön */
    --warn: #DD6B20; /* Orangebrun */
    --bg: #F9FAFB; /* Väldigt ljus bakgrund */
}



  table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 4px;
    font-size: 0.9rem;
    background: var(--bg);
  }

  th {
    background: var(--header);
    color: var(--text);
    padding: 8px 12px;
    text-align: left;
  }

  td {
    background: var(--surface);
    padding: 8px 12px;
    vertical-align: top;
  }

  h1, h2 {
    color: var(--text);
  }

  .week-nav a {
    color: var(--highlight);
    font-weight: bold;
    text-decoration: none;
    margin: 0 6px;
  }

  .week-nav a:hover {
    text-decoration: underline;
  }

  .meal-input {
    background: var(--input);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 6px;
    font-size: 0.85rem;
    width: 100%;
  }

  .meal-input.new-entry {
    border-color: var(--warn);
  }

  .meal-input.existing-entry {
    border-color: var(--success);
  }

  .delete-btn {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
  }

  select.meal-input {
    appearance: none;
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    padding: 6px;
    width: 100%;
    font-size: 0.9rem;
  }

.save-menu-btn {
    background: var(--highlight);
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

    .save-menu-btn:hover {
        background: #2B6CB0; /* lite mörkare blå */
    }


  .recent-history {
    background: var(--header);
    border-radius: 8px;
    color: var(--text);
    padding: 16px;
    margin-top: 24px;
  }

  .recent-history table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
  }

  .recent-history th,
  .recent-history td {
    padding: 4px 8px;
    text-align: left;
  }

/* Dag-cell med ikonknapp */
.day-cell {
    min-width: 25px;
    max-width: 20px;
    padding: 8px 12px;
    font-weight: bold;
    vertical-align: top;
}

    .day-cell button {
        margin-right: 6px;
        background: none;
        border: none;
        color: var(--text);
        font-size: 1rem;
        cursor: pointer;
    }

/* Måltidscell och frukost/lunchfält */
.meal-cell {
    padding: 8px 12px;
    vertical-align: top;
}

.meal-entry-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meal-input-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Extra-rad under varje dag */
.extra-row td {
    padding: 0;
}

.extra-meals {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 0;
}

    .extra-meals label {
        font-size: 0.85rem;
        color: var(--subtext);
        min-width: 60px;
    }

/* Kockcell */
.cook-cell {
    padding: 8px 12px;
    vertical-align: top;
}


.highlight {
    background: linear-gradient(270deg, #ff6ec4, #7873f5, #4ade80, #facc15, #f87171);
    background-size: 1000% 1000%;
    animation: rainbow 6s linear infinite;
    border-radius: 4px;
    color: white;
    padding: 2px 4px;
}

@keyframes rainbow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}


.menu-wishlist-wrapper {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    width: 100%;
}

/* Veckomenyn tar 2/3 av bredden */
.weekly-editor {
    flex: 2;
    min-width: 400px;
}

.wishlist {
    max-width: 100%;
    position: sticky;
    top: 1rem;
}

.wishlist-grid {
    display: grid;
    gap: 1rem;
}

.wishlist-card {
    background: #fff;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .wishlist-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 16px rgba(0,0,0,0.15);
    }

.wishlist-header {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.wishlist-meta {
    display: block;
    font-size: 0.85rem;
    color: #666;
}

.wishlist-body {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: #444;
}

.wishlist-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

    .wishlist-actions .btn {
        border: none;
        padding: 0.4rem 0.8rem;
        border-radius: 8px;
        cursor: pointer;
        font-size: 0.85rem;
        display: flex;
        align-items: center;
        gap: 0.3rem;
    }

        .wishlist-actions .btn.import {
            background: #4ade80;
            color: white;
        }

            .wishlist-actions .btn.import:hover {
                background: #22c55e;
            }

        .wishlist-actions .btn.archive {
            background: #f87171;
            color: white;
        }

            .wishlist-actions .btn.archive:hover {
                background: #dc2626;
            }

/* Wishlist + Recent history till höger */
.wishlist-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}



.recent-history {
    background: var(--header);
    border-radius: 8px;
    color: var(--text);
    padding: 16px;
}
/* Wrap för horisontell scroll */
.recent-table-wrapper {
    overflow-x: auto;
}

.recent-history-fullwidth table {
    width: 100%;
    min-width: 600px; /* säkerställer scroll om skärm <600px */
    border-collapse: collapse;
}
/* Mobilanpassning */
@media (max-width: 768px) {
    .menu-wishlist-wrapper {
        flex-direction: column;
        gap: 1rem;
    }

    .weekly-editor {
        flex: 1;
        min-width: auto; /* låt den krympa */
    }

    .wishlist {
        position: static; /* ta bort sticky på mobil */
        width: 100%;
    }

    .wishlist-actions {
        flex-direction: column;
        align-items: stretch;
    }

        .wishlist-actions .btn {
            justify-content: center;
        }

    /* Gör tabeller scrollbara på små skärmar */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    th, td {
        font-size: 0.8rem;
        padding: 6px;
    }

    .day-cell button {
        font-size: 0.9rem;
    }

    /* Gör senaste 4 veckor till ett kort på mobil */
    .recent-history-fullwidth {
        background: var(--surface);
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        padding: 1rem;
        margin-top: 1rem;
        overflow-x: auto; /* egen scroll */
    }

        .recent-history-fullwidth table {
            min-width: 500px; /* så att den triggar scroll */
            font-size: 0.8rem;
        }

        .recent-history-fullwidth h2 {
            font-size: 1rem;
            margin-bottom: 0.5rem;
        }
}
