/* ============================================================
   Kalorie — styl Makro Rounded
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #556b2f;
    --primary-dark: #3d4d22;
    --primary-light: #e8ecd5;
    --accent: #8ba354;
    --accent-bright: #a8c46a;
    --text: #2c2f22;
    --text-muted: #7a7d68;
    --bg: #fafaf3;
    --card: #ffffff;
    --border: #e5e3d1;
    --border-strong: #cccccc;
    --success: #16a34a;
    --success-bg: #dcfce7;
    --danger: #dc2626;
    --danger-bg: #fee2e2;
    --warning: #d97706;
    --warning-bg: #fef3c7;
    --info: #0891b2;
    --info-bg: #cffafe;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-pill: 999px;
    --shadow-sm: 0 1px 2px rgba(45,80,22,0.04), 0 1px 3px rgba(45,80,22,0.06);
    --shadow: 0 2px 6px rgba(45,80,22,0.06), 0 4px 12px rgba(45,80,22,0.04);
    --shadow-lg: 0 6px 16px rgba(45,80,22,0.1), 0 12px 32px rgba(45,80,22,0.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
}

a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--primary-dark); }
hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
h1, h2, h3, h4 { color: var(--primary-dark); margin-top: 0; }
h1 { font-size: 1.5em; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }
h2 { font-size: 1.15em; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-top: 24px; margin-bottom: 12px; }
h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 12px; }

/* HEADER */
.app-header {
    background: var(--primary-dark);
    border-bottom: 3px solid var(--primary);
    padding: 12px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-wrap: wrap;
    gap: 12px;
}
.app-logo {
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.15em;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: color 0.15s;
}
.app-logo:hover { color: var(--accent-bright); }
.app-nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; margin-left: 24px; }
.app-nav a {
    display: block;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px solid transparent;
    border-radius: var(--radius-pill);
    transition: all 0.15s;
}
.app-nav a:hover { color: #fff; background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.3); }
.app-nav a.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.app-header-right { display: flex; align-items: center; gap: 10px; font-size: 14px; color: rgba(255,255,255,0.85); margin-left: auto; }
.nav-profile { position: relative; }
.nav-profile > summary {
    cursor: pointer;
    list-style: none;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    padding: 8px 16px;
    background: rgba(255,255,255,0.12);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-pill);
    transition: all 0.15s;
    user-select: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.nav-profile > summary::-webkit-details-marker { display: none; }
.nav-profile > summary::after { content: " ▾"; }
.nav-profile[open] > summary::after { content: " ▴"; }
.nav-profile > summary:hover { background: rgba(255,255,255,0.22); border-color: var(--accent); }
.nav-profile-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    min-width: 240px;
    box-shadow: var(--shadow-lg);
    z-index: 200;
    padding: 6px;
}
.nav-profile-menu a {
    display: block;
    padding: 10px 14px;
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all 0.15s;
}
.nav-profile-menu a:hover { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.nav-profile-menu hr { margin: 6px 0; border-top: 1px solid var(--border); }

/* LAYOUT */
.app-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    max-width: 1300px;
    width: 100%;
    margin: 24px auto;
    padding: 0 20px;
    flex: 1;
}
@media (max-width: 900px) { .app-layout { grid-template-columns: 1fr; } }
.sidebar { display: flex; flex-direction: column; gap: 16px; height: fit-content; position: sticky; top: 80px; }
@media (max-width: 900px) { .sidebar { position: static; } }
.day-panel { display: flex; flex-direction: column; gap: 16px; }

/* KARTY */
.card {
    background: #fff;
    border: 1px solid var(--border-strong);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}
.card:hover { border-left-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }

/* PRZYCISKI */
.btn {
    display: inline-block;
    padding: 9px 18px;
    font-size: 12px;
    font-weight: 700;
    font-family: inherit;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px solid transparent;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.15s;
    background: transparent;
    color: var(--text);
    line-height: 1.4;
}
.btn:disabled, .btn.disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(85,107,47,0.25);
}
.btn-secondary { background: #fff; color: var(--primary); border-color: var(--primary); }
.btn-secondary:hover:not(:disabled) { background: var(--primary); color: #fff; }
.btn-danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 11px; }
.btn-lg { padding: 12px 26px; font-size: 14px; }

/* FORMULARZE */
.form-group, form > p { margin-bottom: 16px; }
label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="search"],
select, textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-strong);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    background: #fff;
    color: var(--text);
    transition: all 0.15s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}
