/* ============================================================
   DevBase Knowledge Base Theme — Main Stylesheet
   ============================================================ */

/* ── GOOGLE FONTS loaded via functions.php ── */

/* ── CSS VARIABLES ────────────────────────────────────────── */
:root {
  --bg:           #F6F5F1;
  --surface:      #FFFFFF;
  --surface2:     #EEECEA;
  --border:       #E2DFD9;
  --text:         #1C1A17;
  --muted:        #8A8478;
  --accent:       #3D6B5E;
  --accent-light: #EAF1EF;
  --accent2:      #C17A3A;
  --accent2-light:#FBF3EA;
  --sidebar-w:    260px;
  --radius:       12px;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
}

/* ── DARK MODE ────────────────────────────────────────────── */
body.dark-mode {
  --bg:           #111110;
  --surface:      #1A1918;
  --surface2:     #252422;
  --border:       #2C2A27;
  --text:         #E8E5DF;
  --muted:        #7A7670;
  --accent-light: #1A2E29;
  --accent2-light:#2A1E10;
}

/* ── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  transition: background 0.3s ease, color 0.3s ease;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button, input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }

/* ── LAYOUT WRAPPER ──────────────────────────────────────── */
#page {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

#content-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── SIDEBAR ─────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 200;
  transition: transform 0.3s ease, background 0.3s ease;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 34px; height: 34px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.3px;
  color: var(--text);
}

.logo-text span { color: var(--muted); font-weight: 300; }

/* Sidebar Search */
.sidebar-search {
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: text;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box:hover,
.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61,107,94,0.1);
}

.search-box svg { color: var(--muted); flex-shrink: 0; }

.search-box input {
  border: none; background: none; outline: none;
  font-size: 13px;
  color: var(--text);
  width: 100%;
}

.search-box input::placeholder { color: var(--muted); }

.kbd {
  font-size: 11px;
  color: var(--muted);
  background: var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: monospace;
  flex-shrink: 0;
  line-height: 1.6;
}

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  padding: 10px 0;
  overflow-y: auto;
}

.nav-section { margin-bottom: 2px; }

.nav-section-label {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.9px;
  padding: 10px 20px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover { background: var(--bg); }

.nav-item.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 500;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.nav-icon {
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.65;
  flex-shrink: 0;
}

.nav-item.active .nav-icon { opacity: 1; }

.nav-badge {
  margin-left: auto;
  font-size: 11px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 20px;
  padding: 1px 7px;
  font-weight: 500;
}

.nav-chevron {
  margin-left: auto;
  color: var(--muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.nav-item.expanded .nav-chevron { transform: rotate(90deg); }

/* Sub nav */
.nav-sub {
  display: none;
  padding-left: 44px;
}

.nav-sub.open { display: block; }

.nav-sub .nav-item {
  padding: 5px 16px 5px 4px;
  font-size: 13px;
  color: var(--muted);
}

.nav-sub .nav-item:hover { color: var(--text); background: none; }
.nav-sub .nav-item.active { color: var(--accent); background: none; }
.nav-sub .nav-item.active::before { display: none; }
.nav-sub .nav-item::before { display: none; }

/* Sidebar Footer */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}

.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--muted); }

/* ── TOPBAR ──────────────────────────────────────────────── */
#masthead {
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.3s ease;
  flex-shrink: 0;
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  flex: 1;
  min-width: 0;
}

.breadcrumb-nav .current { color: var(--text); font-weight: 500; }
.breadcrumb-nav svg { flex-shrink: 0; opacity: 0.5; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
  line-height: 1;
}

.btn-ghost {
  background: none;
  color: var(--muted);
}

.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: #2f5448; color: #fff; }

.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s;
}

.btn-icon:hover { background: var(--bg); color: var(--text); }

.mobile-menu-btn {
  display: none;
}

/* ── MAIN CONTENT ────────────────────────────────────────── */
#primary {
  flex: 1;
}

.site-content {
  padding: 40px 48px;
  max-width: 1080px;
}

/* ── ANIMATIONS ──────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0);    }
}

.anim-1 { animation: fadeUp 0.45s ease both; }
.anim-2 { animation: fadeUp 0.45s 0.08s ease both; }
.anim-3 { animation: fadeUp 0.45s 0.16s ease both; }
.anim-4 { animation: fadeUp 0.45s 0.24s ease both; }
.anim-5 { animation: fadeUp 0.45s 0.32s ease both; }

/* ── HERO ────────────────────────────────────────────────── */
.hero {
  margin-bottom: 36px;
}

.hero-eyebrow {
  font-size: 11.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 10px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero-desc {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.65;
  max-width: 500px;
}

/* ── STATS ROW ───────────────────────────────────────────── */
.stats-row {
  display: flex;
  gap: 12px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  flex: 1;
  min-width: 120px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(61,107,94,0.08);
}

.stat-num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label { font-size: 12px; color: var(--muted); }

/* ── SECTION HEADER ──────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.3px;
}

.section-link {
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
}

.section-link:hover { text-decoration: underline; }

/* ── CATEGORY CARDS ──────────────────────────────────────── */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 48px;
}

