/* ═══════════════════════════════════════════════════════════════════
   ISKRA Canada — Operations
   Design tokens lifted verbatim from www.iskraa.ca so the back office
   and the public site are one brand. The layout language (rail, panel
   cards, label/value rows, status pills) follows the GO AI subscriber
   dashboard the client asked us to echo.
   ═══════════════════════════════════════════════════════════════════ */

@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,700;1,9..40,400&family=Manrope:wght@500;600;700;800&display=swap");

:root {
  /* — the site's own palette — */
  --bg: #fbfaf7;
  --ink: #19221f;
  --ink-2: #3c4a45;
  --ink-3: #6d7a75;
  --panel: #f1eee8;
  --panel-2: #e7e2d9;
  --line: #ddd7cc;
  --white: #ffffff;
  --red: #e32636;
  --red-deep: #b51d2b;
  --dark: #14251b;
  --dark-2: #1d3326;
  --dark-line: #2d4a37;
  --green: #1f6b43;
  --green-soft: #9fd6b4;
  --amber: #a9690d;
  --amber-soft: #f0d9b5;

  --r: 4px;
  --maxw: 1240px;
  --gut: clamp(18px, 4vw, 44px);
  --sans: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Manrope", "DM Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --rail: 268px;
}

* { margin: 0; padding: 0; box-sizing: border-box }

html { -webkit-text-size-adjust: 100% }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none }
button, input, select, textarea { font: inherit; color: inherit }

/* ── the brand mark ─────────────────────────────────────────────── */
.mark { display: block; width: 100%; height: 100% }
.mark path { fill: var(--red) }

/* ═══ APP SHELL ═════════════════════════════════════════════════ */

.app { display: flex; min-height: 100vh }

/* ── left rail ──────────────────────────────────────────────────── */
.rail {
  width: var(--rail);
  flex: 0 0 var(--rail);
  background: var(--dark);
  color: #e6efe9;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--dark-line);
}

.rail-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--dark-line);
}
.rail-brand .mk { width: 26px; height: 26px; flex: 0 0 26px }
.rail-brand b {
  font-family: var(--display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -.01em;
  display: block;
  line-height: 1.05;
  color: #fff;
}
.rail-brand span {
  display: block;
  font-size: 9.5px;
  letter-spacing: .26em;
  text-indent: .26em;
  color: #8fae9c;
  font-weight: 700;
  margin-top: 2px;
}

.rail-org {
  margin: 14px 14px 6px;
  padding: 11px 12px;
  border: 1px solid var(--dark-line);
  border-radius: var(--r);
  background: rgba(255, 255, 255, .03);
  display: flex;
  align-items: center;
  gap: 10px;
}
.rail-org .av {
  width: 30px; height: 30px; flex: 0 0 30px;
  border-radius: var(--r);
  background: var(--red);
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-size: 13px;
}
.rail-org .nm { font-weight: 700; font-size: 13.5px; color: #fff; line-height: 1.2 }
.rail-org .sb { font-size: 11px; color: #8fae9c; margin-top: 1px }

.rail-sec {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .22em;
  text-indent: .22em;
  color: #6f8d7c;
  padding: 18px 20px 7px;
}

.rail nav { display: flex; flex-direction: column; gap: 1px; padding: 0 10px }
.rail nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: var(--r);
  font-size: 14px;
  color: #c3d6ca;
  position: relative;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.rail nav a .ic {
  width: 26px; height: 26px; flex: 0 0 26px;
  display: grid; place-items: center;
  border-radius: 3px;
  background: rgba(255, 255, 255, .05);
  color: #9dbcab;
}
.rail nav a .ic svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.7 }
.rail nav a:hover { background: rgba(255, 255, 255, .05); color: #fff }
.rail nav a[aria-current="page"] {
  background: rgba(227, 38, 54, .14);
  color: #fff;
  font-weight: 700;
}
.rail nav a[aria-current="page"]::before {
  content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px;
  width: 3px; background: var(--red); border-radius: 0 2px 2px 0;
}
.rail nav a[aria-current="page"] .ic { background: var(--red); color: #fff }

.rail-foot { margin-top: auto; padding: 14px; border-top: 1px solid var(--dark-line) }
.rail-foot .where {
  font-size: 10px; letter-spacing: .14em; color: #6f8d7c;
  font-weight: 700; text-align: center;
}

/* ── main column ────────────────────────────────────────────────── */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column }

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 30px var(--gut) 22px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.topbar h1 {
  font-family: var(--display);
  font-size: clamp(22px, 2.3vw, 29px);
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.1;
}
.topbar p { color: var(--ink-3); font-size: 14px; margin-top: 5px }
.topbar .acts { display: flex; gap: 9px; flex-wrap: wrap }

.wrap { padding: 26px var(--gut) 72px; max-width: var(--maxw) }

/* ═══ COMPONENTS ════════════════════════════════════════════════ */

.kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .24em;
  text-indent: .24em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border: 1px solid var(--ink);
  border-radius: var(--r);
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
  white-space: nowrap;
}
.btn:hover { background: #000 }
.btn.red { background: var(--red); border-color: var(--red) }
.btn.red:hover { background: var(--red-deep); border-color: var(--red-deep) }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line) }
.btn.ghost:hover { background: var(--panel); border-color: var(--ink-3) }
.btn.sm { padding: 6px 11px; font-size: 12.5px }
.btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.9 }

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.panel + .panel { margin-top: 18px }
.panel-h {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.panel-h h2 { font-family: var(--display); font-size: 16px; font-weight: 800; letter-spacing: -.015em }
.panel-h p { font-size: 12.5px; color: var(--ink-3); margin-top: 2px }
.panel-b { padding: 20px }
.panel-b.flush { padding: 0 }

/* label / value rows — the GO AI account-overview pattern */
.rows { display: flex; flex-direction: column }
.row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.row:last-child { border-bottom: 0 }
.row dt { font-size: 12.5px; color: var(--ink-3) }
.row dd { font-size: 14.5px; font-weight: 500 }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: 12px }
.stat {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 17px;
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--line);
}
.stat.r::before { background: var(--red) }
.stat.g::before { background: var(--green) }
.stat.d::before { background: var(--dark) }
.stat.a::before { background: var(--amber) }
.stat .lb { font-size: 11px; letter-spacing: .1em; color: var(--ink-3); font-weight: 700; text-transform: uppercase }
.stat .vl {
  font-family: var(--display); font-size: 27px; font-weight: 800;
  letter-spacing: -.03em; margin-top: 7px; line-height: 1;
}
.stat .sb { font-size: 12px; color: var(--ink-3); margin-top: 6px }

