:root {
  --orange: #E87B2E; --teal: #1E9FB5; --gold: #F4C842; --brown: #4E2A1A; --cream: #FDF6E3;
  --bg: #FDF6E3; --card: #FFFFFF; --line: #EADFC4; --text: #4E2A1A; --muted: #8A6F5E; --faint: #B9A58F;
  --good: #2E9E5B; --bad: #D64533; --warn: #C98A00; --grey: #CFC6B4; --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.num { font-variant-numeric: tabular-nums; }
.wrap { max-width: 600px; margin: 0 auto; padding: 0 14px 56px; }
header { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 12px 14px 10px; margin: 0 -14px 10px; background: var(--brown); color: var(--cream); }
header h1 { font-size: 20px; margin: 0; flex: 1; letter-spacing: -.01em; line-height: 1.15; }
header h1 small { display: block; font-size: 12px; font-weight: 400; opacity: .75; letter-spacing: 0; }
.hbtn { background: rgba(255,255,255,.14); color: var(--cream); border: 0; border-radius: 12px; padding: 8px 12px; font-size: 14px; font-weight: 600; text-decoration: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 12px; }
.card h2 { margin: 0 0 10px; font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card h2 span { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 12px; }
.big { font-size: 44px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.mid { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .k { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.stat .v { font-size: 20px; font-weight: 700; }
.stat .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); } .muted { color: var(--muted); } .faint { color: var(--faint); }
.pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--cream); color: var(--muted); border: 1px solid var(--line); vertical-align: middle; }
.pill.bad { background: #FBE3DF; color: var(--bad); border-color: #F2C3BC; }
.pill.warn { background: #FFF1CC; color: var(--warn); border-color: #F1DC9A; }
.pill.good { background: #DDF3E6; color: var(--good); border-color: #B7E0C7; }
.hero { border: 2px solid var(--line); }
.hero.ok { border-color: var(--good); background: #F2FBF5; }
.hero.no { border-color: var(--bad); background: #FFF6F4; }
.meter { height: 12px; border-radius: 99px; background: var(--cream); border: 1px solid var(--line); overflow: hidden; margin: 10px 0 4px; }
.meter > i { display: block; height: 100%; background: var(--orange); border-radius: 99px; }
.meter.teal > i { background: var(--teal); }
.note { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.banner { background: #FFF1CC; border: 1px solid #F1DC9A; border-radius: 12px; padding: 10px 12px; font-size: 13.5px; margin: 0 0 12px; }
.banner.bad { background: #FBE3DF; border-color: #F2C3BC; }

/* daily bars */
.bars { display: flex; gap: 8px; align-items: flex-end; height: 170px; margin-top: 6px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.bar .col { position: relative; width: 100%; flex: 1; display: flex; align-items: flex-end; justify-content: center; }
.bar .ghost { position: absolute; bottom: 0; width: 100%; background: var(--grey); opacity: .45; border-radius: 6px 6px 0 0; }
.bar .fill { position: relative; width: 72%; background: var(--orange); border-radius: 6px 6px 0 0; min-height: 2px; }
.bar.downtime .fill { background: var(--grey); }
.bar.today .fill { background: var(--teal); }
.bar.future .fill { display: none; }
.bar .amt { font-size: 12px; font-weight: 700; margin-bottom: 3px; }
.bar .lab { font-size: 11px; color: var(--muted); margin-top: 5px; text-align: center; line-height: 1.15; }
.bar .flag { font-size: 10px; font-weight: 700; color: var(--bad); }
.be-line { position: relative; height: 0; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }

/* heat map */
table.heat { border-collapse: separate; border-spacing: 3px; width: 100%; font-size: 12px; }
table.heat th { font-weight: 600; color: var(--muted); font-size: 11px; }
table.heat td.c { text-align: center; border-radius: 6px; height: 26px; font-weight: 600; }
table.heat td.h { color: var(--muted); font-size: 11px; text-align: right; padding-right: 4px; white-space: nowrap; }

/* tables */
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: right; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 4px 4px; }
table.t th:first-child, table.t td:first-child { text-align: left; }
table.t td { padding: 7px 4px; border-top: 1px solid var(--line); text-align: right; }
table.t td:first-child { font-weight: 600; max-width: 150px; overflow-wrap: anywhere; }
.scroll { overflow-x: auto; margin: 0 -4px; }
.tabs { display: flex; gap: 6px; margin: 0 0 12px; }
.tabs button { flex: 1; padding: 9px 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font-weight: 700; font-size: 14px; }
.tabs button.on { background: var(--brown); color: var(--cream); border-color: var(--brown); }

/* trend */
svg.trend { width: 100%; height: auto; display: block; }

/* forms */
.btn { background: var(--orange); color: #fff; border: 0; border-radius: 12px; padding: 12px 16px; font-size: 16px; font-weight: 700; width: 100%; }
.btn.alt { background: var(--cream); color: var(--brown); border: 1px solid var(--line); }
.btn.sm { width: auto; padding: 8px 12px; font-size: 14px; }
input[type=text], input[type=number], input[type=password], input[type=date] { width: 100%; padding: 10px 11px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--text); font-size: 16px; }
.f { display: grid; grid-template-columns: 1fr 110px; gap: 8px; align-items: center; margin-bottom: 8px; }
.f.three { grid-template-columns: 1fr 90px 90px; }
.f label { font-size: 14px; }
.f small { display: block; color: var(--faint); font-size: 11.5px; }
.check { display: flex; gap: 10px; align-items: center; margin: 8px 0; font-size: 15px; }
.check input { width: 22px; height: 22px; }
.login { max-width: 360px; margin: 14vh auto 0; padding: 0 20px; }
.login h1 { font-size: 28px; margin: 0 0 6px; }
.login p { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.login input { margin-bottom: 10px; }
.login .bad { margin-top: 10px; font-size: 14px; min-height: 18px; color: var(--bad); }
.logo { width: 64px; height: 64px; border-radius: 16px; margin-bottom: 14px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--brown); color: var(--cream); padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 20; }

/* nav + Today screen (dark, same look as the original Sammy's sales page) */
.nav { display: flex; gap: 6px; margin: 0 0 12px; }
.nav a { flex: 1; text-align: center; padding: 9px 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font-weight: 700; font-size: 14px; text-decoration: none; }
.nav a.on { background: var(--brown); color: var(--cream); border-color: var(--brown); }
body.today { background: #000; color: #fff; }
body.today .nav a { background: #151515; border-color: #2a2a2a; color: #999; }
body.today .nav a.on { background: var(--orange); border-color: var(--orange); color: #fff; }
.t-toggle { display: flex; gap: 6px; margin: 0 0 14px; }
.t-toggle button { flex: 1; padding: 9px 4px; border-radius: 12px; border: 1px solid #2a2a2a; background: #151515; color: #999; font-weight: 700; font-size: 14px; }
.t-toggle button.on { background: #fff; color: #000; border-color: #fff; }
.t-logo { display: block; width: min(60%, 240px); margin: 0 auto 10px; background: var(--cream); border-radius: 18px; padding: 8px 14px; }
.t-top { font-size: 16px; color: #999; margin: 6px 0 14px; text-align: center; }
.t-label { font-size: 15px; color: #999; text-transform: uppercase; letter-spacing: .08em; }
.t-num { font-size: clamp(56px, 18vw, 104px); font-weight: 800; line-height: 1; white-space: nowrap; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-bottom: 10px; }
.t-avg { font-size: 22px; color: #ccc; margin: 14px 0 4px; }
.t-sub { font-size: 16px; color: #aaa; margin: 4px 0; }
.t-sold { margin-top: 18px; border-top: 1px solid #333; padding-top: 12px; }
.t-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 18px; line-height: 1.3; padding: 5px 0; border-bottom: 1px solid #1c1c1c; }
.t-row .it { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.t-row .amt { flex: none; color: #ccc; font-variant-numeric: tabular-nums; }
.t-be { margin-top: 18px; background: #111; border: 1px solid #2a2a2a; border-radius: 14px; padding: 12px 14px; }
.t-be .bar { height: 14px; border-radius: 99px; background: #262626; overflow: hidden; margin-top: 8px; }
.t-be .bar i { display: block; height: 100%; border-radius: 99px; background: var(--bad); }
.t-be.ok .bar i { background: #34C759; }
.t-be b.good { color: #34C759; } .t-be b.bad { color: #FF453A; }
.t-foot { font-size: 12.5px; color: #666; margin-top: 14px; text-align: center; }
.t-ptr { text-align: center; color: #888; font-size: 13px; height: 0; overflow: visible; }
