/* ══════════════════════════════════════════════════════════════
   RegHub Frontend — stylesheet
   Based on FRONTEND_TEMPLATE.html, extended with login view,
   modals, toasts and infinite-scroll components.
   ══════════════════════════════════════════════════════════════ */

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  background: #f7f8fadf;
  color: #2c3e50;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: #e8634a; text-decoration: none; }
a:hover { text-decoration: underline; color: #d14f38; }
.hidden { display: none !important; }

/* ── Top Header ─────────────────────────────────────────────── */
.top-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 32px 12px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}
.top-header .brand-link {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: opacity .15s;
}
.top-header .brand-link:hover { opacity: .75; text-decoration: none; }
.top-header svg { width: 36px; height: 36px; flex-shrink: 0; }
.top-header .brand-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: #e8634a;
  letter-spacing: .3px;
}
.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  color: #6b7685;
  padding: 7px 12px;
  border: 1px solid #d4d8e0;
  border-radius: 8px;
  background: #fff;
}
.user-chip .ws-name { font-weight: 600; color: #2c3e50; }
.btn-ghost {
  padding: 8px 14px;
  border: 1px solid #d4d8e0;
  border-radius: 8px;
  background: #fff;
  color: #2c3e50;
  font-size: .85rem;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn-ghost:hover { background: #f0f1f4; }
.btn-primary {
  padding: 9px 16px;
  border: 1px solid #e8634a;
  border-radius: 8px;
  background: #e8634a;
  color: #fff;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-primary:hover { background: #d14f38; }
.btn-primary:disabled { opacity: .5; cursor: default; }
.btn-danger {
  padding: 9px 16px;
  border: 1px solid #c0392b;
  border-radius: 8px;
  background: #c0392b;
  color: #fff;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-danger:hover { background: #a93226; }
.btn-danger:disabled { opacity: .5; cursor: default; }

/* ── Container ──────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 32px 60px;
  flex: 1;
  width: 100%;
}

/* ── Auth views (login + workspace picker) ──────────────────── */
.auth-wrap {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 20px 40px;
}
.auth-card {
  background: #fff;
  border: 1px solid #e9ecf0;
  border-radius: 12px;
  padding: 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 30px rgba(27,32,40,.06);
}
.auth-card h2 { font-size: 1.35rem; color: #1b2028; margin-bottom: 4px; }
.auth-card .auth-sub { font-size: .9rem; color: #6b7685; margin-bottom: 24px; }
.form-field { margin-bottom: 16px; }
.form-field label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: #5a6270;
  margin-bottom: 6px;
}
.form-field label .req { color: #e8634a; }
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d4d8e0;
  border-radius: 8px;
  background: #fff;
  color: #2c3e50;
  font-size: .9rem;
  font-family: inherit;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { border-color: #e8634a; box-shadow: 0 0 0 3px rgba(232,99,74,.1); }
.form-field textarea { resize: vertical; min-height: 80px; }
.form-error {
  font-size: .85rem;
  color: #c0392b;
  background: #fef2f0;
  border: 1px solid #f5c6c0;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 16px;
}
.auth-card .btn-primary { width: 100%; margin-top: 6px; }

/* Workspace picker */
.ws-list { display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow-y: auto; }
.ws-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #e0e3e8;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font-size: .95rem;
  color: #2c3e50;
  transition: border-color .15s, background .15s;
  width: 100%;
}
.ws-item:hover { border-color: #e8634a; background: #fef8f6; }
.ws-item img {
  width: 34px; height: 34px;
  border-radius: 8px;
  object-fit: cover;
  background: #f0f1f4;
  flex-shrink: 0;
}
.ws-item .ws-label { font-weight: 600; }
.ws-item .ws-type { font-size: .78rem; color: #8b919e; }
.ws-item .ws-preferred {
  margin-left: auto;
  font-size: .72rem;
  color: #27864e;
  background: #f0faf4;
  border: 1px solid #b6e2c8;
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
}

/* ── Page header ────────────────────────────────────────────── */
.page-header { margin-bottom: 28px; }
.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #1b2028;
  margin-bottom: 6px;
}
.page-header .subtitle { font-size: 1.05rem; color: #6b7685; }
.page-header .stats {
  display: flex;
  gap: 24px;
  margin-top: 12px;
  font-size: 0.9rem;
  color: #6b7685;
}
.page-header .stats strong { color: #e8634a; }

/* ── Toolbar ────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  align-items: center;
}
.search-box {
  flex: 1 1 300px;
  max-width: 420px;
  position: relative;
}
.search-box input {
  width: 100%;
  padding: 11px 14px 11px 42px;
  border: 1px solid #d4d8e0;
  border-radius: 8px;
  background: #fff;
  color: #2c3e50;
  font-size: 0.9rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.search-box input:focus { border-color: #e8634a; box-shadow: 0 0 0 3px rgba(232,99,74,.1); }
.search-box .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #a0a6b4;
  pointer-events: none;
}
.search-box .icon svg { width: 18px; height: 18px; }
.filter-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-group select,
.filter-group input[type="date"],
.filter-group button {
  padding: 10px 14px;
  border: 1px solid #d4d8e0;
  border-radius: 8px;
  background: #fff;
  color: #2c3e50;
  font-size: .90rem;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  transition: border-color .2s;
}
.filter-group select:focus, .filter-group input[type="date"]:focus { border-color: #e8634a; }
.filter-group button:hover { background: #f0f1f4; }
.filter-group .date-label { font-size: .8rem; color: #8b919e; }
.btn-reset {
  background: #fff !important;
  border-color: #e8634a !important;
  color: #e8634a !important;
  font-weight: 600;
}
.btn-reset:hover { background: #fef4f2 !important; }

/* ── Multi-select dropdown ──────────────────────────────────── */
.ms { position: relative; }
.ms-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid #d4d8e0;
  border-radius: 8px;
  background: #fff;
  color: #2c3e50;
  font-size: .9rem;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .2s;
}
.ms-btn:hover { background: #f0f1f4; }
.ms-btn.ms-active { border-color: #e8634a; color: #e8634a; font-weight: 600; }
.ms-caret { font-size: .7rem; opacity: .6; }
.ms-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 60;
  width: 260px;
  background: #fff;
  border: 1px solid #d4d8e0;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(27,32,40,.14);
  padding: 10px;
}
.ms-search {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d4d8e0;
  border-radius: 7px;
  font-size: .85rem;
  font-family: inherit;
  outline: none;
  margin-bottom: 6px;
}
.ms-search:focus { border-color: #e8634a; }
.ms-actions { display: flex; justify-content: flex-end; margin-bottom: 4px; }
.ms-clear {
  background: none;
  border: none;
  color: #e8634a;
  font-size: .78rem;
  cursor: pointer;
  padding: 2px 4px;
}
.ms-clear:hover { text-decoration: underline; }
.ms-list { max-height: 260px; overflow-y: auto; }
.ms-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 6px;
  font-size: .88rem;
  color: #2c3e50;
  cursor: pointer;
}
.ms-option:hover { background: #f7f8fa; }
.ms-option input { accent-color: #e8634a; cursor: pointer; }
.ms-empty { padding: 10px; color: #8b919e; font-size: .85rem; text-align: center; }

body.dark .ms-btn { background: #23262f; border-color: #3a3f4b; color: #d1d5db; }
body.dark .ms-btn:hover { background: #2c303a; }
body.dark .ms-btn.ms-active { border-color: #e8634a; color: #e8634a; }
body.dark .ms-panel { background: #1e2028; border-color: #3a3f4b; box-shadow: 0 12px 30px rgba(0,0,0,.4); }
body.dark .ms-search { background: #23262f; border-color: #3a3f4b; color: #d1d5db; }
body.dark .ms-option { color: #d1d5db; }
body.dark .ms-option:hover { background: #23262f; }
body.dark .ms-empty { color: #6b7685; }

/* ── Results count ──────────────────────────────────────────── */
.results-count {
  font-size: .9rem;
  color: #6b7685;
  margin-bottom: 12px;
}
.results-count strong { color: #e8634a; }

/* ── News List ──────────────────────────────────────────────── */
.news-list { display: flex; flex-direction: column; gap: 0; }

/* ── News Row ───────────────────────────────────────────────── */
.news-row {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) 180px 145px 34px 34px 34px;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  background: #fff;
  border-bottom: 1px solid #e9ecf0;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  user-select: none;
}
.news-row:first-child { border-radius: 8px 8px 0 0; }
.news-row:hover { background: #fafbfc; border-left-color: #e8634a; }
.news-row.active { background: #fef8f6; border-left-color: #e8634a; }

.news-row .date {
  font-size: .9rem;
  color: #8b919e;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.news-row .title-col { min-width: 0; overflow: hidden; }
.news-row .title {
  font-size: 1.0rem;
  color: #1b2028;
  font-weight: 600;
  display: block;
  line-height: 1.4;
}
.news-row .source {
  font-size: .95rem;
  color: #8b919e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.news-row .type-badge {
  font-size: .85rem;
  padding: 4px 14px;
  border-radius: 14px;
  background: #f0f1f4;
  color: #5a6270;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  border: 1px solid #e0e3e8;
  text-align: center;
}
.news-row .link-icon {
  color: #e8634a;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s;
}
.news-row .link-icon:hover { color: #d14f38; }
.news-row .link-icon svg { width: 20px; height: 20px; }
.news-row .row-delete,
.news-row .row-edit {
  background: none;
  border: none;
  color: #a0a6b4;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 6px;
  transition: color .15s, background .15s;
}
.news-row .row-delete:hover { color: #c0392b; background: #fef2f0; }
.news-row .row-edit:hover { color: #e8634a; background: #fef4f2; }
.news-row .row-delete svg,
.news-row .row-edit svg { width: 18px; height: 18px; }

/* ── Detail Panel ───────────────────────────────────────────── */
.detail-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease, padding .25s ease;
  background: #fff;
  border-left: 3px solid #e8634a;
  border-bottom: 1px solid #e9ecf0;
}
.detail-panel.open {
  max-height: 6000px;
  padding: 28px 32px 32px;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 40px;
}
@media (max-width: 900px) {
  .news-row { grid-template-columns: 90px minmax(0, 1fr) 34px 34px 34px; }
  .news-row .source, .news-row .type-badge { display: none; }
}
@media (max-width: 700px) {
  .detail-grid { grid-template-columns: 1fr; }
}

.detail-section { margin-bottom: 0; }
.detail-section h4 {
  font-size: .88rem;
  text-transform: uppercase;
  letter-spacing: .9px;
  color: #8b919e;
  margin-bottom: 10px;
  font-weight: 600;
}
.detail-section p, .detail-section .val {
  font-size: 1rem;
  color: #3a4553;
  line-height: 1.65;
}
.full-width { grid-column: 1 / -1; }
.detail-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid #edf0f3;
}
.content-box {
  max-height: 320px;
  overflow-y: auto;
  background: #f7f8fadf;
  border: 1px solid #e9ecf0;
  border-radius: 8px;
  padding: 14px 18px;
  font-size: .92rem;
  line-height: 1.6;
  color: #3a4553;
  white-space: pre-wrap;
  word-break: break-word;
}
.detail-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #8b919e;
  font-size: .9rem;
  padding: 8px 0;
}

/* Assessment cards */
.assessment-list { display: flex; flex-direction: column; gap: 14px; }
.assessment-card {
  background: #f7f8fadf;
  border: 1px solid #e9ecf0;
  border-radius: 8px;
  padding: 14px 18px;
}
.assessment-card .assess-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 10px;
}
.assessment-card .assess-title {
  font-size: 1.0rem;
  font-weight: 600;
  color: #1b2028;
}
.assessment-card .assess-accuracy {
  font-size: .85rem;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #d4d8e0;
  white-space: nowrap;
}
.accuracy-high { color: #27864e; border-color: #b6e2c8 !important; background: #f0faf4 !important; }
.accuracy-medium { color: #b57d14; border-color: #f2dfa7 !important; background: #fef9ec !important; }
.accuracy-low { color: #c0392b; border-color: #f5c6c0 !important; background: #fef2f0 !important; }
.assessment-card .assess-desc {
  font-size: 0.85rem;
  color: #5a6270;
  line-height: 1.55;
}
.assessment-card ul { margin: 6px 0 0 18px; font-size: .85rem; color: #5a6270; line-height: 1.6; }

/* Meta pills */
.meta-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.meta-pill {
  font-size: .9rem;
  padding: 5px 14px;
  border-radius: 14px;
  background: #f0f1f4;
  color: #5a6270;
  border: 1px solid #e0e3e8;
}
.meta-pill strong { color: #2c3e50; font-weight: 600; }

/* Tags / pills */
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: .9rem;
  padding: 5px 14px;
  border-radius: 14px;
  font-weight: 500;
}
.tag.topic { background: #f0faf4; color: #27864e; border: 1px solid #b6e2c8; }
.tag.keyword { background: #fef9ec; color: #b57d14; border: 1px solid #f2dfa7; }

/* Related news */
.related-list { list-style: none; }
.related-list li {
  padding: 10px 0;
  border-bottom: 1px solid #edf0f3;
  font-size: 0.9rem;
}
.related-list li:last-child { border-bottom: none; }
.related-list .rel-title { color: #1b2028; font-weight: 500; }
.related-list .rel-title a { color: #1b2028; }
.related-list .rel-meta { color: #8b919e; font-size: .9rem; margin-top: 4px; }

/* ── Infinite scroll loader ─────────────────────────────────── */
.scroll-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 26px 0;
  color: #8b919e;
  font-size: .9rem;
}
.spinner {
  width: 26px; height: 26px;
  border: 3px solid #e0e3e8;
  border-top-color: #e8634a;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.end-of-list {
  text-align: center;
  color: #a0a6b4;
  font-size: .85rem;
  padding: 22px 0;
}

/* ── Empty state ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #8b919e;
  font-size: 1.1rem;
}
.empty-state svg { width: 56px; height: 56px; margin-bottom: 14px; opacity: .4; }

/* ── Modals ─────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 23, 30, .55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 20px 40px;
  z-index: 100;
  overflow-y: auto;
}
.modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 640px;
  padding: 28px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal.modal-sm { max-width: 440px; }
.modal h3 { font-size: 1.2rem; color: #1b2028; margin-bottom: 4px; }
.modal .modal-sub { font-size: .88rem; color: #6b7685; margin-bottom: 20px; }
.modal .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .modal .form-row { grid-template-columns: 1fr; } }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* ── Toasts ─────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
  max-width: 380px;
}
.toast {
  background: #1b2028;
  color: #f0f1f4;
  border-radius: 10px;
  padding: 13px 18px;
  font-size: .9rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  border-left: 4px solid #27864e;
  animation: toast-in .25s ease;
}
.toast.error { border-left-color: #c0392b; }
.toast.info { border-left-color: #e8634a; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
  background: #f0f1f4;
  color: #8b919e;
  padding: 24px 32px;
  margin-top: auto;
  font-size: .9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid #e0e3e8;
}
.footer .brand { color: #e8634a; font-weight: 600; font-size: 1.05rem; cursor: pointer; transition: opacity .15s; }
.footer .brand:hover { opacity: .7; }
.footer a { color: #8b919e; }
.footer a:hover { color: #5a6270; text-decoration: none; }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f0f1f4; }
::-webkit-scrollbar-thumb { background: #c5cad3; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a0a6b4; }

/* ── Dark-mode toggle button ────────────────────────────────── */
.theme-toggle {
  background: none;
  border: 1px solid #d4d8e0;
  border-radius: 8px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6b7685;
  transition: background .15s, border-color .15s, color .15s;
  flex-shrink: 0;
}
.theme-toggle:hover { background: #f0f1f4; border-color: #c5cad3; }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun  { display: none; }

/* ── Dark mode ──────────────────────────────────────────────── */
body.dark { background: #181a20; color: #d1d5db; }
body.dark a { color: #e8634a; }
body.dark a:hover { color: #f0876f; }

body.dark .user-chip { background: #23262f; border-color: #3a3f4b; color: #8b919e; }
body.dark .user-chip .ws-name { color: #d1d5db; }
body.dark .btn-ghost { background: #23262f; border-color: #3a3f4b; color: #d1d5db; }
body.dark .btn-ghost:hover { background: #2c303a; }

body.dark .auth-card { background: #1e2028; border-color: #2c303a; box-shadow: 0 8px 30px rgba(0,0,0,.3); }
body.dark .auth-card h2 { color: #f0f1f4; }
body.dark .form-field label { color: #8b919e; }
body.dark .form-field input,
body.dark .form-field select,
body.dark .form-field textarea { background: #23262f; border-color: #3a3f4b; color: #d1d5db; }
body.dark .form-error { background: #2a1515; border-color: #7f1d1d; color: #f87171; }
body.dark .ws-item { background: #1e2028; border-color: #3a3f4b; color: #d1d5db; }
body.dark .ws-item:hover { border-color: #e8634a; background: #2a2226; }
body.dark .ws-item .ws-type { color: #6b7685; }
body.dark .ws-item .ws-preferred { color: #4ade80; background: #1a2e1a; border-color: #22543d; }

body.dark .page-header h1 { color: #f0f1f4; }
body.dark .page-header .subtitle { color: #6b7685; }
body.dark .page-header .stats { color: #6b7685; }

body.dark .search-box input { background: #23262f; border-color: #3a3f4b; color: #d1d5db; }
body.dark .search-box input:focus { border-color: #e8634a; box-shadow: 0 0 0 3px rgba(232,99,74,.15); }
body.dark .search-box .icon { color: #555b68; }

body.dark .filter-group select,
body.dark .filter-group input[type="date"],
body.dark .filter-group button { background: #23262f; border-color: #3a3f4b; color: #d1d5db; }
body.dark .filter-group select:focus,
body.dark .filter-group input[type="date"]:focus { border-color: #e8634a; }
body.dark .filter-group button:hover { background: #2c303a; }
body.dark .btn-reset { background: #23262f !important; border-color: #e8634a !important; color: #e8634a !important; }
body.dark .btn-reset:hover { background: #2e2220 !important; }
body.dark .btn-primary { background: #e8634a; border-color: #e8634a; color: #fff; }
body.dark .btn-primary:hover { background: #d14f38; }

body.dark .results-count { color: #6b7685; }

body.dark .news-row { background: #1e2028; border-bottom-color: #2c303a; border-left-color: transparent; }
body.dark .news-row:hover { background: #23262f; border-left-color: #e8634a; }
body.dark .news-row.active { background: #2a2226; border-left-color: #e8634a; }
body.dark .news-row .date { color: #6b7685; }
body.dark .news-row .title { color: #f0f1f4; }
body.dark .news-row .source { color: #6b7685; }
body.dark .news-row .type-badge { background: #23262f; color: #8b919e; border-color: #3a3f4b; }
body.dark .news-row .row-delete,
body.dark .news-row .row-edit { color: #555b68; }
body.dark .news-row .row-delete:hover { color: #f87171; background: #2a1515; }
body.dark .news-row .row-edit:hover { color: #e8634a; background: #2e2220; }

body.dark .detail-panel { background: #1e2028; border-left-color: #e8634a; border-bottom-color: #2c303a; }
body.dark .detail-section h4 { color: #6b7685; }
body.dark .detail-section p,
body.dark .detail-section .val { color: #c5cad3; }
body.dark .detail-actions { border-top-color: #2c303a; }
body.dark .content-box { background: #23262f; border-color: #3a3f4b; color: #c5cad3; }
body.dark .detail-loading { color: #6b7685; }

body.dark .assessment-card { background: #23262f; border-color: #3a3f4b; }
body.dark .assessment-card .assess-title { color: #f0f1f4; }
body.dark .assessment-card .assess-accuracy { background: #1e2028; border-color: #3a3f4b; }
body.dark .accuracy-high { color: #4ade80; border-color: #22543d !important; background: #1a2e1a !important; }
body.dark .accuracy-medium { color: #fbbf24; border-color: #78350f !important; background: #2a2210 !important; }
body.dark .accuracy-low { color: #f87171; border-color: #7f1d1d !important; background: #2a1515 !important; }
body.dark .assessment-card .assess-desc { color: #8b919e; }
body.dark .assessment-card ul { color: #8b919e; }

body.dark .meta-pill { background: #23262f; color: #8b919e; border-color: #3a3f4b; }
body.dark .meta-pill strong { color: #d1d5db; }

body.dark .tag.topic { background: #1a2e1a; color: #4ade80; border-color: #22543d; }
body.dark .tag.keyword { background: #2a2210; color: #fbbf24; border-color: #78350f; }

body.dark .related-list li { border-bottom-color: #2c303a; }
body.dark .related-list .rel-title { color: #f0f1f4; }
body.dark .related-list .rel-title a { color: #f0f1f4; }
body.dark .related-list .rel-meta { color: #6b7685; }

body.dark .scroll-loader { color: #6b7685; }
body.dark .spinner { border-color: #3a3f4b; border-top-color: #e8634a; }
body.dark .end-of-list { color: #555b68; }

body.dark .empty-state { color: #555b68; }

body.dark .modal { background: #1e2028; }
body.dark .modal h3 { color: #f0f1f4; }
body.dark .modal .modal-sub { color: #6b7685; }

body.dark .footer { background: #16181e; border-top-color: #2c303a; color: #555b68; }
body.dark .footer .brand { color: #e8634a; }
body.dark .footer a { color: #555b68; }
body.dark .footer a:hover { color: #8b919e; }

body.dark .theme-toggle { border-color: #3a3f4b; color: #8b919e; }
body.dark .theme-toggle:hover { background: #23262f; border-color: #555b68; }
body.dark .theme-toggle .icon-moon { display: none; }
body.dark .theme-toggle .icon-sun  { display: block; }

body.dark ::-webkit-scrollbar-track { background: #1e2028; }
body.dark ::-webkit-scrollbar-thumb { background: #3a3f4b; }
body.dark ::-webkit-scrollbar-thumb:hover { background: #555b68; }

/* ── Print ──────────────────────────────────────────────────── */
@media print {
  .toolbar, .theme-toggle, .header-right { display: none; }
  .news-row { break-inside: avoid; }
  .detail-panel.open { max-height: none; }
}
