/* =============================================================
   PRISMA-SLR - Design System
   Dark mode com acentos ciano (#00D4FF)
   ============================================================= */

/* ----- Variables: Dark theme (padrão) ----- */
:root {
  --bg-base:       #070b14;
  --bg-surface:    #0d1526;
  --bg-card:       #111c33;
  --bg-card-hover: #162040;
  --bg-input:      #0a1020;
  --bg-hover:      #1a2848;

  --primary:       #00D4FF;
  --primary-dim:   rgba(0, 212, 255, 0.15);
  --primary-glow:  rgba(0, 212, 255, 0.4);

  --accent-green:  #00E5A0;
  --accent-red:    #FF4D6A;
  --accent-yellow: #FFB700;
  --accent-purple: #A855F7;

  --text-primary:  #E8EEF8;
  --text-secondary:#8FA3C0;
  --text-muted:    #4D6080;
  --text-inverse:  #070b14;

  --border:        rgba(0, 212, 255, 0.12);
  --border-strong: rgba(0, 212, 255, 0.3);
  --divider:       rgba(255,255,255,0.06);

  --sidebar-w:     260px;
  --header-h:      60px;
  --radius:        10px;
  --radius-lg:     16px;
  --shadow:        0 4px 24px rgba(0,0,0,0.4);
  --shadow-card:   0 2px 12px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.04);

  --font:          'Inter', system-ui, -apple-system, sans-serif;
  --transition:    0.2s ease;
}

/* ----- Variables: Light theme ----- */
body.theme-light {
  --bg-base:       #f0f4fb;
  --bg-surface:    #ffffff;
  --bg-card:       #ffffff;
  --bg-card-hover: #f5f8ff;
  --bg-input:      #f5f7fc;
  --bg-hover:      #eaf0fa;

  --primary:       #0099cc;
  --primary-dim:   rgba(0, 153, 204, 0.1);
  --primary-glow:  rgba(0, 153, 204, 0.3);

  --accent-green:  #059669;
  --accent-red:    #e03050;
  --accent-yellow: #d97706;
  --accent-purple: #7c3aed;

  --text-primary:  #111827;
  --text-secondary:#374151;
  --text-muted:    #9ca3af;
  --text-inverse:  #ffffff;

  --border:        rgba(0, 0, 0, 0.09);
  --border-strong: rgba(0, 153, 204, 0.35);
  --divider:       rgba(0, 0, 0, 0.07);

  --shadow:        0 4px 24px rgba(0,0,0,0.10);
  --shadow-card:   0 1px 6px rgba(0,0,0,0.07), inset 0 1px 0 rgba(255,255,255,0.8);
}

/* Scrollbar claro no light mode */
body.theme-light ::-webkit-scrollbar-track { background: var(--bg-base); }
body.theme-light ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); }
body.theme-light ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.28); }

/* Formulários e selects no light mode */
body.theme-light .sidebar-project select,
body.theme-light .form-control {
  background: var(--bg-input);
  color: var(--text-primary);
  border-color: var(--border);
}
body.theme-light .form-control::placeholder { color: var(--text-muted); }

/* Overlay do modal no light mode */
body.theme-light .modal-overlay { background: rgba(0,0,0,0.45); }
body.theme-light .modal         { box-shadow: 0 12px 40px rgba(0,0,0,0.2); }

/* Loading no light mode */
body.theme-light .loading-overlay { background: rgba(240,244,251,0.7); }

/* Toast no light mode */
body.theme-light .toast { box-shadow: 0 4px 16px rgba(0,0,0,0.12); }

