/* Sillon — interface styles. One family (Archivo, variable width), petrol + amber. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("/static/fonts/archivo-latin-wdth-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("/static/fonts/archivo-latin-ext-wdth-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --paper: #edf0f2;
  --surface: #ffffff;
  --ink: #16222b;
  --muted: #5b6b76;
  --faint: #8a98a2;
  --line: #d5dce1;
  --line-soft: #e6eaed;
  --petrol: #0d5c6b;
  --petrol-deep: #08414c;
  --petrol-soft: #dcedef;
  --amber: #b97400;
  --amber-soft: #fbefd9;
  --sprout: #2f7d4c;
  --sprout-soft: #e1f1e6;
  --alert: #b42318;
  --alert-soft: #fbe5e3;
  --focus: #1f8fa3;
  --radius-panel: 10px;
  --radius-control: 6px;
  --rail: 224px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  font-stretch: 100%;
}
a { color: var(--petrol); text-underline-offset: 2px; }
a:hover { color: var(--petrol-deep); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
img { max-width: 100%; }

/* ------------------------------------------------------------------ layout */

.shell {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  min-height: 100vh;
  background: linear-gradient(to right, var(--petrol-deep) var(--rail), var(--paper) var(--rail));
}
fieldset[disabled] .btn { opacity: 0.45; cursor: not-allowed; }
.rail {
  background: var(--petrol-deep);
  color: #d6e6e9;
  padding: 22px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 0 10px 6px;
  color: #fff;
  text-decoration: none;
  font-stretch: 125%;
  font-weight: 750;
  font-size: 21px;
  letter-spacing: -0.01em;
}
.brand-mark { width: 18px; height: 14px; flex: none; align-self: center; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  color: #c7dadd;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: var(--radius-control);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
}
.nav a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav a[aria-current="page"] { background: rgba(255, 255, 255, 0.13); color: #fff; }
.nav .count {
  font-size: 12px;
  font-weight: 650;
  background: var(--amber);
  color: #fff;
  border-radius: 999px;
  padding: 0 7px;
  min-width: 20px;
  text-align: center;
}
.rail-foot { margin-top: auto; font-size: 13px; color: #9fbcc1; padding: 0 10px; }
.rail-foot form { margin: 6px 0 0; }
.rail-foot button { background: none; border: 0; color: #c7dadd; padding: 0; cursor: pointer; font: inherit; text-decoration: underline; }

.main { padding: 30px 40px 60px; min-width: 0; }
.page { max-width: 1180px; }
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
h1, h2, h3 { margin: 0; line-height: 1.15; }
h1 {
  font-size: 30px;
  font-stretch: 118%;
  font-weight: 700;
  letter-spacing: -0.015em;
}
h2 { font-size: 19px; font-stretch: 110%; font-weight: 650; }
h3 { font-size: 16px; font-weight: 650; }
.page-head p, .lede { margin: 6px 0 0; color: var(--muted); max-width: 70ch; }
.crumb { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.crumb a { color: var(--muted); }

.banner {
  border-radius: var(--radius-control);
  padding: 10px 14px;
  margin-bottom: 16px;
  border: 1px solid;
}
.banner.info { background: var(--petrol-soft); border-color: #b8d8dc; color: var(--petrol-deep); }
.banner.ok { background: var(--sprout-soft); border-color: #bcdcc6; color: #1f5a35; }
.banner.warn { background: var(--amber-soft); border-color: #efd29e; color: #6f4600; }
.banner.error { background: var(--alert-soft); border-color: #f2c1bc; color: #8a1a12; }
.banner ul { margin: 4px 0 0; padding-left: 18px; }
.simulation {
  background: repeating-linear-gradient(-45deg, var(--amber-soft), var(--amber-soft) 12px, #f8e6c4 12px, #f8e6c4 24px);
  border: 1px solid #efd29e;
  color: #6f4600;
  border-radius: var(--radius-control);
  padding: 8px 14px;
  margin-bottom: 18px;
  font-weight: 550;
}

/* ------------------------------------------------------------------ panels */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  padding: 20px 22px;
  margin-bottom: 20px;
}
.panel > h2 { margin-bottom: 4px; }
.panel > .hint { margin: 0 0 14px; color: var(--muted); font-size: 14px; max-width: 75ch; }
.panel-flush { padding: 0; overflow: hidden; }
.panel-flush > h2 { padding: 18px 22px 0; }
.panel-flush > .hint { padding: 0 22px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.muted { color: var(--muted); }
p code, .hint code, .help code { overflow-wrap: anywhere; }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.mt0 { margin-top: 0; }

/* ----------------------------------------------------------------- figures */

.figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  margin-bottom: 20px;
  overflow: hidden;
}
.figure { padding: 16px 20px 18px; border-left: 1px solid var(--line-soft); }
.figure:first-child { border-left: 0; }
.figure .value {
  font-size: 40px;
  line-height: 1;
  font-weight: 650;
  font-stretch: 72%;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.figure .label { color: var(--muted); font-size: 14px; margin-top: 6px; }
.figure .sub { color: var(--faint); font-size: 13px; }
.figure.good .value { color: var(--sprout); }
.figure.warn .value { color: var(--amber); }
.figure.bad .value { color: var(--alert); }

/* pipeline bar: where contacts are in a campaign */
.pipeline { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--line-soft); margin: 10px 0 8px; }
.pipeline span { display: block; height: 100%; }
.pipeline .p-pending { background: #b9c4cb; }
.pipeline .p-active { background: var(--petrol); }
.pipeline .p-completed { background: #6aa3ad; }
.pipeline .p-replied { background: var(--sprout); }
.pipeline .p-stopped { background: #d5dce1; }
.pipeline .p-bounced { background: var(--alert); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: 0; }

/* ------------------------------------------------------------------ tables */

table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.data th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  font-size: 13px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #f7f9fa;
  white-space: nowrap;
}
.data td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.data tr:last-child td { border-bottom: 0; }
.data tbody tr:hover { background: #f9fbfb; }
.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data a.rowlink { color: var(--ink); text-decoration: none; font-weight: 600; }
.data a.rowlink:hover { color: var(--petrol); text-decoration: underline; }
.data tr.unread td { font-weight: 600; }
.empty { padding: 36px 22px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.table-scroll { overflow-x: auto; }

/* ------------------------------------------------------------------ badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
  background: var(--line-soft);
  color: var(--muted);
}
.badge.ok { background: var(--sprout-soft); color: #1f5a35; }
.badge.run { background: var(--petrol-soft); color: var(--petrol-deep); }
.badge.warn { background: var(--amber-soft); color: #7a4d00; }
.badge.bad { background: var(--alert-soft); color: #8a1a12; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ------------------------------------------------------------------- forms */

label { font-weight: 600; font-size: 14px; display: block; margin-bottom: 5px; }
.field { margin-bottom: 14px; }
.field .help { font-size: 13px; color: var(--muted); margin-top: 4px; font-weight: 400; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="time"], input[type="url"], input[type="search"], input[type="file"], select, textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid #c3ccd2;
  border-radius: var(--radius-control);
  padding: 8px 10px;
}
input[type="number"] { max-width: 140px; }
input[type="time"] { max-width: 140px; }
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
textarea.mono, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13.5px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.check { display: flex; gap: 9px; align-items: flex-start; font-weight: 400; margin-bottom: 8px; }
.check input { margin-top: 4px; }
.check strong { font-weight: 600; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days label {
  border: 1px solid #c3ccd2;
  border-radius: var(--radius-control);
  padding: 5px 10px;
  font-weight: 500;
  margin: 0;
  cursor: pointer;
}
.days input { margin-right: 5px; }
.inline-fields { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.inline-fields .field { min-width: 140px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: inherit;
  font-weight: 600;
  font-size: 14.5px;
  border-radius: var(--radius-control);
  padding: 8px 15px;
  border: 1px solid #b9c4cb;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  line-height: 1.3;
  white-space: nowrap;
}
.btn:hover { border-color: var(--petrol); color: var(--petrol-deep); }
.btn.primary { background: var(--petrol); border-color: var(--petrol); color: #fff; }
.btn.primary:hover { background: var(--petrol-deep); color: #fff; }
.btn.danger { color: var(--alert); border-color: #e5b3ad; }
.btn.danger:hover { background: var(--alert-soft); }
.btn.small { padding: 4px 10px; font-size: 13.5px; }
.btn.link { border: 0; background: none; padding: 0; color: var(--petrol); text-decoration: underline; font-weight: 500; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
form.inline { display: inline; margin: 0; }

/* ---------------------------------------------------------- sequence furrow */

.furrow { position: relative; padding-left: 46px; }
.furrow::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 18px;
  bottom: 18px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(var(--petrol), #6aa3ad);
}
.step { position: relative; margin-bottom: 8px; }
.step-marker {
  position: absolute;
  left: -46px;
  top: 14px;
  width: 33px;
  height: 33px;
  border-radius: 50%;
  background: var(--petrol);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-stretch: 80%;
  font-size: 16px;
  box-shadow: 0 0 0 4px var(--paper);
}
.step-wait {
  position: relative;
  margin: 0 0 8px;
  padding: 4px 0;
  color: var(--muted);
  font-size: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.step-wait::before {
  content: "";
  position: absolute;
  left: -36px;
  top: 50%;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid #6aa3ad;
  transform: translateY(-50%);
}
.step-wait input { width: 70px; padding: 4px 8px; }
.step-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: 16px 18px; }
.step-card .spread { margin-bottom: 10px; }
.variant { border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 12px; }
.variant:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.variant-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.variant-tag {
  font-weight: 700;
  font-stretch: 80%;
  color: var(--petrol-deep);
  background: var(--petrol-soft);
  border-radius: 4px;
  padding: 0 7px;
  margin-right: 6px;
}
.var-help { font-size: 13px; color: var(--muted); }
.var-help code { background: var(--line-soft); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }

/* ------------------------------------------------------------------- inbox */

.inbox-layout { display: grid; grid-template-columns: 220px 1fr; gap: 20px; }
.filters a {
  display: flex;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: var(--radius-control);
  text-decoration: none;
  color: var(--ink);
}
.filters a[aria-current="page"] { background: var(--petrol-soft); color: var(--petrol-deep); font-weight: 600; }
.filters .count { color: var(--muted); font-variant-numeric: tabular-nums; }
.thread-msg { border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); margin-bottom: 12px; }
.thread-msg.out { background: #f6f9fa; }
.thread-msg header { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.thread-msg .body { padding: 14px 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.thread-msg iframe { width: 100%; border: 0; min-height: 200px; }

.preview-mail { border: 1px solid var(--line); border-radius: var(--radius-panel); background: #fff; }
.preview-mail .meta { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.preview-mail .content { padding: 16px; }

/* ------------------------------------------------------------------- login */

.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 20% 10%, rgba(13, 92, 107, 0.12), transparent 40%),
    var(--paper);
}
.auth-box { width: 100%; max-width: 400px; }
.auth-box .brand { color: var(--petrol-deep); padding: 0; margin-bottom: 18px; font-size: 26px; }
.auth-panel { padding: 28px 26px 22px; }
.auth-panel h1 { font-size: 23px; margin: 0 0 6px; }
.auth-icon { width: 40px; height: 40px; color: var(--petrol); margin-bottom: 12px; display: block; }
.auth-lead { margin: 0 0 18px; color: var(--muted); }
.auth-foot { margin: 16px 0 0; font-size: 13.5px; color: var(--muted); }
.auth-origin { margin: 14px 0 0; text-align: center; font-size: 12.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.btn.block { display: flex; width: 100%; justify-content: center; padding: 11px 15px; font-size: 15px; white-space: normal; text-align: center; }

/* ---------------------------------------------------------------- security */

.key-list { list-style: none; margin: 0 0 16px; padding: 0; border: 1px solid var(--line-soft); border-radius: var(--radius-control); }
.key-list li { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 12px 14px; flex-wrap: wrap; }
.key-list li + li { border-top: 1px solid var(--line-soft); }
.key-list .key-name { font-weight: 600; }
.key-list .key-meta { font-size: 13.5px; color: var(--muted); }
.key-list .key-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.key-list details summary { cursor: pointer; color: var(--petrol); font-size: 13.5px; text-decoration: underline; list-style: none; }
.key-list details summary::-webkit-details-marker { display: none; }
.key-list details form { display: flex; gap: 8px; margin-top: 8px; }
.key-list details input { width: 200px; max-width: 100%; }
.confirm-bar { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.copy-field { display: flex; gap: 8px; }
.copy-field input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; }
.journal td { font-size: 13.5px; }
.journal .who { font-weight: 600; }
.journal .fail { color: var(--alert); font-weight: 600; }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1000px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .inbox-layout { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); background: var(--paper); }
  .rail { position: static; height: auto; padding: 12px; gap: 8px; min-width: 0; }
  .page-head > * { min-width: 0; }
  .grid-2 { grid-template-columns: minmax(0, 1fr) !important; }
  .row { min-width: 0; }
  .nav { flex-direction: row; overflow-x: auto; }
  .nav a { white-space: nowrap; }
  .rail-foot { display: none; }
  .main { padding: 20px 16px 40px; }
  h1 { font-size: 25px; }
  .figure { border-left: 0; border-top: 1px solid var(--line-soft); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
