/* Ceviche motion lab kit: a faithful HTML replica of app.ceviche.ai (tokens read from the live app 2026-09-26). */
@import url("https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,500;8..60,600&display=swap");

:root {
  --background: #fcfbf9; --foreground: #1f1e1a; --card: #fff;
  --primary: #2a6577; --secondary: #efede6; --muted: #f1efe9; --muted-fg: #6c665a;
  --accent: #f4f2eb; --destructive: #b3402e; --border: #e8e6dd; --input: #dad6cb;
  --brand: #307b8e; --brand-soft: #e0ebed; --brand-ink: #26616f;
  --approve-soft: #e4e8d6; --approve-ink: #5a6b33;
  --draft: #c99b3f; --pending: #c6613f; --paid: #7d8748; --approval: #3b5bdb;
  --sidebar: #f7f5f0; --sidebar-fg: #3e3b33; --sidebar-accent: #eceae2;
  --th: #f1efe9;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  /* marketing backdrop */
  --stage: #f4f2ec;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: transparent; }
body { font-family: var(--sans); color: var(--foreground); -webkit-font-smoothing: antialiased; }

/* ---------- Stage: fixed design canvas, scaled to fit its container ---------- */
.viewport { position: relative; width: 100%; aspect-ratio: var(--ar, 16 / 10); overflow: hidden; border-radius: 20px; background: var(--stage); }
.viewport.plain { background: transparent; border-radius: 0; }
.viewport.dots { background-color: var(--stage); background-image: radial-gradient(#d9d5ca 1px, transparent 1px); background-size: 18px 18px; }
.stage { position: absolute; left: 0; top: 0; width: var(--sw, 1600px); height: var(--sh, 1000px); transform-origin: 0 0; }
.camera { position: absolute; inset: 0; transform-origin: 0 0; will-change: transform; }

/* ---------- App window ---------- */
.app { position: absolute; display: flex; background: var(--sidebar); border: 1px solid #e3e0d6; border-radius: 14px; overflow: hidden; font-size: 14px; }
.app .side { width: 216px; flex: none; padding: 18px 14px; display: flex; flex-direction: column; gap: 2px; color: var(--sidebar-fg); }
.app .side .logo { display: flex; align-items: center; gap: 8px; height: 30px; margin: 0 6px 18px; }
.app .side .logo img { height: 22px; }
.app .side .sec { font-size: 11px; letter-spacing: .06em; color: #8a8475; margin: 18px 8px 8px; }
.app .side .item { display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px; border-radius: 6px; font-size: 14.5px; }
.app .side .item.on { background: var(--sidebar-accent); color: var(--foreground); font-weight: 500; }
.app .side .item svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.6; opacity: .85; }
.app .side .spacer { flex: 1; }
.app .side .user { margin: 10px 8px 0; font-size: 14px; }
.app .side .user small { display: block; color: var(--muted-fg); font-size: 12px; }
.app .main { position: relative; flex: 1; margin: 8px 8px 8px 0; background: var(--background); border: 1px solid #ebe8e0; border-radius: 12px; overflow: hidden; }
.app .topbar { height: 50px; display: flex; align-items: center; gap: 14px; padding: 0 22px; border-bottom: 1px solid var(--border); font-size: 15.5px; font-weight: 500; }
.app .topbar .pill { margin-left: auto; font-size: 12px; font-weight: 500; color: #8a5a1c; background: #fbf1e3; border: 1px solid #e9cfa6; border-radius: 6px; padding: 3px 10px; }
.app .topbar .dot { width: 8px; height: 8px; border-radius: 50%; background: #4bb56c; }
.app .body { padding: 26px 26px 0; }

h1.t { font-family: var(--serif); font-weight: 600; font-size: 25px; letter-spacing: -0.6px; }
.sub { color: var(--muted-fg); font-size: 14px; margin-top: 6px; }
.row { display: flex; align-items: center; gap: 10px; }

/* ---------- Controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 7px; border: 1px solid var(--input); background: #fff; font-size: 13.5px; font-weight: 500; color: var(--foreground); white-space: nowrap; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.soft { background: rgba(42,101,119,.14); border-color: rgba(42,101,119,.38); color: var(--brand-ink); height: 28px; font-size: 12.5px; padding: 0 10px; border-radius: 6px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.icon { width: 34px; padding: 0; justify-content: center; }
.select { display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; height: 36px; padding: 0 12px; border: 1px solid var(--input); border-radius: 7px; background: #fff; font-size: 14px; min-width: 120px; }
.select::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid #8a8475; border-bottom: 1.5px solid #8a8475; transform: rotate(45deg) translateY(-2px); }
.input { display: flex; align-items: center; height: 36px; padding: 0 12px; border: 1px solid var(--input); border-radius: 7px; background: #fff; font-size: 14px; color: #8a8475; }

.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 5px; background: var(--secondary); font-size: 12px; color: var(--foreground); white-space: nowrap; }
.chip.outline { background: #fff; border: 1px solid var(--input); }
.chip.brand { background: var(--brand-soft); color: var(--brand-ink); }
.chip.ok { background: var(--approve-soft); color: var(--approve-ink); border: 1px solid #cdd4b4; }
.chip.warn { background: #f9e7e0; color: #a34c2e; border: 1px solid #efc7b8; }
.chip.solid { background: var(--primary); color: #fff; font-size: 11px; letter-spacing: .04em; }
.chip.mono { font-family: var(--mono); font-size: 11.5px; background: #fff; border: 1px solid var(--input); }
.chip.count { height: 18px; padding: 0 6px; font-size: 11.5px; background: var(--secondary); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #9a9486; }
.dot.draft { background: var(--draft); } .dot.appr { background: var(--approval); } .dot.ready { background: var(--pending); } .dot.open { background: #6f8f86; } .dot.paid { background: #58b27a; } .dot.done { background: #6f8f86; }

/* ---------- Tabs ---------- */
.tabs { display: flex; align-items: center; gap: 18px; height: 40px; border-bottom: 1px solid var(--border); font-size: 13.5px; color: #4b473e; }
.tabs .tab { display: flex; align-items: center; gap: 6px; height: 100%; position: relative; white-space: nowrap; }
.tabs .tab.on { color: var(--foreground); font-weight: 600; }
.tabs .tab.on::after { content: ""; position: absolute; left: -6px; right: -6px; bottom: -1px; height: 2px; background: var(--foreground); border-radius: 2px; }
.seg { display: inline-flex; padding: 4px; gap: 2px; background: var(--muted); border-radius: 9px; font-size: 14px; }
.seg span { padding: 6px 10px; border-radius: 6px; }
.seg span.on { background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.06); font-weight: 500; }

/* ---------- Table ---------- */
.tbl { border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: #fff; }
.tbl .tr { display: grid; align-items: center; min-height: 39px; border-top: 1px solid #efece5; font-size: 14px; padding: 0 12px; column-gap: 12px; background: #fff; }
.tbl .tr:first-child { border-top: 0; }
.tbl .tr.th { background: var(--th); color: #5d584d; font-size: 12.5px; font-weight: 500; min-height: 42px; }
.tbl .tr.sub { background: #fdfcfa; }
.tbl .tr.hl { background: #f5f8f8; }
.tbl .c-r { text-align: right; justify-self: end; }
.tbl .muted { color: var(--muted-fg); }
.tbl .num { font-variant-numeric: tabular-nums; }
.ell { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cb { width: 16px; height: 16px; border: 1.5px solid #bdb8ab; border-radius: 4px; background: #fff; display: inline-grid; place-items: center; }
.cb.on { background: var(--primary); border-color: var(--primary); }
.cb.on::after { content: ""; width: 8px; height: 4px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px,-1px); }

/* ---------- Cards / KPI ---------- */
.card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; }
.kpi .l { font-size: 14px; color: #4b473e; } .kpi .v { font-family: var(--serif); font-size: 25px; font-weight: 600; margin-top: 6px; letter-spacing: -.3px; } .kpi .s { font-size: 12.5px; color: var(--muted-fg); margin-top: 4px; }

/* ---------- Modal ---------- */
.scrim { position: absolute; inset: 0; background: rgba(31,30,26,.38); }
.modal { position: absolute; background: var(--background); border-radius: 12px; overflow: hidden; border: 1px solid #ddd9ce; }
.pdfpane { background: #3a3a3a; }
.pdfbar { height: 58px; background: #2b2b2b; display: flex; align-items: center; gap: 16px; padding: 0 18px; color: #eee; font-size: 14px; }
.paper { background: #fff; color: #111; font-family: Helvetica, Arial, sans-serif; }

/* ---------- Motion helpers ---------- */
.cursor { position: absolute; left: 0; top: 0; width: 26px; height: 26px; z-index: 50; pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }
.ripple { position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; border: 2px solid var(--brand); opacity: 0; z-index: 49; pointer-events: none; }
.shimmer { position: relative; overflow: hidden; background: #eeebe3; border-radius: 5px; color: transparent !important; }
.shimmer::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent); animation: sh 1.1s infinite; }
@keyframes sh { to { transform: translateX(100%); } }
.toast { position: absolute; display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; font-size: 14px; box-shadow: 0 8px 28px rgba(31,30,26,.10); }
.toast .ic { width: 22px; height: 22px; border-radius: 50%; background: var(--approve-soft); color: var(--approve-ink); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.spark { color: var(--brand); }

/* ---------- Zigzag card frame (collapsed sidebar, Ceviche mark always in frame) ---------- */
.app.rail .rail-side { width: 58px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 0; color: var(--sidebar-fg); }
.rail-logo { width: 26px; margin-bottom: 14px; }
.ri { width: 38px; height: 34px; border-radius: 8px; display: grid; place-items: center; }
.ri svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.6; opacity: .85; }
.ri.on { background: var(--sidebar-accent); color: var(--foreground); }
.rail-sep { width: 22px; height: 1px; background: #e2ded3; margin: 8px 0; }
.app.rail .main { margin: 8px 8px 8px 0; }
.app.rail .topbar { height: 46px; font-size: 15px; }
.app.rail .body { padding: 20px 22px 0; }
/* toasts in cards always sit bottom-right of the frame */
.toast.br { left: auto; top: auto; right: 22px; bottom: 22px; }
.app .side .item.sub { height: 30px; padding-left: 37px; font-size: 13.5px; color: var(--muted-foreground); }
