:root {
  --pink:        #ec3f8f;
  --pink-600:    #e21d7e;
  --pink-700:    #c81670;
  --pink-soft:   #fde9f3;
  --pink-bg:     #fdeef5;
  --pink-line:   #f8d3e6;
  --ink:         #20222b;
  --ink-soft:    #4b4f5e;
  --muted:       #8a8f9c;
  --green:       #16b981;
  --green-soft:  #d7f6e9;
  --red:         #e5484d;
  --white:       #ffffff;
  --radius:      18px;
  --radius-sm:   12px;
  --shadow:      0 1px 2px rgba(30,20,40,.04), 0 8px 24px rgba(200,22,112,.06);
  --shadow-lg:   0 12px 40px rgba(200,22,112,.14);
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--pink-bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 14px; }

.hidden { display: none !important; }

/* ---------- Top bar ---------- */
.topbar {
  background: linear-gradient(95deg, var(--pink) 0%, var(--pink-600) 100%);
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 26px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 4px 18px rgba(200,22,112,.18);
}
.brand { display: flex; align-items: center; gap: 13px; }
.brand .logo {
  width: 46px; height: 46px; border-radius: 50%; background: #fff;
  display: grid; place-items: center; overflow: hidden; flex: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.brand .logo img { width: 100%; height: 100%; object-fit: cover; }
.brand .logo span { font-size: 22px; }
.brand h1 { font-size: 18px; font-weight: 800; line-height: 1.05; letter-spacing: .2px; }
.brand p { font-size: 11.5px; opacity: .85; font-weight: 500; }

.clock { text-align: center; font-size: 13px; line-height: 1.3; opacity: .96; }
.clock .date { font-weight: 700; }
.clock .time { font-size: 12px; opacity: .8; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: 999px; font-weight: 600; font-size: 14px;
  color: #fff; opacity: .92; transition: .15s; white-space: nowrap;
}
.nav a:hover { background: rgba(255,255,255,.14); opacity: 1; }
.nav a.active { background: #fff; color: var(--pink-600); opacity: 1; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.nav a svg { width: 16px; height: 16px; }

.userbox { display: flex; align-items: center; gap: 11px; padding-left: 14px; border-left: 1px solid rgba(255,255,255,.25); }
.userbox .avatar { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.25); display: grid; place-items: center; font-weight: 700; }
.userbox .meta { line-height: 1.15; }
.userbox .meta .nm { font-weight: 700; font-size: 13.5px; }
.userbox .meta .rl { font-size: 10.5px; letter-spacing: .12em; opacity: .8; text-transform: uppercase; }
.userbox .logout-btn { display: inline-flex; align-items: center; gap: 7px; color: var(--pink-600); background: #fff; font-weight: 700; font-size: 13px; padding: 8px 15px; border-radius: 999px; transition: .15s; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.userbox .logout-btn svg { width: 15px; height: 15px; }
.userbox .logout-btn:hover { background: var(--pink-soft); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; font-weight: 700; font-size: 14px;
  background: var(--pink); color: #fff; transition: .15s; box-shadow: var(--shadow);
}
.btn:hover { background: var(--pink-600); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.lg { padding: 15px 26px; font-size: 15px; }
.btn.block { width: 100%; }
.btn.ghost { background: #fff; color: var(--pink-600); border: 1.5px solid var(--pink-line); box-shadow: none; }
.btn.ghost:hover { background: var(--pink-soft); }
.btn.dark { background: #1f2230; }
.btn.dark:hover { background: #2c3042; }
.btn.danger { background: #fff; color: var(--red); border: 1.5px solid #f6c9cb; box-shadow: none; }
.btn.danger:hover { background: #fdecec; }
.btn.sm { padding: 8px 14px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- Page chrome ---------- */
.page { padding: 30px 34px 60px; max-width: 1600px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 16px; }
.page-head h2 { font-size: 30px; font-weight: 800; letter-spacing: -.5px; }
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 3px; }

.card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px;
}

/* ---------- Inputs ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--ink-soft); }
.input, select.input, textarea.input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--pink-line);
  border-radius: var(--radius-sm); background: #fff; color: var(--ink); transition: .15s;
}
.input:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px rgba(236,63,143,.13); }
textarea.input { resize: vertical; min-height: 60px; }

/* ---------- Toggle ---------- */
.toggle { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.toggle input { display: none; }
.toggle .track { position: absolute; inset: 0; background: var(--pink-line); border-radius: 999px; transition: .2s; }
.toggle .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle input:checked + .track { background: var(--pink); }
.toggle input:checked + .track::after { transform: translateX(20px); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 50% -10%, #ffd9ec, var(--pink-bg)); padding: 20px; }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 24px; padding: 38px 32px; box-shadow: var(--shadow-lg); }
.login-card .logo { width: 88px; height: 88px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 30px; margin: 0 auto 16px; color: #fff; overflow: hidden; box-shadow: 0 4px 16px rgba(200,22,112,.18); }
.login-card .logo img { width: 100%; height: 100%; object-fit: cover; }
.login-card h1 { text-align: center; font-size: 24px; font-weight: 800; }
.login-card .tagline { text-align: center; color: var(--muted); margin-bottom: 26px; font-size: 14px; }
.login-card .err { background: #fdecec; color: var(--red); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; font-weight: 600; }
.login-hint { text-align: center; font-size: 12px; color: var(--muted); margin-top: 18px; line-height: 1.6; }

/* ===================== ORDER SCREEN ===================== */
.order-layout { display: grid; grid-template-columns: 1fr 560px; gap: 0; height: calc(100vh - 74px); }
.order-menu { padding: 22px 26px; overflow-y: auto; }
.cats { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.cat {
  padding: 9px 22px; border-radius: 999px; font-weight: 700; font-size: 14px;
  background: #fff; color: var(--ink-soft); box-shadow: var(--shadow); transition: .15s;
}
.cat.active { background: var(--pink); color: #fff; }
.cat.togo { border: 1.5px dashed var(--pink); color: var(--pink-600); background: #fff; box-shadow: none; }
.cat.held-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid #fed7aa; background: #fff7ed; color: #c2680c; box-shadow: none; }
.cat.held-btn svg { width: 16px; height: 16px; }
.cat.held-btn:hover { background: #ffedd5; }
.cat.held-btn.has-held { background: #c2680c; color: #fff; border-color: #c2680c; }
.held-strip { margin-bottom: 18px; }
.held-strip.hidden { display: none; }
.held-strip-head { font-size: 12px; font-weight: 800; letter-spacing: .08em; color: #c2680c; display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.held-strip-cards { display: flex; gap: 12px; flex-wrap: wrap; }
.held-card2 { width: 210px; border: 1.5px solid #fcd9b0; border-radius: 14px; padding: 12px 14px; background: #fffaf2; box-shadow: var(--shadow); }
.held-card2-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.held-card2-name { font-weight: 800; font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.held-card2-del { color: var(--red); padding: 2px; border-radius: 6px; line-height: 0; flex: none; }
.held-card2-del svg { width: 16px; height: 16px; }
.held-card2-del:hover { background: #fdecec; }
.held-card2-meta { color: var(--muted); font-size: 12px; margin: 3px 0 10px; }
.held-card2-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.held-card2-total { font-weight: 800; font-size: 17px; }
.held-card2-resume { background: var(--pink); color: #fff; font-weight: 700; font-size: 13px; padding: 7px 14px; border-radius: 999px; display: inline-flex; align-items: center; gap: 4px; }
.held-card2-resume:hover { background: var(--pink-600); }

.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.menu-card {
  position: relative; background: #fff; border-radius: var(--radius); padding: 26px 18px 20px;
  text-align: center; box-shadow: var(--shadow); transition: .15s; cursor: pointer; border: 2px solid transparent;
}
.menu-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--pink-line); }
.menu-card.sold { opacity: .55; cursor: not-allowed; }
.menu-card.sold:hover { transform: none; box-shadow: var(--shadow); border-color: transparent; }
.menu-card .emoji { font-size: 42px; line-height: 1; margin-bottom: 14px; }
.menu-card .nm { font-weight: 700; font-size: 14px; letter-spacing: .02em; }
.menu-card .pr { font-weight: 800; font-size: 22px; margin-top: 6px; }
.menu-card .offer { font-size: 12px; color: var(--green); font-weight: 700; margin-top: 3px; }
.badge { position: absolute; top: 12px; padding: 4px 10px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.badge.sold { right: 12px; background: #6b7280; color: #fff; }
.badge.offer { left: 12px; background: var(--green-soft); color: #0e8c63; display: flex; align-items: center; gap: 4px; }

/* cart */
.cart { background: #fff; border-left: 1px solid var(--pink-line); display: flex; flex-direction: column; height: 100%; }
.cart-head { padding: 20px 22px 14px; display: flex; align-items: center; justify-content: space-between; }
.cart-head h3 { font-size: 18px; font-weight: 800; }
.cart-head .ono { color: var(--muted); font-weight: 700; }
.cart-name { padding: 0 22px 14px; }
.cart-body { flex: 1; overflow-y: auto; padding: 0 22px; }
.cart-empty { text-align: center; color: var(--muted); padding: 80px 20px; }
.cart-empty .big { font-size: 17px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.cart-line { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--pink-line); }
.cart-line .cl-emoji { font-size: 24px; }
.cart-line .cl-info { flex: 1; }
.cart-line .cl-name { font-weight: 700; font-size: 14px; }
.cart-line .cl-price { color: var(--muted); font-size: 12.5px; }
.cart-line .cl-offer { color: var(--green); font-size: 12px; font-weight: 700; }
.qty { display: flex; align-items: center; gap: 9px; }
.qty button { width: 28px; height: 28px; border-radius: 8px; background: var(--pink-soft); color: var(--pink-600); font-weight: 800; font-size: 16px; display: grid; place-items: center; }
.qty button:hover { background: var(--pink); color: #fff; }
.qty .n { font-weight: 700; min-width: 18px; text-align: center; }
.cart-line .cl-total { font-weight: 800; min-width: 56px; text-align: right; }
.cart-foot { border-top: 1px solid var(--pink-line); padding: 16px 22px 20px; }
.tip-row { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.tip-row .tip-btn { flex: 1; padding: 9px 0; border-radius: 10px; border: 1.5px solid var(--pink-line); font-weight: 700; font-size: 13px; background: #fff; min-width: 60px; }
.tip-row .tip-btn.active { background: var(--pink); color: #fff; border-color: var(--pink); }
.sumline { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; color: var(--ink-soft); }
.sumline.discount { color: var(--green); font-weight: 600; }
.sumline.total { font-size: 24px; font-weight: 800; color: var(--ink); padding-top: 8px; }
.sumline.total .amt { color: var(--pink-600); }
.cart-actions { display: flex; gap: 10px; margin-top: 14px; align-items: center; }
.icon-btn { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: #fff; border: 1.5px solid var(--pink-line); color: var(--ink-soft); }
.icon-btn:hover { background: var(--pink-soft); color: var(--pink-600); }
.icon-btn.held { background: #fff7ed; border-color: #fed7aa; color: #c2680c; font-weight: 700; gap: 6px; width: auto; padding: 0 14px; }

/* payment modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(40,15,40,.45); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal { background: #fff; border-radius: 22px; padding: 28px; width: 100%; max-width: 460px; box-shadow: var(--shadow-lg); max-height: 90vh; overflow-y: auto; }
.modal h3 { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.modal .modal-sub { color: var(--muted); margin-bottom: 20px; font-size: 14px; }
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.pay-opt { padding: 16px; border-radius: 14px; border: 2px solid var(--pink-line); font-weight: 700; text-align: center; transition: .15s; text-transform: capitalize; }
.pay-opt:hover { border-color: var(--pink); }
.pay-opt.active { background: var(--pink); color: #fff; border-color: var(--pink); }
.modal-actions { display: flex; gap: 10px; margin-top: 8px; }

/* ---- checkout cash keypad ---- */
.checkout-modal { max-width: 720px; }
.checkout-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.tender-due { background: var(--pink-soft); border-radius: 16px; padding: 18px 20px; margin-bottom: 14px; }
.tender-lbl { font-size: 11px; font-weight: 800; letter-spacing: .1em; color: var(--muted); }
.tender-amt { font-size: 34px; font-weight: 800; color: var(--pink-600); margin-top: 4px; }
.tender-received { border: 1.5px solid var(--pink-line); border-radius: 16px; padding: 16px 20px; margin-bottom: 14px; }
.tender-recv { font-size: 30px; font-weight: 800; }
.tender-change { font-size: 30px; font-weight: 800; color: var(--green); }
.cashpad { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.quickcash { display: flex; gap: 8px; }
.quickcash .qc { flex: 1; padding: 14px 0; border-radius: 12px; border: 1.5px solid var(--pink-line); background: #fff; font-weight: 800; font-size: 15px; }
.quickcash .qc:hover { background: var(--pink-soft); }
.quickcash .qc.exact { background: var(--green); color: #fff; border-color: var(--green); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad .key { padding: 18px 0; border-radius: 14px; background: var(--pink-soft); font-size: 24px; font-weight: 800; color: var(--ink); transition: .12s; }
.keypad .key:hover { background: var(--pink); color: #fff; }
@media (max-width: 720px) { .cashpad { grid-template-columns: 1fr; } }

/* ===================== TABLES ===================== */
.table { width: 100%; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.table-row { display: flex; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--pink-line); }
.table-row:last-child { border-bottom: none; }
.table-row.head { background: var(--pink-soft); font-weight: 700; font-size: 13px; color: var(--ink-soft); text-transform: none; }
.table-row .it-emoji { width: 42px; height: 42px; border-radius: 10px; background: var(--pink-soft); display: grid; place-items: center; font-size: 22px; margin-right: 14px; flex: none; }
.empty-state { text-align: center; color: var(--muted); padding: 60px 20px; font-size: 15px; }

.search { width: 100%; max-width: 340px; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .03em; }
.tag.admin { background: var(--pink-soft); color: var(--pink-700); }
.tag.cashier { background: var(--green-soft); color: #0e8c63; }
.tag.paid { background: var(--green-soft); color: #0e8c63; }
.tag.held { background: #fff7ed; color: #c2680c; }

/* ===================== REPORTS ===================== */
.range-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.range-btn { padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: 13px; background: #fff; color: var(--ink-soft); box-shadow: var(--shadow); }
.range-btn.active { background: var(--pink); color: #fff; }
.event-filter { display: flex; gap: 8px; align-items: center; margin-bottom: 22px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.event-chip { padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; background: #fff; box-shadow: var(--shadow); }
.event-chip.active { background: var(--green); color: #fff; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.stat .lbl { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 12px; }
.stat .lbl .dot { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; }
.stat .val { font-size: 30px; font-weight: 800; }
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.report-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; }
.report-card h4 { font-size: 15px; font-weight: 800; margin-bottom: 16px; }
.report-card .nodata { color: var(--muted); text-align: center; padding: 50px 0; }
.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 11px; font-size: 13px; }
.bar-row .bl { width: 120px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .bt { flex: 1; height: 10px; background: var(--pink-soft); border-radius: 999px; overflow: hidden; }
.bar-row .bt span { display: block; height: 100%; background: var(--pink); border-radius: 999px; }
.bar-row .bv { width: 70px; text-align: right; font-weight: 700; }
svg.chart { width: 100%; display: block; }

@media (max-width: 1100px) {
  .order-layout { grid-template-columns: 1fr; height: auto; }
  .cart { border-left: none; border-top: 1px solid var(--pink-line); }
  .report-grid { grid-template-columns: 1fr; }
  .nav span.lbl { display: none; }
}
