/* ===== CSS VARIABLES ===== */
:root {
    --green: #24804a;
    --green-light: #31995d;
    --green-xlight: #65bf8c;
    --green-glass: rgba(33, 120, 67, 0.1);
    --green-glass-hover: rgba(33, 120, 67, 0.18);
    --accent: #f2c94c;
    --accent-light: rgba(242, 201, 76, 0.18);
    --red: #c94646;
    --red-light: rgba(201, 70, 70, 0.14);

    /* Cleaner, higher-contrast background palette — Notion/Linear inspired */
    --bg: #f7f8f5;
    --bg-2: #eef0eb;
    --surface: rgba(255, 255, 255, 0.82);
    --surface-solid: #ffffff;
    --surface-2: rgba(255, 255, 255, 0.55);
    --surface-border: rgba(0, 0, 0, 0.09);
    --surface-border-strong: rgba(0, 0, 0, 0.16);
    --surface-shadow: 0 1px 3px rgba(0, 0, 0, 0.07), 0 4px 16px rgba(0, 0, 0, 0.06);
    --surface-shadow-lg: 0 2px 8px rgba(0, 0, 0, 0.06), 0 12px 32px rgba(0, 0, 0, 0.08);

    /* High contrast text — Stripe/Linear style */
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-tertiary: #6b7280;
    --text-muted: #9ca3af;
    --text-on-green: #ffffff;

    --font-display: 'DM Sans', system-ui, sans-serif;
    --font-body: 'DM Sans', system-ui, sans-serif;
    --font-mono: 'DM Mono', monospace;

    --radius-sm: 6px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 28px;

    --transition: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --app-header-height: 82px;
    --save-bar-height: 70px;

    /* Allergen colors — bolder, clearly differentiated */
    --lactose-color: #6d28d9;
    --lactose-bg: #ede9fe;
    --lactose-border: #c4b5fd;
    --mushroom-color: #92400e;
    --mushroom-bg: #fef3c7;
    --mushroom-border: #fcd34d;
    --nuts-color: #c2410c;
    --nuts-bg: #ffedd5;
    --nuts-border: #fed7aa;

    --star-color: #92400e;
    --star-bg: #fefce8;
    --star-border: #fde047;
    --star-outline: #f4c43a;
}

/* ===== DARK MODE VARIABLES ===== */
[data-theme='dark'] {
    --bg: #0f1410;
    --bg-2: #1b2220;
    --surface: rgba(30, 38, 32, 0.95);
    --surface-solid: #191f1a;
    --surface-2: rgba(30, 38, 32, 0.72);
    --surface-border: rgba(255, 255, 255, 0.1);
    --surface-border-strong: rgba(255, 255, 255, 0.18);
    --surface-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.35);
    --surface-shadow-lg: 0 2px 8px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.4);
    --text-primary: #e8efe9;
    --text-secondary: #c4d2c2;
    --text-tertiary: #8fa293;
    --text-muted: #6a7b69;
    --accent: #f4d35f;
    --accent-light: rgba(244, 211, 95, 0.24);
    --green: #39b974;
    --green-light: #4fca8a;
    --green-xlight: #7fe3b3;
    --green-glass: rgba(56, 160, 90, 0.16);
    --green-glass-hover: rgba(56, 160, 90, 0.28);
    --red: #e86b6b;
    --red-light: rgba(232, 107, 107, 0.18);
    --star-bg: #1f1a08;
    --star-border: #7b5a00;
    --star-color: #f5cc54;
    --lactose-bg: #271a39;
    --lactose-border: #8762d6;
    --mushroom-bg: #2d2110;
    --mushroom-border: #a57615;
    --nuts-bg: #2a180f;
    --nuts-border: #b0572f;
}

/* ===== RESET ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    font-size: 15px;
}

img {
    max-width: 100%;
    display: block;
}
button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}
input,
select,
textarea {
    font-family: inherit;
}
a {
    color: inherit;
    text-decoration: none;
}

/* ===== TYPOGRAPHY ===== */
h1,
h2,
h3 {
    font-family: var(--font-display);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

/* ===== GLASSMORPHISM ===== */
.glass-card {
    background: var(--surface);
    backdrop-filter: blur(24px) saturate(1.6);
    -webkit-backdrop-filter: blur(24px) saturate(1.6);
    border: 1px solid var(--surface-border);
    box-shadow: var(--surface-shadow);
}

.glass-nav {
    background: rgba(247, 248, 245, 0.88);
    backdrop-filter: blur(28px) saturate(1.8);
    -webkit-backdrop-filter: blur(28px) saturate(1.8);
    border-bottom: 1px solid var(--surface-border);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-body);
    letter-spacing: -0.01em;
    transition: all var(--transition);
    white-space: nowrap;
    line-height: 1;
}

