/* mcpanel — minimal dark theme */
:root {
  --bg: #0e1117;
  --panel: #161b22;
  --panel-2: #1c2230;
  --border: #2a313c;
  --text: #d6dde6;
  --muted: #8b95a4;
  --accent: #4cb27a;
  --warn: #d99e3a;
  --bad: #d64a4a;
  --link: #6aa9ff;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 14px; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button { background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 4px; padding: 6px 12px; cursor: pointer; font: inherit; }
button:hover { background: #242c3b; }
button.danger { background: #4a1f1f; border-color: #6b2a2a; color: #f5d0d0; }
button.danger:hover { background: #5a2525; }
button:disabled { opacity: 0.6; cursor: progress; }
input[type=text], input[type=password] { background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 4px; padding: 6px 8px; font: inherit; }
input:focus { outline: 1px solid var(--link); }

/* Login */
.login-body { display: grid; place-items: center; min-height: 100vh; }
.login-card { background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  padding: 28px 32px; width: 320px; box-shadow: 0 4px 24px rgba(0,0,0,0.3); }
.login-card h1 { margin: 0 0 4px 0; font-size: 22px; }
.login-card .subtitle { margin: 0 0 16px 0; color: var(--muted); font-size: 12px; }
.login-card label { display: block; margin-bottom: 12px; }
.login-card label span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.login-card input { width: 100%; }
.login-card button { width: 100%; margin-top: 8px; padding: 8px; }
.error { background: #3a1d1d; border: 1px solid #6b2a2a; color: #f0c0c0;
  padding: 8px 10px; border-radius: 4px; margin-bottom: 12px; font-size: 12px; }

/* Topbar */
.topbar { display: flex; align-items: center; gap: 16px; padding: 10px 18px;
  background: var(--panel); border-bottom: 1px solid var(--border); }
.brand { font-weight: 600; font-size: 16px; }
.status-group { display: flex; align-items: center; gap: 14px; flex: 1; flex-wrap: wrap; }
.metric { color: var(--muted); font-size: 12px; }
.metric b { color: var(--text); font-weight: 600; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: #2a313c; }
.badge.ok { background: #1e3a2a; color: #9be0ba; }
.badge.bad { background: #3a1d1d; color: #f0a0a0; }
.ok-text { color: var(--accent); }
.warn-text { color: var(--warn); }

/* Main grid */
.grid { display: grid; grid-template-columns: 1fr 360px; gap: 14px; padding: 14px; align-items: start; }
@media (max-width: 1000px) { .grid { grid-template-columns: 1fr; } }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 14px; }
.panel h2 { margin: 0 0 10px 0; font-size: 14px; font-weight: 600; }
.panel h3 { margin: 14px 0 8px 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.muted { color: var(--muted); font-weight: normal; font-size: 12px; }

/* Log box */
.log-box { background: #06090d; border: 1px solid var(--border); border-radius: 4px;
  padding: 10px; min-height: 280px; max-height: 50vh; overflow: auto; margin: 0;
  font-family: ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace; font-size: 12px;
  white-space: pre-wrap; word-break: break-word; }
.console-form { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.console-form .prompt { color: var(--accent); font-family: monospace; font-weight: bold; }
.console-form input { flex: 1; font-family: ui-monospace, monospace; }
.console-out { background: #06090d; border: 1px solid var(--border); border-radius: 4px;
  padding: 8px; max-height: 160px; overflow: auto; margin: 8px 0 0 0;
  font-family: ui-monospace, monospace; font-size: 12px; white-space: pre-wrap; }

/* Plugins */
.drop-zone { border: 2px dashed var(--border); border-radius: 6px; padding: 20px;
  text-align: center; color: var(--muted); cursor: pointer; transition: background 0.1s; }
.drop-zone.hover { background: var(--panel-2); border-color: var(--link); color: var(--text); }
.drop-zone p { margin: 0; }
.upload-status { margin: 8px 0; font-size: 12px; color: var(--muted); min-height: 1em; }
.plugin-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
.plugin-table th, .plugin-table td { text-align: left; padding: 6px 8px;
  border-bottom: 1px solid var(--border); }
.plugin-table th { color: var(--muted); font-weight: normal; }
.plugin-table td:nth-child(3), .plugin-table td:nth-child(4) { color: var(--muted); white-space: nowrap; }
.plugin-table .plugin-name { font-weight: 600; }
.plugin-table .plugin-file { font-family: ui-monospace, monospace; font-size: 11px; }
.plugin-table tr.row-disabled td { opacity: 0.55; }
.plugin-note { margin-top: 6px; font-style: italic; }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 36px; height: 18px; vertical-align: middle; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background: #3a414c;
  border-radius: 999px; transition: 0.15s; }
.switch .slider:before { content: ""; position: absolute; height: 14px; width: 14px;
  left: 2px; top: 2px; background: #d6dde6; border-radius: 50%; transition: 0.15s; }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider:before { transform: translateX(18px); }

/* Mini buttons */
button.mini { padding: 2px 8px; font-size: 11px; }
button.danger-mini { background: #4a1f1f; border-color: #6b2a2a; color: #f5d0d0;
  padding: 2px 8px; font-size: 11px; border-radius: 4px; cursor: pointer; }
button.danger-mini:hover { background: #5a2525; }
.bad { color: var(--bad); }

/* Files panel */
.files-panel { margin: 0 14px 14px 14px; }
.files-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 10px;
  flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.breadcrumb { flex: 1; min-width: 200px; font-family: ui-monospace, monospace; font-size: 12px; }
.breadcrumb a { color: var(--link); }
.breadcrumb .bc-sep { color: var(--muted); margin: 0 4px; }
.files-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.files-actions button { padding: 4px 10px; font-size: 12px; }

.file-drop-zone { position: relative; border: 1px dashed transparent; border-radius: 6px; transition: 0.1s; }
.file-drop-overlay { position: absolute; inset: 0; display: none;
  align-items: center; justify-content: center; background: rgba(76, 178, 122, 0.18);
  border: 2px dashed var(--accent); border-radius: 6px; color: var(--accent);
  font-weight: 600; font-size: 14px; pointer-events: none; z-index: 5; }
.file-drop-overlay.show { display: flex; }

.file-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.file-table th, .file-table td { text-align: left; padding: 5px 8px;
  border-bottom: 1px solid var(--border); }
.file-table th { color: var(--muted); font-weight: normal; font-size: 11px; }
.file-table td.ico { width: 22px; text-align: center; }
.file-table td.fname { font-family: ui-monospace, monospace; }
.file-table td.fname a { color: var(--text); }
.file-table td.fname a.dir-link { color: var(--link); font-weight: 500; }
.file-table td.fname a.text-link:hover { text-decoration: underline; color: var(--link); }
.file-table td.mode { color: var(--muted); font-family: ui-monospace, monospace; font-size: 11px; white-space: nowrap; }
.file-table td.actions { white-space: nowrap; }
.file-table td.actions button { margin-left: 2px; }

/* Editor modal */
.editor-modal { position: fixed; inset: 0; background: rgba(8, 11, 16, 0.75);
  display: flex; align-items: stretch; justify-content: center; z-index: 100; padding: 24px; }
.editor-shell { background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  width: 100%; max-width: 1200px; display: flex; flex-direction: column; overflow: hidden; }
.editor-header { display: flex; align-items: center; gap: 12px; padding: 8px 12px;
  border-bottom: 1px solid var(--border); }
.editor-title { font-family: ui-monospace, monospace; font-size: 13px; font-weight: 600; }
.editor-modified { color: var(--warn); font-size: 12px; }
.editor-spacer { flex: 1; }
.editor-header button { padding: 4px 12px; font-size: 12px; }
.monaco-host { flex: 1; min-height: 60vh; }
.editor-footer { padding: 6px 12px; border-top: 1px solid var(--border); font-size: 11px;
  font-family: ui-monospace, monospace; }

/* Footer */
.footer { padding: 10px 18px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--border); }
