* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Google Sans', Roboto, Arial, sans-serif; background: #f4f8ee; color: #020A4D; min-height: 100vh; }

header { background: #79B92A; padding: 18px 24px 0; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.header-top { display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px; flex-wrap: wrap; gap: 8px; }
header h1 { color: #fff; font-size: 20px; font-weight: 700; }
.header-user { display: flex; align-items: center; gap: 10px; }
.header-user #user-email { color: #eaf6d8; font-size: 12px; }
nav { display: flex; flex-wrap: wrap; }
.nav-tab { padding: 10px 20px; color: #c8e8a0; font-size: 13px; font-weight: 600; cursor: pointer; border-bottom: 3px solid transparent; transition: all .15s; user-select: none; }
.nav-tab:hover { color: #fff; }
.nav-tab.active { color: #fff; border-bottom-color: #fff; }

.page { display: none; max-width: 700px; margin: 0 auto; padding: 24px 16px 48px; }
.page.active { display: block; }

.card { background: #fff; border-radius: 12px; padding: 20px; margin-bottom: 16px; box-shadow: 0 1px 6px rgba(0,0,0,0.06); }
.card-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: #79B92A; margin-bottom: 16px; }

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
label { display: block; font-size: 11px; font-weight: 700; color: #666; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.3px; }
input[type="text"], input[type="number"], select { width: 100%; padding: 10px 12px; border: 1.5px solid #ddd; border-radius: 8px; font-size: 14px; color: #020A4D; background: #fff; -webkit-appearance: none; appearance: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus { outline: none; border-color: #79B92A; box-shadow: 0 0 0 3px #e8f5d6; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

.btn { padding: 10px 16px; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: opacity .15s; }
.btn:hover { opacity: .88; }
.btn-green  { background: #79B92A; color: #fff; }
.btn-orange { background: #e48207; color: #fff; }
.btn-red    { background: #d93025; color: #fff; }
.btn-grey   { background: #f1f3f4; color: #444; }
.btn-full   { width: 100%; }
.btn-sm     { padding: 5px 10px; font-size: 12px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px); background: #020A4D; color: #fff; padding: 12px 20px; border-radius: 8px; font-size: 13px; font-weight: 500; z-index: 999; transition: transform .3s; white-space: nowrap; }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.err  { background: #d93025; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { background: #79B92A; color: #fff; padding: 9px 10px; text-align: left; font-weight: 600; font-size: 12px; }
.data-table td { padding: 9px 10px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.data-table tr:hover td { background: #f3f9e8; }
.data-table .actions { display: flex; gap: 6px; }

.ing-line { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.ing-line:last-child { border-bottom: none; }
.ing-line .name { font-weight: 500; }
.ing-line .right { text-align: right; }

.cost-summary { background: #eef7d6; border-radius: 8px; padding: 14px 16px; font-size: 13px; line-height: 1.8; margin-bottom: 16px; }
.cost-summary .big { font-size: 20px; font-weight: 700; color: #79B92A; }

.recipe-card { background: #fff; border: 1.5px solid #e8e8e8; border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.recipe-card:hover { border-color: #79B92A; box-shadow: 0 2px 8px rgba(121,185,42,0.1); }
.recipe-card .rc-name { font-weight: 700; font-size: 14px; }
.recipe-card .rc-sub  { font-size: 12px; color: #888; margin-top: 2px; }
.recipe-card .rc-btns { float: right; margin-top: -4px; display: flex; gap: 6px; }

.results { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 6px rgba(0,0,0,0.06); }
.results-header { background: #020A4D; color: #fff; padding: 14px 20px; font-size: 13px; font-weight: 600; }
.result-row { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-bottom: 1px solid #f0f0f0; }
.result-row:last-child { border-bottom: none; }
.result-row .rl strong { display: block; font-size: 14px; font-weight: 600; }
.result-row .rl small  { font-size: 11px; color: #999; }
.result-row .rv { font-size: 22px; font-weight: 700; color: #79B92A; }
.result-row.retail { background: #fff8f0; }
.result-row.retail .rv { color: #e48207; font-size: 26px; }

.empty { color: #bbb; font-size: 13px; text-align: center; padding: 24px 0; }
.stale { color: #e48207; font-size: 10px; }
.back-btn { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
hr { border: none; border-top: 1px solid #eee; margin: 16px 0; }
footer { text-align: center; padding: 0 0 32px; color: #bbb; font-size: 11px; }
footer a { color: #79B92A; text-decoration: none; }
.cat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: #79B92A; margin: 16px 0 8px; }

/* ─── Login screen ─────────────────────────────────────────────────────── */
#login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { background: #fff; border-radius: 16px; padding: 40px 32px; max-width: 380px; width: 100%; text-align: center; box-shadow: 0 4px 24px rgba(0,0,0,0.08); }
.login-logo { font-size: 48px; margin-bottom: 8px; }
.login-card h1 { font-size: 22px; color: #020A4D; margin-bottom: 8px; }
.login-sub { font-size: 13px; color: #666; margin-bottom: 24px; line-height: 1.5; }
.login-err { color: #d93025; font-size: 13px; margin-top: 14px; min-height: 18px; }
.login-hint { color: #999; font-size: 12px; margin-top: 12px; }
