:root {
  --bg: #ffffff;
  --ink: #1a1d21;
  --muted: #6b7280;
  --brand: #1878C4;
  --brand-dark: #135a96;
  --accent: #F15A29;
  --line: #e5e7eb;
  --chip: #f3f4f6;
  --ok: #15803d;
  --warn: #b45309;
  --bad: #b91c1c;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181c;
    --ink: #e7e9ec;
    --muted: #9aa1ab;
    --line: #2c3038;
    --chip: #22262d;
  }
}
* { box-sizing: border-box; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 system-ui, "Segoe UI", Roboto, sans-serif;
}

header.bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  background: var(--brand); color: #fff;
}
header.bar .logo {
  width: 32px; height: 32px;
  background: #fff; border-radius: 7px; padding: 3px;
  object-fit: contain;
}
header.bar h1 { font-size: 15px; font-weight: 700; flex: 1; }
header.bar nav { display: flex; gap: 4px; }
header.bar nav a {
  color: rgba(255,255,255,.9); text-decoration: none; font-weight: 600; font-size: 13px;
  padding: 6px 10px; border-radius: 6px;
}
header.bar nav a.active, header.bar nav a:hover { background: rgba(255,255,255,.18); }
header.bar select {
  background: rgba(255,255,255,.15); color: #fff;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 6px; padding: 4px 6px; font-size: 12px;
}
header.bar select option { color: #111; }
header.bar button.logout {
  background: rgba(255,255,255,.15); color: #fff; border: none;
  border-radius: 6px; padding: 6px 10px; font-size: 12px; font-weight: 700; cursor: pointer;
}

label.field { display: block; margin-bottom: 10px; }
label.field span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
input, select, textarea {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--ink); font-size: 14px; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: transparent; }

.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 180px; }

button.primary, button.ghost, button.wa {
  border: none; border-radius: 8px; padding: 9px 14px;
  font-weight: 700; font-size: 14px; cursor: pointer;
}
button.primary { background: var(--brand); color: #fff; }
button.primary:hover { background: var(--brand-dark); }
button.primary:disabled { opacity: .6; cursor: default; }
button.ghost { background: var(--chip); color: var(--ink); }
button.wa { background: #25d366; color: #fff; }

ul.list { list-style: none; }
ul.list li {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px;
}
ul.list li .amt { font-weight: 700; white-space: nowrap; }
ul.list li button.del {
  background: none; border: none; color: var(--bad); cursor: pointer; font-size: 13px;
}
.grand {
  display: flex; justify-content: space-between;
  padding: 10px 0; font-size: 16px; font-weight: 800;
}
.mutedNote { color: var(--muted); font-size: 12px; margin-top: 8px; }

table.dims { width: 100%; border-collapse: collapse; font-size: 13px; }
table.dims td, table.dims th { padding: 7px 6px; border-bottom: 1px solid var(--line); }
table.dims td:last-child, table.dims th:last-child { text-align: right; }
table.dims input { padding: 5px 7px; }

body.page { max-width: 760px; margin: 0 auto; padding-bottom: 60px; }
h2.section { font-size: 15px; margin: 22px 16px 8px; color: var(--brand); }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 0 16px 16px; }
.saveBar { margin: 0 16px 16px; display: flex; gap: 10px; align-items: center; }
.savedMsg { color: var(--ok); font-weight: 700; font-size: 13px; opacity: 0; transition: opacity .2s; }
.savedMsg.show { opacity: 1; }
.errorMsg { color: var(--bad); font-weight: 600; font-size: 13px; margin-top: 8px; min-height: 18px; }

/* Auth pages */
body.authPage {
  min-height: 100vh; display: grid; place-items: center;
  background: linear-gradient(160deg, var(--brand), var(--brand-dark));
  padding: 20px;
}
.authCard {
  background: var(--bg); border-radius: 16px; padding: 32px;
  width: 100%; max-width: 380px; box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.authCard .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.authCard .brand .logo {
  width: 38px; height: 38px; object-fit: contain;
}
.authCard .brand span { font-weight: 800; font-size: 16px; }
.authCard h2 { font-size: 18px; margin-bottom: 4px; }
.authCard p.sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.authCard .switchLink { text-align: center; margin-top: 14px; font-size: 13px; color: var(--muted); }
.authCard .switchLink a { color: var(--brand); font-weight: 700; text-decoration: none; }

/* Landing page */
.hero {
  max-width: 900px; margin: 0 auto; padding: 60px 20px; text-align: center;
}
.hero h1 { font-size: 34px; margin-bottom: 14px; }
.hero p.lead { color: var(--muted); font-size: 17px; max-width: 560px; margin: 0 auto 28px; }
.hero .cta { display: flex; gap: 12px; justify-content: center; }
.features {
  max-width: 900px; margin: 0 auto 60px; padding: 0 20px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px;
}
.features .feat { border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.features .feat h3 { font-size: 15px; margin-bottom: 6px; }
.features .feat p { color: var(--muted); font-size: 13px; }

/* Landing page invoice mockup — illustrative, not a real screenshot */
.invoicePreview {
  max-width: 380px; margin: 44px auto 0; text-align: left;
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 20px 50px rgba(20, 30, 60, .12); overflow: hidden;
}
.ipHead {
  display: flex; align-items: center; gap: 10px;
  padding: 16px; border-bottom: 2px solid var(--brand);
}
.ipLogoDot {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(var(--brand) 0deg 200deg, #FFD400 200deg 260deg, var(--accent) 260deg 360deg);
}
.ipShopName { font-weight: 700; font-size: 13px; }
.ipShopSub { font-size: 11px; color: var(--muted); }
.ipInvoiceNo { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--brand); }
.ipRow {
  display: grid; grid-template-columns: 1fr 40px 70px;
  gap: 8px; padding: 8px 16px; font-size: 12px;
}
.ipRow span:nth-child(2) { text-align: center; color: var(--muted); }
.ipRow span:nth-child(3) { text-align: right; }
.ipRowHead { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; padding-top: 12px; }
.ipTotal {
  display: flex; justify-content: space-between; align-items: center;
  margin: 6px 16px 16px; padding-top: 10px; border-top: 1px solid var(--line);
  font-weight: 800; font-size: 14px; color: var(--brand);
}

.pricing { max-width: 760px; margin: 0 auto 64px; padding: 0 20px; text-align: center; }
.pricing h2 { font-size: 24px; margin-bottom: 24px; }
.priceGrid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px;
  text-align: left;
}
.priceCard { border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.priceCardHighlight { border-color: var(--brand); border-width: 2px; position: relative; }
.priceName { font-weight: 700; font-size: 15px; color: var(--muted); margin-bottom: 6px; }
.priceAmount { font-size: 30px; font-weight: 800; margin-bottom: 14px; }
.priceAmount .pricePer { font-size: 13px; font-weight: 600; color: var(--muted); display: block; margin-top: 2px; }
.priceList { list-style: none; margin-bottom: 18px; }
.priceList li { font-size: 13px; padding: 5px 0; padding-left: 20px; position: relative; }
.priceList li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.priceNote { color: var(--muted); font-size: 12px; margin-top: 18px; }
