/* BAXA Automation — "food magazine" design system: warm paper, deep ink, chilli + saffron, serif display. */
:root {
  --bg: #f6efe4; --bg2: #efe5d6; --panel: #fffdf9; --ink: #201915; --ink2: #4a3f37; --mute: #8a7c70; --line: #eadfce;
  --acc: #e2412a; --acc-d: #b8301d; --acc2: #f2a33a; --ok: #23875d; --warn: #b7791f; --bad: #c2362b; --info: #2f5fb3;
  --radius: 22px; --shadow: 0 1px 0 rgba(32,25,21,.04), 0 18px 40px -18px rgba(80,40,10,.28);
  --serif: "Fraunces", Georgia, serif; --sans: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.45;
  background: radial-gradient(1200px 600px at 85% -10%, #ffd9b8 0%, transparent 60%), radial-gradient(900px 500px at -10% 20%, #ffe7cf 0%, transparent 55%), var(--bg);
  background-attachment: fixed; min-height: 100vh; }
::selection { background: #ffd2c7; }

/* ── header ── */
.top { position: sticky; top: 0; z-index: 50; display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 28px; background: rgba(246,239,228,.78); backdrop-filter: blur(14px); border-bottom: 1px solid rgba(234,223,206,.9); }
.brand { font-family: var(--serif); font-weight: 800; font-size: 26px; letter-spacing: -.02em; display: flex; align-items: baseline; gap: 6px; }
.brand-acc { font-style: italic; font-weight: 600; color: var(--acc); }
.brand small { font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--mute); letter-spacing: .14em; text-transform: uppercase; margin-left: 6px; }
.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

/* ── layout & panels ── */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 22px; padding: 26px 28px 60px; max-width: 1700px; margin: 0 auto; }
@media (max-width: 1150px) { .layout { grid-template-columns: 1fr; padding: 18px 14px 40px; } .top { padding: 12px 14px; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; min-width: 0; box-shadow: var(--shadow); }
.preview { position: sticky; top: 86px; align-self: start; }
@media (max-width: 1150px) { .preview { position: static; } }
h2 { font-family: var(--serif); font-size: 24px; font-weight: 700; letter-spacing: -.01em; margin: 4px 0 14px; color: var(--ink); }
.editor h2:not(:first-child) { margin-top: 26px; }
.hint { color: var(--mute); font-size: 12.5px; }
.status { color: var(--ink2); font-size: 13px; }

/* ── form controls ── */
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink2); flex: 1; min-width: 160px; letter-spacing: .01em; }
input { background: #fff; color: var(--ink); border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 13px; font: inherit; font-size: 14px; transition: border-color .15s, box-shadow .15s; }
input:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 4px rgba(226,65,42,.12); }
input::placeholder { color: #b9ab9d; }
button, .btnlike { font: inherit; font-weight: 700; cursor: pointer; border-radius: 999px; padding: 11px 20px; border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  transition: transform .12s, box-shadow .15s, background .15s; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 13.5px; }
button:hover, .btnlike:hover { transform: translateY(-1px); box-shadow: 0 8px 18px -10px rgba(80,40,10,.5); }
button.primary, .btnlike.primary { background: linear-gradient(135deg, var(--acc) 0%, #f0642c 100%); color: #fff; border: none; box-shadow: 0 10px 22px -10px rgba(226,65,42,.8); }
button.ghost, .btnlike.ghost { background: transparent; }
button.small, .btnlike.small { padding: 7px 13px; font-size: 12px; }
button:disabled { opacity: .55; cursor: wait; transform: none; }

/* ── canteen + logo ── */
.logo-row { align-items: center; }
.logo-box { width: 132px; height: 72px; border: 1.5px dashed #d8c8b4; border-radius: 16px; display: grid; place-items: center; overflow: hidden;
  background: repeating-conic-gradient(#f4ece1 0 25%, #fff 0 50%) 0 0 / 14px 14px; color: var(--mute); font-size: 11px; font-weight: 600; }
.logo-box img { width: 100%; height: 100%; object-fit: contain; }
.file-btn { flex: 0 0 auto; min-width: 0; flex-direction: row; align-items: center; cursor: pointer; background: #fff; color: var(--ink); border: 1.5px solid var(--line);
  border-radius: 999px; padding: 10px 18px; font-size: 13px; font-weight: 700; }
.file-btn:hover { border-color: var(--acc); color: var(--acc); }
.auto { flex-direction: row; align-items: center; gap: 10px; color: var(--ink); font-size: 13px; font-weight: 600; margin-bottom: 12px; cursor: pointer; flex: 0 0 auto; }
.auto input { width: 20px; height: 20px; accent-color: var(--acc); padding: 0; }
.auto small { color: var(--mute); font-weight: 500; }

/* ── menu photo reader ── */
.reader { position: relative; overflow: hidden; border-radius: 18px; padding: 18px; margin-bottom: 16px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  background: linear-gradient(120deg, #fff4e6 0%, #ffe9df 100%); border: 1.5px solid #f6d7c4; }
.reader::after { content: "📸"; position: absolute; right: 14px; top: 6px; font-size: 46px; opacity: .14; }
.primary-file { background: linear-gradient(135deg, var(--acc) 0%, #f0642c 100%); color: #fff; border: none; box-shadow: 0 10px 22px -10px rgba(226,65,42,.8); }
.primary-file:hover { color: #fff; }
.reader .status { flex: 1; min-width: 220px; }

/* ── weekly grid ── */
.grid-wrap { overflow-x: auto; border-radius: 16px; border: 1.5px solid var(--line); background: #fff; }
table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 680px; }
th, td { border-bottom: 1px solid #f1e8dc; padding: 3px; font-size: 12.5px; }
tr:last-child th, tr:last-child td { border-bottom: 0; }
th { color: var(--ink2); font-weight: 700; text-align: left; padding: 9px 10px; white-space: nowrap; background: #fbf6ef; }
tr:first-child th { background: var(--ink); color: #fff; font-family: var(--serif); font-size: 14px; font-weight: 600; }
tr:first-child th:first-child { border-top-left-radius: 14px; } tr:first-child th:last-child { border-top-right-radius: 14px; }
td input { width: 100%; border: 1.5px solid transparent; background: transparent; padding: 8px; border-radius: 9px; font-size: 12.5px; }
td input:hover { background: #fdf8f2; }
td input:focus { background: #fff; border-color: var(--acc); box-shadow: none; }

/* ── design picker ── */
.templates { margin-bottom: 14px; max-height: 440px; overflow-y: auto; padding: 0 6px 0 2px; scrollbar-width: thin; }
.sec { position: sticky; top: 0; z-index: 2; background: var(--panel); padding: 8px 0 8px; font-family: var(--serif); font-size: 16px; font-weight: 700; color: var(--ink); }
.sec small { font-family: var(--sans); color: var(--mute); font-weight: 600; font-size: 12px; margin-left: 4px; }
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tgrid.trending { grid-auto-flow: column; grid-auto-columns: minmax(190px, 1fr); grid-template-columns: none; overflow-x: auto; padding: 4px 2px 10px; }
.tpl { position: relative; border: 2px solid transparent; border-radius: 16px; overflow: hidden; cursor: pointer; background: #fff; padding: 0; text-align: left;
  box-shadow: 0 6px 16px -10px rgba(80,40,10,.45); flex-direction: column; align-items: stretch; }
.tpl:hover { transform: translateY(-3px); box-shadow: 0 16px 30px -14px rgba(80,40,10,.55); }
.tpl canvas { display: block; width: 100%; aspect-ratio: 16/9; }
.tpl span { display: block; padding: 8px 10px; font-size: 12px; font-weight: 700; color: var(--ink2); background: #fff; }
.tpl.on { border-color: var(--acc); box-shadow: 0 0 0 4px rgba(226,65,42,.15), 0 16px 30px -14px rgba(226,65,42,.6); }
.tpl.on span { color: var(--acc); }
.tpl .rank, .tpl .new { position: absolute; top: 8px; left: 8px; font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; z-index: 1; letter-spacing: .02em; }
.tpl .rank { background: linear-gradient(135deg, var(--acc), var(--acc2)); color: #fff; }
.tpl .new { background: #1f9d64; color: #fff; }

/* ── day tabs + TV preview ── */
.day-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; background: var(--bg2); padding: 5px; border-radius: 999px; width: fit-content; max-width: 100%; }
.day-tabs button { padding: 8px 16px; font-size: 12.5px; border: none; background: transparent; box-shadow: none; }
.day-tabs button:hover { transform: none; box-shadow: none; color: var(--acc); }
.day-tabs button.on { background: #fff; color: var(--acc); box-shadow: 0 6px 14px -8px rgba(80,40,10,.5); }
.stage { position: relative; padding: 14px; border-radius: 26px; background: linear-gradient(160deg, #2a2420, #120f0d); box-shadow: 0 30px 60px -28px rgba(20,10,5,.8), inset 0 1px 0 rgba(255,255,255,.08); }
.stage::after { content: ""; position: absolute; left: 50%; bottom: -26px; transform: translateX(-50%); width: 34%; height: 14px; border-radius: 0 0 18px 18px; background: linear-gradient(#2a2420, #15110f); }
.stage canvas { width: 100%; aspect-ratio: 16/9; border-radius: 14px; display: block; background: #000; }
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 40px; }

/* ── account chip ── */
.account { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.account .who { color: var(--mute); max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.st { padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.st.ok { background: #dcf3e7; color: var(--ok); } .st.trial { background: #fff0d6; color: var(--warn); } .st.bad { background: #fde1dc; color: var(--bad); } .st.wait { background: #e3ebfb; color: var(--info); }

/* ── login screen: live design preview on the left, form on the right ── */
.auth-wrap { position: fixed; inset: 0; z-index: 1000; display: grid; grid-template-columns: 1.25fr 1fr; background: var(--bg); }
.auth-show { position: relative; overflow: hidden; background: #120d0a; display: flex; flex-direction: column; justify-content: center; padding: 48px; color: #fff; }
.auth-show canvas { width: 100%; aspect-ratio: 16/9; border-radius: 18px; box-shadow: 0 40px 80px -30px rgba(0,0,0,.9); transition: opacity .5s; position: relative; }
.auth-show h1 { font-family: var(--serif); font-size: clamp(30px, 3.4vw, 52px); line-height: 1.05; margin: 0 0 14px; letter-spacing: -.02em; position: relative; }
.auth-show h1 em { color: var(--acc2); }
.auth-show p { color: #d9cdbf; margin: 0 0 26px; max-width: 560px; font-size: 15px; position: relative; }
.auth-show .glow { position: absolute; width: 700px; height: 700px; border-radius: 50%; background: radial-gradient(circle, rgba(226,65,42,.35), transparent 65%); right: -200px; top: -200px; pointer-events: none; }
.auth-show .cap { margin-top: 14px; font-size: 12px; color: #b9ab9d; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; position: relative; }
.auth-side { display: grid; place-items: center; padding: 32px 24px; overflow-y: auto; }
.auth-card { width: min(420px, 100%); }
.brand.big { font-size: 34px; margin-bottom: 4px; }
.auth-sub { color: var(--mute); font-size: 14px; margin: 0 0 22px; }
.auth-tabs { display: flex; gap: 4px; margin-bottom: 18px; background: var(--bg2); padding: 5px; border-radius: 999px; }
.auth-tabs button { flex: 1; border: none; background: transparent; box-shadow: none; }
.auth-tabs button:hover { transform: none; box-shadow: none; }
.auth-tabs button.on { background: #fff; color: var(--acc); box-shadow: 0 6px 14px -8px rgba(80,40,10,.5); }
#authForm, #payForm { display: flex; flex-direction: column; gap: 12px; }
#authForm button[type=submit] { margin-top: 4px; padding: 14px; font-size: 15px; }
.auth-wrap:not(.signup) .only-signup { display: none; }
.auth-perks { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 8px; color: var(--ink2); font-size: 13px; }
.auth-perks li::before { content: "✦ "; color: var(--acc); }
.auth-msg { min-height: 18px; font-size: 13px; color: var(--mute); margin: 2px 0 0; } .auth-msg.err { color: var(--bad); font-weight: 600; } .auth-msg.ok { color: var(--ok); font-weight: 600; }
@media (max-width: 900px) { .auth-wrap { grid-template-columns: 1fr; overflow-y: auto; } .auth-show { padding: 28px 18px; } .auth-side { padding: 24px 16px 40px; } }

/* ── payment sheet ── */
.pay-wrap { position: fixed; inset: 0; z-index: 1000; background: rgba(32,25,21,.55); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; }
.pay-card { position: relative; width: min(440px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--panel); border-radius: 26px; padding: 28px; box-shadow: 0 40px 90px -30px rgba(0,0,0,.6); }
.pay-card h3 { font-family: var(--serif); margin: 0 0 8px; font-size: 22px; line-height: 1.2; padding-right: 36px; }
.pay-card .price { font-family: var(--serif); font-size: 42px; font-weight: 800; color: var(--acc); margin: 0 0 14px; letter-spacing: -.02em; }
.pay-card .price small { font-family: var(--sans); font-size: 14px; color: var(--mute); font-weight: 600; }
.pay-card .qr { background: #fff; border: 1.5px solid var(--line); border-radius: 18px; padding: 12px; width: 230px; margin: 0 auto 12px; }
.pay-card .qr svg { display: block; width: 100%; height: auto; }
.pay-card .upi { text-align: center; font-size: 14px; }
.pay-card .steps { font-size: 12.5px; color: var(--ink2); padding-left: 18px; }
.pay-card .x { position: absolute; top: 16px; right: 16px; padding: 6px 11px; }
#payForm { flex-direction: row; } #payForm input { flex: 1; min-width: 0; }
.mobile-only-pay { display: none; text-align: center; margin-bottom: 12px; width: 100%; }
@media (pointer: coarse) { .mobile-only-pay { display: flex; } }

/* ── admin ── */
.wrap { padding: 26px 28px; display: grid; gap: 20px; max-width: 1400px; margin: 0 auto; }
table.list { min-width: 0; } table.list th, table.list td { border-bottom: 1px solid #f1e8dc; padding: 10px 8px; font-size: 13px; text-align: left; background: transparent; color: var(--ink); font-family: var(--sans); }
table.list tr:first-child th { background: transparent; color: var(--mute); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.card { background: #fff; border: 1.5px solid var(--line); border-radius: 18px; padding: 16px; }
.card b { display: block; font-family: var(--serif); font-size: 30px; color: var(--acc); }
.card span { color: var(--mute); font-size: 12px; font-weight: 600; }
.pay-card .autopay { background: linear-gradient(120deg,#fff4e6,#ffe9df); border: 1.5px solid #f6d7c4; border-radius: 18px; padding: 14px; margin-bottom: 10px; }
.pay-card .autopay form { display: flex; gap: 8px; } .pay-card .autopay input { flex: 1; min-width: 0; }
.legal { max-width: 900px; margin: 0 auto; padding: 26px 16px 60px; display: grid; gap: 18px; }
.legal p, .legal li { color: var(--ink2); line-height: 1.65; } .legal a { color: var(--acc); }
.legal-nav { gap: 4px; } .legal-links { font-size: 12px; color: var(--mute); margin-top: 14px; } .legal-links a { color: var(--acc); text-decoration: none; }
.site-foot { text-align: center; color: var(--mute); font-size: 12px; padding: 10px 16px 40px; } .site-foot a { color: var(--ink2); }
