/* MJC Master Dashboard — single stylesheet, dark mode default. Phase 1 baseline. */
:root {
  --bg: #0e1116;
  --surface: #161b22;
  --surface-2: #1f2630;
  --border: #2a323e;
  --text: #e6edf3;
  --text-dim: #8b949e;
  --accent: #58a6ff;
  --green: #3fb950;
  --yellow: #d29922;
  --red: #f85149;
  --grey: #6e7681;
  --radius: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand a { color: var(--text); font-weight: 600; }
.brand .badge { font-size: 0.75rem; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-dim); margin-left: 8px; }
.brand .badge.public { background: var(--accent); color: var(--bg); }

.domain-nav { display: flex; gap: 1rem; align-items: center; }
.domain-nav a { color: var(--text-dim); }
.domain-nav a:hover { color: var(--text); }
.services-dropdown { position: relative; }
.services-dropdown summary { cursor: pointer; color: var(--text-dim); list-style: none; }
.services-dropdown summary::-webkit-details-marker { display: none; }
.services-dropdown ul {
  position: absolute; right: 0; top: 100%; margin: 4px 0 0; padding: 0.5rem 0;
  list-style: none; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); min-width: 240px; z-index: 100;
}
.services-dropdown ul li a {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; color: var(--text);
}
.services-dropdown ul li a:hover { background: var(--surface); text-decoration: none; }

.user a { color: var(--text-dim); font-size: 0.9rem; }

main { max-width: 1280px; margin: 0 auto; padding: 1.5rem; }

footer { text-align: center; padding: 2rem 1rem; color: var(--text-dim); font-size: 0.85rem; }

/* Hero */
.hero-tiles h1 { font-size: 1.8rem; margin: 0 0 0.25rem; }
.hero-tiles .subtitle { color: var(--text-dim); margin: 0 0 2rem; }

/* Service grid */
.service-grid h2 { font-size: 1.2rem; margin-bottom: 1rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.service-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem;
  color: var(--text); display: block;
  transition: border-color 0.15s, transform 0.15s;
}
.service-card:hover { border-color: var(--accent); transform: translateY(-1px); text-decoration: none; }
.service-card header { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 0.75rem; }
.service-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 0.85rem; }
.service-card dt { color: var(--text-dim); }
.service-card dd { margin: 0; }
.service-card dd.errors { color: var(--red); font-size: 0.8rem; }

/* Status dots */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.dot-healthy  { background: var(--green); }
.dot-degraded { background: var(--yellow); }
.dot-down     { background: var(--red); }
.dot-stale    { background: var(--grey); }

.status-healthy  { color: var(--green); }
.status-degraded { color: var(--yellow); }
.status-down     { color: var(--red); }
.status-stale    { color: var(--text-dim); }

/* Login */
.login { max-width: 400px; margin: 4rem auto; text-align: center; }
.login h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.login .hint { color: var(--text-dim); font-size: 0.9rem; margin-top: 1rem; }
.btn-primary {
  background: var(--accent); color: var(--bg);
  border: 0; padding: 0.75rem 1.5rem;
  border-radius: var(--radius); font-weight: 600; font-size: 1rem;
  cursor: pointer;
}
.btn-primary:hover { filter: brightness(1.1); }

/* Alerts */
.alert {
  padding: 0.75rem 1rem; margin: 1rem 0; border-radius: var(--radius);
  border: 1px solid var(--border);
}
.alert-success { background: rgba(63,185,80,0.1); border-color: var(--green); color: var(--green); }
.alert-error   { background: rgba(248,81,73,0.1); border-color: var(--red); color: var(--red); }
.alert code { background: var(--surface-2); padding: 1px 4px; border-radius: 3px; }

/* Dev bypass */
.dev-bypass {
  margin-top: 1rem; padding: 1rem;
  background: var(--surface-2); border: 1px dashed var(--yellow);
  border-radius: var(--radius); text-align: left;
}
.dev-bypass summary {
  cursor: pointer; color: var(--yellow); font-weight: 600;
  list-style: none;
}
.dev-bypass summary::-webkit-details-marker { display: none; }
.dev-bypass form { margin-top: 0.75rem; display: flex; gap: 8px; }
.dev-bypass input {
  flex: 1; padding: 0.5rem 0.75rem;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 0.95rem;
}
.btn-secondary {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); padding: 0.5rem 1rem;
  border-radius: var(--radius); cursor: pointer; font-weight: 600;
  font-size: 0.95rem;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.dev-bypass .quick-signin { margin: 0.75rem 0; }
