/* ============================================================
   Page: MCP & Skills — 360eDash
   Administration group, beside Admin View / Activity Log /
   Ticketing. Design tokens mirror css/ticketing.css &
   css/admin-view.css so the page feels like one system; class
   names are prefixed "mc-" so nothing collides with another page
   that can be alive in the DOM at the same time.

   Catatan: pages/mcp-skills.html dimuat sebagai FRAGMENT murni
   lewat loadPage() di js/main.js, TIDAK punya wrapper
   .edash-layout/.edash-main/.edash-content/#sidebar-root/
   #header-root sendiri — semua sudah didefinisikan sekali oleh
   shell utama di index.html. JANGAN tambahkan rule itu di sini.

   DARK MODE: self-contained di bawah file ini (menimpa token
   --mc-*), pola yang sama seperti css/ticketing.css — tidak
   bergantung pada css/dark-mode-v8.css.
============================================================= */

:root {
  --mc-primary: #0f6a71;
  --mc-primary-dark: #0b4f54;
  --mc-primary-soft: #e4f1f1;

  --mc-success: #2f9e6e;
  --mc-warning: #e3a21a;
  --mc-danger: #d64545;
  --mc-info: #3e7cb1;
  --mc-success-soft: #e6f5ef;
  --mc-warning-soft: #fbf1e0;
  --mc-danger-soft: #fbe9e9;
  --mc-info-soft: #e9f0f7;

  --mc-ink: #25343f;
  --mc-muted: #7c8b8d;
  --mc-border: #e7edee;
  --mc-surface: #ffffff;
  --mc-page-bg: #f4f7f7;

  /* Code blocks. Deliberately a tinted neutral rather than the
     near-black a terminal theme would use, so a long config block
     does not punch a dark hole through a light page. */
  --mc-code-bg: #f3f7f7;
  --mc-code-ink: #1d3238;
  --mc-code-border: #dfe9ea;
}

#sidebar-root:empty, #header-root:empty { display: none; }

.mc-wrap { width: 100%; max-width: 1320px; margin: 0 auto; }

/* ---------- Head ---------- */
.mc-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.mc-head h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--mc-ink);
  margin-bottom: 4px;
}
.mc-head p {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--mc-muted);
  max-width: 620px;
}
.mc-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Card ---------- */
.mc-card {
  background: var(--mc-surface);
  border: 1px solid var(--mc-border);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 1px 3px rgba(16, 24, 32, 0.05);
  margin-bottom: 18px;
}
.mc-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.mc-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--mc-ink);
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.mc-card-title i { color: var(--mc-primary); font-size: 14px; }
.mc-card-sub {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--mc-muted);
}

/* ---------- Prose ---------- */
.mc-card p {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--mc-ink);
  margin-bottom: 10px;
}
.mc-card p:last-child { margin-bottom: 0; }
.mc-muted { color: var(--mc-muted) !important; font-size: 12.5px !important; }
.mc-card a { color: var(--mc-primary); font-weight: 500; text-decoration: none; }
.mc-card a:hover { text-decoration: underline; }
.mc-card code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  background: var(--mc-code-bg);
  border: 1px solid var(--mc-code-border);
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--mc-code-ink);
  word-break: break-word;
}

/* ---------- Code block ---------- */
.mc-code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.65;
  background: var(--mc-code-bg);
  border: 1px solid var(--mc-code-border);
  border-radius: 10px;
  color: var(--mc-code-ink);
  padding: 14px 16px;
  margin: 8px 0 10px;
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
}
.mc-code.mc-secret {
  border-color: var(--mc-warning);
  background: var(--mc-warning-soft);
  white-space: pre-wrap;
  word-break: break-all;
}
.mc-steplabel {
  font-size: 11.5px !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mc-muted) !important;
  margin: 16px 0 2px !important;
}
.mc-path { margin-bottom: 4px !important; }
.mc-note {
  font-size: 12.5px !important;
  line-height: 1.65 !important;
  color: var(--mc-muted) !important;
  border-left: 2px solid var(--mc-border);
  padding-left: 12px;
  margin-bottom: 10px !important;
}

