/* ================================================================
   ScholarPress — Complete CSS (Dark + Light Mode)
   ================================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --accent:   #4f8ef7;
  --accent2:  #a78bfa;
  --accent3:  #34d399;
  --warning:  #f59e0b;
  --danger:   #ef4444;
  --success:  #22c55e;
  --info:     #38bdf8;
  --radius:   10px;
  --radius-lg:14px;
  --shadow:   0 2px 12px rgba(0,0,0,.18);
  --shadow-lg:0 8px 32px rgba(0,0,0,.28);
  --trans:    all .2s ease;
}

/* ── DARK MODE (default) ─────────────────────────────────────── */
[data-theme="dark"], body.dark {
  --bg:       #0a0d14;
  --bg2:      #0f1320;
  --bg3:      #141929;
  --surface:  #1a2035;
  --surface2: #1e2640;
  --border:   rgba(255,255,255,.07);
  --border2:  rgba(255,255,255,.12);
  --text:     #e8eaf0;
  --text2:    #9ba3b8;
  --text3:    #5a6480;
  --sidebar-bg:        #1a2035;
  --sidebar-border:    rgba(255,255,255,.07);
  --sidebar-text:      #e8eaf0;
  --sidebar-text2:     #9ba3b8;
  --sidebar-text3:     #5a6480;
  --sidebar-hover:     rgba(255,255,255,.04);
  --sidebar-active-bg: rgba(79,142,247,.12);
  --topbar-bg:   rgba(10,13,20,.9);
  --card-bg:     #0f1320;
  --input-bg:    #0a0d14;
  --hover-bg:    rgba(255,255,255,.04);
  --scrollbar:   #1e2640;
}

/* ── LIGHT MODE ─────────────────────────────────────────────── */
[data-theme="light"], body.light {
  --bg:       #f0f4fa;
  --bg2:      #ffffff;
  --bg3:      #f5f7fc;
  --surface:  #eef1f8;
  --surface2: #e8ecf5;
  --border:   rgba(0,0,0,.08);
  --border2:  rgba(0,0,0,.14);
  --text:     #1a2035;
  --text2:    #4a5568;
  --text3:    #8899aa;
  --sidebar-bg:        #ffffff;
  --sidebar-border:    rgba(0,0,0,.08);
  --sidebar-text:      #1a2035;
  --sidebar-text2:     #4a5568;
  --sidebar-text3:     #8899aa;
  --sidebar-hover:     rgba(79,142,247,.06);
  --sidebar-active-bg: rgba(79,142,247,.10);
  --topbar-bg:   rgba(240,244,250,.92);
  --card-bg:     #ffffff;
  --input-bg:    #f5f7fc;
  --hover-bg:    rgba(0,0,0,.04);
  --scrollbar:   #dde3ef;
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  font-size: 14px;
  line-height: 1.5;
  transition: background .25s, color .25s;
}
a { color: var(--accent); text-decoration: none; transition: var(--trans); }
a:hover { opacity: .85; }
img { max-width: 100%; }
::selection { background: rgba(79,142,247,.3); }

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 10px; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border, var(--border));
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .3s ease, background .3s, border-color .3s;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--sidebar-border, var(--border));
  flex-shrink: 0;
}
.logo-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff; flex-shrink: 0;
}
.logo-text { font-family: 'Playfair Display', serif; font-size: 15px; font-weight: 700; color: #fff; line-height: 1.1; }
.logo-sub  { font-size: 9.5px; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; }

[data-theme="light"] .logo-text,
body.light .logo-text { color: #1a2035; }

.sidebar-nav { flex: 1; padding: 10px 0; }
.nav-section { padding: 6px 0; }
.nav-label {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--sidebar-text3, var(--text3)); padding: 8px 18px 4px;
  display: block;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 18px; font-size: 13px; font-weight: 500;
  color: var(--sidebar-text2, var(--text2)); border-radius: 0;
  position: relative; transition: var(--trans);
}
.nav-item:hover { color: var(--sidebar-text, var(--text)); background: var(--sidebar-hover, var(--hover-bg)); }
.nav-item.active {
  color: var(--accent);
  background: var(--sidebar-active-bg, rgba(79,142,247,.12));
  font-weight: 600;
}
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--accent); border-radius: 0 3px 3px 0;
}
.nav-icon { width: 16px; text-align: center; font-size: 13px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 10px; min-width: 18px; text-align: center;
}

