/* --- 3 RÓWNE KOLUMNY --- */
.layout-three-columns {
    display: grid;
    grid-template-columns:
            minmax(280px, 1fr)
            minmax(280px, 1fr)
            minmax(280px, 1fr);
    gap: 30px;
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
    text-align: center;
    align-items: start;
}

.left-column,
.middle-column,
.right-column {
    min-width: 0;
}

/* LEWA KOLUMNA — WPISY SKROLUJĄ SIĘ */
.left-column {
    overflow-y: auto;
    max-height: calc(100vh - 80px); /* dynamiczna wysokość */
    padding-right: 10px;
}

/* ŚRODKOWA I PRAWA — STICKY */
.middle-column,
.right-column {
    position: sticky;
    top: 20px;
    height: fit-content;
}

/* GŁÓWNY KONTAINER */
body {
    font-family: 'Inter', Arial, sans-serif;
    background: #f5f7fa;
    margin: 0;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/* RAMKI */
.premium-form {
    background: #ffffff;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    overflow: hidden;
    height: auto;
    min-height: 200px;
    width: 100%;
    box-sizing: border-box;
}

/* INPUTY — wyrównane marginesy */
.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccd1d9;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 15px;
    background: #f9fafc;
    box-sizing: border-box;
}

/* SELECT z ikoną */
.meal-select-with-icon {
    height: 48px;
    padding-left: 52px;
    background-repeat: no-repeat;
    background-position: 12px center;
    background-size: 28px 28px;
}

/* LABEL — wyrównanie do lewej */
label {
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
    text-align: left;
    padding-left: 4px;
}

/* PRZYCISKI */
.premium-btn {
    background: #3498db;
    color: white;
    padding: 12px 18px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    float: right;
    margin-left: 10px;
}

/* PRZYCISKI W LISTACH — PREMIUM */
.delete-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(231,76,60,0.3);
}

.edit-btn {
    background: #f1c40f;
    color: #2c3e50;
    border: none;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(241,196,15,0.3);
}

.file-input {
    display: none; /* ukrywamy natywny input */
}

.file-label {
    background: #3498db;
    color: white;
    padding: 12px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    display: inline-block;     /* KLUCZ — jedna linia */
    width: fit-content;
    text-align: left;
    white-space: nowrap;       /* nie łamie się */
}

.file-name {
    font-size: 14px;
    color: #2c3e50;
    font-weight: 500;
    text-align: left;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-label:hover {
    background: #2980b9;
}

.file-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

/* PREMIUM FILTR WPISÓW */
.filter-select {
    width: 100%;
    max-width: 240px;
    padding: 12px 16px;
    border-radius: 12px;
    border: 2px solid #3498db;
    background: #ecf6ff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 6px 16px rgba(52,152,219,0.2);
}

.filter-select:hover {
    background: #d9edff;
    transform: translateY(-2px);
}

/* PDF */
.pdf-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #e74c3c;
    color: white;
    padding: 12px 18px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    margin: 20px auto;
    width: fit-content;
}

/* LISTA WPISÓW */
.entries {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}

.entry-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: #fff;
    padding: 18px;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.entry-actions {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.premium-alert {
    margin-top: 12px;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.premium-alert-show {
    opacity: 1;
}

.premium-alert-success {
    background-color: #e8f7ec;
    color: #2e7d32;
    border-left: 5px solid #4caf50;
}

.premium-alert-error {
    background-color: #fdecea;
    color: #c62828;
    border-left: 5px solid #e53935;
}

.premium-alert-icon {
    font-size: 20px;
}

#progmanStatus {
    transition: all .3s ease;
}

#progmanStatus.success {
    color: #4CAF50;
}

#progmanStatus.error {
    color: #E53935;
}

.pdf-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.import-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 12px;
}

.premium-date {
    flex: 1;
    height: 78px;

    border: 1px solid #d6dde8;
    border-radius: 22px;

    padding: 0 24px;

    background: #fff;

    font-size: 22px;
    font-weight: 500;

    color: #333;

    box-sizing: border-box;
}

.import-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 12px;
}

.import-row .premium-date {
    flex: 1;
    margin-bottom: 0;
}

.import-row .premium-btn {
    margin-top: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ⭐ pełne wycentrowanie kart posiłków */
.entry-item {
    display: flex;
    align-items: center;
    justify-content: center; /* wycentrowanie poziome */
    gap: 20px; /* odstęp między ikoną, treścią i przyciskami */
    padding: 12px;
}

.entry-content {
    flex: 1;
    text-align: center; /* wyjustowanie tekstu */
}

.entry-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.entry-icon {
    width: 40px;
    height: 40px;
}

.day-header h3 {
    margin-bottom: 10px;
    font-size: 20px;
}

/* ⭐ PREMIUM SNACKBAR */
.snackbar {
    visibility: hidden;
    min-width: 260px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 12px;
    padding: 14px 20px;
    position: fixed;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    font-size: 16px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.4s, bottom 0.4s;
}

.snackbar-show {
    visibility: visible;
    opacity: 1;
    bottom: 50px;
}

.snackbar-success {
    background-color: #4CAF50;
}

.snackbar-error {
    background-color: #E53935;
}

img {
    max-width: 100%;
}

.import-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.import-row .premium-date {
    flex: 1;
    min-width: 0;
}

.import-row .premium-btn {
    flex-shrink: 0;
}

@media (max-width: 768px) {

    .layout-three-columns {
        gap: 12px;
    }

    .premium-form {
        padding: 12px;
    }

    .entry-item {
        padding: 8px;
    }

    .entry-icon {
        width: 22px;
        height: 22px;
    }

    .form-input {
        font-size: 13px;
    }

    .premium-btn,
    .pdf-btn {
        font-size: 12px;
        padding: 8px 10px;
    }

    .day-header h3 {
        font-size: 14px;
    }
}

/* Kolory kart */
.meal-breakfast { border-left: 10px solid #f1c40f; }
.meal-lunch     { border-left: 10px solid #2ecc71; }
.meal-dinner    { border-left: 10px solid #34495e; }
.meal-snack     { border-left: 10px solid #e67e22; }
.meal-other     { border-left: 10px solid #95a5a6; }