/* VCG Ops Dashboard — Hearth × Magnolia inspired (matches lead-magnet brand) */
:root {
  --ink: #231f20;
  --ink-soft: #4a4644;
  --bg: #f4f1e1;
  --bg-card: #ffffff;
  --gold: #f3c65c;
  --peach: #f9a073;
  --teal: #a0bbbb;
  --rule: #e6dfc7;
  --green: #5a8d6b;
  --amber: #d99a3a;
  --red: #c25c4f;

  --display: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --body: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  --r: 6px;
  --shadow-sm: 0 1px 2px rgba(35, 31, 32, 0.06);
  --shadow: 0 4px 14px rgba(35, 31, 32, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--body);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--ink); }
a:hover { color: var(--peach); }

h1, h2, h3 { font-family: var(--display); font-weight: 500; letter-spacing: -0.01em; }
h1 { font-size: 2.2rem; margin: 0 0 0.25rem; }
h2 { font-size: 1.4rem; margin: 0 0 0.75rem; }
h3 { font-size: 1.05rem; margin: 0 0 0.5rem; }
h4 { font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; margin: 1rem 0 0.5rem; color: var(--ink-soft); }

.muted { color: var(--ink-soft); }
.small { font-size: 0.85rem; }

/* ── Topbar ─────────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 500;
}
.topnav { display: flex; gap: 1.25rem; flex: 1; }
.topnav a {
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
}
.topnav a.active { border-bottom-color: var(--gold); }

/* Topbar dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown summary {
  list-style: none;
  cursor: pointer;
  font-size: 0.95rem;
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
  user-select: none;
}
.nav-dropdown.active summary { border-bottom-color: var(--gold); }
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown[open] summary { color: var(--peach); }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 0.4rem 0;
  min-width: 240px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.dropdown-menu a {
  padding: 0.5rem 1rem;
  text-decoration: none;
  font-size: 0.9rem;
  color: var(--ink);
}
.dropdown-menu a:hover { background: var(--bg); color: var(--peach); }
.dropdown-menu a.dropdown-head {
  font-weight: 500;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 0.25rem;
  padding-bottom: 0.6rem;
}

/* Agent directory page */
.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1rem;
}
.agent-card { display: flex; flex-direction: column; }
.agent-card-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: start;
  margin-bottom: 0.75rem;
}
.agent-card-head h2 { font-size: 1.15rem; margin: 0; }
.agent-card-head p { margin: 0; }
.agent-what {
  font-size: 0.95rem;
  color: var(--ink);
  margin: 0.5rem 0 0.75rem;
}
.cmd-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.cmd {
  font-family: var(--mono);
  font-size: 0.78rem;
  background: var(--ink);
  color: var(--bg);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
}

.badge-ok { background: var(--green); color: white; }
.badge-warn { background: var(--amber); color: white; }
.badge-fail { background: var(--red); color: white; }
.badge-wip { background: var(--peach); color: var(--ink); }
.badge-review { background: var(--gold); color: var(--ink); }
.badge-idle { background: var(--ink-soft); color: var(--bg); opacity: 0.6; }
.badge-pending { background: var(--teal); color: var(--ink); }
.logout-form { display: flex; align-items: center; gap: 0.75rem; }
.user-pill {
  font-family: var(--mono);
  font-size: 0.78rem;
  background: var(--bg);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}
.link-btn {
  background: none;
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.25rem 0.5rem;
}
.link-btn:hover { color: var(--peach); }

/* ── Page layout ───────────────────────────────────────────────────── */
.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem;
}
.hero-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.panel { margin-bottom: 0; }

.panel-stats { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; gap: 0.15rem; }
.stat .num {
  font-family: var(--display);
  font-size: 1.8rem;
  line-height: 1;
}
.stat .lbl { font-size: 0.75rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.06em; }
.stat.warn .num { color: var(--amber); }

.mini-list { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.mini-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0;
  border-top: 1px solid var(--rule);
  font-size: 0.88rem;
}
.mini-list li:first-child { border-top: none; }
.mini-list .src { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-soft); min-width: 90px; }
.mini-list .form-label { flex: 1; }