.cat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.cat-card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 24px rgba(61,107,94,0.1);
  transform: translateY(-2px);
}

.cat-card.wide { grid-column: span 2; }

.cat-card.wide .cat-inner {
  display: flex;
  gap: 16px;
  align-items: center;
}

.cat-card.wide .cat-body { flex: 1; }

.cat-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.cat-card h3 { font-size: 14px; font-weight: 500; line-height: 1.3; }

.cat-card p {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}

.cat-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 4px;
}

.cat-count { font-size: 11.5px; color: var(--muted); }

.cat-arrow {
  color: var(--muted);
  transition: transform 0.2s, color 0.2s;
  flex-shrink: 0;
}

.cat-card:hover .cat-arrow {
  transform: translateX(4px);
  color: var(--accent);
}

/* ── ARTICLE CARDS ───────────────────────────────────────── */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 48px;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  position: relative;
}

.article-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(61,107,94,0.08);
  transform: translateY(-2px);
}

.article-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 20px;
  width: fit-content;
}

.tag-code  { background: var(--accent-light); color: var(--accent); }
.tag-seo   { background: #EEF2FF; color: #4F46E5; }
.tag-ops   { background: var(--accent2-light); color: var(--accent2); }
.tag-tools { background: #FFF0F0; color: #D94F4F; }
.tag-misc  { background: var(--surface2); color: var(--muted); }

.article-card h3 { font-size: 18px; font-weight: 700; line-height: 1.4; font-family: var(--font-display);  color: #3F51B5; }
.article-image {
  aspect-ratio: 1/0.8;
  overflow: hidden;
}
.article-image img {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.article-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
}

.article-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.article-author {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.author-avatar {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px;
  font-weight: 600;
  color: var(--accent);
  overflow: hidden;
  flex-shrink: 0;
}

.author-avatar img { width: 100%; height: 100%; object-fit: cover; }

.article-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
}

.dot { opacity: 0.4; }

/* ── CHANGELOG / WHAT'S NEW ──────────────────────────────── */
.changelog-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 48px;
}

.changelog-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.changelog-item:last-child { border-bottom: none; }
.changelog-item:hover { background: var(--bg); }

.changelog-date {
  font-size: 11px;
  color: var(--muted);
  width: 64px;
  flex-shrink: 0;
  padding-top: 3px;
}

.changelog-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}

.changelog-info { flex: 1; }

.changelog-title {
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
}

.changelog-desc { font-size: 12.5px; color: var(--muted); }

/* ── SINGLE ARTICLE ──────────────────────────────────────── */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 40px;
  align-items: start;
}

.article-header { margin-bottom: 28px; }

.article-header .article-tag { margin-bottom: 12px; }

.article-header h1 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.4px;
  margin-bottom: 12px;
}

.article-byline {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.article-byline .article-author { font-size: 13px; }
.article-byline .article-meta { font-size: 12.5px; margin-left: 0; }

.article-divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

/* Article Body */
.article-body { line-height: 1.75; }

.article-body h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.3px;
  margin: 36px 0 14px;
  color: var(--text);
}

.article-body h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 28px 0 10px;
}

.article-body h4 { font-size: 14px; font-weight: 600; margin: 20px 0 8px; }

.article-body p { margin-bottom: 16px; color: var(--text); font-size: 15px; }

.article-body ul, .article-body ol {
  margin: 0 0 16px 20px;
  list-style: disc;
}

.article-body ol { list-style: decimal; }

.article-body li { margin-bottom: 6px; font-size: 15px; }

.article-body a { color: var(--accent); text-decoration: underline; }

.article-body strong { font-weight: 600; }

.article-body code {
  font-family: 'Fira Code', 'Cascadia Code', monospace;
  font-size: 13px;
  background: var(--surface2);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.article-body pre {
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 20px 0;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.65;
}

body.dark-mode .article-body pre {
  background: var(--surface2);
  color: var(--text);
}

.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

.article-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 20px 0;
  padding: 12px 20px;
  background: var(--accent-light);
  border-radius: 0 8px 8px 0;
  font-size: 14.5px;
  color: var(--accent);
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
}

.article-body th {
  background: var(--surface2);
  font-weight: 500;
  text-align: left;
  padding: 10px 14px;
  border: 1px solid var(--border);
}

.article-body td {
  padding: 9px 14px;
  border: 1px solid var(--border);
}

.article-body tr:hover td { background: var(--bg); }

/* Table of Contents */
.toc-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: sticky;
  top: 72px;
}

.toc-title {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 12px;
}

.toc-list { list-style: none; margin: 0; padding: 0; }

.toc-list li { margin-bottom: 2px; }

