:root {
  --bg:     #f4f5f7;
  --bg2:    #ffffff;
  --card:   #ffffff;
  --border: #e5e7eb;
  --text:   #111827;
  --muted:  #6b7280;
  --accent: #2563eb;
  --green:  #059669;
  --red:    #dc2626;
  --orange: #d97706;
  --radius: 8px;
  --font:   'Inter', system-ui, -apple-system, sans-serif;
  --shadow: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* Layout */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.page-wrap { display: grid; grid-template-columns: 1fr 300px; gap: 32px; padding: 32px 0 48px; }
@media (max-width: 900px) { .page-wrap { grid-template-columns: 1fr; } .sidebar { order: 2; } }

/* Header */
header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 58px; gap: 24px;
}
.logo { font-size: 19px; font-weight: 800; color: var(--text); letter-spacing: -.5px; }
.logo span { color: var(--accent); }
nav { display: flex; gap: 2px; flex-wrap: wrap; }
nav a {
  padding: 5px 11px; border-radius: 6px; font-size: 13px;
  color: var(--muted); font-weight: 500; transition: .15s;
}
nav a:hover { color: var(--text); background: var(--bg); text-decoration: none; }
nav a.active { color: var(--accent); background: #eff6ff; font-weight: 600; }

/* Category badges */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 100px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em;
}
.badge-blue   { background: #eff6ff; color: #2563eb; }
.badge-purple { background: #f5f3ff; color: #7c3aed; }
.badge-pink   { background: #fdf2f8; color: #be185d; }
.badge-orange { background: #fffbeb; color: #b45309; }
.badge-green  { background: #ecfdf5; color: #059669; }
.badge-cyan   { background: #ecfeff; color: #0e7490; }

/* Featured article */
.featured-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
  display: grid; grid-template-columns: 1.1fr 1fr;
}
@media (max-width: 700px) { .featured-card { grid-template-columns: 1fr; } }
.featured-thumb { aspect-ratio: 16/10; background: var(--bg); overflow: hidden; }
.featured-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.featured-card:hover .featured-thumb img { transform: scale(1.03); }
.featured-body { padding: 28px 32px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.featured-label {
  font-size: 11px; font-weight: 700; letter-spacing: .1em;
  color: var(--accent); text-transform: uppercase;
}
.featured-title { font-size: 22px; font-weight: 800; line-height: 1.35; }
.featured-title a { color: var(--text); }
.featured-title a:hover { color: var(--accent); text-decoration: none; }
.featured-summary { color: var(--muted); font-size: 14px; line-height: 1.65; }

/* Article cards */
.articles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); transform: translateY(-2px); }
.card-thumb { aspect-ratio: 16/9; background: var(--bg); overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.card:hover .card-thumb img { transform: scale(1.04); }
.card-thumb-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: #d1d5db; background: #f9fafb;
}
.card-body { padding: 14px 16px 16px; }
.card-meta { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; flex-wrap: wrap; }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 7px; line-height: 1.4; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); text-decoration: none; }
.card-summary { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 12px; }
.card-footer { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); padding-top: 10px; border-top: 1px solid var(--border); }
.card-stats { display: flex; align-items: center; gap: 10px; }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 20px; }
.widget { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.widget-title { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.widget-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.widget-list li { border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.widget-list li:last-child { border: none; padding: 0; }
.widget-list a { color: var(--text); font-size: 13px; font-weight: 500; line-height: 1.4; }
.widget-list a:hover { color: var(--accent); text-decoration: none; }
.widget-list .meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.cat-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.cat-list a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 10px; border-radius: 6px;
  color: var(--text); font-size: 13px; font-weight: 500; transition: .15s;
}
.cat-list a:hover { background: #eff6ff; color: var(--accent); text-decoration: none; }
.cat-count { background: var(--bg); color: var(--muted); border-radius: 100px; padding: 1px 8px; font-size: 11px; border: 1px solid var(--border); }

/* Section header */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 2px solid var(--text); }
.section-title { font-size: 17px; font-weight: 800; letter-spacing: -.3px; }
.section-link { font-size: 13px; color: var(--accent); font-weight: 500; }

/* Pagination */
.pagination { display: flex; gap: 5px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: 7px 13px; border-radius: 6px; font-size: 13px; font-weight: 600;
  background: var(--card); border: 1px solid var(--border); color: var(--muted);
  transition: .15s;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; background: #eff6ff; }
.pagination .active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Article page */
.article-header { margin-bottom: 28px; }
.article-title { font-size: 30px; font-weight: 800; line-height: 1.3; margin-bottom: 14px; color: var(--text); }
.article-meta { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.article-cover { border-radius: var(--radius); overflow: hidden; margin-bottom: 28px; aspect-ratio: 16/7; background: var(--bg); border: 1px solid var(--border); }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-body { font-size: 16px; line-height: 1.85; color: #374151; }
.article-body h2, .article-body h3 { color: var(--text); margin: 28px 0 12px; font-weight: 700; }
.article-body p { margin-bottom: 18px; }
.article-body a { color: var(--accent); }
.article-body blockquote {
  border-left: 3px solid var(--accent); padding: 12px 20px;
  background: #eff6ff; border-radius: 0 8px 8px 0; margin: 20px 0;
  color: #1e40af; font-style: italic;
}

/* Star rating */
.star-rating { display: flex; gap: 4px; cursor: pointer; }
.star-rating .star { font-size: 22px; color: #d1d5db; transition: .15s; cursor: pointer; }
.star-rating .star.filled, .star-rating .star:hover, .star-rating .star.hover { color: #f59e0b; }
.rating-summary { font-size: 14px; color: var(--muted); }
.rating-summary strong { color: #d97706; }

/* Comments */
.comments-section { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--border); }
.comments-title { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.comment { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.comment-author { font-weight: 700; font-size: 14px; }
.comment-time { font-size: 12px; color: var(--muted); }
.comment-body { margin-top: 8px; font-size: 14px; color: #374151; line-height: 1.7; }

/* Forms */
.form-group { margin-bottom: 16px; }
label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; }
input[type=text], input[type=email], textarea, select {
  width: 100%; padding: 9px 13px; background: #fff;
  border: 1px solid var(--border); border-radius: 7px;
  color: var(--text); font-size: 14px; font-family: inherit;
  transition: border-color .15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
textarea { resize: vertical; min-height: 100px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 7px; font-size: 14px;
  font-weight: 600; cursor: pointer; border: none; transition: .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #1d4ed8; text-decoration: none; color: #fff; }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-ghost { background: #fff; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; background: #eff6ff; }
.btn-success { background: var(--green); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 7px; font-size: 14px; margin-bottom: 16px; }
.alert-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* Footer */
footer {
  border-top: 1px solid var(--border); padding: 24px 0;
  text-align: center; color: var(--muted); font-size: 13px; margin-top: 40px;
  background: #fff;
}

/* Score badge */
.score-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 6px; font-size: 12px; font-weight: 800;
}
.score-high   { background: #ecfdf5; color: #059669; }
.score-medium { background: #fffbeb; color: #b45309; }
.score-low    { background: #fef2f2; color: #dc2626; }

/* Admin overrides — keep admin readable */
.admin-layout { display: flex; min-height: 100vh; background: var(--bg); }
.admin-sidebar {
  width: 220px; background: #1e293b; color: #e2e8f0;
  padding: 0; flex-shrink: 0;
}
.admin-sidebar .sidebar-logo {
  padding: 20px; font-size: 16px; font-weight: 800;
  border-bottom: 1px solid #334155; color: #fff;
}
.admin-sidebar .sidebar-logo span { color: #60a5fa; }
.admin-sidebar nav { display: flex; flex-direction: column; padding: 12px 10px; gap: 2px; }
.admin-sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 7px; color: #94a3b8;
  font-size: 13px; font-weight: 500; transition: .15s;
}
.admin-sidebar nav a:hover { background: #334155; color: #e2e8f0; text-decoration: none; }
.admin-sidebar nav a.active { background: #2563eb; color: #fff; }
.admin-main { flex: 1; padding: 28px 32px; overflow-x: auto; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.admin-title { font-size: 22px; font-weight: 800; color: var(--text); }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat-card .num { font-size: 28px; font-weight: 800; color: var(--accent); }
.stat-card .lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }
.table-wrap { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { background: var(--bg); padding: 11px 14px; text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); }
td { padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f9fafb; }
.actions { display: flex; gap: 6px; align-items: center; }
.status-badge { display: inline-block; padding: 2px 9px; border-radius: 100px; font-size: 11px; font-weight: 700; text-transform: capitalize; }
.status-published { background: #ecfdf5; color: #059669; }
.status-pending   { background: #fffbeb; color: #b45309; }
.status-draft     { background: #f3f4f6; color: #6b7280; }
.status-rejected  { background: #fef2f2; color: #dc2626; }
.editor-toolbar { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.editor-toolbar button { padding: 4px 10px; border: 1px solid var(--border); border-radius: 5px; background: #fff; cursor: pointer; font-size: 12px; }
.editor-toolbar button:hover { background: var(--bg); }