/* status pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 2px;
  border: 1px solid;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.pill.draft    { color: var(--ink-3); border-color: var(--line); background: var(--panel) }
.pill.sent     { color: #1e4b8f; border-color: #bed2ec; background: #eaf1fa }
.pill.accepted,
.pill.paid     { color: var(--green); border-color: var(--green-soft); background: #eef8f2 }
.pill.overdue,
.pill.declined { color: var(--red-deep); border-color: #f0bcc1; background: #fdeef0 }
.pill.partial,
.pill.signing  { color: var(--amber); border-color: var(--amber-soft); background: #fdf4e7 }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px }
.tbl th {
  text-align: left;
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 700;
  padding: 11px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  white-space: nowrap;
}
.tbl td { padding: 13px 20px; border-bottom: 1px solid var(--line); vertical-align: middle }
.tbl tbody tr:last-child td { border-bottom: 0 }
.tbl tbody tr { cursor: pointer; transition: background .14s var(--ease) }
.tbl tbody tr:hover { background: var(--panel) }
.tbl .num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap }
.tbl .ref { font-weight: 700; font-family: var(--display); white-space: nowrap }

/* forms */
.fld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 15px }
.fld label { font-size: 12px; font-weight: 700; color: var(--ink-2); letter-spacing: .02em }
.fld input, .fld select, .fld textarea {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--white);
  padding: 9px 11px;
  font-size: 14px;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
  width: 100%;
}
.fld input:focus, .fld select:focus, .fld textarea:focus {
  outline: 0; border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(25, 34, 31, .07);
}
.fld textarea { resize: vertical; min-height: 78px; line-height: 1.55 }
.fld .hint { font-size: 11.5px; color: var(--ink-3) }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px }

/* line-item editor */
.items { width: 100%; border-collapse: collapse; font-size: 13.5px }
.items th {
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 700; text-align: left;
  padding: 9px 8px; border-bottom: 1px solid var(--line);
}
.items td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top }
.items input, .items select, .items textarea {
  border: 1px solid transparent; background: transparent; border-radius: 3px;
  padding: 6px 7px; width: 100%; font-size: 13.5px;
}
.items input:hover, .items select:hover, .items textarea:hover { border-color: var(--line) }
.items input:focus, .items select:focus, .items textarea:focus {
  outline: 0; border-color: var(--ink); background: var(--white);
}
.items .qty, .items .amt { text-align: right; font-variant-numeric: tabular-nums }
.items .del {
  border: 0; background: transparent; color: var(--ink-3); cursor: pointer;
  padding: 6px; border-radius: 3px; line-height: 0;
}
.items .del:hover { color: var(--red); background: #fdeef0 }
.items .del svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8 }