/* Badges ajuste de contraste */
body.theme-light .badge-screened  { background: rgba(217,119,6,0.12);  color: var(--accent-yellow); }
body.theme-light .badge-eligible  { background: rgba(0,153,204,0.12);  color: var(--primary); }
body.theme-light .badge-included  { background: rgba(5,150,105,0.12);  color: var(--accent-green); }
body.theme-light .badge-excluded  { background: rgba(224,48,80,0.12);  color: var(--accent-red); }
body.theme-light .badge-pending   { background: rgba(217,119,6,0.12);  color: var(--accent-yellow); }
body.theme-light .badge-scopus    { background: rgba(234,88,12,0.12);  color: #ea580c; }
body.theme-light .badge-wos       { background: rgba(37,99,235,0.12);  color: #2563eb; }

/* Alertas no light mode */
body.theme-light .alert-info    { background: rgba(0,153,204,0.07); border-color: rgba(0,153,204,0.25); color: #0077a8; }
body.theme-light .alert-success { background: rgba(5,150,105,0.07); border-color: rgba(5,150,105,0.25); color: #047857; }
body.theme-light .alert-warning { background: rgba(217,119,6,0.07); border-color: rgba(217,119,6,0.25); color: #b45309; }
body.theme-light .alert-error   { background: rgba(224,48,80,0.07); border-color: rgba(224,48,80,0.25); color: #be123c; }

/* Transição suave ao trocar tema */
body, body *, .sidebar, .header, .card, .modal, .btn, .form-control, .toast, table, thead th {
  transition: background-color var(--transition), color var(--transition), border-color var(--transition);
}

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

html {
  font-size: 15px;
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  max-width: 100vw;
}

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

button { cursor: pointer; font-family: var(--font); }

img, svg { display: block; max-width: 100%; }

/* ----- Scrollbar ----- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: rgba(0,212,255,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,212,255,0.4); }

/* ============================================================
   LAYOUT
   ============================================================ */

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  overflow: hidden;
  transition: transform var(--transition);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--divider);
}

.sidebar-logo img { width: 32px; height: 32px; }

.sidebar-logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.sidebar-logo-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Project selector */
.sidebar-project {
  padding: 12px 16px;
  border-bottom: 1px solid var(--divider);
}

.sidebar-project label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.sidebar-project select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-family: var(--font);
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}

.sidebar-project select:focus { border-color: var(--primary); }

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

.nav-section-title {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 12px 20px 4px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
  position: relative;
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--primary-dim);
  text-decoration: none;
}

.nav-item.active {
  color: var(--primary);
  border-left-color: var(--primary);
  background: var(--primary-dim);
}

.nav-item i {
  width: 18px;
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.8;
}

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

.nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: var(--text-inverse);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.nav-badge.warn { background: var(--accent-yellow); }
.nav-badge.success { background: var(--accent-green); }

/* Sidebar footer */
.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--divider);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  border: 0;
  background: rgba(7, 11, 20, 0.7);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
  z-index: 90;
}

/* Main content */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  width: 100%;
}