/* ── Action items ──────────────────────────────────────────────────── */
.checklist { list-style: none; padding: 0; margin: 0; }
.item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: start;
  padding: 0.75rem 0;
  border-top: 1px solid var(--rule);
}
.item:first-child { border-top: none; }
.item-title { font-weight: 500; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.item-detail { color: var(--ink-soft); font-size: 0.88rem; margin-top: 0.2rem; }
.item-link { font-size: 0.85rem; }
.checkbox {
  background: none;
  border: 1px solid var(--ink-soft);
  border-radius: 4px;
  width: 22px;
  height: 22px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  color: transparent;
}
.checkbox:hover { background: var(--gold); border-color: var(--gold); color: var(--ink); }

.severity-critical .item-title::before { content: '🔴'; }
.severity-high .item-title::before { content: '🟠'; }
.severity-normal .item-title::before { content: '🟡'; }
.severity-low .item-title::before { content: '⚪'; }

.badge {
  font-family: var(--mono);
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--bg);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.badge-critical { background: var(--red); color: white; }
.badge-high { background: var(--amber); color: white; }
.badge-ok { background: var(--green); color: white; }

.source-tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--ink-soft);
  background: var(--bg);
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
}

.add-form summary { cursor: pointer; list-style: none; }
.add-form summary::-webkit-details-marker { display: none; }
.inline-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}
.inline-form input[type="text"] {
  flex: 1;
  min-width: 180px;
}
.empty { padding: 1rem 0; }

/* ── Agents ────────────────────────────────────────────────────────── */
.agent-rows { display: flex; flex-direction: column; }
.agent-row {
  border-top: 1px solid var(--rule);
}
.agent-row:first-child { border-top: none; }
.agent-row summary {
  display: grid;
  grid-template-columns: auto 1fr 2fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0;
  cursor: pointer;
  list-style: none;
}
.agent-row summary::-webkit-details-marker { display: none; }
.agent-row .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ink-soft);
}
.indicator-ok .dot { background: var(--green); }
.indicator-warn .dot { background: var(--amber); }
.indicator-fail .dot { background: var(--red); }
.indicator-wip .dot { background: var(--peach); }
.indicator-review .dot { background: var(--gold); }
.indicator-idle .dot { background: var(--ink-soft); opacity: 0.4; }

.agent-label { font-weight: 500; }
.agent-detail {
  padding: 0.5rem 0 1rem 1.5rem;
  border-left: 2px solid var(--rule);
  margin-left: 4px;
}

.kv { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 1rem; margin: 0.5rem 0; }
.kv dt { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; }
.kv dd { margin: 0; }
.logtail {
  background: #1e1b1c;
  color: #ddd;
  padding: 0.75rem;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.78rem;
  overflow-x: auto;
  max-height: 240px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-ok { background: var(--green); }
.status-fail { background: var(--red); }
.status-stale { background: var(--amber); }
.status-missing { background: var(--ink-soft); opacity: 0.4; }

/* ── Email page ────────────────────────────────────────────────────── */
.inbox-list { list-style: none; padding: 0; margin: 0; }
.inbox-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-top: 1px solid var(--rule);
}
.inbox-row:first-child { border-top: none; }

/* ── Forms / buttons ──────────────────────────────────────────────── */
input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  background: var(--bg);
  border: 1px solid var(--rule);
  padding: 0.55rem 0.7rem;
  border-radius: 4px;
  font-family: var(--body);
  font-size: 0.95rem;
  color: var(--ink);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: -1px;
}
label {
  display: block;
  margin: 0.75rem 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
label input { margin-top: 0.25rem; }

button.primary, .btn.primary {
  background: var(--ink);
  color: var(--bg);
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 4px;
  font-family: var(--body);
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button.primary:hover, .btn.primary:hover { background: var(--peach); color: var(--ink); }
button.primary:disabled { opacity: 0.5; cursor: not-allowed; }

.alert {
  background: rgba(194, 92, 79, 0.1);
  border: 1px solid var(--red);
  color: var(--red);
  padding: 0.6rem 0.9rem;
  border-radius: 4px;
  margin: 0.75rem 0;
  font-size: 0.9rem;
}

/* ── Login ─────────────────────────────────────────────────────────── */
.login-wrap {
  min-height: calc(100vh - 4rem);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: var(--bg-card);
  padding: 2.5rem 2.5rem 2rem;
  border-radius: var(--r);
  border: 1px solid var(--rule);
  width: 360px;
  box-shadow: var(--shadow);
}
.login-card h1 { text-align: center; }
.login-card .muted { text-align: center; margin-bottom: 1.25rem; }
.login-card button.primary { width: 100%; margin-top: 0.5rem; }

code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--bg);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}

.check-form, .delete-form { margin: 0; }

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; }
  .topnav { order: 3; flex-basis: 100%; }
  .agent-row summary { grid-template-columns: auto 1fr; }
  .agent-row summary .agent-summary, .agent-row summary .agent-meta { grid-column: 2; }
}
