/* Coffee Creamer Plus tracker — deep navy with a muted champagne-gold accent */
:root {
  --navy-950: #060f30; --navy-900: #0a1742; --navy-800: #101f55; --navy-700: #1a3278; --navy-100: #e6eaf6; --navy-50: #f2f4fb;
  --gold: #c9a55c; --gold-600: #a98541; --gold-100: #f8f2e4; --gold-ink: #5f4a1c;
  --bg: #f4f5f9; --card: #fff; --ink: #0d1838; --muted: #68738f; --line: #e6e9f2;
  --red: #b83a31; --red-bg: #fcecea; --amber: #8a6410; --amber-bg: #fbf1da;
  --green: #17734a; --green-bg: #e3f4eb; --blue: #24509f; --blue-bg: #e7eefb; --grey-bg: #eef0f6;
  --shadow: 0 1px 2px rgba(13, 24, 56, .04), 0 10px 28px rgba(13, 24, 56, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--navy-700); font-weight: 600; }
h1 { font-size: 27px; line-height: 1.2; margin: 0; letter-spacing: -.02em; font-weight: 800; }
h2 { font-size: 17px; line-height: 1.3; margin: 0; font-weight: 750; letter-spacing: -.01em; }
h2.big { font-size: 23px; margin-bottom: 6px; }
h3 { font-size: 12.5px; margin: 24px 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); } .small, small { font-size: 12.5px; } .neg { color: var(--red); } .grow { flex: 1; }
.loading { text-align: center; padding: 80px 0; color: var(--muted); }
[hidden] { display: none !important; }
.ic { width: 20px; height: 20px; flex-shrink: 0; }

