/* --- Helpcenter Styles --- */
:root {
  --bg: #f6f8fa;
  --panel: #ffffff;
  --border: #e3e8ee;
  --text: #1f2933;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-soft: #eff4ff;
  --radius: 10px;
  --maxw: 1200px;
}

* { box-sizing: border-box; }

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

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

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  height: 60px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { font-weight: 700; font-size: 18px; color: var(--text); }
.brand:hover { text-decoration: none; }
.search {
  flex: 1;
  max-width: 420px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  outline: none;
}
.search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.admin-link {
  margin-left: auto;
  font-size: 14px;
  color: var(--muted);
}

/* Layout */
.layout {
  display: flex;
  gap: 28px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 24px;
  align-items: flex-start;
}
.sidebar {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 88px;
}
.nav-area { margin-bottom: 22px; }
.nav-area-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin-bottom: 8px;
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a {
  display: block;
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
}
.sidebar li a:hover { background: var(--accent-soft); text-decoration: none; }
.sidebar li a.active { background: var(--accent); color: #fff; }
.empty { color: var(--muted); font-size: 13px; padding: 4px 12px; font-style: italic; }

/* Content */
.content {
  flex: 1;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 44px;
}
.doc-meta { margin-bottom: 12px; }
.badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}
.doc h1 { margin: 0 0 18px; font-size: 30px; }
.doc-body { font-size: 16px; }
.doc-body h2 { margin-top: 28px; font-size: 22px; }
.doc-body h3 { margin-top: 22px; font-size: 18px; }
.doc-body img { max-width: 100%; height: auto; border-radius: 8px; }
.doc-body pre {
  background: #0f172a; color: #e2e8f0; padding: 14px 16px;
  border-radius: 8px; overflow: auto;
}
.doc-body code { background: #eef2f7; padding: 2px 6px; border-radius: 4px; }
.doc-body pre code { background: none; padding: 0; }
.doc-body blockquote {
  border-left: 4px solid var(--accent);
  margin: 16px 0; padding: 4px 16px; color: var(--muted);
}
.placeholder { color: var(--muted); }

/* Responsive */
@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; position: static; }
  .content { padding: 24px 20px; }
  .search { max-width: none; }
}

/* --- Admin --- */
.admin-body { background: var(--bg); }
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 24px; }
.admin-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 24px;
}
.admin-header h1 { font-size: 22px; margin: 0; }
.admin-header .spacer { margin-left: auto; }
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 20px;
}
.card h2 { margin-top: 0; font-size: 17px; }
.btn {
  display: inline-block;
  background: var(--accent); color: #fff;
  border: none; border-radius: 8px;
  padding: 9px 16px; font-size: 14px; cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: #1d4ed8; text-decoration: none; }
.btn.secondary { background: #e2e8f0; color: var(--text); }
.btn.secondary:hover { background: #cbd5e1; }
.btn.danger { background: #dc2626; }
.btn.danger:hover { background: #b91c1c; }
.btn.small { padding: 5px 10px; font-size: 13px; }

table.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
  text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--border); font-size: 14px;
}
.admin-table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.actions { display: flex; gap: 8px; }

label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; }
input[type=text], input[type=password], input[type=number], textarea, select {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-row { display: flex; gap: 16px; }
.form-row > div { flex: 1; }
.checkbox-row { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.checkbox-row input { width: auto; }
.checkbox-row label { margin: 0; }

.flash {
  padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 14px;
}
.flash.ok { background: #dcfce7; color: #166534; }
.flash.err { background: #fee2e2; color: #991b1b; }

/* Login */
.login-box {
  max-width: 360px; margin: 80px auto;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px;
}
.login-box h1 { font-size: 20px; margin: 0 0 6px; }
.login-box p { color: var(--muted); margin-top: 0; font-size: 14px; }

/* Quill editor sizing */
#editor { background: #fff; min-height: 320px; }
.ql-toolbar.ql-snow, .ql-container.ql-snow { border-color: var(--border); }
.ql-container.ql-snow { border-bottom-left-radius: 8px; border-bottom-right-radius: 8px; }
.ql-toolbar.ql-snow { border-top-left-radius: 8px; border-top-right-radius: 8px; }
.ql-editor img { max-width: 100%; height: auto; }
.editor-hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.editor-uploading { color: var(--accent); font-size: 13px; margin: 6px 0 0; display: none; }