/* Header */
.header {
  height: var(--header-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-title {
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  line-height: 1.4;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#sidebar-toggle {
  display: none;
  min-width: 36px;
  justify-content: center;
  flex-shrink: 0;
}

/* Page content */
.content {
  flex: 1;
  padding: 28px;
  max-width: 1400px;
  min-width: 0;
  width: 100%;
  overflow-x: hidden;
}

/* ============================================================
   COMPONENTES
   ============================================================ */

/* Page header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title i { color: var(--primary); font-size: 1.3rem; }

.page-subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 2px;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition);
}

.card:hover { border-color: var(--border-strong); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--divider);
}

.card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title i { color: var(--primary); }

/* Stat cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--primary);
  opacity: 0;
  transition: opacity var(--transition);
}

.stat-card:hover { border-color: var(--border-strong); }
.stat-card:hover::before { opacity: 1; }

.stat-card.green::before  { background: var(--accent-green); }
.stat-card.yellow::before { background: var(--accent-yellow); }
.stat-card.red::before    { background: var(--accent-red); }
.stat-card.purple::before { background: var(--accent-purple); }

.stat-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--primary-dim);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}

.stat-icon i { color: var(--primary); font-size: 1rem; }
.stat-card.green  .stat-icon { background: rgba(0,229,160,0.12); }
.stat-card.green  .stat-icon i { color: var(--accent-green); }
.stat-card.yellow .stat-icon { background: rgba(255,183,0,0.12); }
.stat-card.yellow .stat-icon i { color: var(--accent-yellow); }
.stat-card.red    .stat-icon { background: rgba(255,77,106,0.12); }
.stat-card.red    .stat-icon i { color: var(--accent-red); }
.stat-card.purple .stat-icon { background: rgba(168,85,247,0.12); }
.stat-card.purple .stat-icon i { color: var(--accent-purple); }

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

@media (max-width: 1100px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 800px)  { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.btn-primary {
  background: var(--primary);
  color: var(--text-inverse);
}
.btn-primary:hover { background: #00BBDD; box-shadow: 0 0 16px var(--primary-glow); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-dim); }

.btn-ghost {
  background: var(--bg-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text-primary); border-color: var(--border-strong); }

.btn-success { background: var(--accent-green); color: #051a12; }
.btn-success:hover { filter: brightness(1.1); }

.btn-danger { background: var(--accent-red); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }

.btn-warning { background: var(--accent-yellow); color: #1a1000; }
.btn-warning:hover { filter: brightness(1.1); }

.btn-sm { padding: 5px 11px; font-size: 0.75rem; }
.btn-lg { padding: 11px 22px; font-size: 0.9rem; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Forms */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

.form-control::placeholder { color: var(--text-muted); }

textarea.form-control { resize: vertical; min-height: 80px; }

select.form-control { cursor: pointer; }

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.855rem;
}

thead th {
  background: var(--bg-surface);
  padding: 11px 14px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr { border-bottom: 1px solid var(--divider); transition: background var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }

tbody td {
  padding: 11px 14px;
  color: var(--text-primary);
  vertical-align: middle;
}

.truncate {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

/* Badges / Status */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-identified { background: rgba(100,116,139,0.2); color: #94a3b8; }
.badge-screened   { background: rgba(255,183,0,0.15);  color: var(--accent-yellow); }
.badge-eligible   { background: rgba(0,212,255,0.15);  color: var(--primary); }
.badge-included   { background: rgba(0,229,160,0.15);  color: var(--accent-green); }
.badge-excluded   { background: rgba(255,77,106,0.15); color: var(--accent-red); }
.badge-pending    { background: rgba(255,183,0,0.15);  color: var(--accent-yellow); }
.badge-confirmed  { background: rgba(255,77,106,0.15); color: var(--accent-red); }
.badge-rejected   { background: rgba(100,116,139,0.2); color: #94a3b8; }
.badge-scopus     { background: rgba(255,100,50,0.15); color: #ff7a50; }
.badge-wos        { background: rgba(50,100,255,0.15); color: #6699ff; }
.badge-other      { background: rgba(150,150,150,0.1); color: #94a3b8; }

/* Alert/Notifications */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 0.855rem;
  border: 1px solid;
  margin-bottom: 16px;
}

.alert i { margin-top: 1px; flex-shrink: 0; }

.alert-info    { background: rgba(0,212,255,0.07); border-color: rgba(0,212,255,0.2); color: var(--primary); }
.alert-success { background: rgba(0,229,160,0.07); border-color: rgba(0,229,160,0.2); color: var(--accent-green); }
.alert-warning { background: rgba(255,183,0,0.07); border-color: rgba(255,183,0,0.2); color: var(--accent-yellow); }
.alert-error   { background: rgba(255,77,106,0.07); border-color: rgba(255,77,106,0.2); color: var(--accent-red); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  transform: translateY(20px);
  transition: transform 0.2s;
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--divider);
}

.modal-title { font-size: 1rem; font-weight: 700; }

.modal-body { padding: 22px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--divider);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
}

.tab-btn {
  padding: 9px 18px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.855rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition);
}

.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Progress bar */
.progress-bar {
  background: var(--bg-input);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--primary);
  transition: width 0.5s ease;
}

.progress-fill.green  { background: var(--accent-green); }
.progress-fill.yellow { background: var(--accent-yellow); }
.progress-fill.red    { background: var(--accent-red); }

/* Search and filters bar */
.filters-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.search-input {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.search-input i {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}

.search-input input {
  width: 100%;
  padding-left: 34px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 2.5rem;
  margin-bottom: 16px;
  opacity: 0.4;
  display: block;
}

.empty-state p { font-size: 0.95rem; margin-bottom: 6px; }
.empty-state small { font-size: 0.8rem; }

/* Loading spinner */
.spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: absolute; inset: 0;
  background: rgba(7,11,20,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  z-index: 10;
}

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-input);
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-dim);
}

.upload-zone i { font-size: 2rem; color: var(--primary); margin-bottom: 12px; display: block; }
.upload-zone p { color: var(--text-secondary); font-size: 0.9rem; }
.upload-zone small { color: var(--text-muted); font-size: 0.78rem; }

/* PRISMA Flow diagram */
.prisma-diagram { font-family: var(--font); }

.prisma-box {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 14px 18px;
  text-align: center;
  position: relative;
}

.prisma-box.section-identification { border-color: rgba(0,212,255,0.4); }
.prisma-box.section-screening      { border-color: rgba(255,183,0,0.4); }
.prisma-box.section-eligibility    { border-color: rgba(168,85,247,0.4); }
.prisma-box.section-included       { border-color: rgba(0,229,160,0.4); }

.prisma-box-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.prisma-box-count {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.prisma-box-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Charts container */
.chart-container {
  position: relative;
  min-height: 280px;
}

/* Article detail */
.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color var(--transition);
}

.article-card:hover { border-color: var(--border-strong); }

.article-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  align-items: center;
}

