/* ═══════════════════════════════════════════════════════════════════════════
   PANTRY PAL  —  Neon / Dopamine Design  2026
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700;800&display=swap');

/* ── Design tokens ─────────────────────────────────────────────────────────── */
:root {
    /* backgrounds */
    --bg:         #07070f;
    --surface:    #0d0d1c;
    --surface-2:  #12122a;
    --border:     #1e1e38;

    /* neon palette */
    --cyan:       #00f5ff;
    --pink:       #ff006e;
    --green:      #00ff88;
    --purple:     #9d4edd;
    --yellow:     #ffd60a;

    /* text */
    --text:       #cacafa;
    --muted:      #6b6b90;
    --dim:        #3a3a5c;

    /* status */
    --danger:     #ff3355;
    --success:    #00ff88;

    /* glow helpers */
    --glow-cyan:  0 0 18px rgba(0,245,255,.45);
    --glow-pink:  0 0 18px rgba(255,0,110,.45);
    --glow-green: 0 0 18px rgba(0,255,136,.45);

    /* nav (variablized for theme overrides) */
    --header-bg:     rgba(7,7,15,.88);
    --nav-mobile-bg: rgba(7,7,15,.97);

    --radius:     12px;
    --radius-sm:  8px;
    --font:       'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

/* ── Base ──────────────────────────────────────────────────────────────────── */
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════════════════
   AUTH PAGES
   ═══════════════════════════════════════════════════════════════════════════ */

.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
    background:
        linear-gradient(rgba(0,245,255,.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,245,255,.03) 1px, transparent 1px),
        var(--bg);
    background-size: 44px 44px;
}

.auth-wrap {
    width: min(92vw, 420px);
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.auth-brand { text-align: center; }

.auth-logo-icon { font-size: 3rem; display: block; margin-bottom: .5rem; }

.auth-logo-text {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: .18em;
    color: var(--cyan);
    text-shadow: var(--glow-cyan);
    margin-bottom: .35rem;
}

.auth-logo-img {
    max-height: 300px;
    width: auto;
    object-fit: contain;
}

.nav-logo-img {
    height: 36px;
    width: auto;
    object-fit: contain;
    display: block;
}

.auth-logo-sub { color: var(--muted); font-size: .9rem; }

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 0 40px rgba(0,245,255,.06);
}

.auth-card h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: .2rem;
}

.auth-card-sub { color: var(--muted); font-size: .875rem; margin-bottom: 1.5rem; }

.auth-error {
    background: rgba(255,51,85,.1);
    border: 1px solid rgba(255,51,85,.35);
    color: #ff6680;
    border-radius: var(--radius-sm);
    padding: .65rem 1rem;
    font-size: .875rem;
    margin-bottom: 1rem;
}

.auth-switch {
    text-align: center;
    color: var(--muted);
    font-size: .875rem;
    margin-top: 1.25rem;
}

.auth-switch a { color: var(--cyan); text-decoration: none; font-weight: 600; }
.auth-switch a:hover { text-shadow: var(--glow-cyan); }

/* ═══════════════════════════════════════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════════════════════════════════════ */

header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0,245,255,.15);
    box-shadow: 0 0 30px rgba(0,245,255,.04);
}

.nav-inner {
    max-width: 1260px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-logo {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: .08em;
    color: var(--cyan);
    text-decoration: none;
    text-shadow: var(--glow-cyan);
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: .25rem;
    flex: 1;
}

.nav-links a {
    color: var(--muted);
    text-decoration: none;
    padding: .4rem .9rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: .9rem;
    transition: color .15s, background .15s;
}

.nav-links a:hover {
    color: var(--text);
    background: rgba(255,255,255,.05);
}

.nav-links a.active {
    color: var(--cyan);
    background: rgba(0,245,255,.08);
    text-shadow: 0 0 10px rgba(0,245,255,.4);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-left: auto;
    flex-shrink: 0;
}

.nav-username {
    font-size: .85rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: lowercase;
    text-decoration: none;
    transition: color .15s;
}

.nav-username:hover,
.nav-username-active {
    color: var(--cyan);
    text-shadow: 0 0 10px rgba(0,245,255,.4);
}

/* ── Settings page ─────────────────────────────────────────────────────────── */

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.settings-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
}