input:disabled, select:disabled, textarea:disabled {
    background: #f4f5ea;
    color: var(--text-muted);
    cursor: not-allowed;
    border-style: dashed;
}
textarea { resize: vertical; min-height: 80px; }

/* TABELE */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin: 16px 0;
}
th {
    text-align: left;
    padding: 12px 16px;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: var(--primary);
}
td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr { transition: all 0.15s; }
tbody tr:hover td { background: var(--primary-light); }
tbody tr:last-child td { border-bottom: none; }

/* ALERTY */
.flash, .alert {
    padding: 14px 18px;
    margin-bottom: 16px;
    border-radius: var(--radius);
    border-left: 4px solid var(--accent);
    background: #fff;
    font-weight: 500;
}
.flash-success, .alert-success { border-left-color: var(--success); background: var(--success-bg); color: #14532d; }
.flash-error, .alert-error { border-left-color: var(--danger); background: var(--danger-bg); color: #7f1d1d; }
.flash-info, .alert-info { border-left-color: var(--info); background: var(--info-bg); color: #164e63; }
.flash-warning, .alert-warning { border-left-color: var(--warning); background: var(--warning-bg); color: #78350f; }

/* INFO BOX */
.info-box { background: #f9faf5; border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 10px 14px; margin: 12px 0; }
.info-box summary { cursor: pointer; font-weight: 700; color: var(--primary); list-style: none; user-select: none; font-size: 14px; }
.info-box summary::-webkit-details-marker { display: none; }
.info-box summary::before { content: "ℹ️ "; }
.info-box[open] summary::before { content: "🔽 "; }
.info-box[open] summary { margin-bottom: 12px; }
.info-content { padding-top: 12px; border-top: 1px solid var(--border); font-size: 14px; line-height: 1.7; }
.info-content pre {
    background: #fff;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 13px;
    margin: 8px 0;
}

/* METRYKI */
.metric { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.metric-card {
    background: #fff;
    border: 1px solid var(--border-strong);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 18px;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}
.metric-card:hover { border-left-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.metric-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}
.metric-value { font-size: 1.6em; font-weight: 800; color: var(--primary); }


/* ============================================================
   KALENDARZ
   ============================================================ */
.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.calendar-nav h2 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-dark);
    margin: 0;
}
.calendar-nav button {
    background: #fff;
    border: 2px solid var(--border-strong);
    width: 34px;
    height: 34px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.15s;
    color: var(--primary);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}
.calendar-nav button:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.calendar-weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: 36px;      /* ← NOWE: równa wysokość każdego rzędu */
    gap: 4px;
}

.calendar-weekdays span {
    text-align: center;
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 700;
    padding: 6px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.calendar-day {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
    width: 100%;
    min-width: 0;
    height: 100%;               /* ← NOWE: wypełnia rząd z grid-auto-rows */
}

.calendar-day:hover:not(.empty) {
    background: var(--primary-light);
}
.calendar-day.empty {
    cursor: default;
    pointer-events: none;
    visibility: hidden;         /* ← NOWE: zajmuje miejsce, ale jest niewidoczna */
}
.calendar-day.today {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 700;
}
.calendar-day.selected {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(85,107,47,0.3);
}


/* ============================================================
   QUICK STATS
   ============================================================ */
.quick-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.quick-stat:last-child { border-bottom: none; }
.quick-stat-label { color: var(--text-muted); font-weight: 600; }
.quick-stat-value { font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }

/* DAY HEADER */
.day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 16px 20px;
    border: 1px solid var(--border-strong);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-lg);
    gap: 12px;
    box-shadow: var(--shadow-sm);
}
.day-header h1 {
    font-size: 1.3em;
    font-weight: 800;
    color: var(--primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}
.day-header input[type="date"] {
    padding: 8px 14px;
    border: 2px solid var(--border-strong);
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--text);
    transition: all 0.15s;
    border-radius: var(--radius);
    width: auto;
}
.day-header input[type="date"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

/* GOALS */
.goals-panel {
    background: #fff;
    border: 1px solid var(--border-strong);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    transition: all 0.15s;
    box-shadow: var(--shadow-sm);
}
.goals-panel:hover { border-left-color: var(--accent); }
.goals-panel h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-dark);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.goal-row {
    display: grid;
    grid-template-columns: 130px 1fr 130px;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}
.goal-row:last-child { margin-bottom: 0; }
.goal-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.goal-values {
    font-size: 13px;
    font-weight: 800;
    color: var(--primary);
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.progress {
    height: 14px;
    background: var(--primary-light);
    border: 1px solid var(--border);
    overflow: hidden;
    position: relative;
    border-radius: var(--radius-pill);
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--primary));
    transition: width 0.4s ease;
    border-radius: var(--radius-pill);
}
.progress-bar.warn { background: linear-gradient(90deg, #fbbf24, var(--warning)); }
.progress-bar.over { background: linear-gradient(90deg, #f87171, var(--danger)); }

/* ============================================================
   PASEK WIDEŁEK (min / cel / max)
   ============================================================ */

.widelki-row {
    display: grid;
    grid-template-columns: 130px 1fr 150px;
    align-items: center;
    gap: 20px;
    margin-bottom: 22px;
}

.widelki-row:last-child {
    margin-bottom: 0;
}

.widelki-name {
    font-size: 12px;
    font-weight: 800;
    color: var(--primary-dark);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.widelki-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-dark);
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.widelki-value .current {
    font-size: 15px;
}

.widelki-value .cel {
    color: var(--text-muted);
    font-weight: 500;
}

.widelki-wrapper {
    position: relative;
    padding: 8px 0;
}

.widelki-pasek {
    position: relative;
    height: 22px;
    background: #f3f4f6;
    border-radius: 999px;
    overflow: hidden;
    cursor: help;
}

.widelki-strefa {
    position: absolute;
    top: 0;
    bottom: 0;
    background: #dcfce7;
    z-index: 1;
    transition: all 0.3s;
}

.widelki-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 2;
    border-radius: 999px 0 0 999px;
    transition: all 0.3s ease;
    max-width: 100%;
}

.widelki-fill.state-ok {
    background: linear-gradient(90deg, #bbf7d0, #16a34a);
}

.widelki-fill.state-low {
    background: linear-gradient(90deg, #fde68a, #d97706);
}

.widelki-fill.state-critical {
    background: linear-gradient(90deg, #fca5a5, #dc2626);
}

.widelki-marker {
    position: absolute;
    top: -2px;
    bottom: -2px;
    width: 2px;
    z-index: 4;
}

.widelki-marker.min {
    background: #6b7280;
    border-radius: 1px;
}

.widelki-marker.cel {
    background: var(--primary-dark);
    width: 3px;
    box-shadow: 0 0 0 1px #fff;
    border-radius: 1px;
}

.widelki-marker.max {
    background: #6b7280;
    border-radius: 1px;
}

/* Tooltip */
.widelki-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    background: #1f2937;
    color: #fff;
    font-size: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    line-height: 1.5;
}

.widelki-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
}

.widelki-wrapper:hover .widelki-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.widelki-tooltip .tt-tytul {
    font-weight: 800;
    font-size: 13px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

.widelki-tooltip .tt-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 4px;
}

.widelki-tooltip .tt-row:last-child {
    margin-bottom: 0;
}

.widelki-tooltip .tt-row .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.widelki-tooltip .tt-row .dot-min { background: #9ca3af; }
.widelki-tooltip .tt-row .dot-cel { background: #fff; }
.widelki-tooltip .tt-row .dot-max { background: #9ca3af; }

.widelki-tooltip .tt-comment {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.15);
    font-size: 12px;
    font-weight: 700;
}

.widelki-tooltip .tt-comment.success { color: #86efac; }
.widelki-tooltip .tt-comment.warning { color: #fcd34d; }
.widelki-tooltip .tt-comment.danger { color: #fca5a5; }

/* Responsywność */
@media (max-width: 720px) {
    .widelki-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .widelki-value {
        text-align: left;
    }

    .widelki-tooltip {
        left: 0;
        transform: translateX(0) translateY(6px);
        max-width: calc(100vw - 60px);
        white-space: normal;
    }

    .widelki-tooltip::after {
        left: 40px;
    }

    .widelki-wrapper:hover .widelki-tooltip {
        transform: translateX(0) translateY(0);
    }
}



/* MEALS */
.meal-section {
    background: #fff;
    border: 1px solid var(--border-strong);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}
.meal-section:hover { border-left-color: var(--accent); box-shadow: var(--shadow); }
.meal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: var(--primary-light);
    border-bottom: 2px solid var(--primary);
    gap: 12px;
}
.meal-title { display: flex; align-items: center; gap: 10px; }
.meal-header h3 {
    font-size: 13px;
    font-weight: 800;
    color: var(--primary-dark);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0;
}
.meal-sum {
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    background: var(--primary);
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-variant-numeric: tabular-nums;
}
.meal-actions { display: flex; gap: 8px; align-items: center; }
.btn-add {
    background: var(--primary);
    color: #fff;
    border: 2px solid var(--primary);
    padding: 6px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    border-radius: var(--radius-pill);
}
.btn-add:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(85,107,47,0.3);
}
.meal-entries { padding: 0 18px; }
.entry {
    display: grid;
    grid-template-columns: 1fr auto auto auto auto;
    align-items: center;
    gap: 14px;
    padding: 12px 8px;
    border-bottom: 1px solid var(--border);
    transition: all 0.15s;
    border-radius: var(--radius-sm);
}
.entry:last-child { border-bottom: none; }
.entry:hover {
    background: var(--primary-light);
    padding-left: 12px;
    padding-right: 12px;
}
.entry-name { font-size: 14px; font-weight: 600; color: var(--text); }
.entry-masa { font-size: 12px; color: var(--text-muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.entry-kcal { font-size: 14px; font-weight: 800; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.entry-makro { font-size: 11px; color: var(--text-muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.btn-del {
    background: #fff;
    border: 2px solid var(--danger);
    color: var(--danger);
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.15s;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    border-radius: var(--radius-pill);
}
.btn-del:hover {
    background: var(--danger);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(220,38,38,0.3);
}
.empty-meal {
    color: var(--text-muted);
    font-size: 12px;
    padding: 16px 0;
    font-style: italic;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* SUMMARY */
.summary-panel {
    background: var(--primary-dark);
    color: #fff;
    border: 1px solid var(--primary-dark);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-lg);
}
.summary-panel h3 {
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 18px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-bright);
}
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
}
.summary-item { display: flex; flex-direction: column; gap: 4px; }
.summary-label {
    font-size: 11px;
    color: var(--accent-bright);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    line-height: 1.2;
}
.summary-label .ico {
    display: inline-block;
    width: 14px;
    text-align: center;
    margin-right: 4px;
}
.summary-value {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    font-variant-numeric: tabular-nums;
    padding-left: 18px;   /* wyrównanie do tekstu etykiety (14px emoji + 4px odstęp) */
    line-height: 1.1;
}
.summary-value small { font-size: 13px; font-weight: 500; color: var(--accent-bright); margin-left: 2px; }
.summary-remaining {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.15);
    font-size: 14px;
    color: rgba(255,255,255,0.85);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}
.summary-remaining strong { color: var(--accent-bright); font-size: 18px; }

/* TOAST */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
    pointer-events: none;
}
.toast {
    background: #fff;
    border: 1px solid var(--border-strong);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 14px 20px;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    min-width: 260px;
    font-size: 14px;
    font-weight: 500;
    pointer-events: auto;
}
.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-info { border-left-color: var(--info); }
@keyframes toastIn { from { transform: translateX(400px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(400px); opacity: 0; } }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(44,47,34,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }

.modal {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s ease;
}
.modal-lg { max-width: 620px; }

@keyframes modalIn {
    from { transform: scale(0.95) translateY(10px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}
.modal h3 {
    margin-top: 0;
    color: var(--primary-dark);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 15px;
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-pill);
    transition: all 0.15s;
}
.modal-close:hover { background: var(--primary-light); color: var(--primary-dark); }

/* Wyszukiwarka produktów w modalu */
.prod-search-bar { display: flex; gap: 10px; margin-bottom: 16px; }
.prod-search-results {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px;
    background: #fafaf3;
}
.prod-search-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
}
.prod-search-item:hover { background: var(--primary-light); }
.prod-search-item .name { font-size: 14px; font-weight: 600; color: var(--text); }
.prod-search-item .kcal { font-size: 13px; font-weight: 700; color: var(--primary-dark); font-variant-numeric: tabular-nums; }

/* Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* EMPTY */
.empty { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.empty-icon { font-size: 3em; margin-bottom: 12px; opacity: 0.5; }
.empty h3 { color: var(--primary-dark); margin: 0 0 8px; }

/* FOOTER */
.main-footer {
    background: #fff;
    border-top: 1px solid var(--border);
    padding: 16px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 40px;
}
.footer-container { max-width: 1300px; margin: 0 auto; }

/* FAB */
.fab {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: 2px solid var(--primary-dark);
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(85,107,47,0.4);
    z-index: 90;
    transition: all 0.2s;
    font-family: inherit;
}
.fab:hover {
    background: var(--primary-dark);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 24px rgba(85,107,47,0.5);
}
@media (max-width: 900px) { .fab { display: flex; align-items: center; justify-content: center; } }

/* RESPONSYWNOŚĆ */
@media (max-width: 768px) {
    .app-header { padding: 12px 16px; }
    .app-nav { margin-left: 12px; order: 3; width: 100%; margin-top: 8px; }
    .app-nav a { padding: 6px 10px; font-size: 11px; }
    .app-layout { padding: 0 12px; margin: 16px auto; }
    h1 { font-size: 1.25em; }
    th, td { padding: 10px 12px; }
    .toast-container { left: 16px; right: 16px; bottom: 16px; }
    .toast { min-width: auto; }
    .calendar-day { font-size: 12px; }
}

/* ============================================================
   TABELA PRODUKTÓW (my_products.php)
   ============================================================ */

.products-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #fff;
    margin: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.products-table thead {
    background: var(--primary);
}

.products-table th {
    text-align: left;
    padding: 12px 14px;
    color: #fff;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: var(--primary);
    white-space: nowrap;
}

.products-table th a {
    color: #fff;
    text-decoration: none;
    display: inline-block;
    transition: opacity 0.15s;
}

.products-table th a:hover {
    opacity: 0.8;
}

.products-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    font-size: 13px;
}

.products-table tbody tr {
    transition: background 0.15s;
}

.products-table tbody tr:hover td {
    background: var(--primary-light);
}

.products-table tbody tr:last-child td {
    border-bottom: none;
}

.products-table .badge {
    font-size: 10px;
    padding: 3px 8px;
}

.products-table .btn-sm {
    padding: 5px 10px;
    font-size: 14px;
    line-height: 1;
}

/* Responsywność — na mobile tabela się przewija */
@media (max-width: 768px) {
    .products-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .products-table {
        min-width: 800px;
    }
}


/* ============================================================
   DRAG & DROP — sortowanie płynów
   ============================================================ */

.fluid-sortable {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px;
}

.fluid-sortable-item {
    display: grid;
    grid-template-columns: 30px 30px 1fr 100px 60px 70px;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f9faf5;
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius);
    transition: all 0.15s;
    cursor: default;
}

.fluid-sortable-item:hover {
    background: var(--primary-light);
    border-left-color: var(--accent);
}

.fluid-sortable-item.dragging {
    opacity: 0.4;
    border-left-color: var(--accent);
    box-shadow: 0 4px 12px rgba(85, 107, 47, 0.2);
}

.drag-handle {
    font-size: 20px;
    color: var(--primary);
    cursor: grab;
    user-select: none;
    text-align: center;
    font-weight: bold;
    line-height: 1;
    transition: color 0.15s;
}

.drag-handle:hover {
    color: var(--accent);
}

.drag-handle:active {
    cursor: grabbing;
}

.fluid-checkbox {
    display: flex;
    justify-content: center;
    margin: 0;
}

.fluid-checkbox input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.fluid-name {
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
}

.fluid-type {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.pozycja-manual {
    width: 60px !important;
    padding: 6px 8px !important;
    font-size: 13px !important;
    text-align: center;
    background: #fff !important;
}

@media (max-width: 720px) {
    .fluid-sortable-item {
        grid-template-columns: 30px 30px 1fr 60px;
        grid-template-areas:
            "handle check name pos"
            "handle check type pos";
    }

    .fluid-type {
        display: none;
    }
}


/* ============================================================
   ANIMOWANE TŁO — emoji jedzenia (dla login.php)
   ============================================================ */

.food-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.food-bg span {
    position: absolute;
    bottom: -80px;
    font-size: 48px;
    opacity: 0;
    animation: floatUp linear infinite;
    will-change: transform, opacity;
    user-select: none;
    filter: blur(0.3px);
}




@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg) scale(0.8);
        opacity: 0;
    }
    10% {
        opacity: 0.14;
    }
    50% {
        transform: translateY(-50vh) rotate(180deg) scale(1);
        opacity: 0.22;
    }
    90% {
        opacity: 0.14;
    }
    100% {
        transform: translateY(-110vh) rotate(360deg) scale(0.8);
        opacity: 0;
    }
}

.calorie-bubble {
    position: fixed;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 163, 84, 0.18), rgba(139, 163, 84, 0));
    pointer-events: none;
    z-index: 0;
    animation: bubblePulse ease-in-out infinite;
    will-change: transform, opacity;
}

.calorie-bubble:nth-child(1) { top: 15%; left: 10%; width: 220px; height: 220px; animation-duration: 8s;  animation-delay: 0s;  }
.calorie-bubble:nth-child(2) { top: 60%; left: 80%; width: 180px; height: 180px; animation-duration: 11s; animation-delay: 2s;  }
.calorie-bubble:nth-child(3) { top: 30%; left: 70%; width: 260px; height: 260px; animation-duration: 14s; animation-delay: 4s;  }
.calorie-bubble:nth-child(4) { top: 75%; left: 20%; width: 200px; height: 200px; animation-duration: 10s; animation-delay: 1s;  }
.calorie-bubble:nth-child(5) { top:  5%; left: 50%; width: 160px; height: 160px; animation-duration: 12s; animation-delay: 3s;  }

@keyframes bubblePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.25);
        opacity: 0.8;
    }
}

/* Strona logowania — layout */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}

.login-header {
    background: var(--primary-dark);
    border-bottom: 3px solid var(--primary);
    padding: 14px 28px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    z-index: 2;
}

.login-logo {
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.15em;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.login-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: #fff;
    border: 1px solid var(--border-strong);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 2;
    animation: cardIn 0.5s ease-out;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-card h1 {
    font-size: 1.4em;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-dark);
    text-align: center;
    margin-top: 0;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    margin-bottom: 28px;
}

.login-card label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.login-card input[type="text"],
.login-card input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border-strong);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 15px;
    background: #fff;
    color: var(--text);
    transition: all 0.15s;
    margin-bottom: 18px;
}