.dev-bypass .quick-signin .btn-secondary {
  width: 100%; padding: 0.75rem; font-size: 1rem;
  background: rgba(210,153,34,0.1); border-color: var(--yellow); color: var(--yellow);
}
.dev-bypass .quick-signin .btn-secondary:hover {
  background: rgba(210,153,34,0.2); color: var(--yellow);
}
.passcode-display {
  background: var(--bg); padding: 2px 6px; border-radius: 3px;
  font-size: 0.95rem; user-select: all;
}
.manual-passcode { margin-top: 0.75rem; }
.manual-passcode summary {
  cursor: pointer; color: var(--text-dim); font-size: 0.85rem;
  list-style: none;
}
.manual-passcode summary::-webkit-details-marker { display: none; }
.manual-passcode form { margin-top: 0.5rem; }

.login hr {
  margin: 2rem 0 1rem;
  border: 0; border-top: 1px solid var(--border);
}

/* Hero tiles (8-tile landing strip) */
.hero-strip { margin-bottom: 2rem; }
.hero-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
.hero-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
}
.hero-tile-value { font-size: 1.6rem; font-weight: 700; }
.hero-tile-label { font-size: 0.85rem; color: var(--text-dim); margin-top: 4px; }
.hero-tile-sublabel { font-size: 0.75rem; color: var(--text-dim); opacity: 0.75; margin-top: 2px; }
.hero-tile-money { border-color: var(--green); }
.hero-tile-money .hero-tile-value { color: var(--green); }
.hero-tile-alert { border-color: var(--red); }
.hero-tile-alert .hero-tile-value { color: var(--red); }
.hero-tile-warn { border-color: var(--yellow); }
.hero-tile-warn .hero-tile-value { color: var(--yellow); }
.hero-tile-ok { border-color: var(--green); }
.hero-tile-ok .hero-tile-value { color: var(--green); }
.hero-tile-users .hero-tile-value { color: var(--accent); }

/* Alert strip */
.alert-strip { margin: 1.5rem 0; }
.alert-strip ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.alert-strip .alert {
  display: flex; align-items: center; gap: 12px;
  padding: 0.6rem 1rem;
}
.alert-strip .alert-warn { background: rgba(210,153,34,0.08); border-color: var(--yellow); color: var(--yellow); }
.alert-strip .alert-error { background: rgba(248,81,73,0.08); border-color: var(--red); color: var(--red); }
.alert-strip .alert-count {
  font-size: 1.4rem; font-weight: 700;
  min-width: 32px; text-align: center;
}
.alert-strip .alert-text { flex: 1; }
.alert-strip .alert a { font-size: 0.85rem; }

/* Domain cards (5 nav cards on landing) */
.domain-cards { margin: 2rem 0; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
.domain-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem; color: var(--text);
  display: block; transition: border-color 0.15s, transform 0.15s;
}
.domain-card:hover {
  border-color: var(--accent); transform: translateY(-1px);
  text-decoration: none;
}
.domain-card h3 { margin: 0 0 4px; font-size: 1.1rem; }
.domain-card p { margin: 0; font-size: 0.85rem; color: var(--text-dim); }

/* Domain page panels */
.panels { display: flex; flex-direction: column; gap: 1.5rem; }
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.25rem;
}
.panel-header { display: flex; align-items: center; gap: 10px; margin-bottom: 1rem; }
.panel-header h2 { margin: 0; flex: 1; font-size: 1.2rem; }
.panel-header .ts { font-size: 0.75rem; color: var(--text-dim); }
.panel-buckets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.bucket { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem; }
.bucket h3 { margin: 0 0 0.5rem; font-size: 0.85rem; text-transform: uppercase; color: var(--text-dim); letter-spacing: 0.05em; }
.bucket dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 0.85rem; }
.bucket dt { color: var(--text-dim); }
.bucket dd { margin: 0; word-break: break-word; }
.json-snippet {
  background: var(--surface-2); padding: 4px 8px; border-radius: 4px;
  font-size: 0.7rem; color: var(--text-dim); margin: 0;
  max-height: 100px; overflow: auto;
}
.null-value { color: var(--grey); font-style: italic; }
.errors-block {
  margin-top: 1rem; padding: 0.75rem;
  background: rgba(248,81,73,0.08); border: 1px solid var(--red);
  border-radius: var(--radius); color: var(--red);
}
.errors-block h4 { margin: 0 0 0.5rem; }
.errors-block ul { margin: 0; padding-left: 1.2rem; font-size: 0.8rem; }
.panel-footer { margin-top: 1rem; font-size: 0.85rem; }

