/* Formula Ops — the white-label theme engine and the app shell. Powered by Endersoft.
   Every Endersoft module inherits these tokens (--surface, --surface-2, --text, --muted, --border,
   --border-strong, --cyan, --on-accent, --r, --shadow-pop), so one theme dresses the whole program.

   THE FIRST CUSTOMER'S THEME — In Your Face Skincare ("Elegant should be the default"):
   black, white, #b5c347 accents; titles and product names in Century Gothic; all other text Helvetica;
   base type LARGER than 13.5pt (their words), with a size picker (Normal 13.5pt · Large 15pt · Extra 16.5pt). */

:root, [data-theme="iyfs"] {
  --accent: #b5c347;
  --cyan: #8a9636;               /* the modules' accent token: the brand green, ink-strength for legibility */
  --on-accent: #101010;
  --surface: #ffffff;
  --surface-2: #f6f7f2;
  --text: #101010;
  --muted: #61665a;
  --border: rgba(16,16,16,.10);
  --border-strong: rgba(16,16,16,.20);
  --danger: #b3372f;
  --success: #3c7a34;
  --warning: #a07a1f;
  --r: 10px; --r-pill: 999px;
  --shadow-pop: 0 12px 32px rgba(16,16,16,.16);
  --grad: #b5c347;
  --font-title: "Century Gothic", "Avenir Next", "Futura", "URW Gothic", sans-serif;
  --font-body: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --fs: 15pt;                    /* "large" — the customer wanted bigger than the mockup's 13.5pt */
}
[data-fontsize="normal"] { --fs: 13.5pt; }
[data-fontsize="large"]  { --fs: 15pt; }
[data-fontsize="extra"]  { --fs: 16.5pt; }

/* Botanica — deep greens on cream; round and soft. */
[data-theme="botanica"] {
  --accent: #2f6a4c; --cyan: #2f6a4c; --on-accent: #f4f1e8;
  --surface: #faf7ef; --surface-2: #f0ebdd; --text: #1d2b23; --muted: #5c6b60;
  --border: rgba(29,43,35,.12); --border-strong: rgba(29,43,35,.24);
  --r: 14px; --shadow-pop: 0 14px 36px rgba(29,43,35,.18); --grad: #2f6a4c;
  --font-title: Georgia, "Times New Roman", serif;
  --font-body: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* Atelier — graphite and porcelain; square, sharp, quiet. */
[data-theme="atelier"] {
  --accent: #3e5a72; --cyan: #3e5a72; --on-accent: #f5f7f9;
  --surface: #fbfbfc; --surface-2: #eef1f4; --text: #16202a; --muted: #5d6a76;
  --border: rgba(22,32,42,.12); --border-strong: rgba(22,32,42,.26);
  --r: 4px; --shadow-pop: 0 10px 28px rgba(22,32,42,.16); --grad: #3e5a72;
  --font-title: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--surface-2); color: var(--text);
  font-family: var(--font-body); font-size: var(--fs); line-height: 1.45;
  display: flex; flex-direction: column;
}
h1, h2, h3, .brand, .product-name { font-family: var(--font-title); letter-spacing: .01em; }
a { color: var(--cyan); }
button { font: inherit; }

/* ── shell ─────────────────────────────────────────────────────────────────────── */
.shell { display: flex; flex: 1; min-height: 0; }
.nav {
  width: 232px; flex: none; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 14px 0;
}
.nav .brand { padding: 4px 18px 14px; font-size: 1.25em; font-weight: 700; }
.nav .brand small { display: block; font-family: var(--font-body); font-size: .55em; color: var(--muted); font-weight: 400; }
.nav a.item {
  display: block; padding: 7px 18px; color: var(--text); text-decoration: none; font-size: .92em;
  border-left: 3px solid transparent;
}
.nav a.item:hover { background: var(--surface-2); }
.nav a.item.active { border-left-color: var(--accent); font-weight: 700; background: var(--surface-2); }
.nav .group { margin: 10px 18px 4px; font-size: .7em; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.nav .spacer { flex: 1; }
.nav .me { padding: 10px 18px; border-top: 1px solid var(--border); font-size: .85em; color: var(--muted); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 12px 20px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.topbar h1 { margin: 0; font-size: 1.15em; }
.topbar .sub { color: var(--muted); font-size: .85em; }
.topbar .spacer { margin-left: auto; }
.content { flex: 1; min-height: 0; overflow: auto; padding: 18px 20px; }
.content.flush { padding: 0; }

/* ── cards, tables, panels ─────────────────────────────────────────────────────── */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; margin-bottom: 14px; }
.panel h2 { margin: 0 0 10px; font-size: 1em; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; cursor: pointer; }
.tile:hover { border-color: var(--accent); }
.tile .t-title { font-weight: 700; font-family: var(--font-title); }
.tile .t-sub { color: var(--muted); font-size: .82em; margin-top: 3px; }
.tile .t-row { display: flex; justify-content: space-between; font-size: .85em; margin-top: 6px; }
table.grid { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
table.grid th { text-align: left; font-size: .78em; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--border-strong); cursor: pointer; }
table.grid td { padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: .92em; }
table.grid tr:hover td { background: var(--surface-2); cursor: pointer; }
.pill { display: inline-block; padding: 2px 10px; border-radius: var(--r-pill); font-size: .75em; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border-strong); }
.pill.accent { background: var(--accent); color: var(--on-accent); border: 0; }
.pill.warn { color: var(--warning); border-color: var(--warning); }
.pill.danger { color: var(--danger); border-color: var(--danger); }
.pill.ok { color: var(--success); border-color: var(--success); }
.btn { background: var(--accent); color: var(--on-accent); border: 0; border-radius: var(--r); padding: 7px 14px; font-weight: 700; cursor: pointer; }
.btn.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.btn:disabled { opacity: .5; cursor: default; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: calc(var(--r) - 3px); padding: 6px 9px;
}
label.f { display: block; margin: 8px 0; font-size: .88em; }
label.f span { display: block; color: var(--muted); font-size: .82em; margin-bottom: 3px; }

/* ── the formula editor ────────────────────────────────────────────────────────── */
.formula-total { font-size: 1.25em; font-weight: 700; }
.formula-total.ok { color: var(--success); }
.formula-total.off { color: var(--danger); }
.fline { display: grid; grid-template-columns: 1fr 110px 40px 40px; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--border); }
.fline input[type="number"] { text-align: right; }
.fline .pin { cursor: pointer; text-align: center; opacity: .45; }
.fline .pin.on { opacity: 1; color: var(--accent); }
.locknote { background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--r); padding: 8px 12px; font-size: .85em; }

/* ── boards host (Views) ───────────────────────────────────────────────────────── */
.board-host { height: 100%; min-height: 420px; }
.snf-bar { margin-bottom: 12px; }

/* ── footer: Powered by Endersoft ─────────────────────────────────────────────── */
.footer {
  flex: none; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px; background: var(--surface); border-top: 1px solid var(--border);
  color: var(--muted); font-size: .78em;
}
.footer img { height: 16px; opacity: .8; }
.footer a { color: var(--muted); text-decoration: none; }

/* ── home attention list ───────────────────────────────────────────────────────── */
.attn { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.attn:hover { background: var(--surface-2); }
.attn .what { font-weight: 600; }
.attn .why { color: var(--muted); font-size: .85em; }

/* the stats page */
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 14px; }
.chart-panel h3 { margin: 0 0 8px; font-size: .95em; }

@media print {
  .nav, .topbar, .footer { display: none; }
  .content { overflow: visible; }
}