/* ---------- Client blocks ---------- */
.mc-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.mc-chip {
  font-size: 12px;
  font-weight: 500;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--mc-border);
  background: var(--mc-page-bg);
  color: var(--mc-ink);
  text-decoration: none !important;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.mc-chip:hover {
  background: var(--mc-primary-soft);
  border-color: #d5eaea;
  color: var(--mc-primary-dark);
  text-decoration: none !important;
}
.mc-chip.is-on { background: var(--mc-primary); border-color: var(--mc-primary); color: #fff; }

.mc-client {
  border: 1px solid var(--mc-border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-top: 16px;
  background: var(--mc-page-bg);
  scroll-margin-top: 20px;
}
.mc-client h4 {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--mc-ink);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.mc-client .mc-code { background: var(--mc-surface); }

/* ---------- Ladder ---------- */
.mc-ladder {
  margin: 16px 0 0;
  padding-left: 20px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--mc-ink);
}
.mc-ladder li { margin-bottom: 8px; padding-left: 4px; }
.mc-ladder li:last-child { margin-bottom: 0; }
.mc-ladder li::marker { color: var(--mc-primary); font-weight: 600; }

/* ---------- Forms ---------- */
.mc-btnrow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.mc-input {
  font-family: inherit;
  font-size: 13px;
  color: var(--mc-ink);
  background: var(--mc-surface);
  border: 1px solid var(--mc-border);
  border-radius: 10px;
  padding: 10px 13px;
  min-width: 240px;
  flex: 1 1 240px;
  max-width: 420px;
}
.mc-input::placeholder { color: var(--mc-muted); }
.mc-input:focus { outline: 2px solid var(--mc-primary); outline-offset: 1px; }
.mc-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--mc-muted);
  cursor: pointer;
  white-space: nowrap;
}
.mc-check input { accent-color: var(--mc-primary); cursor: pointer; }
.mc-formmsg { font-size: 12.5px; color: var(--mc-muted); }

/* Small button variant, on top of the global .btn atom. */
.btn.mc-btn-sm { padding: 7px 13px; font-size: 12.5px; border-radius: 8px; }

/* ---------- Minted token callout ---------- */
.mc-minted {
  border: 1px solid var(--mc-warning);
  background: var(--mc-warning-soft);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 14px 0;
}
.mc-minted p { font-size: 13px; }

/* ---------- Table ---------- */
.mc-table-wrap { overflow-x: auto; margin-top: 12px; }
.mc-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 620px; }
.mc-table thead th {
  text-align: left;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--mc-muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--mc-border);
  white-space: nowrap;
}
.mc-table tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--mc-border);
  color: var(--mc-ink);
  vertical-align: top;
}
.mc-table tbody tr:last-child td { border-bottom: none; }
.mc-table tbody tr:hover { background: var(--mc-page-bg); }
.mc-table .mc-empty-cell {
  color: var(--mc-muted);
  font-style: normal;
  text-align: left;
  padding: 18px 12px;
}

/* ---------- Verdict line (Verify) ---------- */
.mc-verdict {
  font-size: 13px !important;
  line-height: 1.65 !important;
  border-radius: 10px;
  padding: 12px 14px;
  border: 1px solid var(--mc-border);
  background: var(--mc-page-bg);
  color: var(--mc-ink) !important;
}
.mc-verdict.is-ok { border-color: var(--mc-success); background: var(--mc-success-soft); }
.mc-verdict.is-fail { border-color: var(--mc-danger); background: var(--mc-danger-soft); }

/* ---------- Offline / endpoint-missing notice ----------
   Every call on this page can land on a backend older than the
   endpoint it wants. When that happens the page says so in one
   plain sentence here instead of rendering half a feature. */
.mc-offline {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--mc-warning);
  background: var(--mc-warning-soft);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 12px 0;
  font-size: 12.5px;
  line-height: 1.65;
  color: #6b5218;
}
.mc-offline i { color: var(--mc-warning); margin-top: 2px; flex-shrink: 0; }