.btn i {
    width: 15px;
    height: 15px;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.btn-primary {
    background: var(--green);
    color: var(--text-on-green);
    box-shadow:
        0 1px 2px rgba(26, 86, 50, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.btn-primary:hover {
    background: var(--green-light);
    box-shadow:
        0 4px 12px rgba(26, 86, 50, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}
.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(26, 86, 50, 0.2);
}

.btn-secondary {
    background: var(--green-glass);
    color: var(--green);
    border: 1px solid rgba(26, 86, 50, 0.2);
}
.btn-secondary:hover {
    background: var(--green-glass-hover);
    border-color: rgba(26, 86, 50, 0.3);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--surface-border);
}
.btn-ghost:hover {
    background: var(--bg-2);
    color: var(--text-primary);
    border-color: var(--surface-border-strong);
}

.btn-danger {
    background: var(--red);
    color: white;
    box-shadow: 0 1px 2px rgba(185, 28, 28, 0.2);
}
.btn-danger:hover {
    background: #991b1b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(185, 28, 28, 0.25);
}

.btn-large {
    padding: 12px 28px;
    font-size: 0.95rem;
    border-radius: var(--radius-lg);
}
.btn-full {
    width: 100%;
    justify-content: center;
}
.icon-btn {
    padding: 8px;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
}
.icon-btn i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 0.95rem;
    line-height: 1;
}

/* ===== FORMS ===== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.form-label .required {
    color: var(--red);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 12px;
    color: var(--text-tertiary);
    font-size: 0.95rem;
    pointer-events: none;
    flex-shrink: 0;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius);
    border: 1.5px solid var(--surface-border-strong);
    background: var(--surface-solid);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-body);
    transition: all var(--transition);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.input-wrapper .form-input {
    padding-left: 40px;
}

.form-input:focus {
    border-color: var(--green);
    background: #fff;
    box-shadow:
        0 0 0 3px rgba(26, 86, 50, 0.12),
        0 1px 2px rgba(0, 0, 0, 0.04);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    resize: vertical;
    min-height: 72px;
}

select.form-input {
    cursor: pointer;
}

.toggle-pw {
    position: absolute;
    right: 10px;
    color: var(--text-tertiary);
    padding: 4px;
    display: flex;
    border-radius: var(--radius-sm);
}
.toggle-pw i {
    width: 16px;
    height: 16px;
    font-size: 1rem;
}
.toggle-pw:hover {
    color: var(--green);
}

.form-error {
    font-size: 0.8rem;
    color: var(--red);
    min-height: 16px;
    font-weight: 500;
}

.form-hint {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    margin-top: 1px;
    line-height: 1.4;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

/* ===== TOGGLE SWITCH ===== */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 26px;
    transition: all var(--transition);
    cursor: pointer;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: all var(--transition);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.toggle-switch input:checked + .toggle-slider {
    background: var(--green);
}
.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

/* ===== APP HEADER ===== */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 12px 18px 12px 6px;
}

.header-left {
    align-items: center;
    gap: 14px;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.header-right {
    justify-content: flex-end;
}
.header-center {
    flex: 2;
    display: flex;
    justify-content: center;
}

.nav-logo {
    width: auto;
    height: 56px;
    max-width: 160px;
    margin-left: 2px;
    object-fit: contain;
    border-radius: 12px;
}

@media (max-width: 900px) {
    .header-inner {
        flex-wrap: wrap;
        gap: 12px;
        padding: 14px 18px;
    }
    .header-left,
    .header-right,
    .header-center {
        flex: 1 1 100%;
        justify-content: flex-start;
    }
    .header-center {
        justify-content: center;
    }
    .header-right {
        justify-content: flex-end;
    }
    .nav-logo {
        height: 52px;
    }
}

@media (max-width: 640px) {
    .header-inner {
        flex-wrap: wrap;
        padding: 12px 16px;
    }
    .header-left,
    .header-right,
    .header-center {
        width: 100%;
        justify-content: space-between;
    }
    .header-center {
        order: 3;
        justify-content: flex-start;
    }
    .header-right {
        justify-content: flex-end;
    }
    .app-main,
    .save-bar-inner {
        padding-left: 16px;
        padding-right: 16px;
    }
    .save-bar-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
}

/* ===== ALLERGEN TAGS ===== */
.allergen-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1.5px solid;
    line-height: 1.4;
}

.allergen-tag.lactose {
    background: #eef2ff;
    color: #4f46e5;
    border-color: #c7d2fe;
}
.allergen-tag.mushroom {
    background: #fff7ed;
    color: #92400e;
    border-color: #fcd34d;
}
.allergen-tag.nuts {
    background: #fff1f0;
    color: #9a3412;
    border-color: #fda29b;
}