/* Creative page */
.creative-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}
.big-number { font-size: 1.6rem; color: var(--accent); margin: 0.5rem 0; }
.kpi-row { display: flex; gap: 1.5rem; margin: 0.75rem 0; }
.kpi { display: flex; flex-direction: column; }
.kpi-value { font-size: 1.6rem; font-weight: 700; }
.kpi-label { font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; }
.chapters-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-top: 0.5rem; }
.chapters-table th { text-align: left; padding: 6px 8px; color: var(--text-dim); border-bottom: 1px solid var(--border); }
.chapters-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); }
.journal-text { white-space: pre-wrap; line-height: 1.6; padding: 0.5rem 0; }

/* Trainings page */
.trainings-grid { display: flex; flex-direction: column; gap: 1.5rem; }
.training-product .price { color: var(--green); font-weight: 600; }
.brand-badge {
  font-size: 0.7rem; padding: 2px 8px;
  border-radius: 999px; background: var(--surface-2); color: var(--text-dim);
}
.cohort-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.75rem; margin-top: 0.75rem; }
.cohort-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem; }
.cohort-card h4 { margin: 0 0 4px; font-size: 1rem; }
.cohort-dates { font-size: 0.8rem; color: var(--text-dim); margin-bottom: 0.5rem; }
.cohort-fill { font-size: 0.85rem; }
.cohort-fill .seats-taken { font-size: 1.4rem; font-weight: 700; color: var(--accent); }
.cohort-fill .cohort-of { color: var(--text-dim); margin: 0 4px; }
.fill-bar { background: var(--surface-2); height: 6px; border-radius: 3px; margin: 6px 0; overflow: hidden; }
.fill-bar-inner { background: var(--green); height: 100%; }
.fill-pct { font-size: 0.75rem; color: var(--text-dim); }
.cohort-status-label { font-size: 0.75rem; text-transform: uppercase; margin-top: 6px; color: var(--text-dim); }
.cohort-status-open { border-color: var(--green); }
.cohort-status-full { border-color: var(--yellow); }
.cohort-status-closed { border-color: var(--grey); }

