@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&display=swap');

/* ============ Design tokens ============ */
:root {
  --cream-50: #FFFDF9;
  --cream-100: #FAF7F2;
  --cream-200: #F2EBE0;
  --cream-300: #E8DECF;

  --espresso: #2A211B;
  --espresso-soft: #5C4433;
  --mocha: #6F635A;
  --muted: #9A8E83;

  --gold: #C8A24B;
  --gold-soft: #E2C778;
  --gold-deep: #9C7327;
  --gold-grad: linear-gradient(135deg, #E2C778 0%, #C8A24B 55%, #9C7327 100%);

  --line: #ECE3D6;
  --white: #FFFFFF;

  --ok: #2E7D5B;
  --ok-bg: #E6F4EC;
  --warn: #B7791F;
  --warn-bg: #FBF1DD;
  --info: #2C6E9B;
  --info-bg: #E6F0F8;
  --danger: #B4453C;
  --danger-bg: #FBEAE8;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --shadow-sm: 0 6px 18px -12px rgba(42, 33, 27, 0.30);
  --shadow: 0 18px 44px -26px rgba(42, 33, 27, 0.40);
  --shadow-lg: 0 30px 70px -40px rgba(42, 33, 27, 0.45);
  --ring: 0 0 0 4px rgba(200, 162, 75, 0.28);

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

/* ============ Base ============ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--espresso);
  background: var(--cream-100);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; color: var(--espresso); line-height: 1.18; margin: 0 0 .4em; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1rem; color: var(--mocha); }
a { color: var(--gold-deep); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--espresso); }
img { max-width: 100%; display: block; }
small { font-size: .82rem; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 560px; }
.section { padding: 48px 0; }
.muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.serif { font-family: var(--font-display); }
.eyebrow { text-transform: uppercase; letter-spacing: .22em; font-size: .72rem; font-weight: 600; color: var(--gold-deep); }
.price { font-family: var(--font-display); font-weight: 600; color: var(--espresso); }
.divider { height: 1px; background: var(--line); border: 0; margin: 22px 0; }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }

/* ============ Brand logo ============ */
.od-logo { display: inline-flex; align-items: center; gap: 12px; }
.od-mark { flex: none; filter: drop-shadow(0 6px 12px rgba(156, 115, 39, .18)); }
.od-logo__text { display: flex; flex-direction: column; line-height: 1; }
.od-logo__name { font-family: var(--font-display); font-weight: 600; font-size: 1.32rem; letter-spacing: -.01em; }
.od-logo__tag { font-size: .58rem; letter-spacing: .26em; font-weight: 600; margin-top: 4px; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: .95rem;
  padding: 12px 22px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform .12s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--gold-grad); color: #3a2c10; box-shadow: 0 14px 30px -16px rgba(156, 115, 39, .8); }
.btn-primary:hover { color: #2a1f0a; box-shadow: 0 18px 36px -16px rgba(156, 115, 39, .95); }
.btn-dark { background: var(--espresso); color: #fff; }
.btn-dark:hover { background: #1c150f; color: #fff; }
.btn-ghost { background: transparent; color: var(--espresso); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-deep); background: var(--cream-50); }
.btn-soft { background: var(--cream-200); color: var(--espresso-soft); }
.btn-soft:hover { background: var(--cream-300); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-danger:hover { background: #f6dcd9; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: .85rem; }
.btn-lg { padding: 15px 30px; font-size: 1.02rem; }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ============ Cards & surfaces ============ */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 26px; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.surface-cream { background: var(--cream-50); }

/* ============ Badges ============ */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: .75rem; font-weight: 600; letter-spacing: .01em; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-muted { background: var(--cream-200); color: var(--mocha); }
.badge-gold { background: linear-gradient(135deg,#fbf1d8,#f3e3bb); color: var(--gold-deep); border: 1px solid #ecdcae; }

/* ============ Forms ============ */
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 7px; color: var(--espresso-soft); }
.input, .select, .textarea {
  width: 100%; font-family: var(--font-body); font-size: .98rem; color: var(--espresso);
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--white); transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--gold); box-shadow: var(--ring); outline: none; }
.textarea { min-height: 90px; resize: vertical; }
.field-hint { font-size: .8rem; color: var(--muted); margin-top: 6px; }
.field-error { font-size: .82rem; color: var(--danger); margin-top: 6px; }
.input-error { border-color: var(--danger); }
.checkbox-row { display: flex; align-items: center; gap: 10px; }
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--gold-deep); }

/* ============ Flash ============ */
.flash-stack { position: fixed; top: 18px; right: 18px; z-index: 90; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.flash { padding: 13px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow); font-size: .9rem; font-weight: 500; display: flex; gap: 10px; align-items: flex-start; animation: flashIn .3s ease; background: #fff; border-left: 4px solid var(--mocha); }
.flash-success { border-color: var(--ok); color: var(--ok); }
.flash-error { border-color: var(--danger); color: var(--danger); }
.flash-info { border-color: var(--info); color: var(--info); }
@keyframes flashIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ============ Customer top nav ============ */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(255,253,249,.86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar .container { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 18px; }
.topnav { display: flex; align-items: center; gap: 26px; }
.topnav a { color: var(--espresso-soft); font-weight: 500; font-size: .95rem; }
.topnav a:hover, .topnav a.active { color: var(--gold-deep); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.points-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px; background: linear-gradient(135deg,#fbf1d8,#f3e3bb); border: 1px solid #ecdcae; color: var(--gold-deep); font-weight: 600; font-size: .85rem; }
.cart-link { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--espresso); }
.cart-link:hover { border-color: var(--gold); }
.cart-count { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--gold-grad); color: #3a2c10; font-size: .68rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* ============ Footer ============ */
.footer { background: var(--espresso); color: rgba(255,255,255,.7); padding: 40px 0; margin-top: 56px; }
.footer .od-logo__name { color: #fff; }
.footer a { color: var(--gold-soft); }

/* ============ Hero ============ */
.hero { position: relative; overflow: hidden; padding: 60px 0 30px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero h1 { margin-bottom: 16px; }
.hero p.lead { font-size: 1.1rem; color: var(--mocha); max-width: 46ch; }
.hero-card { background: var(--gold-grad); border-radius: var(--radius-xl); padding: 40px; color: #3a2c10; box-shadow: var(--shadow-lg); }
.hero-card h3 { color: #3a2c10; font-size: 1.5rem; }

/* ============ Menu ============ */
.menu-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 30px; }
.chip { padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: .88rem; color: var(--espresso-soft); cursor: pointer; transition: all .15s ease; }
.chip:hover { border-color: var(--gold); }
.chip.active { background: var(--espresso); color: #fff; border-color: var(--espresso); }

.menu-cat-title { display: flex; align-items: baseline; gap: 14px; margin: 38px 0 18px; }
.menu-cat-title h2 { margin: 0; }
.menu-cat-title .line { flex: 1; height: 1px; background: var(--line); }

.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 22px; }
.menu-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; transition: transform .18s ease, box-shadow .25s ease; }
.menu-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.menu-thumb { aspect-ratio: 4/3; background: var(--cream-200); position: relative; overflow: hidden; }
.menu-thumb img { width: 100%; height: 100%; object-fit: cover; }
.menu-thumb .placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,var(--cream-200),var(--cream-300)); }
.menu-thumb .tag-top { position: absolute; top: 12px; left: 12px; }
.menu-body { padding: 18px; display: flex; flex-direction: column; flex: 1; }
.menu-body h3 { font-size: 1.12rem; margin-bottom: 4px; }
.menu-body .desc { font-size: .86rem; color: var(--mocha); flex: 1; margin-bottom: 14px; min-height: 38px; }
.menu-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.menu-foot .price { font-size: 1.18rem; }
.stock-note { font-size: .76rem; font-weight: 600; }
.stock-low { color: var(--warn); }
.stock-out { color: var(--danger); }

/* ============ Generic grids ============ */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 28px; align-items: start; }

/* ============ Cart / order lines ============ */
.line-item { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.line-item:last-child { border-bottom: 0; }
.line-thumb { width: 70px; height: 70px; border-radius: 12px; object-fit: cover; background: var(--cream-200); flex: none; }
.line-main { flex: 1; min-width: 0; }
.line-title { font-weight: 600; }
.qty-control { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.qty-control button { width: 34px; height: 34px; border: 0; background: #fff; cursor: pointer; font-size: 1.1rem; color: var(--espresso); }
.qty-control button:hover { background: var(--cream-100); }
.qty-control span { min-width: 34px; text-align: center; font-weight: 600; }

.summary-row { display: flex; justify-content: space-between; padding: 7px 0; color: var(--mocha); }
.summary-row.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px; font-size: 1.25rem; font-family: var(--font-display); font-weight: 600; color: var(--espresso); }

/* ============ Auth ============ */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-aside { background: var(--espresso); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-aside::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle, rgba(200,162,75,.35), transparent 70%); }
.auth-aside h1 { color: #fff; font-size: 2.4rem; position: relative; }
.auth-aside p { color: rgba(255,255,255,.72); position: relative; max-width: 38ch; }
.auth-quote { font-family: var(--font-display); font-size: 1.25rem; font-style: italic; color: rgba(255,255,255,.9); position: relative; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--cream-100); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .od-logo { margin-bottom: 26px; }
.auth-switch { text-align: center; margin-top: 18px; font-size: .9rem; color: var(--mocha); }

/* ============ Receipt ============ */
.receipt { max-width: 460px; margin: 0 auto; background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--line); }
.receipt-head { background: var(--gold-grad); padding: 28px; text-align: center; color: #3a2c10; }
.receipt-queue { background: var(--espresso); color: #fff; text-align: center; padding: 22px; }
.receipt-queue .num { font-family: var(--font-display); font-size: 3rem; font-weight: 700; color: var(--gold-soft); line-height: 1; }
.receipt-body { padding: 26px; }
.receipt-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; font-size: .85rem; margin-bottom: 18px; }
.receipt-meta .k { color: var(--muted); }
.receipt-line { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: .9rem; border-bottom: 1px dashed var(--line); }
.receipt-foot { text-align: center; font-size: .82rem; color: var(--muted); padding: 0 26px 26px; }
.dashed-top { border-top: 2px dashed var(--line); }

/* ============ Steps / status timeline ============ */
.steps { display: flex; gap: 8px; margin: 18px 0; }
.step { flex: 1; text-align: center; font-size: .72rem; color: var(--muted); }
.step .dot { height: 6px; border-radius: 999px; background: var(--cream-300); margin-bottom: 8px; }
.step.done .dot { background: var(--gold-grad); }
.step.done { color: var(--espresso-soft); font-weight: 600; }

/* ============ QRIS ============ */
.qris-box { text-align: center; padding: 24px; border: 2px dashed var(--gold); border-radius: var(--radius-lg); background: var(--cream-50); }
.qris-box img { max-width: 300px; margin: 0 auto 14px; border-radius: 12px; }
.qris-placeholder { width: 260px; height: 260px; margin: 0 auto 14px; border-radius: 12px; background: #fff; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--muted); padding: 20px; }

/* ============ Reward cards ============ */
.reward-card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; transition: box-shadow .2s ease, transform .18s ease; }
.reward-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.reward-card.locked { opacity: .72; }
.reward-cost { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--gold-deep); font-family: var(--font-display); }

/* ============ Tables ============ */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th { text-align: left; padding: 13px 16px; background: var(--cream-100); color: var(--espresso-soft); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: var(--cream-50); }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ============ Admin shell ============ */
.admin { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.sidebar { background: var(--espresso); color: rgba(255,255,255,.72); padding: 26px 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { padding: 0 8px 22px; margin-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand .od-logo__name { color: #fff; }
.sidebar nav { display: flex; flex-direction: column; gap: 3px; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: rgba(255,255,255,.74); font-weight: 500; font-size: .92rem; }
.sidebar nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar nav a.active { background: var(--gold-grad); color: #3a2c10; font-weight: 600; }
.sidebar nav .nav-badge { margin-left: auto; background: var(--danger); color: #fff; border-radius: 999px; font-size: .7rem; padding: 1px 8px; font-weight: 700; }
.sidebar nav a.active .nav-badge { background: #3a2c10; color: var(--gold-soft); }
.sidebar .group-label { padding: 18px 14px 6px; font-size: .68rem; text-transform: uppercase; letter-spacing: .16em; color: rgba(255,255,255,.4); }
.admin-main { background: var(--cream-100); min-width: 0; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; padding: 20px 32px; border-bottom: 1px solid var(--line); background: rgba(255,253,249,.7); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; }
.admin-content { padding: 30px 32px 56px; }
.admin-user { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--gold-grad); color: #3a2c10; display: flex; align-items: center; justify-content: center; font-weight: 700; }

/* ============ Stat cards ============ */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stat .label { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-family: var(--font-display); font-size: 1.9rem; font-weight: 600; margin-top: 6px; color: var(--espresso); }
.stat .sub { font-size: .82rem; color: var(--mocha); margin-top: 4px; }
.stat.accent { background: var(--gold-grad); border: 0; color: #3a2c10; }
.stat.accent .label, .stat.accent .value, .stat.accent .sub { color: #3a2c10; }

/* ============ Page header ============ */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 1.8rem; }
.page-head .sub { color: var(--mocha); margin: 4px 0 0; }

/* ============ Empty state ============ */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .od-mark { margin: 0 auto 18px; opacity: .6; }

/* ============ Utilities ============ */
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.wrap { flex-wrap: wrap; }
.stack > * + * { margin-top: 14px; }
.w-full { width: 100%; }
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.print-only { display: none; }

/* ============ Responsive ============ */
@media (max-width: 980px) {
  .hero-grid, .split { grid-template-columns: 1fr; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .admin { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -280px; z-index: 100; transition: left .25s ease; width: 264px; box-shadow: var(--shadow-lg); }
  .sidebar.open { left: 0; }
  .admin-menu-toggle { display: inline-flex !important; }
}
@media (max-width: 760px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .topnav { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .receipt-meta { grid-template-columns: 1fr; }
  .container { padding: 0 18px; }
}
.admin-menu-toggle { display: none; }

/* ============ Print (receipt) ============ */
@media print {
  .no-print { display: none !important; }
  .print-only { display: block; }
  body { background: #fff; }
  .receipt { box-shadow: none; border: 1px solid #ddd; max-width: 100%; }
}
