:root {
  --bg: #fbf7ed;
  --card: #fffaf1;
  --ink: #263024;
  --muted: #6d765f;
  --brand: #287246;
  --brand-dark: #174d2e;
  --accent: #d6a441;
  --line: #e8ddc8;
  --danger: #b64935;
  --shadow: 0 20px 50px rgba(38, 48, 36, .12);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #fff3d2, transparent 34rem), var(--bg);
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
.shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(251, 247, 237, .9); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.nav { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; }
.brand img { width: 44px; height: 44px; object-fit: contain; }
.nav-links { display: flex; gap: 18px; color: var(--muted); font-weight: 650; }
.hero { display: grid; grid-template-columns: 1.08fr .92fr; gap: 44px; align-items: center; padding: 64px 0 40px; }
.eyebrow { margin: 0 0 10px; color: var(--brand); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: .78rem; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2.5rem, 6vw, 5.5rem); line-height: .95; margin-bottom: 22px; color: var(--brand-dark); }
h2 { font-size: clamp(1.8rem, 3vw, 3rem); line-height: 1.05; margin-bottom: 16px; }
.lead { font-size: 1.22rem; color: var(--muted); line-height: 1.7; max-width: 640px; }
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 560px; margin: 28px 0; }
.hero-stats div { padding: 16px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255, 250, 241, .72); box-shadow: 0 10px 26px rgba(38,48,36,.06); }
.hero-stats strong { display: block; color: var(--brand-dark); font-size: 1.55rem; line-height: 1; }
.hero-stats span { display: block; margin-top: 6px; color: var(--muted); font-size: .9rem; font-weight: 750; }
.hero-actions, .category-tabs { display: flex; gap: 12px; flex-wrap: wrap; }
.button, .menu-card button, .link-button { border: 0; cursor: pointer; border-radius: 999px; font-weight: 800; }
.button { display: inline-flex; align-items: center; justify-content: center; padding: 13px 20px; }
.primary { background: var(--brand); color: white; box-shadow: 0 10px 24px rgba(40, 114, 70, .24); }
.ghost { background: #fff6e0; color: var(--brand-dark); border: 1px solid var(--line); }
.full { width: 100%; margin-top: 16px; }
.hero-card, .panel, .menu-card { background: rgba(255, 250, 241, .9); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); }
.hero-card { padding: 22px; transform: rotate(1deg); }
.hero-card img { width: 100%; border-radius: 22px; display: block; background: white; }
.table-chip { margin-top: 14px; padding: 13px 16px; border-radius: 16px; background: #ecf5e9; color: var(--brand-dark); }
.section { padding: 52px 0; }
.two-col { display: grid; grid-template-columns: .95fr 1.05fr; gap: 40px; align-items: start; }
.two-col p:last-child { color: var(--muted); font-size: 1.08rem; line-height: 1.8; }
.experience-grid { display: grid; grid-template-columns: 1.35fr repeat(3, 1fr); gap: 16px; }
.feature-card { min-height: 230px; padding: 24px; border: 1px solid var(--line); border-radius: 28px; background: rgba(255,255,255,.72); box-shadow: 0 14px 34px rgba(38,48,36,.08); }
.feature-card.highlight { background: linear-gradient(135deg, #fff8e6, #edf7e9); }
.feature-card p { color: var(--muted); line-height: 1.65; }
.step { display: inline-grid; place-items: center; width: 46px; height: 46px; margin-bottom: 18px; border-radius: 50%; background: var(--brand); color: white; font-weight: 900; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.section-subtitle { max-width: 600px; color: var(--muted); line-height: 1.65; margin-bottom: 0; }
.category-tabs button { padding: 10px 15px; border: 1px solid var(--line); background: white; color: var(--muted); border-radius: 999px; cursor: pointer; font-weight: 800; }
.category-tabs button.active { background: var(--brand); color: white; border-color: var(--brand); }
.menu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.menu-card { padding: 20px; min-height: 190px; display: flex; flex-direction: column; justify-content: space-between; }
.menu-card p { color: var(--muted); line-height: 1.55; }
.tag { display: inline-flex; margin-bottom: 12px; color: var(--brand); font-weight: 900; font-size: .75rem; }
.menu-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.menu-card strong { color: var(--brand-dark); font-size: 1.1rem; }
.menu-card button { padding: 10px 14px; background: var(--accent); color: #2d2109; }
.order-layout { display: grid; grid-template-columns: .9fr 1.1fr; gap: 22px; align-items: start; }
.panel { padding: 24px; }
label, legend { display: block; font-weight: 800; margin: 14px 0 8px; }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 16px; padding: 13px 14px; background: white; color: var(--ink); }
.hint { color: var(--muted); font-size: .92rem; line-height: 1.6; }
.payment-options { border: 1px solid var(--line); border-radius: 18px; margin: 18px 0 0; padding: 8px 16px 14px; }
.payment-options label { font-weight: 700; color: var(--muted); }
.payment-options input { width: auto; }
.cart-head, .total-row, .cart-line, .order-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.link-button { background: transparent; color: var(--danger); padding: 0; }
.cart-items { display: grid; gap: 12px; margin: 16px 0; }
.cart-items.empty { color: var(--muted); padding: 18px; background: #fff6e0; border-radius: 16px; }
.cart-line { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.qty-controls { display: flex; align-items: center; gap: 8px; }
.qty-controls button { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: white; cursor: pointer; }
.total-row { border-top: 2px solid var(--line); padding-top: 16px; font-size: 1.1rem; }
.payment-box { margin-top: 16px; padding: 16px; background: #eff7ec; border-radius: 18px; display: flex; align-items: center; gap: 14px; color: var(--brand-dark); }
.hidden { display: none; }
.fake-qr { width: 72px; height: 72px; flex: 0 0 auto; display: grid; place-items: center; background: repeating-linear-gradient(45deg, #111 0 5px, #fff 5px 10px); color: white; font-weight: 900; border: 6px solid white; }
.fake-qr.large { width: 148px; height: 148px; border-width: 10px; border-radius: 18px; color: var(--accent); text-shadow: 0 1px 1px #000; }
.qr-showcase { display: grid; grid-template-columns: 1fr 280px; gap: 24px; align-items: center; padding: 34px; border: 1px solid var(--line); border-radius: 32px; background: linear-gradient(135deg, rgba(255,250,241,.94), rgba(237,247,233,.94)); box-shadow: var(--shadow); }
.qr-showcase p { color: var(--muted); line-height: 1.75; }
.qr-card { justify-self: end; width: 240px; padding: 22px; border-radius: 28px; background: white; border: 1px solid var(--line); text-align: center; box-shadow: 0 16px 36px rgba(38,48,36,.1); }
.qr-card .fake-qr { margin: 0 auto 14px; }
.qr-card strong, .qr-card span { display: block; }
.qr-card span { margin-top: 6px; color: var(--muted); font-size: .86rem; word-break: break-all; }
.orders-list { display: grid; gap: 16px; }
.order-card { background: white; border: 1px solid var(--line); border-left: 6px solid var(--brand); border-radius: 22px; padding: 18px; box-shadow: 0 12px 30px rgba(38,48,36,.08); }
.order-card.done { opacity: .62; border-left-color: var(--muted); }
.order-meta { color: var(--muted); font-size: .92rem; }
.order-card ul { margin: 12px 0; padding-left: 20px; }
.status-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.status-actions button { border: 0; border-radius: 999px; padding: 9px 12px; cursor: pointer; font-weight: 800; }
.status-actions button:first-child { background: var(--brand); color: white; }
.status-actions button:last-child { background: #fff0eb; color: var(--danger); }
.footer { display: flex; justify-content: space-between; gap: 18px; padding: 32px 0 48px; color: var(--muted); border-top: 1px solid var(--line); }
@media (max-width: 860px) {
  .nav { align-items: flex-start; flex-direction: column; padding: 12px 0; }
  .nav-links { width: 100%; overflow-x: auto; padding-bottom: 4px; }
  .hero, .two-col, .order-layout { grid-template-columns: 1fr; }
  .experience-grid { grid-template-columns: 1fr 1fr; }
  .feature-card.highlight { grid-column: 1 / -1; }
  .qr-showcase { grid-template-columns: 1fr; padding: 24px; }
  .qr-card { justify-self: stretch; width: 100%; }
  .menu-grid { grid-template-columns: repeat(2, 1fr); }
  .section-heading { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 560px) {
  .hero-stats, .experience-grid { grid-template-columns: 1fr; }
  .menu-grid { grid-template-columns: 1fr; }
  h1 { font-size: 3rem; }
  .footer { flex-direction: column; }
}
.admin-layout { display: grid; grid-template-columns: minmax(260px, .72fr) minmax(0, 1.28fr); gap: 18px; align-items: start; }
.admin-layout .wide { grid-column: 1 / -1; }
.section-heading.compact { margin-bottom: 12px; }
.login-panel { position: sticky; top: 92px; }
.metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.metric-grid div { padding: 16px; border-radius: 18px; background: #eff7ec; border: 1px solid var(--line); }
.metric-grid strong { display: block; color: var(--brand-dark); font-size: 1.35rem; }
.metric-grid span { color: var(--muted); font-weight: 750; }
.admin-list { display: grid; gap: 10px; }
.admin-row { display: flex; justify-content: space-between; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: white; }
.admin-row span, .admin-row p { display: block; margin: 4px 0 0; color: var(--muted); line-height: 1.45; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.row-actions button { border: 0; border-radius: 999px; padding: 9px 12px; cursor: pointer; font-weight: 800; background: #fff6e0; color: var(--brand-dark); }
.row-actions button:last-child { background: #fff0eb; color: var(--danger); }
.compact-list { max-height: 420px; overflow: auto; padding-right: 4px; }
.qr-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.qr-print-card { padding: 16px; border: 1px solid var(--line); border-radius: 22px; background: white; text-align: center; box-shadow: 0 10px 26px rgba(38,48,36,.06); }
.qr-print-card img { width: 150px; height: 150px; object-fit: contain; display: block; margin: 0 auto 10px; }
.qr-print-card strong, .qr-print-card span { display: block; }
.qr-print-card span { margin: 6px 0 12px; color: var(--muted); font-size: .82rem; word-break: break-all; }
.status-actions button:nth-child(2) { background: var(--accent); color: #2d2109; }
.status-actions button:nth-child(4) { background: #fff0eb; color: var(--danger); }
@media print {
  body * { visibility: hidden; }
  #tableQrList, #tableQrList * { visibility: visible; }
  #tableQrList { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .qr-print-card { break-inside: avoid; box-shadow: none; }
  .qr-print-card a { display: none; }
}
@media (max-width: 860px) {
  .admin-layout { grid-template-columns: 1fr; }
  .login-panel { position: static; }
  .admin-row { flex-direction: column; }
  .row-actions { justify-content: flex-start; }
}
@media (max-width: 560px) {
  .metric-grid { grid-template-columns: 1fr; }
}
.login-panel { position: static; }
.login-panel.logged-in { background: linear-gradient(135deg, #eff7ec, #fffaf1); }
.role-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
#roleHome { background: linear-gradient(135deg, #fff8e6, #edf7e9); }
[data-permission].hidden, [data-permission-any].hidden, #seedDemoBtn.hidden { display: none; }
.menu-form { margin: 0 0 16px; padding: 16px; border: 1px dashed var(--brand); border-radius: 22px; background: #f4faef; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.form-grid label { margin: 0; }
.metric-grid .report-detail { grid-column: 1 / -1; padding: 16px; border-radius: 18px; background: white; border: 1px solid var(--line); }
.report-detail h3 { margin-bottom: 8px; color: var(--brand-dark); }
.report-detail ul { margin: 0; padding-left: 20px; color: var(--muted); line-height: 1.8; }
.locked-table { border-color: rgba(40, 114, 70, .45); background: linear-gradient(135deg, #eff7ec, #fffaf1); }
.locked-table input:read-only { color: var(--brand-dark); font-weight: 900; background: #eef8eb; cursor: not-allowed; }
@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
}
.report-dashboard { display: grid; gap: 18px; }
.report-dashboard .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-card { padding: 16px; border-radius: 18px; background: #eff7ec; border: 1px solid var(--line); }
.metric-card strong { display: block; color: var(--brand-dark); font-size: clamp(1.1rem, 2vw, 1.6rem); line-height: 1.15; }
.metric-card span { display: block; margin-top: 6px; color: var(--muted); font-weight: 800; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.report-card { padding: 16px; border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: 0 10px 26px rgba(38,48,36,.06); }
.report-card h3 { margin-bottom: 12px; color: var(--brand-dark); }
.report-card:last-child { grid-column: 1 / -1; }
.table-wrap { width: 100%; overflow-x: auto; }
.report-card table { width: 100%; border-collapse: collapse; min-width: 520px; }
.report-card th, .report-card td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.report-card th { position: sticky; top: 0; background: #fff6e0; color: var(--brand-dark); font-size: .86rem; text-transform: uppercase; letter-spacing: .04em; }
.report-card td { color: var(--muted); }
.report-card tbody tr:hover { background: #fbf7ed; }
@media (max-width: 980px) {
  .report-dashboard .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .report-dashboard .metric-grid { grid-template-columns: 1fr; }
}
.report-tabs { position: sticky; top: 74px; z-index: 4; display: flex; gap: 10px; flex-wrap: wrap; padding: 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,250,241,.92); backdrop-filter: blur(10px); }
.report-tabs a { padding: 9px 14px; border-radius: 999px; background: white; color: var(--brand-dark); font-weight: 900; border: 1px solid var(--line); }
.report-section { scroll-margin-top: 130px; display: grid; gap: 16px; }
.charts-grid .report-card:last-child { grid-column: auto; }
.chart-card { min-height: 260px; }
.bar-chart { min-height: 180px; display: flex; align-items: end; gap: 10px; padding: 12px 4px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.chart-bar { min-width: 48px; flex: 1; display: grid; align-items: end; gap: 8px; text-align: center; }
.chart-bar span { display: block; width: 100%; max-width: 42px; margin: 0 auto; border-radius: 12px 12px 4px 4px; background: linear-gradient(180deg, var(--brand), var(--brand-dark)); box-shadow: 0 8px 18px rgba(40,114,70,.18); }
.chart-bar small { color: var(--muted); font-weight: 800; font-size: .72rem; white-space: nowrap; transform: rotate(-18deg); transform-origin: top center; }
.hbar-chart { display: grid; gap: 12px; }
.hbar-row { display: grid; gap: 6px; }
.hbar-row div { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.hbar-row strong { color: var(--brand-dark); }
.hbar-row progress { width: 100%; height: 14px; appearance: none; }
.hbar-row progress::-webkit-progress-bar { border-radius: 999px; background: #f1eadb; }
.hbar-row progress::-webkit-progress-value { border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--brand)); }
.hbar-row progress::-moz-progress-bar { border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--brand)); }
@media (max-width: 860px) {
  .report-tabs { top: 0; border-radius: 22px; }
  .report-tabs a { flex: 1; text-align: center; }
}

.report-panel { width: min(1480px, calc(100vw - 32px)); justify-self: center; }
.report-panel .section-heading { align-items: center; }
.report-dashboard { max-width: 100%; }
.report-dashboard .metric-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.report-section { min-height: min(72vh, 760px); }
.report-section .metric-grid { align-content: start; }
.report-grid { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); align-items: start; }
.charts-grid { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.report-card:last-child { grid-column: 1 / -1; }
.report-card { min-width: 0; }
.table-wrap { max-height: 58vh; border: 1px solid var(--line); border-radius: 14px; }
.report-card table { min-width: 680px; }
@media (min-width: 1180px) {
  .report-panel { margin-left: calc((1120px - min(1480px, calc(100vw - 32px))) / 2); margin-right: calc((1120px - min(1480px, calc(100vw - 32px))) / 2); }
}
@media (max-width: 720px) {
  .report-panel { width: min(100%, calc(100vw - 32px)); }
  .report-grid, .charts-grid { grid-template-columns: 1fr; }
  .report-card table { min-width: 620px; }
  .table-wrap { max-height: 70vh; }
}
.qr-assist-panel { background: linear-gradient(135deg, #fff8e6, #edf7e9); }
.qr-assist-form { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 12px; align-items: end; }
.qr-assist-form label { margin: 0; }
.assist-qr-box { margin-top: 18px; }
.assist-qr-card { display: grid; grid-template-columns: 260px 1fr; gap: 22px; align-items: center; padding: 18px; border: 1px solid var(--line); border-radius: 24px; background: white; box-shadow: 0 16px 36px rgba(38,48,36,.1); }
.assist-qr-card img { width: 260px; height: 260px; object-fit: contain; padding: 10px; border-radius: 20px; background: #fffaf1; border: 1px solid var(--line); }
.assist-qr-card h3 { font-size: clamp(2rem, 5vw, 4rem); color: var(--brand-dark); margin-bottom: 10px; }
.assist-qr-card p:not(.eyebrow) { color: var(--muted); word-break: break-all; line-height: 1.6; }
@media (max-width: 720px) {
  .qr-assist-form, .assist-qr-card { grid-template-columns: 1fr; }
  .assist-qr-card img { width: min(100%, 320px); height: auto; justify-self: center; }
}
.member-section { padding-top: 24px; }
.member-panel { display: grid; grid-template-columns: .9fr 1.1fr; gap: 22px; align-items: center; background: linear-gradient(135deg, #eff7ec, #fff8e6); }
.member-box { display: grid; gap: 12px; }
.member-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px; border-radius: 20px; background: white; border: 1px solid var(--line); }
.member-card strong, .member-card span { display: block; }
.member-card span { margin-top: 4px; color: var(--muted); font-size: .92rem; }
.point-badge { min-width: 96px; padding: 12px 14px; border-radius: 999px; background: var(--brand); color: white; text-align: center; font-weight: 900; }
.reward-progress { height: 14px; border-radius: 999px; background: #f1eadb; overflow: hidden; border: 1px solid var(--line); }
.reward-progress div { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--brand)); }
.member-password { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; }
@media (max-width: 860px) { .member-panel, .member-password { grid-template-columns: 1fr; } }
