/* SplitBill demo design system — shared across all surfaces. No external assets. */

:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --ink: #17272e;
  --ink-2: #51626b;
  --ink-3: #8a979e;
  --line: #e5e2d9;
  --line-2: #efece4;
  /* Brand palette — exact values sampled from SplitBill_Vector_Logo.pdf */
  --brand: #14833b;        /* wordmark green */
  --brand-dark: #0e5931;   /* receipt outline green */
  --brand-soft: #e9f5ec;
  --brand-bright: #70cf2a; /* receipt green */
  --accent: #ff791a;       /* sunrise orange */
  --accent-dark: #c85a08;
  --accent-soft: #ffeede;
  --good: #1c7c4d;
  --good-soft: #e6f3ec;
  --warn: #935d0c;
  --warn-soft: #f9efdd;
  --bad: #b3261e;
  --bad-soft: #f9e9e8;
  --info: #34539c;
  --info-soft: #e9eef8;
  --radius: 14px;
  --radius-s: 9px;
  --shadow: 0 1px 2px rgba(23, 39, 46, 0.05), 0 8px 24px rgba(23, 39, 46, 0.06);
  --mono: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; letter-spacing: -0.01em; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
h3 { font-size: 15.5px; }
p { margin: 0 0 .8em; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
small, .muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.mono { font-family: var(--mono); font-size: 0.86em; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 24px 20px 64px; }
.wrap-narrow { max-width: 760px; }

/* Top bar */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar .spacer { flex: 1; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; color: var(--ink); }
.logo:hover { text-decoration: none; }
.logo-img { width: 30px; height: 30px; display: block; }
.wordmark { font-weight: 800; letter-spacing: -0.015em; color: var(--brand-dark); }
.wordmark .wm-bill { color: var(--accent); }
.env-tag {
  font-size: 11.5px; font-weight: 650; letter-spacing: .04em;
  color: var(--accent-dark); background: var(--accent-soft);
  padding: 3px 9px; border-radius: 999px; text-transform: uppercase;
}

/* Cards & layout */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; margin-bottom: 16px;
}
.card h2 { display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 14px; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .cols-2, .cols-3 { grid-template-columns: 1fr; } }
.row { display: flex; align-items: center; gap: 10px; }
.row .spacer { flex: 1; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: var(--radius-s); padding: 9px 15px; font: inherit; font-weight: 600;
  cursor: pointer; transition: background .12s, border-color .12s, transform .05s;
  text-decoration: none;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-danger { color: var(--bad); border-color: #ecc7c4; }
.btn-danger:hover { background: var(--bad-soft); }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 7px; }
.btn-lg { padding: 13px 20px; font-size: 16px; border-radius: 11px; width: 100%; }

/* Status pills — reserved status colors, always icon/text + color */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 650; letter-spacing: .015em;
  padding: 2.5px 9px; border-radius: 999px; white-space: nowrap;
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-good { color: var(--good); background: var(--good-soft); }
.pill-warn { color: var(--warn); background: var(--warn-soft); }
.pill-bad { color: var(--bad); background: var(--bad-soft); }
.pill-info { color: var(--info); background: var(--info-soft); }
.pill-neutral { color: var(--ink-2); background: var(--line-2); }

/* KPI stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.tile .label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); letter-spacing: .02em; }
.tile .value { font-size: 24px; font-weight: 750; letter-spacing: -0.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tile .sub { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.tile.alert .value { color: var(--bad); }
.tile.okay .value { color: var(--good); }

/* Tables */
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-3); font-weight: 650; padding: 7px 10px; border-bottom: 1px solid var(--line);
}
table.data td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }

/* Forms */
input[type='text'], input[type='email'], input[type='number'], select {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-s); padding: 9px 12px; width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
label.field { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 10px 0 4px; }

/* Toasts */
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast {
  background: var(--ink); color: #fff; border-radius: 10px; padding: 10px 15px;
  font-size: 13.5px; box-shadow: var(--shadow); max-width: 340px;
  animation: toast-in .18s ease-out;
}
.toast.bad { background: var(--bad); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* Phone frame for the customer surface on desktop */
.phone-viewport { display: flex; justify-content: center; padding: 28px 12px 60px; }
.phone {
  width: 100%; max-width: 430px; background: var(--surface);
  border-radius: 22px; border: 1px solid var(--line); box-shadow: var(--shadow);
  overflow: hidden; min-height: 70vh; display: flex; flex-direction: column;
}
@media (max-width: 520px) {
  .phone-viewport { padding: 0; }
  .phone { border: 0; border-radius: 0; box-shadow: none; min-height: 100vh; }
}

/* Divider list (bill lines) */
.lines { display: flex; flex-direction: column; }
.line-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.line-row:last-child { border-bottom: 0; }

/* Misc */
.divider { height: 1px; background: var(--line); margin: 14px 0; border: 0; }
.kbd {
  font-family: var(--mono); font-size: 12px; background: var(--line-2);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px;
}
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.amount { font-variant-numeric: tabular-nums; font-weight: 650; }
