:root {
  --blue: #2563eb; --blue-dark: #1d4ed8;
  --ink: #0f172a; --muted: #5b6472;
  --bg: #f5f7fb; --card: #ffffff; --line: #e2e8f0;
  --red: #dc2626; --green: #16a34a;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Poppins", "Open Sans", -apple-system, sans-serif;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.top-nav {
  background: var(--ink); color: #fff; display: flex; align-items: center;
  gap: 24px; padding: 14px 24px; position: sticky; top: 0; z-index: 10;
}
.top-nav .wordmark { font-weight: 700; font-size: 18px; }
.top-nav a { color: rgba(255,255,255,0.75); }
.top-nav a:hover { color: #fff; text-decoration: none; }
.top-nav .spacer { flex: 1; }
.top-nav .user { font-size: 13px; color: rgba(255,255,255,0.6); }

.main { max-width: 1000px; margin: 0 auto; padding: 28px 20px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px 24px; margin-bottom: 18px; }

.btn {
  display: inline-block; background: var(--blue); color: #fff; border: none;
  border-radius: 8px; padding: 10px 18px; font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none; font-family: inherit;
}
.btn:hover { background: var(--blue-dark); text-decoration: none; }
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.secondary:hover { background: var(--bg); }
.btn.danger { background: transparent; color: var(--red); border: 1px solid rgba(220,38,38,0.4); }
.btn.danger:hover { background: rgba(220,38,38,0.06); }

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
.error-text { color: var(--red); font-size: 13px; margin-top: 8px; }

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

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.draft { background: rgba(91,100,114,0.12); color: var(--muted); }
.pill.published { background: rgba(22,163,74,0.12); color: var(--green); }
.tag-pill { display: inline-block; background: rgba(37,99,235,0.1); color: var(--blue); padding: 2px 8px; border-radius: 999px; font-size: 12px; margin-right: 4px; }

.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 40px; width: 360px; box-shadow: 0 10px 40px rgba(15,23,42,0.08); text-align: center; }
.login-box h1 { font-size: 20px; margin: 0 0 4px; }
.login-box .wordmark { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.login-box .sub { color: var(--muted); font-size: 13px; margin: 0 0 24px; }
.ms-signin-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); font-weight: 600; font-size: 14px; margin-bottom: 16px;
}
.ms-signin-btn:hover { background: var(--bg); text-decoration: none; }
.login-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin-bottom: 16px; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }


#editor-container .ql-editor { min-height: 360px; font-size: 15px; line-height: 1.6; font-family: "Open Sans", -apple-system, sans-serif; }
#editor-container .ql-toolbar { border-radius: 8px 8px 0 0; }
#editor-container .ql-container { border-radius: 0 0 8px 8px; }
.article-body.ql-editor { font-size: 15px; line-height: 1.7; }
.article-body.ql-editor img { max-width: 100%; border-radius: 8px; }

.meta-row { display: flex; gap: 14px; color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.filters { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.filters select, .filters input { padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; font-family: inherit; }