.settings-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: .25rem;
}

.settings-card-sub {
    color: var(--muted);
    font-size: .875rem;
    margin-bottom: 1.5rem;
}

.settings-success {
    background: rgba(0,255,136,.1);
    border: 1px solid rgba(0,255,136,.3);
    color: var(--green);
    border-radius: var(--radius-sm);
    padding: .65rem 1rem;
    font-size: .875rem;
    margin-bottom: 1rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MAIN CONTENT AREA
   ═══════════════════════════════════════════════════════════════════════════ */

main {
    max-width: 1260px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* ── Page header ───────────────────────────────────────────────────────────── */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.15;
}

.page-sub {
    color: var(--muted);
    font-size: .9rem;
    margin-top: .2rem;
}

/* ── Search / Toolbar ──────────────────────────────────────────────────────── */

.search-bar-wrap {
    margin-bottom: 1.25rem;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 220px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: .95rem;
    padding: .6rem 1rem;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.search-input::placeholder { color: var(--dim); }

.search-input:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0,245,255,.1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .55rem 1.3rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: .875rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: transform .15s, box-shadow .2s, opacity .15s;
    white-space: nowrap;
}

.btn:hover  { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--cyan);
    color: #000;
    box-shadow: var(--glow-cyan);
}
.btn-primary:hover { box-shadow: var(--glow-cyan); filter: brightness(1.12); }

.btn-success {
    background: var(--green);
    color: #000;
    box-shadow: var(--glow-green);
}
.btn-success:hover { box-shadow: var(--glow-green); filter: brightness(1.12); }

.btn-danger {
    background: rgba(255,51,85,.15);
    color: #ff6680;
    border: 1px solid rgba(255,51,85,.3);
}
.btn-danger:hover {
    background: rgba(255,51,85,.25);
    box-shadow: 0 0 14px rgba(255,51,85,.35);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--cyan);
    color: var(--cyan);
}
.btn-outline:hover {
    background: rgba(0,245,255,.08);
    box-shadow: var(--glow-cyan);
}

.btn-ghost {
    background: rgba(255,255,255,.05);
    color: var(--muted);
    border: 1px solid var(--border);
}
.btn-ghost:hover {
    background: rgba(255,255,255,.1);
    color: var(--text);
}

.btn-sm   { padding: .3rem .75rem; font-size: .8rem; }
.btn-icon { padding: .3rem .55rem; font-size: 1rem; line-height: 1; }
.btn-full { width: 100%; justify-content: center; padding: .75rem; font-size: 1rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   TABLE
   ═══════════════════════════════════════════════════════════════════════════ */

.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

table { width: 100%; border-collapse: collapse; }

thead {
    background: linear-gradient(135deg, rgba(0,245,255,.12), rgba(0,136,204,.08));
    border-bottom: 1px solid rgba(0,245,255,.2);
}

th {
    padding: .85rem 1.2rem;
    text-align: left;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--cyan);
}

td {
    padding: .85rem 1.2rem;
    border-bottom: 1px solid var(--border);
    font-size: .9rem;
    vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(0,245,255,.03); }

.inv-table tbody tr { height: 72px; }
.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.sortable:hover { color: var(--cyan); }
.sort-arrow { font-size: .75rem; opacity: .7; }

.actions { display: flex; gap: .4rem; flex-wrap: nowrap; align-items: center; }

.item-name { font-weight: 600; color: var(--text); text-transform: capitalize; }
.unit-text { color: var(--muted); font-size: .85rem; }

.qty-badge {
    display: inline-block;
    background: rgba(0,245,255,.1);
    color: var(--cyan);
    border-radius: 20px;
    padding: .15rem .65rem;
    font-size: .8rem;
    font-weight: 700;
}

.items-table thead { background: var(--surface-2); }
.items-table th    { color: var(--muted); }

/* ═══════════════════════════════════════════════════════════════════════════
   RECIPE CARDS
   ═══════════════════════════════════════════════════════════════════════════ */

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
    gap: 1rem;
}

.recipe-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    transition: transform .2s, border-color .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.recipe-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0,245,255,.4);
    box-shadow: 0 8px 32px rgba(0,245,255,.08);
}

.recipe-card-accent {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--cyan), var(--pink));
}