/* Sidebar footer */
.sidebar-footer {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--sidebar-border, var(--border));
  flex-shrink: 0;
  background: var(--sidebar-bg);
}
.u-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.u-info { flex: 1; min-width: 0; }
.u-name { font-size: 12.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-role { font-size: 10.5px; color: var(--text3); }
[data-theme="light"] .u-name, body.light .u-name { color: #1a2035; }
[data-theme="light"] .u-role, body.light .u-role { color: #4a5568; }
[data-theme="light"] .logo-sub, body.light .logo-sub { color: rgba(255,255,255,.6); }
.btn-logout {
  width: 28px; height: 28px; border-radius: 7px;
  background: rgba(239,68,68,.15); color: var(--danger);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0; transition: var(--trans);
}

/* ── SIDEBAR THEME OVERRIDES ─────────────────────────────────── */
[data-theme="light"] .sidebar,
body.light .sidebar {
  background: #ffffff !important;
  border-right: 1px solid rgba(0,0,0,.09) !important;
}
[data-theme="light"] .sidebar-footer,
body.light .sidebar-footer {
  background: #f5f7fc !important;
  border-top: 1px solid rgba(0,0,0,.08) !important;
}
[data-theme="light"] .sidebar-logo,
body.light .sidebar-logo {
  border-bottom: 1px solid rgba(0,0,0,.08) !important;
}
[data-theme="light"] .nav-label,
body.light .nav-label {
  color: #8899aa !important;
}
[data-theme="light"] .nav-item,
body.light .nav-item {
  color: #4a5568 !important;
}
[data-theme="light"] .nav-item:hover,
body.light .nav-item:hover {
  color: #1a2035 !important;
  background: rgba(79,142,247,.07) !important;
}
[data-theme="light"] .nav-item.active,
body.light .nav-item.active {
  color: var(--accent) !important;
  background: rgba(79,142,247,.10) !important;
}
[data-theme="light"] .logo-text,
body.light .logo-text {
  color: #1a2035 !important;
}
[data-theme="light"] .logo-sub,
body.light .logo-sub {
  color: #8899aa !important;
}
[data-theme="light"] .u-name,
body.light .u-name {
  color: #1a2035 !important;
}
[data-theme="light"] .u-role,
body.light .u-role {
  color: #6b7a99 !important;
}
[data-theme="dark"] .sidebar,
body.dark .sidebar {
  background: #1a2035 !important;
  border-right: 1px solid rgba(255,255,255,.07) !important;
}
[data-theme="dark"] .nav-item,
body.dark .nav-item {
  color: #9ba3b8;
}
[data-theme="dark"] .nav-item:hover,
body.dark .nav-item:hover {
  color: #e8eaf0;
  background: rgba(255,255,255,.04);
}
.btn-logout:hover { background: rgba(239,68,68,.28); opacity: 1; }

/* ── Main layout ──────────────────────────────────────────────── */
.main { margin-left: 240px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

/* ── Topbar ────────────────────────────────────────────────────── */
.topbar {
  height: 56px; display: flex; align-items: center; gap: 12px;
  padding: 0 22px;
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  transition: background .25s;
}
.topbar-title { font-size: 15px; font-weight: 600; color: var(--text); flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px;
  background: transparent; border: none; cursor: pointer;
  color: var(--text2); font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--trans); position: relative;
}
.icon-btn:hover { background: var(--hover-bg); color: var(--text); }

/* Theme toggle button */
.theme-toggle {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; color: var(--text2); font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--trans);
}
.theme-toggle:hover { background: var(--surface2); color: var(--text); }

.badge-dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger); border: 2px solid var(--bg2);
}

