:root {
  --bg: #f4f7f8;
  --panel: #ffffff;
  --text: #13242a;
  --muted: #64757d;
  --line: #d8e1e5;
  --accent: #0f6c81;
  --danger: #a33a32;
  --warn: #b26f1e;
  --ok: #256b45;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a, button, input, select, textarea { font: inherit; }
a { color: inherit; }

.op-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.op-side {
  padding: 24px 18px;
  background: #10252d;
  color: #fff;
  border-right: 1px solid rgba(255,255,255,0.08);
}

.op-brand {
  display: block;
  margin-bottom: 24px;
  text-decoration: none;
}
.op-brand strong { display: block; font-size: 18px; }
.op-brand span { display: block; margin-top: 4px; color: rgba(255,255,255,0.7); font-size: 13px; }

.op-nav { display: grid; gap: 6px; }
.op-nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: rgba(255,255,255,0.84);
}
.op-nav a.active,
.op-nav a:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.op-main {
  min-width: 0;
  padding: 24px;
}
.op-topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}
.op-userbox {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}
.op-lang {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.88);
}
.op-lang button {
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
}
.op-lang button.active {
  background: var(--accent);
  color: #fff;
}

.op-grid,
.op-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.op-card,
.op-panel,
.op-tablewrap,
.op-form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(16, 32, 39, 0.06);
}
.op-card { padding: 16px; }
.op-card small { color: var(--muted); display: block; margin-bottom: 10px; text-transform: uppercase; font-weight: 700; font-size: 11px; }
.op-card strong { font-size: 28px; display: block; }

.op-panel,
.op-form,
.op-tablewrap {
  padding: 18px;
}
.op-panel h2,
.op-form h2,
.op-tablewrap h2,
.op-page-title {
  margin: 0 0 14px;
}
.op-page-title p {
  margin: 8px 0 0;
  color: var(--muted);
}

.op-actions,
.op-inline-actions,
.op-filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button,
.op-button {
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  cursor: pointer;
  text-decoration: none;
}
button.primary,
.op-button.primary { background: var(--accent); color: #fff; }
button.secondary,
.op-button.secondary { background: #fff; color: var(--text); border: 1px solid var(--line); }
button.danger { background: var(--danger); color: #fff; }
button.warn { background: var(--warn); color: #fff; }
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
}
textarea { min-height: 110px; resize: vertical; }
.op-knowledge-body { min-height: 280px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}
.op-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}
th {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
}

.op-badge {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: #ebf3f5;
  color: #24434e;
  font-size: 12px;
  font-weight: 700;
}
.op-badge.danger { background: #f8e6e5; color: #7d2d27; }
.op-badge.warn { background: #f8efdf; color: #7b5418; }
.op-badge.ok { background: #e3f2ea; color: #22573a; }
.op-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.op-fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}
.op-fieldset legend {
  color: var(--muted);
  font-weight: 700;
  padding: 0 6px;
}
.op-topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 14px;
}
.op-topic-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.op-topic-grid input { width: auto; }
.op-checklist {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.op-checklist li {
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 6px;
  background: #f7fafb;
}
.op-checklist li.ok {
  color: var(--ok);
  background: #e8f5ee;
}
.op-knowledge-grid {
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.8fr);
}
.op-avatar-block {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}
.op-avatar-initials,
.op-avatar-image,
.op-site-logo {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #10252d;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}
.op-avatar-image {
  object-fit: cover;
  background: #eef4f7;
}
.op-avatar-block p {
  margin: 6px 0 10px;
}
.op-ecosystem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.op-ecosystem-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}
.op-ecosystem-card span,
.op-ecosystem-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}
.op-ecosystem-card .op-button {
  grid-column: 1 / -1;
  text-align: center;
}

.op-message {
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
}
.op-message.error { border-color: #f0c3bf; background: #fff4f3; color: #7d2d27; }
.op-message.success { border-color: #b9dbc8; background: #f2fbf6; color: #22573a; }

.op-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.op-login-card {
  width: min(460px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 16px 42px rgba(16, 32, 39, 0.08);
}

.op-muted { color: var(--muted); }
.op-stack { display: grid; gap: 14px; }
.op-split { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.op-kv {
  display: grid;
  gap: 10px;
}
.op-kv > div {
  display: grid;
  gap: 4px;
}
.op-kv small {
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 700;
  font-size: 11px;
}
.op-list {
  margin: 0;
  padding-left: 18px;
}
.op-note {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
}
.op-pre {
  margin: 0;
  padding: 12px;
  background: #f6f8f9;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: auto;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (max-width: 900px) {
  .op-shell { grid-template-columns: 1fr; }
  .op-side { border-right: 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
  .op-topbar,
  .op-userbox {
    align-items: flex-start;
    flex-direction: column;
  }
}
.op-note {
  padding: 12px 14px;
  border-radius: 6px;
  background: #f6f8f9;
  border: 1px solid var(--line);
}
.op-kv {
  display: grid;
  gap: 8px;
}
.op-kv div {
  display: grid;
  gap: 4px;
}
.op-kv small {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
}
.op-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

@media (max-width: 900px) {
  .op-shell { grid-template-columns: 1fr; }
  .op-side { border-right: 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
}