.login-card input[type="text"]:focus,
.login-card input[type="password"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.login-card button[type="submit"] {
    width: 100%;
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    background: var(--primary);
    color: #fff;
    border: 2px solid var(--primary);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    overflow: hidden;
}

.login-card button[type="submit"]:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(85,107,47,0.25);
}

.login-card button[type="submit"]:active {
    transform: translateY(0);
}

.login-card button[type="submit"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    transition: left 0.5s;
}

.login-card button[type="submit"]:hover::before {
    left: 100%;
}

.login-footer {
    text-align: center;
    padding: 16px 24px;
    background: #fff;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
    position: relative;
    z-index: 2;
}

.login-card .alert {
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    .food-bg span {
        font-size: 28px !important;
    }
    .food-bg span:nth-child(n+8) {
        display: none;
    }
    .calorie-bubble:nth-child(n+3) {
        display: none;
    }
    .login-card {
        padding: 28px 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    /* Znacznie wolniejsze, prawie statyczne — dla osób z wrażliwością */
    .food-bg span {
        animation-duration: 120s !important;
        opacity: 0.05 !important;
    }
    .calorie-bubble {
        animation: none !important;
        opacity: 0.15 !important;
    }
    .login-card {
        animation: none !important;
    }
    .login-card button[type="submit"]::before {
        display: none;
    }
}



/* POPRAWKA: animowane tło na stronie logowania */
body {
    background: var(--bg);
}

body .login-page {
    background: transparent;
}

/* Animacje za formularzem, ale nad tłem strony */
body .calorie-bubble,
body .food-bg {
    z-index: 0;
    pointer-events: none;
}

body .login-page .login-header,
body .login-page .login-footer {
    position: relative;
    z-index: 2;
}

body .login-page .login-main {
    position: relative;
    z-index: 1;
}

body .login-page .login-card {
    position: relative;
    z-index: 2;
}



/* ============================================================
   DESZCZ METEORÓW — emoji z ogonkami lecące po skosie
   ============================================================ */

.meteor-shower {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* Każdy meteoryt — kontener */
.meteor {
    position: absolute;
    top: -150px;
    font-size: 56px;
    opacity: 0;
    line-height: 1;
    text-shadow: 0 0 20px rgba(255, 200, 80, 0.6);
    animation: meteorFall linear infinite;
    will-change: transform, opacity;
    user-select: none;
    display: inline-block;
}

/* Ogon meteorytu — OBRÓCONY o 25° w lewo-górę (godzina 11) */
.meteor::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 50%;
    margin-right: 8px;
    width: 200px;
    height: 4px;
    background: linear-gradient(
        to left,
        rgba(255, 230, 130, 0.9) 0%,
        rgba(255, 200, 80, 0.5) 30%,
        rgba(255, 160, 40, 0.15) 65%,
        transparent 100%
    );
    border-radius: 4px;
    /* KLUCZOWA ZMIANA: obrót o 25° w górę (żeby ogon był na 11) */
    transform: translateY(-50%) rotate(65deg);
    transform-origin: right center;
    pointer-events: none;
    filter: blur(1.5px);
}


/* ============================================================
   POZYCJE STARTOWE I TRAJEKTORIE (2× wolniejsze)
   ============================================================ */

.meteor:nth-child(1)  { left: -10%; font-size: 64px; animation-duration: 8s;   animation-delay: 0s;   }
.meteor:nth-child(2)  { left:  5%;  font-size: 40px; animation-duration: 11s;  animation-delay: 1.2s; }
.meteor:nth-child(3)  { left: 18%;  font-size: 72px; animation-duration: 9s;   animation-delay: 0.5s; }
.meteor:nth-child(4)  { left: 30%;  font-size: 36px; animation-duration: 13s;  animation-delay: 2.1s; }
.meteor:nth-child(5)  { left: 42%;  font-size: 52px; animation-duration: 10s;  animation-delay: 0.8s; }
.meteor:nth-child(6)  { left: 55%;  font-size: 68px; animation-duration: 8.5s; animation-delay: 3s;   }
.meteor:nth-child(7)  { left: 68%;  font-size: 76px; animation-duration: 7.5s; animation-delay: 1.5s; }
.meteor:nth-child(8)  { left: 78%;  font-size: 38px; animation-duration: 9.5s; animation-delay: 2.5s; }
.meteor:nth-child(9)  { left: 88%;  font-size: 56px; animation-duration: 10.5s; animation-delay: 0.3s; }
.meteor:nth-child(10) { left: 100%; font-size: 48px; animation-duration: 11.5s; animation-delay: 4s;  }
.meteor:nth-child(11) { left: 12%;  font-size: 70px; animation-duration: 9.2s; animation-delay: 3.5s; }
.meteor:nth-child(12) { left: 25%;  font-size: 42px; animation-duration: 12.5s; animation-delay: 1.8s; }
.meteor:nth-child(13) { left: 48%;  font-size: 58px; animation-duration: 8.8s; animation-delay: 2.7s; }
.meteor:nth-child(14) { left: 62%;  font-size: 66px; animation-duration: 11s;  animation-delay: 0.6s; }
.meteor:nth-child(15) { left: 82%;  font-size: 44px; animation-duration: 11.8s; animation-delay: 4.5s; }
.meteor:nth-child(16) { left: 94%;  font-size: 54px; animation-duration: 9.8s; animation-delay: 3.3s; }


/* ============================================================
   ANIMACJA — meteoryt leci po skosie w prawo-dół
   Cały kontener obraca się o -20° (żeby emoji i ogonek pasowały)
   ============================================================ */

@keyframes meteorFall {
    0% {
        transform: translate(0, 0) rotate(-20deg);
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translate(60vw, 130vh) rotate(-20deg);
        opacity: 0;
    }
}


/* ============================================================
   BĄBELKI KALORII — pulsujące kółka w tle
   ============================================================ */

.calorie-bubble {
    position: fixed;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 163, 84, 0.18), rgba(139, 163, 84, 0));
    pointer-events: none;
    z-index: 0;
    animation: bubblePulse ease-in-out infinite;
    will-change: transform, opacity;
}

