:root {
  color-scheme:light; color:#282838; background:#f1f0f5;
  font-family:system-ui,-apple-system,"PingFang HK","Noto Sans TC",sans-serif; line-height:1.5;
  --purple:#6250b5; --strong:#50409c; --soft:#eeeaf9; --line:#e3e0eb; --muted:#68647b;
}
* { box-sizing:border-box; }
[hidden] { display:none !important; }
body { margin:0; }
.mast { background:#fff; border-bottom:1px solid var(--line); }
.mast-inner { max-width:1060px; margin:auto; padding:15px 24px; display:flex; gap:12px; align-items:center; justify-content:space-between; }
.brand { color:#007ab4; font-weight:750; font-size:1.25rem; letter-spacing:.09em; }
main { max-width:1060px; margin:auto; padding:30px 24px 44px; }
.panel { background:#fff; border:1px solid var(--line); border-radius:13px; }
.overview-head { padding:20px 24px; display:flex; align-items:center; justify-content:space-between; gap:12px; border-bottom:1px solid var(--line); }
h1,h2,p { margin:0; }
h1 { font-size:1.35rem; line-height:1.3; }
h2 { font-size:1.13rem; }
.demo { color:var(--muted); font-size:.875rem; margin-top:2px; }
button,input,select { font:inherit; color:inherit; }
button { background:#fff; border:1px solid #d8d4e3; border-radius:8px; padding:7px 12px; min-height:40px; cursor:pointer; }
button:hover:not(:disabled) { background:#f7f5fc; }
button:disabled { opacity:.43; cursor:default; }
button:focus-visible,input:focus-visible,select:focus-visible { outline:2px solid var(--purple); outline-offset:2px; }
.primary { color:white; border-color:var(--purple); background:var(--purple); font-weight:650; }
.primary:hover:not(:disabled) { background:var(--strong); }
.date-button { display:flex; min-width:0; align-items:center; gap:8px; text-align:left; }
.date-button svg { width:19px; flex:0 0 19px; }
.chevron { flex:0 0 6px; width:6px; height:6px; border-right:1.5px solid var(--muted); border-bottom:1.5px solid var(--muted); transform:rotate(45deg); margin-left:4px; margin-bottom:3px; }
.metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); border-bottom:1px solid var(--line); }
.metric { text-align:left; min-width:0; border:0; border-radius:0; border-bottom:3px solid transparent; padding:22px 24px 19px; }
.metric + .metric { border-left:1px solid #f1eff6; }
.metric[aria-pressed="true"] { border-bottom-color:var(--purple); background:#faf8fe; }
.metric span { display:block; color:var(--muted); font-weight:550; font-size:.95rem; }
.metric strong { display:block; margin-top:5px; font-size:clamp(1.15rem,4vw,2.15rem); font-variant-numeric:tabular-nums; line-height:1.22; overflow-wrap:anywhere; }
.trend { padding:19px 24px 12px; }
.trend-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.trend-controls { display:flex; gap:12px; }
select { appearance:none; border:0; border-bottom:1px solid #918ba3; border-radius:0; background:#fff; min-height:40px; padding:4px 26px 4px 7px; cursor:pointer;
  background-image:linear-gradient(45deg,transparent 50%,#746c87 50%),linear-gradient(135deg,#746c87 50%,transparent 50%);
  background-position:calc(100% - 11px) 50%,calc(100% - 7px) 50%;
  background-size:4px 4px; background-repeat:no-repeat;
}
#chart { display:block; width:100%; overflow:visible; touch-action:pan-y; }
#chart text { fill:var(--muted); font-family:inherit; }
#chart-detail { min-height:24px; padding-top:2px; font-size:.875rem; text-align:center; }
#chart-empty { padding:22px 0; }
.chart-pages { display:flex; gap:10px; align-items:center; justify-content:space-between; padding:6px 0 4px; font-size:.85rem; color:var(--muted); text-align:center; }
.chart-pages button { white-space:nowrap; }
.metadata { display:flex; flex-wrap:wrap; justify-content:space-between; gap:4px 14px; padding:10px 2px; font-size:.875rem; color:var(--muted); }
#updated.stale,#date-error { color:#8c3a31; }
.muted { color:var(--muted); }
dialog { color:inherit; width:min(550px,calc(100% - 24px)); max-height:calc(100dvh - 24px); border:1px solid var(--line); border-radius:14px; padding:0; box-shadow:0 12px 36px #28213e33; }
dialog::backdrop { background:#27223c69; }
.picker-top,.month-nav { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.picker-top { padding:13px 17px; border-bottom:1px solid var(--line); }
#close-picker,.month-nav button { padding:0; width:38px; min-height:36px; font-size:1.35rem; }
.picker-body { display:grid; grid-template-columns:minmax(0,1fr) 126px; gap:14px; padding:14px 16px 10px; }
.weekdays,#calendar-days { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); text-align:center; }
.weekdays { font-size:.85rem; color:var(--muted); padding:8px 0 4px; }
#calendar-days { row-gap:2px; }
#calendar-days button { border:0; border-radius:0; min-height:36px; padding:0; font-variant-numeric:tabular-nums; }
#calendar-days .other { color:#777187; }
#calendar-days .in-range { background:var(--soft); }
#calendar-days .end-point { background:var(--purple); color:#fff; border-radius:6px; }
#calendar-days .end-point:hover { background:var(--strong); }
#calendar-days .today:not(.end-point) { box-shadow:inset 0 0 0 1px var(--purple); border-radius:6px; }
.presets { display:grid; grid-template-columns:1fr 1fr; align-content:start; gap:5px; }
.presets button { padding:3px 4px; font-size:.8125rem; min-height:34px; white-space:nowrap; }
.presets button[aria-pressed="true"] { border-color:var(--purple); color:var(--strong); background:var(--soft); }
#custom { padding:11px 16px 15px; border-top:1px solid var(--line); }
.date-inputs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
label { display:grid; gap:3px; }
input { background:#fff; border:1px solid #d8d4e3; border-radius:8px; min-height:40px; min-width:0; width:100%; padding:4px 7px; }
#picker-hint,#date-error { font-size:.875rem; margin-top:7px; }
.picker-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:10px; }
.notice,.login { margin:0 auto 14px; }
.notice { padding:10px 12px; border:1px solid #e9caac; border-radius:8px; background:#fff5e9; color:#733926; }
.login { max-width:420px; padding:24px; }
#sign-in { display:grid; gap:12px; margin-top:20px; }
@media(max-width:600px) {
  main { padding:16px 12px 30px; }
  .mast-inner { padding:11px 14px; }
  .overview-head { padding:13px 11px; }
  .date-button { padding:6px 7px; font-size:.875rem; gap:5px; }
  h1 { font-size:1.125rem; }
  .metric { text-align:center; padding:13px 4px 11px; }
  .metric span { font-size:.875rem; }
  .trend { padding:12px 9px 9px; }
  .trend-heading { gap:6px; }
  .trend-controls { gap:7px; }
  .trend-controls select { font-size:.875rem; }
  .picker-body { grid-template-columns:minmax(0,1fr); gap:8px; }
  .presets { grid-template-columns:repeat(4,minmax(0,1fr)); }
}
@media(max-width:359px) {
  .overview-head { align-items:flex-start; flex-direction:column; }
  .trend-heading { flex-wrap:wrap; }
}

/* Mobile sales summary layout based on the supplied POS interface. */
:root { --purple:#6d62cc; --strong:#554ab1; --soft:#f2f0fc; --line:#e4e6ee; --muted:#626879; color:#242834; background:#eceef4; }
main { max-width:495px; min-height:100vh; margin:0 auto; padding:0 12px 22px; background:#f5f6fa; }
.report-head { position:sticky; top:0; z-index:2; margin:0 -12px 12px; background:#fff; box-shadow:0 1px 3px #24283411; }
.overview-head { padding:12px 13px 9px; align-items:center; gap:7px; border:0; }
.heading-group { display:flex; align-items:center; flex-wrap:wrap; gap:4px 7px; }
.heading-group h1 { font-size:1.12rem; white-space:nowrap; }
.branch { font-size:.76rem; padding:3px 8px; background:var(--purple); color:#fff; border-radius:20px; font-weight:650; white-space:nowrap; }
.demo { margin:0; font-size:.75rem; }
.date-button { max-width:54%; gap:5px; font-size:.8rem; padding:4px 7px; min-height:35px; }
.date-button span:first-of-type { overflow-wrap:anywhere; }
.date-button svg { width:15px; flex-basis:15px; }
.sync-strip { display:flex; gap:8px; flex-wrap:wrap; justify-content:space-between; align-items:center; padding:5px 13px; border-top:1px solid #eceef4; color:var(--muted); background:#fafbfd; font-size:.75rem; }
.mode-tag { background:var(--soft); color:var(--strong); font-weight:650; padding:2px 6px; border-radius:5px; }
#signout { min-height:26px; padding:2px 6px; }
.metric { text-align:center; padding:11px 4px 9px; }
.metric strong { font-size:clamp(1rem,5.2vw,1.55rem); }
.metric span { font-size:.79rem; }
.metric small { display:block; min-height:16px; margin-top:4px; color:var(--strong); font-size:.69rem; }
.trend { padding:13px 12px 8px; }
.trend h2 { font-size:1rem; }
.order-strip { display:flex; gap:16px; font-size:.83rem; padding:8px 12px; border-bottom:1px solid var(--line); }
.list-card { margin-top:12px; overflow:hidden; }
.list-card header { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:10px 12px; border-bottom:1px solid var(--line); }
.list-card h2 { font-size:1rem; }
.list-card header span { font-size:.78rem; }
#all-orders { color:var(--strong); font-size:.8rem; min-height:33px; }
.order-labels,.order-row { display:grid; grid-template-columns:minmax(52px,.72fr) minmax(65px,.95fr) minmax(78px,1.25fr) minmax(42px,.68fr); gap:6px; padding:8px 10px; align-items:start; }
.order-labels,.order-row small { color:var(--muted); font-size:.72rem; }
.order-row { border-top:1px solid var(--line); font-size:.81rem; }
.order-row span,.order-row b { min-width:0; overflow-wrap:anywhere; font-variant-numeric:tabular-nums; }
.order-row b,.order-labels span:last-child { text-align:right; }
.order-row small { display:block; }
.item-chip { display:inline-block; color:var(--strong); border:1px solid #c6bcf2; border-radius:5px; padding:1px 4px; margin:0 0 2px; }
.report-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:3px 8px; padding:8px 11px; border-bottom:1px solid var(--line); font-size:.85rem; }
.report-row small { color:var(--muted); }
.report-row b { justify-self:end; font-variant-numeric:tabular-nums; }
.report-row progress { grid-column:1/-1; height:5px; width:100%; appearance:none; border:0; margin:2px 0; }
.report-row progress::-webkit-progress-bar { background:#e9e5f4; border-radius:8px; }
.report-row progress::-webkit-progress-value { background:var(--purple); border-radius:8px; }
.report-row progress::-moz-progress-bar { background:var(--purple); border-radius:8px; }
.empty-copy,#detail-notice,#search-status { padding:9px 11px; font-size:.85rem; }
.search-orders { display:flex; gap:8px; align-items:end; padding:10px; }
.search-orders label { flex:1; min-width:0; }
#close-orders { font-size:1.3rem; line-height:1; }
#order-pages { padding:10px; border-top:1px solid var(--line); }
.login { margin:16px auto; }
.login p { margin-top:10px; }
.login-actions { display:flex; flex-wrap:wrap; gap:7px; margin-top:14px; }
.action { display:inline-flex; align-items:center; text-decoration:none; border-radius:8px; padding:7px 12px; }
@media(min-width:600px) {
  body { padding:15px 0; }
  main { min-height:calc(100vh - 30px); border:1px solid #dfe2eb; border-radius:24px; box-shadow:0 12px 36px #20223a12; }
  .report-head { border-radius:24px 24px 0 0; }
}
@media(max-width:359px) {
  .overview-head { flex-direction:row; align-items:center; }
  .heading-group { gap:4px; }
  .heading-group h1 { font-size:1rem; }
  .date-button { max-width:57%; }
}