.article-meta i { color: var(--text-muted); }
.article-abstract {
  font-size: 0.855rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Screening navigation */
.screening-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--divider);
  margin-bottom: 20px;
}

.screening-counter {
  font-size: 0.855rem;
  color: var(--text-secondary);
}

.screening-progress {
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 600;
}

/* Decision buttons */
.decision-bar {
  display: flex;
  gap: 10px;
  align-items: stretch;
  padding: 16px 0;
}

.decision-bar .btn { flex: 1; justify-content: center; }

/* Keyword chips */
.keyword-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chip {
  background: var(--primary-dim);
  border: 1px solid rgba(0,212,255,0.2);
  color: var(--primary);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 500;
}

.chip.green  { background: rgba(0,229,160,0.1);  border-color: rgba(0,229,160,0.2);  color: var(--accent-green); }
.chip.purple { background: rgba(168,85,247,0.1); border-color: rgba(168,85,247,0.2); color: var(--accent-purple); }

/* Toast notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.855rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 380px;
  box-shadow: var(--shadow);
  animation: slideInRight 0.3s ease forwards;
}

.toast.success { border-left: 3px solid var(--accent-green); }
.toast.success i { color: var(--accent-green); }
.toast.error   { border-left: 3px solid var(--accent-red); }
.toast.error   i { color: var(--accent-red); }
.toast.info    { border-left: 3px solid var(--primary); }
.toast.info    i { color: var(--primary); }
.toast.warning { border-left: 3px solid var(--accent-yellow); }
.toast.warning i { color: var(--accent-yellow); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);   opacity: 1; }
}

/* Network/vis.js override */
.vis-network canvas { outline: none; }

/* Utilities */
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.items-center{ align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2       { gap: 8px; }
.gap-3       { gap: 12px; }
.gap-4       { gap: 16px; }
.mt-1        { margin-top: 6px; }
.mt-2        { margin-top: 12px; }
.mt-3        { margin-top: 18px; }
.mb-1        { margin-bottom: 6px; }
.mb-2        { margin-bottom: 12px; }
.mb-3        { margin-bottom: 18px; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-primary-color { color: var(--primary); }
.text-success{ color: var(--accent-green); }
.text-danger { color: var(--accent-red); }
.text-warning{ color: var(--accent-yellow); }
.font-bold   { font-weight: 700; }
.font-medium { font-weight: 500; }
.text-sm     { font-size: 0.855rem; }
.text-xs     { font-size: 0.75rem; }
.text-lg     { font-size: 1.1rem; }
.w-full      { width: 100%; }
.hidden      { display: none !important; }
.relative    { position: relative; }

/* Divider */
hr.divider {
  border: none;
  border-top: 1px solid var(--divider);
  margin: 20px 0;
}

/* Responsive */
@media (max-width: 768px) {
  body.sidebar-open {
    overflow: hidden;
  }
  .sidebar {
    max-width: min(86vw, var(--sidebar-w));
    box-shadow: 0 18px 48px rgba(0,0,0,0.4);
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar.open + .sidebar-backdrop {
    display: block;
    opacity: 1;
    visibility: visible;
  }
  .main {
    margin-left: 0;
  }
  .header {
    height: auto;
    min-height: var(--header-h);
    padding: 10px 16px;
    align-items: center;
    flex-wrap: wrap;
  }
  #sidebar-toggle {
    display: inline-flex;
  }
  .header-title {
    flex: 1 1 0;
    font-size: 0.95rem;
  }
  .header-actions {
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 8px;
    padding-top: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .header-actions::-webkit-scrollbar {
    display: none;
  }
  .header-actions .btn,
  .header-actions .badge,
  .header-actions .gtranslate_wrapper {
    flex: 0 0 auto;
  }
  .content {
    padding: 16px;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .header {
    padding: 0 14px;
    gap: 10px;
  }

  .content {
    padding: 14px;
  }

  .header-project-context,
  .header-separator {
    display: none;
  }

  .header-title {
    font-size: 0.92rem;
  }

  .header-actions {
    display: flex;
    align-items: center;
  }

  .gtranslate_wrapper {
    min-width: 0;
  }

  .page-header {
    gap: 12px;
  }

  .page-title {
    font-size: 1.25rem;
  }

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

  .card {
    padding: 16px;
  }

  .btn {
    white-space: normal;
    text-align: center;
  }
}