/* ── Content ────────────────────────────────────────────────── */
.content { padding: 22px; flex: 1; max-width: 1400px; width: 100%; }

/* ── Page header ─────────────────────────────────────────────── */
.page-header { margin-bottom: 20px; }
.page-header h1 { font-family: 'Playfair Display', serif; font-size: 24px; font-weight: 700; color: var(--text); line-height: 1.2; }
.page-header p  { font-size: 13px; color: var(--text2); margin-top: 3px; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: background .25s, border-color .25s;
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; gap: 10px; }
.card-title  { font-size: 14px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.card-sub    { font-size: 12px; color: var(--text3); margin-top: 2px; }

/* ── Stats grid ──────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 14px; }
.stat-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
  display: flex; align-items: center; gap: 14px;
  transition: var(--trans);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon {
  width: 44px; height: 44px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.si-blue   { background: rgba(79,142,247,.15);  color: var(--accent);  }
.si-purple { background: rgba(167,139,250,.15); color: var(--accent2); }
.si-green  { background: rgba(34,197,94,.15);   color: var(--success); }
.si-orange { background: rgba(245,158,11,.15);  color: var(--warning); }
.si-red    { background: rgba(239,68,68,.15);   color: var(--danger);  }
.si-info   { background: rgba(56,189,248,.15);  color: var(--info);    }
.si-teal   { background: rgba(52,211,153,.15);  color: var(--accent3); }
.stat-val  { font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-lbl  { font-size: 12px; color: var(--text2); margin-top: 3px; }
.stat-sub  { font-size: 11px; color: var(--accent3); margin-top: 2px; }

/* ── Grid helpers ────────────────────────────────────────────── */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
.f-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.flex  { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-3  { margin-top: 12px; }
.mb-3  { margin-bottom: 12px; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  border: none; font-family: inherit;
  text-decoration: none; transition: var(--trans);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); opacity: 1; }
.btn:active { transform: translateY(0); }
.btn-primary  { background: var(--accent); color: #fff; }
.btn-success  { background: var(--success); color: #fff; }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-warning  { background: var(--warning); color: #fff; }
.btn-info     { background: var(--info); color: #fff; }
.btn-secondary{ background: var(--surface); color: var(--text); border: 1px solid var(--border2); }
.btn-outline  { background: transparent; color: var(--text2); border: 1px solid var(--border2); }
.btn-outline:hover { background: var(--hover-bg); }
.btn-sm   { padding: 5px 11px; font-size: 12px; }
.btn-lg   { padding: 11px 24px; font-size: 15px; }
.btn-block{ width: 100%; justify-content: center; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text2); margin-bottom: 5px; }
.form-control {
  width: 100%; padding: 9px 12px;
  background: var(--input-bg); border: 1px solid var(--border2);
  border-radius: 8px; color: var(--text); font-size: 13.5px;
  font-family: inherit; outline: none;
  transition: border-color .2s, box-shadow .2s, background .25s;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,142,247,.12); }
.form-control:disabled { opacity: .5; cursor: not-allowed; }
.form-hint  { font-size: 11.5px; color: var(--text3); margin-top: 4px; }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }
.req { color: var(--danger); margin-left: 2px; }

/* ── Tables ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text3); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text2); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--hover-bg); color: var(--text); }
td b, td b a { color: var(--text); font-weight: 600; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-primary   { background: rgba(79,142,247,.15);  color: var(--accent);  }
.badge-success   { background: rgba(34,197,94,.15);   color: var(--success); }
.badge-danger    { background: rgba(239,68,68,.15);   color: var(--danger);  }
.badge-warning   { background: rgba(245,158,11,.15);  color: var(--warning); }
.badge-info      { background: rgba(56,189,248,.15);  color: var(--info);    }
.badge-secondary { background: var(--surface); color: var(--text2); border: 1px solid var(--border2); }
.badge-purple    { background: rgba(167,139,250,.15); color: var(--accent2); }

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
  padding: 12px 15px; border-radius: var(--radius);
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13.5px; margin-bottom: 16px;
}
.alert-success { background: rgba(34,197,94,.1);   color: #4ade80; border: 1px solid rgba(34,197,94,.2);  }
.alert-danger  { background: rgba(239,68,68,.1);   color: #f87171; border: 1px solid rgba(239,68,68,.2);  }
.alert-warning { background: rgba(245,158,11,.1);  color: #fbbf24; border: 1px solid rgba(245,158,11,.2); }
.alert-info    { background: rgba(56,189,248,.1);  color: #38bdf8; border: 1px solid rgba(56,189,248,.2); }

[data-theme="light"] .alert-success { color: #16a34a; }
[data-theme="light"] .alert-danger  { color: #dc2626; }
[data-theme="light"] .alert-warning { color: #d97706; }
[data-theme="light"] .alert-info    { color: #0284c7; }

/* ── Dropdown ────────────────────────────────────────────────── */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius-lg); min-width: 180px;
  box-shadow: var(--shadow-lg); z-index: 200;
  display: none; overflow: hidden;
}
.dropdown-menu.show { display: block; animation: fadeIn .15s ease; }
.dd-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 14px; font-size: 13px; color: var(--text2);
  transition: var(--trans); cursor: pointer;
}
.dd-item:hover { background: var(--hover-bg); color: var(--text); }
.dd-item.dng { color: var(--danger); }
.dd-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Tabs ────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 8px 16px; font-size: 13px; font-weight: 500; color: var(--text2); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; transition: var(--trans); }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.show { display: flex; animation: fadeIn .2s; }
.modal {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius-lg); padding: 24px;
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
}
.modal-title { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 18px; }