.recipe-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    text-transform: capitalize;
    margin-top: .25rem;
}

.recipe-meta { color: var(--muted); font-size: .8rem; }

.card-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.in-discover-badge {
    display: inline-flex; align-items: center;
    padding: .3rem .75rem; font-size: .8rem; border-radius: 6px;
    background: rgba(0,245,255,.08); color: var(--cyan);
    border: 1px solid rgba(0,245,255,.2); white-space: nowrap;
}

.pending-badge {
    display: inline-flex; align-items: center;
    padding: .3rem .75rem; font-size: .8rem; border-radius: 6px;
    background: rgba(255,214,10,.08); color: var(--yellow);
    border: 1px solid rgba(255,214,10,.2); white-space: nowrap;
}

/* Recipe detail content */
.section-label {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--cyan);
    margin-bottom: .5rem;
}

.ing-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.ing-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .4rem .75rem;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    font-size: .875rem;
}

.ing-list .ing-name { text-transform: capitalize; font-weight: 600; }
.ing-list .ing-qty  { color: var(--cyan); font-weight: 700; }

.steps-wrap { display: flex; flex-direction: column; gap: .5rem; }

.step-row {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    font-size: .875rem;
    line-height: 1.5;
}

.step-num {
    background: linear-gradient(135deg, var(--cyan), #0088cc);
    color: #000;
    border-radius: 50%;
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 800;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ACCORDION
   ═══════════════════════════════════════════════════════════════════════════ */

.accordion-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: .75rem;
    overflow: hidden;
    transition: border-color .2s;
}

.accordion-item:hover { border-color: rgba(0,245,255,.2); }

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    cursor: pointer;
    user-select: none;
    gap: .75rem;
    transition: background .12s;
}

.accordion-header:hover { background: rgba(0,245,255,.03); }

.accordion-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    flex: 1;
    text-transform: capitalize;
}