/* Journal strip on landing */
.journal-strip { margin-top: 2rem; padding: 1rem 1.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.journal-strip h2 { margin: 0 0 0.5rem; font-size: 1rem; color: var(--text-dim); text-transform: uppercase; }

/* Public status page */
.status-hero { margin: 1rem 0 2rem; }
.status-banner {
  padding: 1.5rem 2rem; border-radius: var(--radius);
  border: 1px solid var(--border); margin-bottom: 1.5rem;
}
.status-banner-ok { background: rgba(63,185,80,0.1); border-color: var(--green); }
.status-banner-warn { background: rgba(210,153,34,0.1); border-color: var(--yellow); }
.status-banner h1 { margin: 0 0 0.25rem; font-size: 1.6rem; }
.status-banner p { margin: 0; color: var(--text-dim); font-size: 0.85rem; }

.status-headlines {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.headline {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  text-align: center;
}
.headline-value {
  display: block; font-size: 2rem; font-weight: 700;
  color: var(--accent);
}
.headline-label {
  display: block; margin-top: 4px; font-size: 0.85rem;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em;
}

.status-grid-rows { display: flex; flex-direction: column; gap: 6px; margin-top: 1rem; }
.status-row {
  display: flex; align-items: center; gap: 12px;
  padding: 0.75rem 1rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.status-row-label { flex: 1; }
.status-row-state { font-size: 0.85rem; color: var(--text-dim); }
.status-row-healthy .status-row-state { color: var(--green); }
.status-row-degraded .status-row-state { color: var(--yellow); }
.status-row-down .status-row-state { color: var(--red); }
.status-row-stale .status-row-state { color: var(--grey); }

.status-meta { margin-top: 2rem; padding: 1rem; color: var(--text-dim); font-size: 0.85rem; text-align: center; }

/* Wiring audit */
.summary-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 2rem;
}
.summary-tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem; text-align: center;
}
.summary-tile .tile-value { font-size: 2rem; font-weight: 700; color: var(--text); }
.summary-tile .tile-label { font-size: 0.8rem; color: var(--text-dim); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.tile-ok { border-color: var(--green); }
.tile-ok .tile-value { color: var(--green); }
.tile-warn { border-color: var(--yellow); }
.tile-warn .tile-value { color: var(--yellow); }
.tile-error { border-color: var(--red); }
.tile-error .tile-value { color: var(--red); }

.wiring-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-top: 0.75rem; }
.wiring-table th { text-align: left; padding: 8px 10px; color: var(--text-dim); border-bottom: 2px solid var(--border); font-size: 0.75rem; text-transform: uppercase; }
.wiring-table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.wiring-table .url-cell { font-size: 0.75rem; word-break: break-all; }
.wiring-table .env-var { font-size: 0.7rem; color: var(--text-dim); font-family: monospace; }
.wiring-table .row-wired { background: rgba(63,185,80,0.04); }
.wiring-table .row-endpoint_missing { background: rgba(248,81,73,0.04); }
.wiring-table .row-not_configured { background: rgba(210,153,34,0.04); }
.wiring-table .row-unreachable { background: rgba(248,81,73,0.04); }

.http-code {
  display: inline-block; padding: 3px 8px;
  border-radius: 4px; font-family: monospace; font-size: 0.85rem; font-weight: 600;
}
.http-code-2xx { background: rgba(63,185,80,0.15); color: var(--green); }
.http-code-3xx { background: rgba(88,166,255,0.15); color: var(--accent); }
.http-code-4xx { background: rgba(210,153,34,0.15); color: var(--yellow); }
.http-code-5xx { background: rgba(248,81,73,0.15); color: var(--red); }
.http-code-error { background: rgba(248,81,73,0.15); color: var(--red); }
.http-code-0xx { background: rgba(248,81,73,0.15); color: var(--red); }

.check-yes { color: var(--green); font-size: 1.1rem; }
.check-no { color: var(--red); font-size: 1.1rem; }
.verdict {
  display: inline-block; padding: 3px 8px;
  border-radius: 4px; font-size: 0.75rem; text-transform: uppercase; font-weight: 600;
}
.verdict-wired { background: rgba(63,185,80,0.15); color: var(--green); }
.verdict-endpoint_missing { background: rgba(248,81,73,0.15); color: var(--red); }
.verdict-not_configured { background: rgba(210,153,34,0.15); color: var(--yellow); }
.verdict-unreachable { background: rgba(248,81,73,0.15); color: var(--red); }
.verdict-service_error { background: rgba(248,81,73,0.15); color: var(--red); }
.verdict-endpoint_responds_but_envelope_wrong { background: rgba(210,153,34,0.15); color: var(--yellow); }
.verdict-endpoint_exists_auth_required { background: rgba(88,166,255,0.15); color: var(--accent); }

.remediation { font-size: 0.8rem; max-width: 320px; }
.remediation .ok { color: var(--green); }
.error-snippet { color: var(--red); font-family: monospace; font-size: 0.7rem; }
.alert-ok {
  padding: 0.75rem 1rem; background: rgba(63,185,80,0.1);
  border: 1px solid var(--green); border-radius: var(--radius); color: var(--green);
}
.alert-warn {
  padding: 0.75rem 1rem; background: rgba(210,153,34,0.1);
  border: 1px solid var(--yellow); border-radius: var(--radius); color: var(--yellow);
}

/* LinkedIn weekly entry form */
.linkedin-entry-form { margin-top: 1rem; }
.linkedin-page-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; margin-bottom: 1rem; background: var(--bg);
}
.linkedin-page-card legend {
  padding: 0 8px; font-weight: 600; color: var(--text);
}
.linkedin-page-card legend code {
  font-size: 0.75rem; color: var(--text-dim); font-weight: 400; margin-left: 8px;
}
.linkedin-page-card .prev-row {
  font-size: 0.85rem; color: var(--text-dim); margin: 0 0 0.75rem; padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--border);
}
.linkedin-page-card .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
}
.linkedin-page-card .form-row label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 0.8rem; color: var(--text-dim);
}
.linkedin-page-card .form-row label.full-width {
  grid-column: 1 / -1;
}
.linkedin-page-card input {
  padding: 6px 10px; border-radius: 4px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 0.95rem;
}
.linkedin-page-card input:focus { border-color: var(--accent); outline: none; }
.form-actions { margin-top: 1rem; }
.form-actions button.primary {
  background: var(--accent); color: white; border: none;
  padding: 10px 20px; border-radius: var(--radius); font-weight: 600;
  cursor: pointer; font-size: 0.95rem;
}
.form-actions button.primary:hover { filter: brightness(1.1); }
.form-actions .hint { color: var(--text-dim); font-size: 0.8rem; margin-top: 0.5rem; }

/* Public mode tweaks */
body.public footer span::before { content: "Public Status · "; }
