/* FlowCreate Console — brand-aligned UI.
   Palette + type pulled from the flowcreate.solutions marketing site:
   orange→amber accent, deep-navy ink, muted blue-grey, light surfaces,
   DM Serif Display headings + Roboto body + Roboto Mono labels/CTAs. */

:root {
  --ink:        #19243c;   /* primary text / dark */
  --slate:      #273238;   /* secondary text */
  --muted:      #8b93a7;   /* labels, meta */
  --accent:     #ff693a;   /* brand orange */
  --accent-2:   #ff991c;   /* brand amber */
  --grad:       linear-gradient(135deg, #ff693a 0%, #ff991c 100%);

  --bg:         #f4f5f7;   /* page */
  --surface:    #ffffff;   /* cards */
  --line:       #e7e9f0;   /* hairlines */
  --line-soft:  #eef0f5;

  --ok:         #15803d;  --ok-bg:   #e8f6ed;
  --warn:       #b4530a;  --warn-bg: #fff2e2;
  --info:       #285263;

  --display: "DM Serif Display", Georgia, "Times New Roman", serif;
  --sans: "Roboto", system-ui, -apple-system, Segoe UI, sans-serif;
  --mono: "Roboto Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --shadow: 0 1px 2px rgba(25,36,60,.04), 0 8px 24px rgba(25,36,60,.06);
  --r-card: 16px;
  --r-ctl: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Shared atoms ───────────────────────────────────────────── */
.eyebrow {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .68rem;
  font-weight: 500;
  color: var(--muted);
}
.muted { color: var(--muted); }
.figure { font-family: var(--display); font-weight: 400; line-height: 1; letter-spacing: -.01em; }
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  font-family: var(--mono);
  font-size: .76rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
  border: 1px solid transparent;
  border-radius: var(--r-ctl);
  padding: .6rem 1.1rem;
  cursor: pointer;
  background: var(--surface);
  color: var(--ink);
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease, opacity .15s ease;
  white-space: nowrap;
}
.btn:hover { box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: .5; cursor: default; box-shadow: none; }
.btn--primary { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(255,105,58,.28); }
.btn--primary:hover { box-shadow: 0 8px 22px rgba(255,105,58,.36); }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--muted); }
.btn--danger { background: var(--surface); color: #b42318; border-color: #f0c4bf; }
.btn--danger:hover { background: #fdeceb; }
.btn--sm { padding: .32rem .6rem; font-size: .66rem; letter-spacing: .05em; }
.btn--block { width: 100%; }

/* ── Forms ──────────────────────────────────────────────────── */
label, .field-label { display: block; }
.field-label { font-family: var(--mono); font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 .35rem; }
input, select {
  width: 100%;
  font-family: var(--sans);
  font-size: .95rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  padding: .6rem .7rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,105,58,.14); }
/* Plain number fields — no spinner arrows (wheel-scroll is also disabled in JS). */
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.error { color: #b42318; font-size: .82rem; min-height: 1.1em; margin-top: .5rem; }
.ok { color: var(--ok); }

/* ── Top bar ────────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: .6rem; }
/* Real flowCreate.solutions wordmark — Roboto Mono, teal + orange (matches the site). */
.logo { font-family: var(--mono); font-weight: 500; font-size: 1.15rem; letter-spacing: -.01em; line-height: 1; text-decoration: none; white-space: nowrap; }
.logo .fc  { color: #285263; }
.logo .sol { color: var(--accent); }
.topbar .eyebrow { align-self: center; }

/* ── Layout ─────────────────────────────────────────────────── */
.wrap { max-width: 1080px; margin: 0 auto; padding: 1.75rem 1.5rem 4rem; }
.section { margin-top: 1.5rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: 1.4rem 1.5rem;
}
.card-title { font-family: var(--display); font-size: 1.15rem; color: var(--ink); margin: 0; font-weight: 400; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ── Stat cards ─────────────────────────────────────────────── */
.stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 1.2rem 1.3rem;
  box-shadow: var(--shadow);
}
.stat-value { font-family: var(--display); font-size: 1.9rem; line-height: 1; color: var(--ink); }
.stat-label { font-family: var(--mono); font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-top: .5rem; }
.stat--hero { background: var(--ink); border-color: var(--ink); }
.stat--hero .stat-value { font-size: 2.3rem; }
.stat--hero .stat-label { color: #aeb6c7; }

/* ── Week panel ─────────────────────────────────────────────── */
.week-controls { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.week-controls input { width: auto; }
.weeklabel { font-family: var(--display); font-size: 1.35rem; color: var(--ink); }
.breakdown { display: flex; gap: 2rem; flex-wrap: wrap; align-items: flex-end; margin: 1.1rem 0; padding-bottom: 1.1rem; border-bottom: 1px solid var(--line); }
.bd-item { display: flex; flex-direction: column; gap: .25rem; }
.bd-site { font-family: var(--mono); font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.bd-amount { font-family: var(--mono); font-size: 1.05rem; font-weight: 500; color: var(--slate); }
.bd-count { color: var(--muted); font-size: .8rem; }
.bd-total { margin-left: auto; text-align: right; }
.bd-total .bd-amount { font-family: var(--display); font-size: 1.8rem; font-weight: 400; }
.billbar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: .25rem 0 1rem; }
.billmsg { font-family: var(--mono); font-size: .76rem; color: var(--muted); }

/* ── Tables (ledger) ────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
thead th {
  font-family: var(--mono); font-size: .62rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted); font-weight: 500; text-align: left;
  padding: .5rem .65rem; border-bottom: 1px solid var(--line);
}
tbody td { padding: .65rem .65rem; border-bottom: 1px solid var(--line-soft); font-size: .9rem; color: var(--slate); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafbfd; }
.amount { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.col-actions { text-align: right; white-space: nowrap; }
.est { color: var(--muted); cursor: help; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-block; font-family: var(--mono); font-size: .6rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .08em; padding: .2rem .55rem; border-radius: 999px;
  border: 1px solid transparent;
}
.badge--pending, .badge--draft, .badge--pending_approval { color: var(--warn); background: var(--warn-bg); border-color: #f6dcbb; }
.badge--invoiced, .badge--sent, .badge--paid, .badge--approved { color: var(--ok); background: var(--ok-bg); border-color: #c7e9d3; }
.badge--rejected, .badge--void { color: #b42318; background: #fdeceb; border-color: #f3cfca; }

/* ── Empty state ────────────────────────────────────────────── */
.empty { color: var(--muted); font-family: var(--mono); font-size: .82rem; padding: 1rem .65rem; }

/* ── Centered (login / form / notices) ──────────────────────── */
.center { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.panel { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 2rem 1.9rem; }
.panel h1 { font-family: var(--display); font-weight: 400; font-size: 1.5rem; margin: 0 0 .2rem; }
.panel .lead { color: var(--muted); font-size: .9rem; margin: 0 0 1.4rem; }
.panel .field-label { margin-top: .9rem; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 560px) {
  .wrap { padding: 1.25rem 1rem 3rem; }
  .breakdown { gap: 1.1rem; }
  .bd-total { margin-left: 0; text-align: left; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