.accord-actions { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.arrow { color: var(--muted); font-size: .8rem; transition: transform .2s; }

.accordion-body {
    padding: 0 1.25rem 1.25rem;
    border-top: 1px solid var(--border);
    display: none;
}
.accordion-body.open { display: block; }

.list-empty { color: var(--muted); font-size: .875rem; padding: .5rem 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════════════════ */

.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.modal-backdrop.open { display: flex; }

.modal {
    background: var(--surface);
    border: 1px solid rgba(0,245,255,.25);
    border-radius: var(--radius);
    box-shadow: 0 0 60px rgba(0,245,255,.1), 0 24px 64px rgba(0,0,0,.5);
    width: min(92vw, 480px);
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.75rem;
    animation: modalIn .2s ease;
}

.modal-wide { width: min(92vw, 620px); }

@keyframes modalIn {
    from { transform: scale(.96) translateY(8px); opacity: 0; }
    to   { transform: scale(1)   translateY(0);   opacity: 1; }
}

.modal h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1.25rem;
}

.modal-header-neon h2 {
    color: var(--cyan);
    text-shadow: var(--glow-cyan);
    text-transform: capitalize;
    margin-bottom: 1rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════════════════ */

.form-group { margin-bottom: 1rem; }

.form-group label {
    display: block;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: .4rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: .6rem .9rem;
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: .95rem;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.form-group input::placeholder { color: var(--dim); }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0,245,255,.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}

.form-actions {
    display: flex;
    gap: .75rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

/* ── Dynamic ingredient / instruction rows ─────────────────────────────────── */

.ingredient-col-headers {
    display: grid;
    grid-template-columns: 1fr 90px 90px auto;
    gap: .45rem;
    margin-bottom: .4rem;
}

.ingredient-col-headers span {
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted);
}

.ingredient-row {
    display: grid;
    grid-template-columns: 1fr 90px 90px auto;
    gap: .45rem;
    margin-bottom: .45rem;
    align-items: center;
}

.ingredient-row input,
.ingredient-row select,
.instruction-row input {
    padding: .5rem .75rem;
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: .875rem;
    outline: none;
    width: 100%;
    transition: border-color .2s;
}

.ingredient-row select { cursor: pointer; }

.ingredient-row select option,
.ingredient-row select optgroup { background: var(--surface-2); color: var(--text); }

.ingredient-row input:focus,
.ingredient-row select:focus,
.instruction-row input:focus { border-color: var(--cyan); }

.instruction-row {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    gap: .45rem;
    margin-bottom: .45rem;
    align-items: center;
}

.step-number {
    background: linear-gradient(135deg, var(--cyan), #0088cc);
    color: #000;
    border-radius: 50%;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 800;
    flex-shrink: 0;
}

/* ── Checkbox grid for meal plan recipe selection ──────────────────────────── */

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: .35rem;
    max-height: 250px;
    overflow-y: auto;
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .75rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .875rem;
    cursor: pointer;
    padding: .2rem 0;
    text-transform: capitalize;
    color: var(--muted);
    transition: color .12s;
}

.checkbox-label:hover { color: var(--text); }
.checkbox-label input[type="checkbox"] { accent-color: var(--cyan); width: 15px; height: 15px; cursor: pointer; }

/* ── Toggle ────────────────────────────────────────────────────────────────── */

.toggle-label {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    white-space: nowrap;
}

.toggle-label input { accent-color: var(--cyan); width: 15px; height: 15px; }

/* ── Tag list ──────────────────────────────────────────────────────────────── */

.tag-list { display: flex; flex-wrap: wrap; gap: .4rem; padding: .5rem 0; }

.tag {
    background: rgba(0,245,255,.08);
    color: var(--cyan);
    border: 1px solid rgba(0,245,255,.2);
    padding: .2rem .65rem;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 700;
    text-transform: capitalize;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    pointer-events: none;
}

.toast {
    padding: .7rem 1.2rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: .875rem;
    animation: toastIn .25s ease;
    min-width: 210px;
}

.toast.success {
    background: rgba(0,255,136,.12);
    border: 1px solid rgba(0,255,136,.35);
    color: var(--green);
    box-shadow: var(--glow-green);
}

.toast.error {
    background: rgba(255,51,85,.12);
    border: 1px solid rgba(255,51,85,.35);
    color: #ff6680;
    box-shadow: var(--glow-pink);
}

.toast.info {
    background: rgba(0,245,255,.1);
    border: 1px solid rgba(0,245,255,.3);
    color: var(--cyan);
    box-shadow: var(--glow-cyan);
}

@keyframes toastIn {
    from { transform: translateX(110%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════════════════════ */

.empty-state {
    text-align: center;
    padding: 3.5rem 1rem;
    color: var(--dim);
    font-size: .95rem;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SCROLLBAR (Webkit)
   ═══════════════════════════════════════════════════════════════════════════ */

::-webkit-scrollbar              { width: 6px; height: 6px; }
::-webkit-scrollbar-track        { background: var(--surface); }
::-webkit-scrollbar-thumb        { background: var(--dim); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover  { background: var(--muted); }

/* ── Recipe count selector (meal plan) ─────────────────────────────────────── */

.recipe-count-list {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    max-height: 260px;
    overflow-y: auto;
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .75rem;
}

.recipe-count-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    padding: .25rem 0;
}

.recipe-count-name {
    flex: 1;
    font-size: .875rem;
    color: var(--muted);
    text-transform: capitalize;
}

.recipe-count-ctrl {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-shrink: 0;
}

.count-val {
    min-width: 22px;
    text-align: center;
    font-size: .9rem;
    font-weight: 700;
    color: var(--cyan);
}

.btn-count {
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    font-family: var(--font);
    transition: border-color .15s, background .15s, color .15s;
}

.btn-count:hover {
    border-color: var(--cyan);
    background: rgba(0,245,255,.1);
    color: var(--cyan);
}

/* ── Grocery list checkoff ──────────────────────────────────────────────────── */

.item-check { accent-color: var(--cyan); cursor: pointer; }

tr.item-checked td:nth-child(2) {
    color: var(--dim);
    text-decoration: line-through;
}

tr.item-checked td:nth-child(3) { opacity: .45; }

.add-checked-wrap { margin-top: .75rem; }

/* ── Hamburger (mobile nav toggle) ─────────────────────────────────────────── */

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.hamburger span {
    display: block;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform .2s, opacity .2s;
}

.hamburger.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ── Tag option-group labels (recipe checkbox grid) ─────────────────────────── */

.tag-optgroup-label {
    display: block;
    grid-column: 1 / -1;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--cyan);
    padding: .4rem 0 .2rem;
    border-bottom: 1px solid rgba(0,245,255,.15);
    margin-top: .35rem;
}

.tag-optgroup-label:first-child { margin-top: 0; padding-top: 0; }

/* ── Tag filters ─────────────────────────────────────────────────────────────── */

.tag-filter-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
    margin-bottom: 1.25rem;
}

.tag-filter-label {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    white-space: nowrap;
    margin-right: .2rem;
}

.tag-btn {
    background: var(--surface);
    border: 1.5px solid var(--border);
    color: var(--muted);
    border-radius: 20px;
    padding: .2rem .7rem;
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font);
    text-transform: capitalize;
    transition: border-color .15s, color .15s, background .15s;
    white-space: nowrap;
}

.tag-btn:hover {
    border-color: rgba(0,245,255,.4);
    color: var(--cyan);
    background: rgba(0,245,255,.06);
}

.tag-btn.tag-active {
    background: rgba(0,245,255,.12);
    border-color: var(--cyan);
    color: var(--cyan);
    box-shadow: 0 0 8px rgba(0,245,255,.2);
}

/* ── Inventory item inline tags ─────────────────────────────────────────────── */

.item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .2rem;
    margin-top: .3rem;
}

.item-tag {
    background: rgba(157,78,221,.1);
    color: var(--purple);
    border: 1px solid rgba(157,78,221,.2);
    padding: .1rem .45rem;
    border-radius: 20px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: capitalize;
}

/* ── Expiration date coloring ────────────────────────────────────────────────── */

td.exp-past { color: var(--danger); font-weight: 700; }
td.exp-soon { color: var(--yellow); font-weight: 700; }

/* ── Recipe card tags ────────────────────────────────────────────────────────── */

.recipe-tags { margin-top: -.1rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   DISCOVER / STAR RATINGS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Stars row on recipe cards */
.stars-row {
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: .8rem;
    flex-wrap: wrap;
}

/* Display-only star (on cards and modal header) */
.star-d {
    font-size: 1rem;
    color: var(--dim);
    line-height: 1;
}
.star-d.star-filled { color: var(--yellow); text-shadow: 0 0 6px rgba(255,214,10,.5); }

/* Interactive star (in modal user-rating row) */
.star-i {
    font-size: 1.3rem;
    color: var(--dim);
    cursor: pointer;
    line-height: 1;
    transition: color .12s, transform .1s, text-shadow .12s;
}
.star-i:hover,
.star-i.star-filled {
    color: var(--yellow);
    text-shadow: 0 0 8px rgba(255,214,10,.55);
}
.star-i:hover { transform: scale(1.2); }

.rating-avg {
    font-weight: 700;
    color: var(--yellow);
    font-size: .85rem;
}

.rating-count {
    color: var(--muted);
    font-size: .78rem;
}

/* User rating row inside detail modal */
.user-rating-row {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .75rem 0 .25rem;
    border-top: 1px solid var(--border);
    margin-top: .75rem;
    flex-wrap: wrap;
}

.rating-prompt {
    font-size: .8rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-right: .25rem;
}

/* Modal header rating display (avg stars + count) */
.detail-rating {
    display: flex;
    align-items: center;
    gap: .3rem;
    margin-bottom: .75rem;
}

/* Rating filter buttons (min-star row on Discover) */
.rating-filter-btn {
    background: var(--surface);
    border: 1.5px solid var(--border);
    color: var(--muted);
    border-radius: 20px;
    padding: .2rem .75rem;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font);
    transition: border-color .15s, color .15s, background .15s;
    white-space: nowrap;
}
.rating-filter-btn:hover {
    border-color: rgba(255,214,10,.5);
    color: var(--yellow);
    background: rgba(255,214,10,.06);
}
.rating-filter-btn.active {
    background: rgba(255,214,10,.12);
    border-color: var(--yellow);
    color: var(--yellow);
    box-shadow: 0 0 8px rgba(255,214,10,.2);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
    .hamburger { display: flex; }

    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0; right: 0;
        flex-direction: column;
        gap: 0;
        padding: .5rem 1rem .75rem;
        background: var(--nav-mobile-bg);
        border-bottom: 1px solid rgba(0,245,255,.15);
        z-index: 199;
    }
    .nav-links.open { display: flex; }
    .nav-links li   { width: 100%; }
    .nav-links a    { display: block; padding: .75rem 1rem; }

    .nav-inner { position: relative; flex-wrap: nowrap; }
    .nav-user  { margin-left: 0; gap: .5rem; }

    .form-row    { grid-template-columns: 1fr; }
    .recipe-grid { grid-template-columns: 1fr; }
    .toolbar     { flex-direction: column; align-items: stretch; }
    .actions     { flex-wrap: wrap; }
    .page-title  { font-size: 1.5rem; }
    .accord-actions { flex-wrap: wrap; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   THEMES  (override only color tokens; structural variables unchanged)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Neon Noir ──────────────────────────────────────────────────────────── */
:root[data-theme="neon-noir"] {
    --bg:            #0f1117;
    --surface:       #1a1d26;
    --surface-2:     #222635;
    --border:        #2a2e3a;
    --text:          #eaeaf0;
    --muted:         #8a8fa3;
    --dim:           #4a4f63;
    --cyan:          #00d4ff;
    --pink:          #7c4dff;
    --green:         #00ffa3;
    --purple:        #a855f7;
    --yellow:        #fbbf24;
    --danger:        #ff4455;
    --success:       #00ffa3;
    --glow-cyan:     0 0 18px rgba(0,212,255,.45);
    --glow-pink:     0 0 18px rgba(124,77,255,.45);
    --glow-green:    0 0 18px rgba(0,255,163,.45);
    --header-bg:     rgba(15,17,23,.88);
    --nav-mobile-bg: rgba(15,17,23,.97);
}

/* ── Fresh Produce ──────────────────────────────────────────────────────── */
:root[data-theme="fresh-produce"] {
    --bg:            #edf7f0;
    --surface:       #ffffff;
    --surface-2:     #e4f0e8;
    --border:        #c2d4c8;
    --text:          #1b1b1b;
    --muted:         #6f7d6a;
    --dim:           #bcc9be;
    --cyan:          #4caf50;
    --pink:          #ff9800;
    --green:         #8bc34a;
    --purple:        #7c4dff;
    --yellow:        #f59e0b;
    --danger:        #e53935;
    --success:       #4caf50;
    --glow-cyan:     none;
    --glow-pink:     none;
    --glow-green:    none;
    --header-bg:     rgba(246,255,248,.92);
    --nav-mobile-bg: rgba(246,255,248,.97);
}

/* ── Warm Kitchen ────────────────────────────────────────────────────────── */
:root[data-theme="warm-kitchen"] {
    --bg:            #f8ede2;
    --surface:       #ffffff;
    --surface-2:     #f5e6d6;
    --border:        #d9c4b0;
    --text:          #2b2b2b;
    --muted:         #8a7f75;
    --dim:           #c4b8ae;
    --cyan:          #d97706;
    --pink:          #ef4444;
    --green:         #22c55e;
    --purple:        #8b5cf6;
    --yellow:        #f59e0b;
    --danger:        #ef4444;
    --success:       #22c55e;
    --glow-cyan:     none;
    --glow-pink:     none;
    --glow-green:    none;
    --header-bg:     rgba(255,248,242,.92);
    --nav-mobile-bg: rgba(255,248,242,.97);
}

/* ── Minimal Cool ────────────────────────────────────────────────────────── */
:root[data-theme="minimal-cool"] {
    --bg:            #edf0f5;
    --surface:       #ffffff;
    --surface-2:     #e8ebf0;
    --border:        #c5cad4;
    --text:          #111827;
    --muted:         #6b7280;
    --dim:           #c0c5cc;
    --cyan:          #2563eb;
    --pink:          #6366f1;
    --green:         #06b6d4;
    --purple:        #7c3aed;
    --yellow:        #f59e0b;
    --danger:        #ef4444;
    --success:       #22c55e;
    --glow-cyan:     none;
    --glow-pink:     none;
    --glow-green:    none;
    --header-bg:     rgba(249,250,251,.92);
    --nav-mobile-bg: rgba(249,250,251,.97);
}

/* ── Soft Matte Pastel ───────────────────────────────────────────────────── */
:root[data-theme="soft-matte-pastel"] {
    --bg:            #eaeaf5;
    --surface:       #ffffff;
    --surface-2:     #e2e2f0;
    --border:        #c8c8e0;
    --text:          #2a2a3a;
    --muted:         #8b8ba7;
    --dim:           #c0c0d8;
    --cyan:          #a78bfa;
    --pink:          #f9a8d4;
    --green:         #67e8f9;
    --purple:        #7c4dff;
    --yellow:        #fbbf24;
    --danger:        #f87171;
    --success:       #86efac;
    --glow-cyan:     none;
    --glow-pink:     none;
    --glow-green:    none;
    --header-bg:     rgba(247,247,251,.92);
    --nav-mobile-bg: rgba(247,247,251,.97);
}

/* ── Earthy Organic ──────────────────────────────────────────────────────── */
:root[data-theme="earthy-organic"] {
    --bg:            #e8e4d8;
    --surface:       #ffffff;
    --surface-2:     #e0dcd0;
    --border:        #c4c0b0;
    --text:          #2f2f2f;
    --muted:         #7a7a6a;
    --dim:           #b8b5aa;
    --cyan:          #6b8e23;
    --pink:          #bc6c25;
    --green:         #a3b18a;
    --purple:        #7c5c3a;
    --yellow:        #e9b44c;
    --danger:        #c0392b;
    --success:       #6b8e23;
    --glow-cyan:     none;
    --glow-pink:     none;
    --glow-green:    none;
    --header-bg:     rgba(244,241,234,.92);
    --nav-mobile-bg: rgba(244,241,234,.97);
}

/* ── Vibrant Food Pop ────────────────────────────────────────────────────── */
:root[data-theme="vibrant-food-pop"] {
    --bg:            #f2eced;
    --surface:       #ffffff;
    --surface-2:     #ece6e7;
    --border:        #d0cccc;
    --text:          #1a1a1a;
    --muted:         #7a7a7a;
    --dim:           #c0c0c0;
    --cyan:          #ff4d6d;
    --pink:          #ffb703;
    --green:         #06d6a0;
    --purple:        #7c4dff;
    --yellow:        #ffb703;
    --danger:        #ff4d6d;
    --success:       #06d6a0;
    --glow-cyan:     none;
    --glow-pink:     none;
    --glow-green:    none;
    --header-bg:     rgba(255,254,254,.92);
    --nav-mobile-bg: rgba(255,254,254,.97);
}

/* ── Dark Mode Matte ─────────────────────────────────────────────────────── */
:root[data-theme="dark-mode-matte"] {
    --bg:            #121212;
    --surface:       #1e1e1e;
    --surface-2:     #252525;
    --border:        #2c2c2c;
    --text:          #e5e5e5;
    --muted:         #9ca3af;
    --dim:           #4a4a4a;
    --cyan:          #3b82f6;
    --pink:          #f59e0b;
    --green:         #22c55e;
    --purple:        #a855f7;
    --yellow:        #fbbf24;
    --danger:        #ef4444;
    --success:       #22c55e;
    --glow-cyan:     0 0 18px rgba(59,130,246,.4);
    --glow-pink:     0 0 18px rgba(245,158,11,.4);
    --glow-green:    0 0 18px rgba(34,197,94,.4);
    --header-bg:     rgba(18,18,18,.88);
    --nav-mobile-bg: rgba(18,18,18,.97);
}

/* ── Soft Candy ──────────────────────────────────────────────────────────── */
:root[data-theme="soft-candy"] {
    --bg:            #f5e8f2;
    --surface:       #ffffff;
    --surface-2:     #f0e0ed;
    --border:        #dfc8d4;
    --text:          #2d2d2d;
    --muted:         #9a9a9a;
    --dim:           #d0c0ca;
    --cyan:          #ff8fab;
    --pink:          #ffc8dd;
    --green:         #bde0fe;
    --purple:        #d4a5e6;
    --yellow:        #ffd166;
    --danger:        #ff6b6b;
    --success:       #a8d8a8;
    --glow-cyan:     none;
    --glow-pink:     none;
    --glow-green:    none;
    --header-bg:     rgba(255,247,251,.92);
    --nav-mobile-bg: rgba(255,247,251,.97);
}

/* ═══════════════════════════════════════════════════════════════════════════
   ADMIN DASHBOARD
   ═══════════════════════════════════════════════════════════════════════════ */

.admin-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.admin-stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem 1.5rem;
    text-align: center;
}

.admin-stat-number {
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--cyan);
    text-shadow: var(--glow-cyan);
    line-height: 1;
    margin-bottom: .5rem;
}

.admin-stat-label {
    font-size: .8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .07em;
}

.admin-section {
    margin-bottom: 3rem;
}

.admin-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .6rem;
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 .45rem;
    background: var(--pink);
    color: #fff;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: .75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.admin-table th {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
}