.toc-list a {
  font-size: 13px;
  color: var(--muted);
  display: block;
  padding: 4px 0;
  border-left: 2px solid transparent;
  padding-left: 12px;
  transition: color 0.15s, border-color 0.15s;
}

.toc-list a:hover,
.toc-list a.active {
  color: var(--accent);
  border-left-color: var(--accent);
}

.toc-list .toc-h3 { padding-left: 24px; }

/* ── SEARCH RESULTS ──────────────────────────────────────── */
.search-results-header {
  margin-bottom: 24px;
}

.search-results-header h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
}

.search-results-header p { color: var(--muted); font-size: 14px; margin-top: 6px; }

.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.no-results svg { margin: 0 auto 16px; opacity: 0.3; }
.no-results h2 { font-family: var(--font-display); font-size: 22px; font-weight: 400; margin-bottom: 8px; color: var(--text); }

/* ── FOOTER ──────────────────────────────────────────────── */
#colophon {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12.5px;
  color: var(--muted);
  flex-shrink: 0;
}

#colophon a { color: var(--muted); transition: color 0.15s; }
#colophon a:hover { color: var(--accent); }

.footer-links { display: flex; gap: 16px; }

/* ── OVERLAY (mobile) ────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 150;
}

.sidebar-overlay.active { display: block; }

/* ── Login Page ────────────────────────────────────── */
body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.login-wrap {
  width: 100%;
  max-width: 400px;
  padding: 24px 16px;
  position: relative;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  text-decoration: none;
  color: var(--text);
}

.login-logo .logo-icon {
  width: 34px; height: 34px;
  background: var(--accent);
  color: #fff;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}

.login-logo .logo-text {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.login-logo .logo-text span { font-weight: 400; color: var(--muted); }

.login-card h1 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 24px;
}

.login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  color: #B91C1C;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 20px;
}

body.dark-mode .login-error {
  background: #2D1515;
  border-color: #7F1D1D;
  color: #FCA5A5;
}

.form-field {
  margin-bottom: 16px;
}

.form-field label,
.field-label-row label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.forgot-link {
  font-size: 12px;
  color: var(--accent);
}

.forgot-link:hover { text-decoration: underline; }

.form-field input[type="text"],
.form-field input[type="password"] {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.form-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61,107,94,0.12);
}

.password-wrap {
  position: relative;
}

.password-wrap input[type="password"],
.password-wrap input[type="text"] {
  padding-right: 40px;
}

.pw-toggle {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pw-toggle:hover { color: var(--text); }

.remember-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: 20px;
  user-select: none;
}

.remember-row input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

.login-submit {
  width: 100%;
  justify-content: center;
  padding: 10px;
  font-size: 14px;
}

.login-dark-toggle {
  position: absolute;
  top: 28px; right: 20px;
}

/* nEW tHEME */
/* ===== Focus Card ===== */
.focus-card {
  background: #F5C451;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 32px;
}

.focus-inner {
  display: flex;
  justify-content: space-between;
}

.focus-tag {
  font-size: 11px;
  text-transform: uppercase;
  opacity: 0.7;
}

.focus-progress {
  height: 6px;
  background: rgba(0,0,0,0.1);
  border-radius: 10px;
  margin-top: 10px;
}

.progress-bar {
  width: 66%;
  height: 100%;
  background: #000;
  border-radius: 10px;
}

/* ===== Kanban ===== */
.kanban {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.kanban-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}

.kanban-title {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 10px;
}

/* ===== Task Card ===== */
.task-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
}

.task-card.highlight {
  background: #FFF7E6;
}

.task-tag {
  font-size: 10px;
  padding: 3px 6px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 6px;
}

.task-status {
  font-size: 11px;
  color: var(--muted);
}

.task-status.red { color: #D94F4F; }
.task-status.green { color: #16A34A; }
.btn-download {
  position: absolute;
  z-index: 2;
  right: 20px;
  top: 20px;
}
.btn-card-download {
  background-color: #D94F4F;
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .article-layout { grid-template-columns: 1fr; }
  .toc-widget { position: static; }
}

@media (max-width: 768px) {
  #sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }

  #sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0,0,0,0.15);
  }

  #content-area { margin-left: 0; }

  .site-content { padding: 24px 18px; }

  #masthead { padding: 0 18px; }

  .mobile-menu-btn { display: flex; }

  .categories-grid { grid-template-columns: 1fr 1fr; }

  .cat-card.wide { grid-column: span 2; }

  .articles-grid { grid-template-columns: 1fr; }

  .hero h1 { font-size: 28px; }

  .stats-row .stat-card { min-width: calc(50% - 6px); }

  #colophon { padding: 16px 18px; }
}

@media (max-width: 480px) {
  .categories-grid { grid-template-columns: 1fr; }
  .cat-card.wide { grid-column: span 1; }
  .cat-card.wide .cat-inner { flex-direction: column; align-items: flex-start; }
  .stats-row .stat-card { min-width: 100%; }
}
