/* WordPress admin–inspired shell */
:root {
  --wp-blue: #2271b1;
  --wp-blue-dark: #135e96;
  --wp-sidebar: #1d2327;
  --wp-sidebar-hover: #2c3338;
  --wp-body: #f0f0f1;
  --wp-surface: #fff;
  --wp-border: #c3c4c7;
  --wp-text: #1d2327;
  --wp-muted: #646970;
  --wp-red: #d63638;
  --radius: 4px;
  --shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--wp-text);
  background: var(--wp-body);
}

a { color: var(--wp-blue); }
a:hover { color: var(--wp-blue-dark); }

code { background: #f6f7f7; padding: 0.1em 0.35em; border-radius: 3px; font-size: 0.92em; }

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #1d2327 0%, #2c3338 45%, #2271b1 140%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--wp-surface);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.login-card h1 { margin: 0 0 1rem; font-size: 1.35rem; font-weight: 600; }

.install-list { margin: 1rem 0; padding-left: 1.25rem; color: var(--wp-muted); }

.admin-root { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 200px;
  flex-shrink: 0;
  background: var(--wp-sidebar);
  color: #f0f0f1;
  padding: 0.75rem 0;
}

.admin-sidebar .brand {
  padding: 0.75rem 1rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.5rem;
}

.admin-sidebar a {
  display: block;
  padding: 0.55rem 1rem;
  color: #b4b9be;
  text-decoration: none;
  font-size: 13px;
}

.admin-sidebar a:hover,
.admin-sidebar a.is-active {
  color: #fff;
  background: var(--wp-sidebar-hover);
}

.admin-sidebar .nav-section {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-sidebar .nav-label {
  padding: 0.35rem 1rem;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8c8f94;
}

.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.admin-topbar {
  background: var(--wp-surface);
  border-bottom: 1px solid var(--wp-border);
  padding: 0.65rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
}

.admin-topbar h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 400;
}

.admin-topbar .user-meta { color: var(--wp-muted); font-size: 13px; }

.admin-content { padding: 1.5rem; flex: 1; }

.wrap-card {
  background: var(--wp-surface);
  border: 1px solid var(--wp-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
  max-width: 1100px;
}

.wrap-card + .wrap-card { margin-top: 1.25rem; }

.button {
  display: inline-block;
  text-decoration: none;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--wp-border);
  background: #f6f7f7;
  color: var(--wp-text);
  cursor: pointer;
  font-size: 13px;
  line-height: 1.4;
}

.button:hover { background: #f0f0f1; border-color: #8c8f94; }

.button-primary {
  background: var(--wp-blue);
  border-color: var(--wp-blue);
  color: #fff;
}

.button-primary:hover { background: var(--wp-blue-dark); border-color: var(--wp-blue-dark); color: #fff; }

.button-link-delete {
  background: transparent;
  border: none;
  color: var(--wp-red);
  padding: 0;
  cursor: pointer;
  font-size: inherit;
}

.button-link-delete:hover { text-decoration: underline; }

label { display: block; font-weight: 600; margin-bottom: 0.35rem; font-size: 13px; }

input[type="text"],
input[type="password"],
input[type="email"],
select,
textarea {
  width: 100%;
  max-width: 640px;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--wp-border);
  border-radius: var(--radius);
  font: inherit;
}

textarea { min-height: 280px; resize: vertical; max-width: 100%; }

.form-row { margin-bottom: 1rem; }

.notice {
  padding: 0.65rem 0.85rem;
  border-left: 4px solid var(--wp-blue);
  background: #f0f6fc;
  margin: 0 0 1rem;
}

.notice-error { border-color: var(--wp-red); background: #fcf0f1; }

.notice-info { border-color: #72aee6; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-tile {
  background: var(--wp-surface);
  border: 1px solid var(--wp-border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}

.stat-tile .num { font-size: 1.75rem; font-weight: 600; color: var(--wp-blue); }
.stat-tile .lbl { color: var(--wp-muted); font-size: 12px; margin-top: 0.25rem; }

.table-wrap { overflow-x: auto; }

table.widefat {
  width: 100%;
  border-collapse: collapse;
  background: var(--wp-surface);
}

table.widefat th,
table.widefat td {
  border: 1px solid var(--wp-border);
  padding: 0.55rem 0.75rem;
  text-align: left;
}

table.widefat th { background: #f6f7f7; font-weight: 600; }

.row-actions { font-size: 12px; visibility: hidden; }
tr:hover .row-actions { visibility: visible; }

.badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-publish { background: #00a32a1a; color: #00a32a; }
.badge-draft { background: #64697022; color: var(--wp-muted); }

.schema-block {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  background: #1d2327;
  color: #e2e4e7;
  padding: 1rem;
  border-radius: var(--radius);
  overflow: auto;
  max-height: 480px;
}

/* Public theme */
.public-body { margin: 0; font-family: var(--font); color: #1a1a1a; background: #fafafa; }
.public-header {
  background: #fff;
  border-bottom: 1px solid var(--wp-border);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.public-header a { text-decoration: none; color: var(--wp-text); font-weight: 600; }
.public-main { max-width: 720px; margin: 0 auto; padding: 2rem 1.25rem; }
.public-main .content { background: #fff; padding: 2rem; border-radius: 8px; box-shadow: var(--shadow); border: 1px solid var(--wp-border); }
.public-footer { text-align: center; padding: 2rem; color: var(--wp-muted); font-size: 13px; }

.kpro-html img { max-width: 100%; height: auto; }
.kpro-code {
  overflow: auto;
  max-width: 100%;
  padding: 1rem;
  background: #1d2327;
  color: #e2e4e7;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.45;
}
.kpro-code code { font-family: ui-monospace, Consolas, monospace; white-space: pre; word-break: break-word; }
.kpro-text { line-height: 1.65; }