.admin-table tbody tr:hover {
    background: var(--surface-2);
}

.admin-empty {
    color: var(--muted);
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

.admin-pill {
    display: inline-block;
    padding: .15rem .5rem;
    background: rgba(0,245,255,.1);
    color: var(--cyan);
    border-radius: 4px;
    font-size: .75rem;
    font-weight: 600;
}

.admin-meta {
    color: var(--muted);
    font-size: .85rem;
    margin-bottom: .75rem;
}

/* ── Alert bar ────────────────────────────────────────────────────────── */
.admin-alert-bar {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    padding: .85rem 1.25rem;
    margin-bottom: 1.5rem;
    background: rgba(255, 51, 85, .1);
    border: 1px solid rgba(255, 51, 85, .3);
    border-radius: var(--radius);
    font-size: .9rem;
    color: var(--text);
}
.admin-alert-icon { font-size: 1.1rem; }
.admin-alert-actions { display: flex; gap: .5rem; margin-left: auto; }

/* ── Stat card variants ───────────────────────────────────────────────── */
.admin-stat-accent .admin-stat-number {
    color: var(--green);
    text-shadow: var(--glow-green);
}
.admin-stat-urgent {
    border-color: rgba(255, 51, 85, .4);
    background: rgba(255, 51, 85, .06);
}
.admin-stat-urgent .admin-stat-number {
    color: var(--danger);
}
.admin-badge.urgent { background: var(--danger); }

/* ── Charts row ───────────────────────────────────────────────────────── */
.admin-charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}
.admin-chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
}
.admin-chart-title {
    font-size: .85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    margin-bottom: 1rem;
}