/* ── Pagination ──────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: 4px; padding: 14px; justify-content: center; }
.pagination a, .pagination .pg-cur {
  width: 32px; height: 32px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; transition: var(--trans);
}
.pagination a { color: var(--text2); background: var(--surface); border: 1px solid var(--border); }
.pagination a:hover { background: var(--hover-bg); color: var(--text); }
.pagination .pg-cur { background: var(--accent); color: #fff; font-weight: 600; }

/* ── Misc helpers ────────────────────────────────────────────── */
.text-sm   { font-size: 12.5px; }
.text-xs   { font-size: 11.5px; }
.text-muted{ color: var(--text3); }
.mono      { font-family: 'JetBrains Mono', monospace; }
.divider   { height: 1px; background: var(--border); margin: 14px 0; }
.empty { padding: 40px 20px; text-align: center; }
.empty i   { font-size: 36px; color: var(--text3); display: block; margin-bottom: 12px; }
.empty h3  { font-size: 15px; color: var(--text2); margin-bottom: 5px; }
.empty p   { font-size: 13px; color: var(--text3); }
.avatar-sm { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg,var(--accent),var(--accent2)); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0; }
.avatar-md { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg,var(--accent),var(--accent2)); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: #fff; flex-shrink: 0; }

/* ── OJS-style status steps ──────────────────────────────────── */
.workflow-steps {
  display: flex; align-items: center; gap: 0;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  margin-bottom: 18px;
}
.wf-step {
  flex: 1; padding: 10px 8px; text-align: center;
  font-size: 11px; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: .5px;
  background: var(--card-bg); border-right: 1px solid var(--border);
  position: relative; transition: var(--trans);
}
.wf-step:last-child { border-right: none; }
.wf-step.done  { background: rgba(34,197,94,.08);  color: var(--success); }
.wf-step.active{ background: rgba(79,142,247,.12); color: var(--accent);  font-weight: 700; }
.wf-step i { display: block; font-size: 14px; margin-bottom: 3px; }

/* ── Animations ──────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
.fade-in { animation: fadeIn .25s ease; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main { margin-left: 0; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .f-row { grid-template-columns: 1fr; }
  .workflow-steps { flex-wrap: wrap; }
}
@media (max-width: 500px) {
  .stats-grid { grid-template-columns: 1fr; }
  .content { padding: 14px; }
}