.calorie-bubble:nth-child(1) { top: 15%; left: 10%; width: 220px; height: 220px; animation-duration: 8s;  animation-delay: 0s; }
.calorie-bubble:nth-child(2) { top: 60%; left: 80%; width: 180px; height: 180px; animation-duration: 11s; animation-delay: 2s; }
.calorie-bubble:nth-child(3) { top: 30%; left: 70%; width: 260px; height: 260px; animation-duration: 14s; animation-delay: 4s; }
.calorie-bubble:nth-child(4) { top: 75%; left: 20%; width: 200px; height: 200px; animation-duration: 10s; animation-delay: 1s; }
.calorie-bubble:nth-child(5) { top:  5%; left: 50%; width: 160px; height: 160px; animation-duration: 12s; animation-delay: 3s; }

@keyframes bubblePulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50%      { transform: scale(1.25); opacity: 0.8; }
}


/* ============================================================
   LAYOUT STRONY LOGOWANIA
   ============================================================ */

.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: transparent;
    position: relative;
    overflow: hidden;
}

.login-header {
    background: var(--primary-dark);
    border-bottom: 3px solid var(--primary);
    padding: 14px 28px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    z-index: 2;
}

.login-logo {
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.15em;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.login-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: #fff;
    border: 1px solid var(--border-strong);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 2;
    animation: cardIn 0.5s ease-out;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-card h1 {
    font-size: 1.4em;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-dark);
    text-align: center;
    margin-top: 0;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    margin-bottom: 28px;
}

.login-card label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.login-card input[type="text"],
.login-card input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border-strong);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 15px;
    background: #fff;
    color: var(--text);
    transition: all 0.15s;
    margin-bottom: 18px;
}

.login-card input[type="text"]:focus,
.login-card input[type="password"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.login-card button[type="submit"] {
    width: 100%;
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    background: var(--primary);
    color: #fff;
    border: 2px solid var(--primary);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    overflow: hidden;
}

.login-card button[type="submit"]:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(85,107,47,0.25);
}

.login-card button[type="submit"]:active {
    transform: translateY(0);
}

.login-card button[type="submit"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    transition: left 0.5s;
}

.login-card button[type="submit"]:hover::before {
    left: 100%;
}

.login-footer {
    text-align: center;
    padding: 16px 24px;
    background: #fff;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
    position: relative;
    z-index: 2;
}

.login-card .alert {
    margin-bottom: 20px;
}


/* ============================================================
   MOBILE — mniej meteorytów
   ============================================================ */

@media (max-width: 600px) {
    .meteor {
        font-size: 40px;
    }
    .meteor:nth-child(n+11) {
        display: none;
    }
    .calorie-bubble:nth-child(n+3) {
        display: none;
    }
    .login-card {
        padding: 28px 22px;
    }
}