/* layout: navy sidebar + light content */
.shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100dvh; }
.side { background: linear-gradient(180deg, var(--navy-900), var(--navy-950)); color: #fff; padding: 26px 16px 18px; display: flex; flex-direction: column; gap: 26px; position: sticky; top: 0; height: 100dvh; }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 0 10px; }
.side-brand b { display: block; font-size: 12.5px; letter-spacing: .14em; font-weight: 800; line-height: 1.3; }
.side-brand small { color: #9fabd0; font-size: 12px; }
.logo { width: 42px; height: 42px; border-radius: 13px; background: linear-gradient(140deg, #e6cf9b, var(--gold-600)); color: var(--navy-900); font-weight: 800; font-size: 19px; display: flex; justify-content: center; align-items: center; flex-shrink: 0; }
.logo i { font-style: normal; font-size: 13px; margin: -8px 0 0 1px; }
.side nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.side nav a { display: flex; align-items: center; gap: 13px; padding: 11px 14px; border-radius: 12px; color: #b4bfe0; text-decoration: none; font-weight: 600; font-size: 14.5px; line-height: 1.3; }
.side nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side nav a.on { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.side nav a.on .ic { color: var(--gold); }
.side nav a i { font-style: normal; margin-left: auto; background: var(--gold); color: var(--navy-950); border-radius: 10px; font-size: 11px; font-weight: 800; padding: 2px 8px; line-height: 1.4; }
.side-user { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: rgba(255, 255, 255, .06); }
.side-user div { min-width: 0; flex: 1; line-height: 1.35; } .side-user b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user small { color: #9fabd0; } .side-user small a { color: #d5dcf3; font-weight: 500; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--navy-700); display: grid; place-items: center; font-weight: 800; flex-shrink: 0; border: 1.5px solid var(--gold); }
.signout { color: #b4bfe0; display: grid; place-items: center; padding: 8px; border-radius: 10px; } .signout:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.content { min-width: 0; padding: 34px 40px 60px; max-width: 1320px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.head-actions { display: flex; gap: 10px; }

/* cards */
.card { background: var(--card); border-radius: 20px; padding: 26px 28px; margin-bottom: 22px; box-shadow: var(--shadow); }
.card > :last-child { margin-bottom: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 22px; }
.card .stats { margin: 22px 0 0; } .card .stat { background: var(--navy-50); box-shadow: none; }
.stat { background: var(--card); border-radius: 20px; padding: 22px 24px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; min-width: 0; box-shadow: var(--shadow); font-weight: 400; border: 1.5px solid transparent; }
a.stat:hover { border-color: var(--gold); }
.stat-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; min-height: 44px; }
.stat-top span { color: var(--muted); font-size: 13.5px; font-weight: 600; padding-top: 2px; }
.stat > b { font-size: 26px; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; line-height: 1.2; }
.stat small { color: var(--muted); line-height: 1.45; }
.stat-ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.stat-ic.navy { background: var(--navy-100); color: var(--navy-700); } .stat-ic.gold { background: var(--gold-100); color: var(--gold-600); }
.stat-ic.red { background: var(--red-bg); color: var(--red); } .stat-ic.blue { background: var(--blue-bg); color: var(--blue); }
.stat.hero { background: linear-gradient(135deg, var(--navy-700), var(--navy-900)); color: #fff; }
.stat.hero .stat-top span, .stat.hero small { color: #c3cdec; } .stat.hero .stat-ic { background: rgba(255, 255, 255, .12); color: #ecd9ac; }
.delta { font-style: normal; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 9px; vertical-align: middle; letter-spacing: 0; white-space: nowrap; margin-left: 4px; }
.delta.up { background: var(--green-bg); color: var(--green); } .delta.down { background: var(--red-bg); color: var(--red); }
.hero .delta.up { background: rgba(255, 255, 255, .14); color: #b9f5d4; } .hero .delta.down { background: rgba(255, 255, 255, .14); color: #ffc9c4; }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 22px; } .split > .card { min-width: 0; }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 22px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1.5px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 8px 17px; font: inherit; font-size: 13.5px; font-weight: 600; line-height: 1.3; cursor: pointer; }
.chip:hover { border-color: var(--navy-700); } .chip.on { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.hint { background: var(--gold-100); border-radius: 14px; padding: 15px 20px; color: var(--gold-ink); font-size: 13.5px; margin: 0 0 22px; }
.empty { text-align: center; color: var(--muted); padding: 30px 16px; } .empty p { margin: 0 0 16px; } .empty p:last-child { margin: 0; }
.note { background: var(--navy-50); border-radius: 10px; padding: 8px 13px; font-size: 13.5px; align-self: flex-start; }
.steps { margin: 0; padding-left: 22px; } .steps li { margin: 18px 0; padding-left: 4px; } .steps .btn { margin-left: 8px; }
.badge { display: inline-block; border-radius: 999px; padding: 3px 11px; font-size: 12px; font-weight: 700; white-space: nowrap; line-height: 1.4; }
.badge.red { background: var(--red-bg); color: var(--red); } .badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.green { background: var(--green-bg); color: var(--green); } .badge.blue { background: var(--blue-bg); color: var(--blue); }
.badge.grey { background: var(--grey-bg); color: var(--muted); } .badge.navy { background: var(--navy-100); color: var(--navy-700); }
.inv { font-size: 12px; font-weight: 700; color: var(--navy-700); background: var(--navy-100); border-radius: 7px; padding: 2px 9px; white-space: nowrap; margin-left: 4px; }

/* buttons + inputs */
.btn { border: 1.5px solid transparent; border-radius: 12px; padding: 11px 20px; font: inherit; font-weight: 700; line-height: 1.3; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.btn.primary, .btn.navy { background: var(--navy-800); color: #fff; box-shadow: 0 6px 16px rgba(16, 31, 85, .18); }
.btn.primary:hover, .btn.navy:hover { background: var(--navy-700); }
.btn.outline { background: transparent; border-color: #c3cbe3; color: var(--navy-800); } .btn.outline:hover { border-color: var(--navy-800); background: #fff; }
.btn.ghost { background: var(--card); border-color: var(--line); color: var(--ink); } .btn.ghost:hover { border-color: var(--navy-700); }
.btn.danger { background: var(--card); border-color: #f1cfcb; color: var(--red); } .btn.danger:hover { background: var(--red-bg); }
.btn.sm { padding: 8px 15px; font-size: 13px; border-radius: 10px; box-shadow: none; }
/* small actions inside lists are tonal, so a long list is not a wall of dark buttons */
.btn.primary.sm { background: var(--navy-100); color: var(--navy-800); } .btn.primary.sm:hover { background: var(--navy-800); color: #fff; }
.btn.block { width: 100%; margin-top: 20px; padding: 14px; } .btn:disabled { opacity: .6; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; } .btns.left { justify-content: flex-start; }
input, select, textarea { font: inherit; font-size: 16px; color: var(--ink); background: #fff; border: 1.5px solid #d6dbe9; border-radius: 12px; padding: 11px 14px; width: 100%; min-width: 0; }
select { padding-right: 30px; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(26, 50, 120, .14); outline-offset: 0; border-color: var(--navy-700); }
.btn:focus-visible, .chip:focus-visible { outline: 3px solid rgba(26, 50, 120, .3); outline-offset: 2px; }
input[type=checkbox] { width: 18px; height: 18px; padding: 0; accent-color: var(--navy-800); flex-shrink: 0; }
.toolbar input[type=search] { width: 320px; border-radius: 999px; padding: 10px 18px; } .toolbar select { width: auto; border-radius: 999px; padding: 10px 34px 10px 18px; }

/* sales & orders */
.order { display: flex; gap: 20px; justify-content: space-between; align-items: flex-start; padding: 20px 0; border-top: 1px solid var(--line); }
.order:first-of-type { border-top: 0; padding-top: 4px; } .order:last-of-type { padding-bottom: 4px; }
.order-main { min-width: 0; display: flex; flex-direction: column; gap: 7px; } .order-title { font-weight: 750; font-size: 15.5px; }
.order-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.order-side { text-align: right; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; align-items: flex-end; }
.order-side .btns { flex-wrap: nowrap; }
.order-total { font-size: 18px; font-weight: 800; letter-spacing: -.01em; line-height: 1.3; }
.prep { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.prep span { background: var(--navy-50); border-radius: 10px; padding: 7px 13px; } .prep .short { background: var(--red-bg); color: var(--red); }

/* tables + bars */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 700; font-size: 12.5px; padding: 13px 16px; background: var(--navy-50); white-space: nowrap; }
th:first-child { border-radius: 12px 0 0 12px; } th:last-child { border-radius: 0 12px 12px 0; }
td { padding: 15px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; } .r { text-align: right; font-variant-numeric: tabular-nums; } td:last-child { white-space: nowrap; } td[data-label=""] { text-align: right; }
td .badge { margin-left: 4px; } td:first-child .badge, td > .badge:first-child { margin-left: 0; }
.cellsub { display: block; font-weight: 400; margin-top: 2px; }
.table-wrap + p, table + p { margin-top: 16px; }
.bars { display: grid; gap: 14px; margin-top: 6px; }
.table-wrap + .bars { margin-top: 26px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 200px) 1fr auto; gap: 16px; align-items: center; font-size: 14px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.bar-track { background: var(--grey-bg); border-radius: 8px; height: 12px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--navy-700), var(--navy-800)); border-radius: 8px; }
.bar-val { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; white-space: nowrap; }

/* daily sales chart */
.chart { display: flex; gap: 14px; height: 260px; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; color: var(--muted); font-size: 12px; padding-bottom: 44px; text-align: right; min-width: 40px; }
.chart-cols { flex: 1; display: flex; gap: 8px; align-items: stretch; min-width: 0; }
.col { flex: 1; display: flex; flex-direction: column; min-width: 0; text-align: center; }
.col-bar { flex: 1; background: var(--grey-bg); border-radius: 10px; position: relative; overflow: hidden; display: flex; align-items: flex-end; }
.col-fill { display: block; width: 100%; background: #b7c1de; border-radius: 10px; min-height: 0; }
.col-fill.hit { background: var(--navy-700); }
.col.now .col-fill { background: linear-gradient(180deg, #dcc48f, var(--gold-600)); }
.col-target { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--gold-600); height: 0; }
.col small { height: 44px; padding-top: 10px; color: var(--muted); font-size: 11.5px; line-height: 1.35; overflow: hidden; }
.col.now small { color: var(--ink); font-weight: 800; }
.legend { display: flex; gap: 20px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; margin-top: 14px; padding-left: 54px; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.lg { width: 12px; height: 12px; border-radius: 4px; background: #b7c1de; display: inline-block; }
.lg.now { background: var(--gold); } .lg.hit { background: var(--navy-700); } .lg.line { height: 0; border-radius: 0; background: none; border-top: 2px dashed var(--gold-600); width: 18px; }

/* target gauge */
.gauge-wrap { position: relative; max-width: 290px; margin: 6px auto 0; }
.gauge { width: 100%; display: block; } .gauge rect { fill: var(--grey-bg); } .gauge rect.on { fill: var(--gold); }
.gauge-mid { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; }
.gauge-mid b { display: block; font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; } .gauge-mid small { color: var(--muted); }
.gauge-note { text-align: center; font-weight: 700; margin: 20px 0; }
.mini { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mini div { background: var(--navy-50); border-radius: 14px; padding: 14px 16px; } .mini span { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 2px; } .mini b { font-size: 19px; font-weight: 800; }

/* dialog + forms */
dialog { border: 0; border-radius: 22px; padding: 0; width: min(700px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: 0 24px 70px rgba(6, 15, 48, .45); color: var(--ink); }
dialog::backdrop { background: rgba(6, 15, 48, .6); }
.form { padding: 30px 32px; } .form h2 { font-size: 21px; margin-bottom: 8px; } .form > .muted { margin: 0 0 22px; } .form h2 + .fields { margin-top: 20px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; } .fields.one { grid-template-columns: 1fr; }
.fields .full { grid-column: 1 / -1; }
.fields + p { margin: 16px 0 0; }
label > span, .lbl { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 700; color: #3b476b; margin-bottom: 7px; line-height: 1.4; }
label small { display: block; color: var(--muted); margin-top: 6px; line-height: 1.45; }
label.check { display: flex; align-items: center; gap: 12px; background: var(--gold-100); border-radius: 12px; padding: 13px 16px; cursor: pointer; } label.check span { margin: 0; color: var(--gold-ink); }
.paybox { background: var(--navy-50); border-radius: 16px; padding: 20px; }
.actions { display: flex; gap: 10px; margin-top: 28px; align-items: center; }
.err { background: var(--red-bg); color: var(--red); border-radius: 10px; padding: 12px 16px; margin: 18px 0 0; font-weight: 600; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) 134px 80px 116px 36px; gap: 8px; margin-bottom: 10px; }
.pp { grid-column: 1 / -1; color: var(--muted); margin: -2px 4px 4px; } .pp:empty { display: none; }
.line-foot { display: flex; align-items: center; margin-top: 8px; } .line-foot b { font-size: 17px; }
.icon { border: 0; background: none; color: var(--muted); font-size: 15px; cursor: pointer; border-radius: 10px; } .icon:hover { background: var(--grey-bg); color: var(--ink); }
.inline-form { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 18px; align-items: end; } .inline-form .btn { grid-column: 1 / -1; justify-self: start; margin-top: 4px; }

/* sign in */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 20% 0%, var(--navy-700), var(--navy-950)); }
.auth-card { background: var(--card); border-radius: 24px; padding: 36px; width: min(470px, 100%); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.auth-card .side-brand { padding: 0; margin-bottom: 28px; } .auth-card .side-brand small { color: var(--muted); }
.auth-card h1 { margin-bottom: 8px; } .auth-card .form { padding: 0; margin-top: 24px; }

#toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--navy-900); color: #fff; padding: 13px 22px; border-radius: 12px; z-index: 50; max-width: calc(100vw - 32px); box-shadow: 0 8px 24px rgba(0, 0, 0, .3); font-weight: 600; }
#toast.bad { background: var(--red); }

@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } .content { padding: 28px 28px 52px; } }
@media (max-width: 900px) {
  .shell { display: block; }
  .side { position: sticky; top: 0; z-index: 5; height: auto; padding: 14px 16px 0; gap: 12px; display: grid; grid-template-columns: 1fr auto; }
  .side-brand { order: 1; padding: 0; } .side-brand .logo { width: 36px; height: 36px; font-size: 16px; border-radius: 11px; }
  .side-user { background: none; padding: 0; order: 2; } .side-user div, .side-user .avatar { display: none; }
  .side nav { order: 3; grid-column: 1 / -1; flex-direction: row; overflow-x: auto; gap: 4px; scrollbar-width: none; padding-bottom: 12px; margin: 0 -4px; } .side nav::-webkit-scrollbar { display: none; }
  .side nav a { white-space: nowrap; padding: 9px 14px; font-size: 14px; gap: 8px; } .side nav a .ic { width: 17px; height: 17px; }
  .side nav a.on { box-shadow: inset 0 -3px 0 var(--gold); }
  .side nav a i { margin-left: 2px; }
  .content { padding: 24px 18px 48px; } h1 { font-size: 23px; } .page-head { margin-bottom: 22px; }
}
@media (max-width: 640px) {
  .card { padding: 20px 18px; border-radius: 18px; margin-bottom: 16px; } .card-head { margin-bottom: 16px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; } .stat { padding: 16px; border-radius: 16px; gap: 6px; } .stat > b { font-size: 19px; } .stat-top { min-height: 36px; }
  .stat-ic { width: 36px; height: 36px; } .stat-ic .ic { width: 17px; height: 17px; }
  .head-actions { width: 100%; } .head-actions .btn { flex: 1; }
  .form { padding: 24px 20px; } .fields, .inline-form { grid-template-columns: 1fr; } .auth-card { padding: 28px 22px; }
  .order { flex-direction: column; gap: 14px; padding: 18px 0; } .order-side { align-items: stretch; text-align: left; width: 100%; gap: 12px; } .order-side .btns { justify-content: flex-start; } .order-side .btn { flex: 1; }
  .toolbar { gap: 10px; margin-bottom: 16px; } .toolbar input[type=search] { width: 100%; order: 3; } .toolbar select { width: 100%; }
  .line { grid-template-columns: 1fr 1fr 1fr 36px; margin-bottom: 16px; } .line .p { grid-column: 1 / -1; }
  .bar-row { grid-template-columns: 96px 1fr auto; gap: 10px; } .chart { height: 220px; gap: 8px; } .chart-cols { gap: 3px; } .col-bar, .col-fill { border-radius: 6px; } .legend { padding-left: 0; gap: 12px; }
  .actions { flex-wrap: wrap; }
  /* tables become stacked cards on phones */
  thead { display: none; } table, tbody, tr, td { display: block; width: 100%; }
  tr { border-bottom: 1px solid var(--line); padding: 14px 0; } tr:first-child { padding-top: 2px; } tr:last-child { border-bottom: 0; padding-bottom: 2px; }
  td { border: 0; padding: 4px 0; text-align: left !important; display: flex; gap: 12px; justify-content: space-between; align-items: baseline; }
  td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; flex-shrink: 0; }
  .cell { text-align: right; min-width: 0; } td:first-child .cell { text-align: left; }
  td:first-child { font-weight: 750; display: block; padding-bottom: 6px; } td:first-child::before, td[data-label=""]::before { content: none; }
  td:last-child { justify-content: flex-end; white-space: normal; padding-top: 8px; } td:last-child:empty { display: none; }
  .cellsub { display: inline; margin-left: 6px; }
}