.star-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--star-bg);
    color: var(--star-color);
    border: 1.5px solid var(--star-border);
    letter-spacing: 0.02em;
}

.star-tag i {
    font-size: 0.72rem;
    line-height: 1;
}

/* ===== ITEM CARD ===== */
.item-card {
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid var(--surface-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: var(--surface-shadow);
}

.item-card:hover {
    border-color: rgba(26, 86, 50, 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Star item — golden outline */
.item-card.star-item {
    border-color: var(--star-outline);
    box-shadow:
        0 0 0 1px var(--star-outline),
        var(--surface-shadow);
}
.item-card.star-item:hover {
    box-shadow:
        0 0 0 2px var(--star-outline),
        0 4px 20px rgba(212, 160, 23, 0.2);
}

.item-card.selected {
    border-color: var(--green);
    background: rgba(26, 86, 50, 0.04);
    box-shadow:
        0 0 0 2.5px var(--green),
        0 4px 20px rgba(26, 86, 50, 0.12);
}

.item-card.selected.star-item {
    border-color: var(--green);
    box-shadow:
        0 0 0 2.5px var(--green),
        0 4px 20px rgba(26, 86, 50, 0.12);
}

.item-card.selected::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: white;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(26, 86, 50, 0.3);
}

.item-card.disabled {
    opacity: 0.4;
    pointer-events: none;
    filter: grayscale(0.5);
}

.item-card-img {
    width: 100%;
    height: 130px;
    object-fit: cover;
}

.item-card-body {
    padding: 12px 14px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.item-card-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.item-card-desc {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    line-height: 1.4;
}

.item-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: auto;
    padding-top: 4px;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal {
    width: 100%;
    max-width: 540px;
    max-height: 92vh;
    overflow-y: auto;
    border-radius: var(--radius-xl);
    /* Solid white background for maximum form legibility */
    background: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid var(--surface-border);
    box-shadow:
        0 8px 40px rgba(0, 0, 0, 0.16),
        0 2px 8px rgba(0, 0, 0, 0.08);
    animation: slideUp 0.2s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.modal-sm {
    max-width: 400px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px 0;
    margin-bottom: 2px;
    border-bottom: 1px solid var(--surface-border);
    padding-bottom: 16px;
}

.modal-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    transition: all var(--transition);
}
.modal-close:hover {
    background: var(--bg-2);
    color: var(--text-primary);
}
.modal-close i {
    font-size: 0.95rem;
    line-height: 1;
}

.modal-body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #ffffff;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 24px 20px;
    border-top: 1px solid var(--surface-border);
    background: #fafafa;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ===== DARK MODE TOGGLE ===== */
.dark-toggle {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border: 1px solid var(--surface-border);
    background: transparent;
    transition: all var(--transition);
    cursor: pointer;
}
.dark-toggle:hover {
    background: var(--bg-2);
    color: var(--text-primary);
    border-color: var(--surface-border-strong);
}
.dark-toggle i {
    font-size: 0.95rem;
    line-height: 1;
}

/* ===== MENU SUMMARY POPUP ===== */
.menu-summary-modal .modal {
    max-width: 90vw;
    width: 860px;
}
.menu-summary-modal .modal-body {
    padding: 16px 24px 20px;
}

/* ===== GLASS NAV DARK ===== */
[data-theme='dark'] .glass-nav {
    background: rgba(15, 20, 16, 0.92);
}
[data-theme='dark'] .sticky-save-bar {
    background: rgba(24, 30, 25, 0.96);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
[data-theme='dark'] .week-badge {
    background: rgba(57, 182, 107, 0.12);
    border-color: rgba(57, 182, 107, 0.25);
    color: #cde9d4;
}
[data-theme='dark'] .nav-logo,
[data-theme='dark'] #school-logo {
    filter: brightness(1.2) saturate(1.15);
    opacity: 0.98;
    background-color: rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 0 14px rgba(255, 255, 255, 0.18);
    border-radius: 14px;
}
[data-theme='dark'] .star-info-bar {
    background: rgba(244, 210, 74, 0.14);
    border-color: rgba(244, 210, 74, 0.32);
    color: #f9e7b3;
}
[data-theme='dark'] .star-info-bar i {
    color: #f4d35f;
}
[data-theme='dark'] .star-info-bar .star-used-badge {
    background: rgba(244, 210, 74, 0.18);
    border-color: rgba(244, 210, 74, 0.32);
    color: var(--text-primary);
}
[data-theme='dark'] .btn-primary {
    background: #2f7e5b;
    color: #f4f8f3;
    box-shadow: 0 4px 12px rgba(57, 182, 107, 0.2);
}
[data-theme='dark'] .btn-primary:hover {
    background: #3ca77b;
}
[data-theme='dark'] .day-btn.active {
    background: rgba(57, 182, 107, 0.18);
    color: var(--text-primary);
}
[data-theme='dark'] .day-btn.active:hover {
    background: rgba(57, 182, 107, 0.22);
}
[data-theme='dark'] .star-info-bar.star-limit-reached {
    background: rgba(172, 41, 41, 0.16);
    border-color: rgba(232, 107, 107, 0.28);
    color: #f5d4d4;
}
[data-theme='dark'] .star-info-bar.star-limit-reached i {
    color: #f9b3b3;
}
[data-theme='dark'] .star-info-bar.star-limit-reached .star-used-badge {
    background: rgba(232, 107, 107, 0.18);
    border-color: rgba(232, 107, 107, 0.28);
    color: #ffffff;
}
[data-theme='dark'] .fixed-item-notice {
    background: rgba(56, 160, 90, 0.12);
    border-color: rgba(56, 160, 90, 0.24);
    color: #d8f5d7;
}
[data-theme='dark'] .allergen-tag.lactose {
    background: rgba(99, 102, 241, 0.18);
    color: #eef2ff;
    border-color: rgba(99, 102, 241, 0.42);
}
[data-theme='dark'] .allergen-tag.mushroom {
    background: rgba(168, 85, 0, 0.18);
    color: #ffefc7;
    border-color: rgba(168, 85, 0, 0.38);
}
[data-theme='dark'] .allergen-tag.nuts {
    background: rgba(220, 38, 38, 0.18);
    color: #ffe8dc;
    border-color: rgba(220, 38, 38, 0.38);
}
[data-theme='dark'] .modal {
    background: #1e2620 !important;
}
[data-theme='dark'] .modal-footer {
    background: #171d18;
}
[data-theme='dark'] .modal-body {
    background: #1e2620;
}
[data-theme='dark'] .form-input {
    background: #141a15;
    color: var(--text-primary);
    border-color: var(--surface-border-strong);
}
[data-theme='dark'] .form-input:focus {
    background: #0f1410;
}
[data-theme='dark'] .loading-overlay {
    background: rgba(10, 14, 11, 0.75);
}
[data-theme='dark'] .summary-table-wrap,
[data-theme='dark'] .summary-table td.row-label,
[data-theme='dark'] .summary-table th {
    background: #1a1f1b;
}
[data-theme='dark'] .summary-table th {
    background: #141a15;
}
[data-theme='dark'] .summary-table td.row-label {
    background: #141a15;
}
[data-theme='dark'] .summary-table td.voted,
[data-theme='dark'] .summary-table td.consensus-winner {
    color: var(--text-primary);
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--green);
    color: white;
    padding: 12px 20px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(26, 86, 50, 0.35);
    z-index: 300;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    white-space: nowrap;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}
.toast.error {
    background: var(--red);
    box-shadow: 0 8px 24px rgba(192, 57, 43, 0.35);
}

[data-theme='dark'] .toast {
    background: #1b5d45;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.toast-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ===== LOADING OVERLAY ===== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(240, 242, 237, 0.7);
    backdrop-filter: blur(8px);
    z-index: 400;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.loading-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--surface-border);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== ALLERGEN CHECKBOXES IN FORM ===== */
.allergen-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.allergen-check {
    display: flex;
    align-items: center;
    cursor: pointer;
}
.allergen-check input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
/* Default: fully visible, not faded */
.allergen-check .allergen-tag {
    opacity: 1;
    transition: all var(--transition);
    cursor: pointer;
    user-select: none;
}
/* Unselected: slightly muted but still readable */
.allergen-check:not(:has(input:checked)) .allergen-tag {
    opacity: 0.55;
    filter: grayscale(0.3);
}
/* Selected: full colour + ring */
.allergen-check input:checked + .allergen-tag {
    opacity: 1;
    filter: none;
    box-shadow: 0 0 0 2px currentColor;
}
.allergen-check .allergen-tag:hover {
    opacity: 1 !important;
    filter: none !important;
}

/* ===== UTILITY ===== */
.highlight {
    color: var(--green);
    font-weight: 600;
}
.text-muted {
    color: var(--text-tertiary);
}

/* ===== RESPONSIVE BREAKPOINTS ===== */
@media (max-width: 768px) {
    .header-inner {
        padding: 10px 16px;
        gap: 8px;
    }
    .header-center {
        flex: unset;
    }
    .modal {
        border-radius: var(--radius-lg);
    }
    .modal-footer {
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 8px 14px;
        font-size: 0.82rem;
    }
    .btn-large {
        padding: 11px 22px;
    }
}