/* ---------- Skills filters ---------- */
.mc-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 6px; }
.mc-select-wrap { position: relative; display: inline-flex; align-items: center; }
.mc-select-wrap select {
  appearance: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--mc-ink);
  background: var(--mc-surface);
  border: 1px solid var(--mc-border);
  border-radius: 10px;
  padding: 10px 32px 10px 13px;
  cursor: pointer;
}
.mc-select-wrap i {
  position: absolute;
  right: 12px;
  font-size: 10px;
  color: var(--mc-muted);
  pointer-events: none;
}
.mc-link {
  color: var(--mc-primary);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.mc-link:hover { text-decoration: underline; }
.mc-dash { color: var(--mc-muted); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .mc-card { padding: 18px 16px; }
  .mc-client { padding: 15px 14px; }
  .mc-head h1 { font-size: 22px; }
  .mc-input { min-width: 0; max-width: none; }
}

/* ============================================================
   DARK MODE — self-contained, overrides the --mc-* tokens above.
   Same approach as css/ticketing.css so this page never depends
   on css/dark-mode-v8.css being loaded or updated.
============================================================= */
html[data-theme="dark"] {
  --mc-primary: #21a7ae;
  --mc-primary-dark: #16868d;
  --mc-primary-soft: rgba(33, 167, 174, 0.16);
  --mc-success: #4fbd8a;
  --mc-warning: #e8b34a;
  --mc-danger: #ef6b6b;
  --mc-info: #69a8d6;
  --mc-success-soft: rgba(79, 189, 138, 0.14);
  --mc-warning-soft: rgba(232, 179, 74, 0.14);
  --mc-danger-soft: rgba(239, 107, 107, 0.14);
  --mc-info-soft: rgba(105, 168, 214, 0.14);
  --mc-ink: #e7eff0;
  --mc-muted: #9ab0b4;
  --mc-border: #2a3d42;
  --mc-surface: #18272c;
  --mc-page-bg: #101b1f;
  --mc-code-bg: #0e1b1f;
  --mc-code-ink: #cfe3e4;
  --mc-code-border: #26383d;
}

html[data-theme="dark"] .mc-client { background: #142327; }
html[data-theme="dark"] .mc-client .mc-code { background: var(--mc-code-bg); }
html[data-theme="dark"] .mc-chip { background: #142327; }
html[data-theme="dark"] .mc-chip:hover { background: rgba(33, 167, 174, 0.24); color: var(--mc-primary); }
html[data-theme="dark"] .mc-chip.is-on { color: #08181b; }
html[data-theme="dark"] .mc-offline { color: #f0d488; border-color: rgba(232, 179, 74, 0.45); }
html[data-theme="dark"] .mc-minted { border-color: rgba(232, 179, 74, 0.45); }
html[data-theme="dark"] .mc-code.mc-secret { border-color: rgba(232, 179, 74, 0.45); color: #f3e2b4; }
html[data-theme="dark"] .mc-table tbody tr:hover { background: rgba(255, 255, 255, 0.04); }

/* ---------- Rendered SKILL.md body (skills bank detail) ----------
   The backend renders SKILL.md to HTML, so the markup inside here is
   plain document tags rather than this page's own classes. */
.mc-skillbody { font-size: 13.5px; line-height: 1.7; color: var(--mc-ink); }
.mc-skillbody h1, .mc-skillbody h2, .mc-skillbody h3 {
  font-size: 14.5px;
  font-weight: 600;
  margin: 16px 0 6px;
  color: var(--mc-ink);
}
.mc-skillbody p { margin-bottom: 10px; }
.mc-skillbody ul, .mc-skillbody ol { margin: 0 0 10px 20px; }
.mc-skillbody li { margin-bottom: 4px; }
.mc-skillbody pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  background: var(--mc-code-bg);
  border: 1px solid var(--mc-code-border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  overflow-x: auto;
}
.mc-skillbody table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-bottom: 10px; }
.mc-skillbody th, .mc-skillbody td { padding: 8px 10px; border-bottom: 1px solid var(--mc-border); text-align: left; }

/* Anchors wearing the global .btn atom must not also carry the browser's
   default link underline — every other page uses <button> for these, this
   page needs real <a download> for the zip and the SKILL.md files. */
a.btn, a.btn:hover { text-decoration: none; }