/* totals block */
.totals { margin-left: auto; width: min(340px, 100%); margin-top: 16px }
.totals .t {
  display: flex; justify-content: space-between; gap: 20px;
  padding: 8px 0; font-size: 14px; border-bottom: 1px solid var(--line);
}
.totals .t span:last-child { font-variant-numeric: tabular-nums; font-weight: 500 }
.totals .t.grand {
  border-bottom: 0; border-top: 2px solid var(--ink); margin-top: 4px; padding-top: 12px;
  font-family: var(--display); font-weight: 800; font-size: 19px; letter-spacing: -.02em;
}

/* empty state */
.empty { padding: 52px 20px; text-align: center; color: var(--ink-3) }
.empty .mk { width: 34px; height: 34px; margin: 0 auto 14px; opacity: .3 }
.empty h3 { font-family: var(--display); font-size: 16px; color: var(--ink); font-weight: 800; margin-bottom: 5px }
.empty p { font-size: 13.5px; max-width: 360px; margin: 0 auto 16px }

/* catalogue picker */
.cat { display: grid; grid-template-columns: repeat(auto-fit, minmax(224px, 1fr)); gap: 10px }
.cat button {
  text-align: left; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--white); padding: 13px 14px; cursor: pointer;
  transition: border-color .16s var(--ease), background .16s var(--ease);
}
.cat button:hover { border-color: var(--ink); background: var(--panel) }
.cat .n { font-weight: 700; font-size: 13.5px; margin-bottom: 3px }
.cat .d { font-size: 11.5px; color: var(--ink-3); line-height: 1.45 }
.cat .p {
  margin-top: 8px; font-family: var(--display); font-weight: 800;
  font-size: 13px; color: var(--red);
}

.note {
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--red);
  border-radius: var(--r); padding: 13px 15px; font-size: 13px; color: var(--ink-2);
  line-height: 1.55;
}

.toolbar { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; margin-bottom: 16px }
.toolbar .sp { flex: 1 }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden }
.seg button {
  border: 0; background: var(--white); padding: 7px 13px; font-size: 12.5px;
  font-weight: 700; color: var(--ink-3); cursor: pointer; border-right: 1px solid var(--line);
}
.seg button:last-child { border-right: 0 }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff }

/* ── the development gate ───────────────────────────────────────── */
.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px max(18px, env(safe-area-inset-left, 0px));
  background:
    radial-gradient(90% 70% at 12% 0%, rgba(31, 107, 67, .30) 0, transparent 60%),
    radial-gradient(85% 80% at 95% 100%, rgba(227, 38, 54, .22) 0, transparent 62%),
    var(--dark);
}
.gate-card {
  width: min(410px, 100%);
  background: var(--white);
  border-radius: var(--r);
  padding: 34px 34px 26px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .34);
}
.gate-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 26px }
.gate-brand .mk { width: 30px; height: 30px; flex: 0 0 30px }
.gate-brand b {
  font-family: var(--display); font-weight: 800; font-size: 18px;
  letter-spacing: -.01em; display: block; line-height: 1.05;
}
.gate-brand span {
  display: block; font-size: 9.5px; letter-spacing: .26em; text-indent: .26em;
  color: var(--ink-3); font-weight: 700; margin-top: 2px;
}
.gate-card h1 {
  font-family: var(--display); font-size: 25px; font-weight: 800;
  letter-spacing: -.028em; line-height: 1.1;
}
.gate-sub { font-size: 13.5px; color: var(--ink-3); margin: 7px 0 22px; line-height: 1.5 }
.gate-go { width: 100%; justify-content: center; padding: 11px; margin-top: 4px }
.gate-go:disabled { opacity: .55; cursor: not-allowed }
.gate-msg { font-size: 13px; color: var(--red-deep); margin-top: 13px; min-height: 18px; line-height: 1.45 }
.gate-foot {
  font-size: 11.5px; color: var(--ink-3); line-height: 1.5;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line);
}

.rail-foot .out {
  display: block; width: 100%; text-align: center; background: transparent;
  border: 1px solid var(--dark-line); color: #9dbcab; border-radius: var(--r);
  padding: 7px; font-size: 12.5px; font-weight: 700; cursor: pointer; margin-bottom: 10px;
  transition: border-color .18s var(--ease), color .18s var(--ease);
}
.rail-foot .out:hover { border-color: var(--red); color: #fff }

@media (max-width: 920px) {
  :root { --rail: 0px }
  .rail { display: none }
  .grid2, .grid3 { grid-template-columns: 1fr }
  .row { grid-template-columns: 1fr; gap: 3px }
}
