:root {
  --bg: #f6f4ef;
  --card: #ffffff;
  --ink: #22251f;
  --muted: #6b6f66;
  --brand: #1d5c4d;
  --brand-dark: #134237;
  --accent: #d9822b;
  --line: #e4e0d6;
  --pending: #b7791f;
  --confirmed: #1d5c4d;
  --completed: #5a67d8;
  --cancelled: #9b2c2c;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
}
.page { max-width: 560px; margin: 0 auto; padding: 0 14px 90px; }

.topbar {
  background: var(--brand);
  color: #fff;
  padding: 14px 16px;
  font-weight: 700;
  letter-spacing: .4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar a { color: #cfe6de; text-decoration: none; font-weight: 400; font-size: 14px; }

.subhead { color: var(--muted); margin: 14px 2px 10px; font-size: 14px; }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}
.stat .num { font-size: 26px; font-weight: 700; }
.stat .lbl { color: var(--muted); font-size: 13px; }
.stat.warn { border-color: var(--accent); }

h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .6px;
     color: var(--muted); margin: 22px 2px 8px; }

.listcard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 10px;
  padding: 14px;
  display: block;
  text-decoration: none;
  color: var(--ink);
}
.listcard .row { display: flex; justify-content: space-between; align-items: baseline; }
.listcard .title { font-weight: 700; }
.listcard .meta { color: var(--muted); font-size: 14px; margin-top: 4px; }

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.badge.pending   { background: #fdf0dc; color: var(--pending); }
.badge.confirmed { background: #e0efe9; color: var(--confirmed); }
.badge.completed { background: #e6e8fb; color: var(--completed); }
.badge.cancelled { background: #fbe4e4; color: var(--cancelled); }

.btn {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  margin-top: 12px;
  cursor: pointer;
}
.btn:active { background: var(--brand-dark); }
.btn.secondary { background: #fff; color: var(--brand); border: 1.5px solid var(--brand); }
.btn.small { width: auto; display: inline-block; padding: 8px 14px; font-size: 14px; margin-top: 0; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; }
.btnrow .btn { width: auto; flex: 1; margin-top: 8px; }

form .field { margin-bottom: 14px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=number], input[type=date], input[type=time],
input[type=email], input[type=password], select, textarea {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 70px; }
.checks { display: flex; gap: 14px; flex-wrap: wrap; }
.checks label { color: var(--ink); font-size: 15px; display: flex; align-items: center; gap: 6px; }
.checks input { width: 20px; height: 20px; }

.switch { display: flex; justify-content: space-between; align-items: center;
          padding: 10px 0; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
}

.bar-row { display: flex; align-items: flex-end; gap: 8px; height: 130px;
           padding-top: 8px; }
.bar { flex: 1; background: var(--brand); border-radius: 6px 6px 0 0;
       min-height: 4px; position: relative; }
.bar-lbls { display: flex; gap: 8px; }
.bar-lbls span { flex: 1; text-align: center; font-size: 11px; color: var(--muted); }

.hbar { background: #eee9dd; border-radius: 6px; height: 18px; overflow: hidden; }
.hbar > div { background: var(--accent); height: 100%; border-radius: 6px; }
.hbar-row { display: grid; grid-template-columns: 90px 1fr 40px; gap: 8px;
            align-items: center; margin: 8px 0; font-size: 14px; }

.bottomnav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  display: flex;
  z-index: 10;
}
.bottomnav a {
  flex: 1;
  text-align: center;
  padding: 12px 0;
  text-decoration: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.bottomnav a.active { color: var(--brand); }

.login-wrap { max-width: 380px; margin: 12vh auto 0; padding: 0 16px; }
.login-wrap h1 { text-align: center; color: var(--brand); }
.demo-hint { text-align: center; color: var(--muted); font-size: 14px;
             background: #fff; border: 1px dashed var(--line);
             border-radius: 10px; padding: 10px; margin-top: 16px; }

.money { font-variant-numeric: tabular-nums; }
.total-row { display: flex; justify-content: space-between; padding: 6px 0; }
.total-row.grand { font-weight: 700; font-size: 18px; border-top: 1px solid var(--line);
                   margin-top: 6px; padding-top: 10px; }

/* printable invoice */
@media print {
  .bottomnav, .topbar .noprint, .btn, .noprint { display: none !important; }
  body { background: #fff; }
  .page { padding-bottom: 0; }
}
