/* Marketing Engine dashboard. Built to the Design Bible:
   one type family (Montserrat) in three roles, mostly white, the accent #C68F79
   used once or twice per screen, deep navy for structure, red reserved for a hard
   stop only, generous top clearance, no em or en dashes anywhere. */

:root {
  --bg: #ffffff;
  --canvas: #fbfaf9;
  --ink: #1e2a44;          /* deep navy, headings + structure */
  --body: #4a4a4a;
  --muted: #8c8783;
  --line: #ece7e3;         /* warm hairline */
  --line-soft: #f3efec;
  --accent: #c68f79;       /* used sparingly */
  --accent-soft: #f5ebe5;
  --good: #3f8f6b;
  --good-soft: #e7f1ec;
  --warn: #b88234;
  --warn-soft: #f6eedf;
  --stop: #b23a3a;         /* hard stop / blocked only */
  --stop-soft: #f5e4e4;
  --shadow: 0 1px 2px rgba(30, 42, 68, 0.04), 0 6px 20px rgba(30, 42, 68, 0.05);
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--canvas);
  color: var(--body);
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { color: var(--ink); font-weight: 600; margin: 0; letter-spacing: -0.01em; }
a { color: inherit; text-decoration: none; }

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

.sidebar {
  width: 236px;
  flex: 0 0 236px;
  background: var(--bg);
  border-right: 1px solid var(--line);
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { padding: 0 10px 26px; }
.brand-name { display: block; font-weight: 700; color: var(--ink); font-size: 16px; letter-spacing: -0.02em; }
.brand-sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; letter-spacing: 0.04em; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  color: var(--body);
  font-weight: 500;
  font-size: 14.5px;
  position: relative;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item:hover { background: var(--line-soft); }
.nav-item.active { background: var(--accent-soft); color: var(--ink); }
.nav-item.active .nav-ico { color: var(--accent); }
.nav-ico { font-size: 13px; color: var(--muted); width: 16px; text-align: center; }
.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sidebar-foot { margin-top: auto; padding-top: 18px; }

.main {
  flex: 1;
  padding: 40px 48px 64px;
  max-width: 1180px;
  min-width: 0;
}
.loading { color: var(--muted); padding: 40px 0; }

/* ----------------------------------------------------------------- page head */
.page-head { margin-bottom: 28px; }
.page-head h1 { font-size: 27px; }
.page-head .sub { color: var(--muted); margin-top: 6px; font-size: 14px; }

.head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

/* ----------------------------------------------------------------- buttons */
.btn {
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn:hover { border-color: #dcd5cf; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #b87e68; border-color: #b87e68; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--ink); background: var(--line-soft); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-stop { color: var(--stop); border-color: var(--stop-soft); background: var(--stop-soft); }
.btn-stop:hover { background: #efd8d8; border-color: #efd8d8; }
.btn-good { color: var(--good); border-color: var(--good-soft); background: var(--good-soft); }
.btn-good:hover { background: #d8ebe1; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ----------------------------------------------------------------- cards */
.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }

/* ----------------------------------------------------------------- stat card */
.stat {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 500; letter-spacing: 0.02em; }
.stat-value { font-size: 38px; font-weight: 600; color: var(--ink); margin-top: 8px; line-height: 1; letter-spacing: -0.02em; }
.stat-value .unit { font-size: 18px; color: var(--muted); font-weight: 500; margin-left: 3px; }
.stat-foot { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.stat-accent .stat-value { color: var(--accent); }

/* ----------------------------------------------------------------- dots + pills */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: 0 0 9px; }
.dot.on { background: var(--good); }
.dot.off { background: #d8d2cc; }
.dot.warn { background: var(--warn); }
.dot.stop { background: var(--stop); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--line-soft);
  color: var(--body);
  letter-spacing: 0.01em;
}
.pill.great, .pill.good { background: var(--good-soft); color: var(--good); }
.pill.median { background: var(--line-soft); color: var(--body); }
.pill.below { background: var(--warn-soft); color: var(--warn); }
.pill.publish { background: var(--good-soft); color: var(--good); }
.pill.fix_first { background: var(--warn-soft); color: var(--warn); }
.pill.do_not_publish { background: var(--stop-soft); color: var(--stop); }
.badge {
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted); background: var(--line-soft);
  padding: 3px 9px; border-radius: 6px;
}

/* ----------------------------------------------------------------- lists */
.row-list { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 0; border-bottom: 1px solid var(--line-soft);
}
.row:last-child { border-bottom: none; }
.row-main { flex: 1; min-width: 0; }
.row-title { color: var(--ink); font-weight: 500; font-size: 14.5px; }
.row-meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.row-right { text-align: right; flex: 0 0 auto; }
.row-value { color: var(--ink); font-weight: 600; font-size: 15px; }

/* ----------------------------------------------------------------- channel bars */
.bar-track { height: 6px; background: var(--line-soft); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.bar-fill { height: 100%; border-radius: 4px; background: var(--accent); }
.bar-fill.great, .bar-fill.good { background: var(--good); }
.bar-fill.below { background: var(--warn); }
.bar-fill.median { background: #c3bcb4; }

/* ----------------------------------------------------------------- sparkline */
.spark { display: inline-block; vertical-align: middle; }

/* ----------------------------------------------------------------- queue */
.qtabs { display: flex; gap: 6px; margin-bottom: 22px; flex-wrap: wrap; }
.qtab {
  font-size: 13.5px; font-weight: 500; padding: 8px 14px; border-radius: 9px;
  cursor: pointer; color: var(--muted); border: 1px solid transparent;
}
.qtab:hover { background: var(--line-soft); }
.qtab.active { background: var(--bg); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow); }
.qtab .count { margin-left: 6px; opacity: 0.7; font-weight: 600; }

.qcard { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 16px; }
.qcard-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.qcard h3 { font-size: 16px; margin: 2px 0 8px; }
.qcard .preview { color: var(--body); font-size: 13.5px; white-space: pre-wrap; max-height: 90px; overflow: hidden; position: relative; }
.qcard .context { color: var(--muted); font-size: 12.5px; margin-top: 10px; }
.findings { margin-top: 14px; border-top: 1px solid var(--line-soft); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.finding { display: flex; gap: 10px; align-items: baseline; font-size: 13px; }
.sev { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 5px; flex: 0 0 auto; }
.sev.P0 { background: var(--stop-soft); color: var(--stop); }
.sev.P1 { background: var(--warn-soft); color: var(--warn); }
.sev.P2 { background: var(--accent-soft); color: var(--accent); }
.sev.P3 { background: var(--line-soft); color: var(--muted); }
.finding .what { color: var(--body); }
.finding .matched { color: var(--muted); font-style: italic; }
.qcard-actions { display: flex; gap: 10px; margin-top: 18px; align-items: center; }
.reject-reason { flex: 1; border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; font-family: inherit; font-size: 13.5px; }

/* ----------------------------------------------------------------- email */
.email-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 18px 28px; padding: 20px 22px; background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.email-sstat-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.email-sstat-value { font-size: 24px; color: var(--ink); font-weight: 600; margin-top: 4px; letter-spacing: -0.01em; }
.email-warn-row { margin-top: 12px; }
.email-warn-note {
  display: inline-block; font-size: 12.5px; font-weight: 500; color: var(--warn);
  background: var(--warn-soft); padding: 7px 12px; border-radius: 9px;
}
.qtab[data-etab], .qtab[data-email-days] { font-family: inherit; background: transparent; }

.email-table-wrap { overflow-x: auto; }
.email-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.email-table th {
  text-align: right; font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted); padding: 0 12px 10px; white-space: nowrap;
}
.email-table th:first-child, .email-table th:nth-child(2), .email-table th:nth-child(3) { text-align: left; }
.email-table td { text-align: right; padding: 11px 12px; border-top: 1px solid var(--line-soft); color: var(--body); white-space: nowrap; }
.email-table td.email-cap { text-align: left; color: var(--ink); max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.email-table td:nth-child(2), .email-table td:nth-child(3) { text-align: left; }
.email-import-stats { font-size: 13px; color: var(--body); margin-top: 6px; }

.email-stat-strip { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.email-ministat { display: flex; flex-direction: column; gap: 2px; }
.email-ministat-label { font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: 0.02em; }
.email-ministat-value { font-size: 16px; color: var(--ink); font-weight: 600; }

.email-preview-panel { margin-top: 16px; border-top: 1px solid var(--line-soft); padding-top: 14px; }
.email-preview-frame {
  width: 100%; height: 480px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); display: block;
}

.email-flow-row { display: flex; align-items: center; gap: 16px; }
.email-flow-main { flex: 1; min-width: 0; }
.email-flow-main h3 { font-size: 16px; margin: 0 0 4px; }
.email-switch { flex: 0 0 auto; cursor: pointer; display: inline-flex; align-items: center; }
.email-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.email-switch-track {
  width: 42px; height: 24px; border-radius: 20px; background: #d8d2cc;
  position: relative; transition: background 0.15s ease;
}
.email-switch-knob {
  position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--bg); box-shadow: 0 1px 2px rgba(30, 42, 68, 0.2); transition: left 0.15s ease;
}
.email-switch input:checked + .email-switch-track { background: var(--good); }
.email-switch input:checked + .email-switch-track .email-switch-knob { left: 21px; }
.email-switch input:focus + .email-switch-track { outline: 2px solid var(--accent-soft); outline-offset: 2px; }
.email-health { display: flex; align-items: center; }
.pill.draft { background: var(--line-soft); color: var(--body); }
.pill.scheduled { background: var(--accent-soft); color: var(--accent); }
.pill.sending { background: var(--warn-soft); color: var(--warn); }
.pill.sent { background: var(--good-soft); color: var(--good); }
.pill.paused { background: var(--line-soft); color: var(--muted); }
.pill.complained { background: var(--stop-soft); color: var(--stop); }
.pill.bounced { background: var(--warn-soft); color: var(--warn); }
.pill.suppressed { background: var(--line-soft); color: var(--muted); }
.pill.customer { background: var(--accent-soft); color: var(--accent); }

/* ----------------------------------------------------------------- instagram */
.ig-conn { font-size: 12px; font-weight: 600; color: var(--muted); }
.ig-conn.on { color: var(--good); }
.ig-conn.off { color: var(--muted); }

/* Generate for me panel inside the Compose card. Canvas inset, the same neutral
   secondary surface as .joblog, so it reads as a plain card and spends no accent. */
.ig-gen {
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.ig-gen-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.ig-or {
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 4px 0 16px;
}

.ig-verdict { border-radius: 10px; padding: 12px 14px; font-size: 13.5px; margin-top: 14px; }
.ig-verdict.ok { background: var(--good-soft); color: var(--good); }
.ig-verdict.bad { background: var(--stop-soft); color: var(--stop); }

.ig-post { padding: 16px 18px; }
.ig-post-row { display: flex; gap: 16px; align-items: flex-start; }
.ig-post-body { flex: 1; min-width: 0; }
.ig-thumb {
  flex: 0 0 84px; width: 84px; height: 84px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); background: var(--canvas); position: relative;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 12px;
}
.ig-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ig-thumb-empty { text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.ig-thumb-more {
  position: absolute; right: 4px; bottom: 4px; background: var(--ink); color: #fff;
  font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 6px;
}
.ig-when { color: var(--muted); font-size: 12.5px; font-weight: 500; margin-left: auto; }
.pill.pending { background: var(--line-soft); color: var(--body); }
.pill.approved { background: var(--good-soft); color: var(--good); }
.pill.blocked { background: var(--stop-soft); color: var(--stop); }
.pill.published { background: var(--line-soft); color: var(--body); }

.ig-reschedule { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.ig-reschedule input {
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px;
  font-family: inherit; font-size: 13px; color: var(--ink); background: var(--bg);
}
.ig-reschedule input:focus { outline: none; border-color: var(--accent); }

.ig-summary { display: flex; gap: 28px; flex-wrap: wrap; margin-bottom: 20px; }
.ig-stat-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.ig-stat-value { font-size: 24px; color: var(--ink); font-weight: 600; margin-top: 4px; letter-spacing: -0.01em; }

.ig-table-wrap { overflow-x: auto; }
.ig-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ig-table th {
  text-align: right; font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted); padding: 0 12px 10px; white-space: nowrap;
}
.ig-table th:nth-child(2) { text-align: left; }
.ig-table td { text-align: right; padding: 11px 12px; border-top: 1px solid var(--line-soft); color: var(--body); white-space: nowrap; }
.ig-table td.ig-cap { text-align: left; color: var(--ink); max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.ig-table td.ig-cap a { color: var(--ink); }
.ig-table td.ig-cap a:hover { color: var(--accent); }
.ig-table td.ig-rank { color: var(--muted); font-weight: 600; text-align: left; }
.ig-table td.ig-score { color: var(--ink); font-weight: 600; }
/* Best row highlighted off the accent: a soft good tint and a hairline left rule,
   rank and score stay navy. The single accent moment on this screen is the star
   on rank 1, not the whole row. */
.ig-table tr.ig-best td { background: var(--good-soft); }
.ig-table tr.ig-best td.ig-rank { color: var(--ink); box-shadow: inset 2px 0 0 var(--good); }
.ig-table tr.ig-best td.ig-score { color: var(--ink); }
.ig-table tr.ig-best .ig-star { color: var(--accent); font-weight: 700; }

.ig-connect { max-width: 560px; }
.ig-pages { display: flex; gap: 8px; flex-wrap: wrap; }

/* ----------------------------------------------------------------- ig strategy card */
/* Mostly white, navy structure, no accent fills. The one accent moment on this tab is
   the Generate a post button (btn btn-primary); the strategy card, the Schedule post
   button and the Connect button on the not-connected state all spend none, so only one
   solid accent fill is ever on the Instagram screen at once. */
.ig-strategy { margin-bottom: 18px; }
.ig-mini-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px;
}
.ig-strat-top {
  display: flex; gap: 28px; flex-wrap: wrap; align-items: flex-start;
  padding-bottom: 18px; border-bottom: 1px solid var(--line-soft);
}
.ig-strat-stage { flex: 1 1 320px; }
.ig-strat-metric { flex: 1 1 240px; }
.ig-stage-tag { font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.ig-stage-range { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.ig-stage-goal { font-size: 14px; color: var(--body); margin-top: 10px; line-height: 1.5; }
.ig-metric-now { font-size: 20px; font-weight: 600; color: var(--ink); margin: 2px 0 6px; letter-spacing: -0.01em; }
.ig-metric-now .hint { font-size: 12.5px; font-weight: 400; color: var(--muted); letter-spacing: 0; }

/* Stage ladder: five rungs, the current one marked with a navy left rule and a soft
   tint. No accent. */
.ig-ladder { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.ig-rung {
  flex: 1 1 110px; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; background: var(--bg);
}
.ig-rung.current { background: var(--canvas); box-shadow: inset 3px 0 0 var(--ink); border-color: var(--line); }
.ig-rung-n { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.ig-rung.current .ig-rung-n { color: var(--ink); }
.ig-rung-name { font-size: 14px; font-weight: 600; color: var(--ink); margin-top: 3px; }
.ig-rung-metric { font-size: 11.5px; color: var(--muted); margin-top: 4px; word-break: break-word; }

.ig-strat-grid { display: flex; gap: 28px; flex-wrap: wrap; margin: 4px 0 18px; }
.ig-strat-col { flex: 1 1 280px; }
.ig-exit-note { font-size: 13.5px; color: var(--body); line-height: 1.5; }
.ig-grid-prog { margin-top: 10px; }
.ig-grid-bar { height: 7px; border-radius: 4px; background: var(--line-soft); overflow: hidden; }
.ig-grid-bar span { display: block; height: 100%; background: var(--good); border-radius: 4px; }
.ig-ignored-row { font-size: 13px; color: var(--body); padding: 5px 0; border-top: 1px solid var(--line-soft); line-height: 1.45; }
.ig-ignored-row:first-of-type { border-top: none; }
.ig-ignored-row b { color: var(--ink); }

.ig-next { border-top: 1px solid var(--line-soft); padding-top: 16px; }
.ig-next-row { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line-soft); font-size: 13.5px; }
.ig-next-row:first-of-type { border-top: none; }
.ig-next-pillar { font-weight: 600; color: var(--ink); white-space: nowrap; }
.ig-next-subj { color: var(--body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Collapsible advanced / full plan blocks. Plain, no accent. */
.ig-advanced { margin-top: 16px; }
.ig-advanced > summary {
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink);
  list-style: none; padding: 4px 0;
}
.ig-advanced > summary::-webkit-details-marker { display: none; }
.ig-advanced > summary::before { content: "+ "; color: var(--muted); }
.ig-advanced[open] > summary::before { content: "- "; }
.ig-fullplan { border-top: 1px solid var(--line-soft); padding-top: 12px; margin-top: 18px; }
.ig-fullplan-body { max-width: 640px; }

/* ----------------------------------------------------------------- create form */
.form { display: flex; flex-direction: column; gap: 18px; max-width: 560px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 7px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px;
  font-family: inherit; font-size: 14px; color: var(--ink); background: var(--bg);
}
.field textarea { min-height: 78px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field-row { display: flex; gap: 14px; }
.field-row .field { flex: 1; }

/* ----------------------------------------------------------------- job log */
.joblog {
  margin-top: 18px; background: var(--canvas); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 16px; font-size: 12.5px; color: var(--body);
  max-height: 240px; overflow: auto;
}
.joblog .line { padding: 2px 0; border-bottom: 1px solid var(--line-soft); }
.joblog .line:last-child { border-bottom: none; }
.job-status { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13px; }

/* ----------------------------------------------------------------- empty */
.empty { color: var(--muted); text-align: center; padding: 40px 20px; font-size: 14px; }
.empty .big { font-size: 15px; color: var(--ink); font-weight: 600; margin-bottom: 6px; }

/* ----------------------------------------------------------------- spinner */
.spin {
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--accent);
  display: inline-block; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------------------------------------------- toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 10px;
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow); z-index: 50;
}

/* ----------------------------------------------------------------- login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--canvas); }
.login-card { background: var(--bg); border: 1px solid var(--line); border-radius: 18px; padding: 40px 38px; width: 340px; box-shadow: var(--shadow); text-align: center; }
.login-mark { font-weight: 700; font-size: 19px; color: var(--ink); letter-spacing: -0.02em; }
.login-sub { color: var(--muted); font-size: 13px; margin: 6px 0 26px; }
.login-card input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-family: inherit; font-size: 15px; margin-bottom: 12px; }
.login-card input:focus { outline: none; border-color: var(--accent); }
.login-error { color: var(--stop); font-size: 13px; min-height: 18px; margin: 12px 0 0; }

/* ----------------------------------------------------------------- responsive */
@media (max-width: 820px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; padding: 14px 16px; gap: 14px; }
  .brand { padding: 0; }
  .nav { flex-direction: row; gap: 4px; margin-left: auto; }
  .nav-item span:not(.nav-ico):not(.nav-badge) { display: none; }
  .sidebar-foot { margin: 0; padding: 0; }
  .main { padding: 24px 18px 56px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .field-row { flex-direction: column; }
  .ig-post-row { flex-direction: column; }
  .ig-summary { gap: 18px; }
}