/* ── Collapsible sections ─────────────────────────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: .6rem 0;
    user-select: none;
}
.section-header:hover .admin-section-title { color: var(--cyan); }
.section-header-left {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.section-icon { font-size: 1.1rem; }
.collapse-icon {
    font-size: .85rem;
    color: var(--muted);
    transition: color .15s;
}
.section-header:hover .collapse-icon { color: var(--cyan); }

/* ── Rank number ──────────────────────────────────────────────────────── */
.rank-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    background: var(--surface-2);
    border-radius: 4px;
    font-size: .75rem;
    font-weight: 700;
    color: var(--muted);
    margin-right: .35rem;
}

/* ── Flag reason pill ─────────────────────────────────────────────────── */
.flag-reason-pill {
    display: inline-block;
    padding: .2rem .55rem;
    background: rgba(255, 51, 85, .1);
    color: var(--danger);
    border-radius: 4px;
    font-size: .78rem;
}

/* ── Flag button (Discover cards) ─────────────────────────────────────── */
.btn-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
    font-size: .9rem;
    opacity: .45;
    transition: opacity .15s, border-color .15s, background .15s;
    flex-shrink: 0;
}
.btn-flag:hover { opacity: 1; border-color: var(--danger); background: rgba(255,51,85,.08); }
.btn-flag-active { opacity: 1; border-color: var(--danger); background: rgba(255,51,85,.1); }
.btn-flag-active-modal { color: var(--danger) !important; }

/* ── Flag modal ───────────────────────────────────────────────────────── */
.flag-modal-name {
    font-weight: 700;
    color: var(--cyan);
    margin-bottom: .25rem;
    font-size: 1rem;
}
.flag-modal-desc {
    color: var(--muted);
    font-size: .9rem;
    margin-bottom: 1rem;
}
.radio-group {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.radio-label {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .9rem;
    cursor: pointer;
    padding: .5rem .75rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: background .15s, border-color .15s;
}
.radio-label:hover { background: var(--surface-2); border-color: var(--border); }
.radio-label input[type=radio] { accent-color: var(--cyan); width: 1rem; height: 1rem; }
