/* ── CLN2026 Admin Dashboard – Custom CSS ─────────────────────────────────── */
/* Copyright (c) 2026 Flavio Abreu Araujo <flavio.abreuaraujo@uclouvain.be>   */
/* SPDX-License-Identifier: MIT                                               */

:root {
  --sidebar-bg:      #0f2040;
  --sidebar-accent:  #1B4F8E;
  --sidebar-text:    #c8d8f0;
  --sidebar-hover:   rgba(255,255,255,.08);
  --sidebar-active:  rgba(255,255,255,.14);
  --sidebar-width:   240px;
  --topbar-h:        60px;
  --body-bg:         #f0f4f9;
  --card-bg:         #ffffff;
  --primary:         #1B4F8E;
  --primary-light:   #2d6ecf;
  --success:         #10b981;
  --warning:         #f59e0b;
  --danger:          #ef4444;
  --info:            #0891b2;
  --text-muted:      #64748b;
  --border:          #e2e8f0;
}

/* ── Reset / Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--body-bg);
  color: #1e293b;
  font-size: 14px;
}

/* ── Layout wrapper ───────────────────────────────────────────────────────── */
.app-wrapper { display: flex; min-height: 100vh; }

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1000;
  transition: width .25s ease;
}

.sidebar-brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-brand .brand-text { min-width: 0; }
.sidebar-brand .brand-name {
  font-size: 18px; font-weight: 700; color: #fff;
  white-space: nowrap;
}
.sidebar-brand .brand-sub {
  font-size: 10px; color: var(--sidebar-text); opacity: .7;
  white-space: nowrap;
}
.sidebar-logo {
  width: 38px; height: 38px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.35));
}

.sidebar-section {
  padding: 20px 0 0;
  flex: 1;
}
.sidebar-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1.2px;
  color: rgba(255,255,255,.35); text-transform: uppercase;
  padding: 0 20px 6px;
  margin-top: 10px;
}
.sidebar-nav { list-style: none; margin: 0; padding: 0; }
.sidebar-nav li a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 0;
  font-size: 13.5px;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.sidebar-nav li a .nav-icon {
  font-size: 18px; width: 22px; text-align: center; flex-shrink: 0;
}
.sidebar-nav li a:hover {
  background: var(--sidebar-hover);
  color: #fff;
}
.sidebar-nav li.active a {
  background: var(--sidebar-active);
  color: #fff;
  border-left: 3px solid #4f9cf9;
}
.sidebar-badge {
  margin-left: auto;
  background: var(--primary-light);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-footer a {
  display: flex; align-items: center; gap: 10px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13px;
  opacity: .8;
}
.sidebar-footer a:hover { opacity: 1; color: #fff; }

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

/* ── Topbar ───────────────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-title { font-size: 17px; font-weight: 700; color: #1e293b; }
.topbar-right { display: flex; align-items: center; gap: 16px; }

/* ── Page content ─────────────────────────────────────────────────────────── */
.page-content { padding: 28px; flex: 1; }
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.page-header h2 { margin: 0; font-size: 22px; font-weight: 700; }
.page-header-sub { color: var(--text-muted); font-size: 13px; }

/* ── Stat cards ───────────────────────────────────────────────────────────── */
.stat-card {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 1px 6px rgba(0,0,0,.07);
  display: flex;
  align-items: center;
  gap: 18px;
  border: 1px solid var(--border);
  transition: box-shadow .2s;
}
.stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.11); }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
}
.stat-icon.blue   { background: rgba(27,79,142,.12); color: var(--primary); }
.stat-icon.green  { background: rgba(16,185,129,.12); color: var(--success); }
.stat-icon.amber  { background: rgba(245,158,11,.12); color: var(--warning); }
.stat-icon.red    { background: rgba(239,68,68,.12);  color: var(--danger); }
.stat-icon.cyan   { background: rgba(8,145,178,.12);  color: var(--info); }
.stat-icon.purple { background: rgba(124,58,237,.12); color: #7c3aed; }

.stat-info .stat-value {
  font-size: 30px; font-weight: 800; line-height: 1;
  color: #0f172a;
}
.stat-info .stat-label {
  font-size: 12px; color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}
.stat-info .stat-delta {
  font-size: 11px; margin-top: 3px;
  display: flex; align-items: center; gap: 3px;
}
.stat-delta.up   { color: var(--success); }
.stat-delta.down { color: var(--danger); }

/* ── Generic card ─────────────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
  overflow: hidden;
}
.card-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: #fff;
}
.card-header-title { font-size: 15px; font-weight: 700; margin: 0; }
.card-body { padding: 22px; }

/* ── Chart containers ─────────────────────────────────────────────────────── */
.chart-wrap { position: relative; }

/* ── Tables ───────────────────────────────────────────────────────────────── */
.table-modern { width: 100%; border-collapse: separate; border-spacing: 0; }
.table-modern thead th {
  background: #f8fafc;
  font-size: 11px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; color: var(--text-muted);
  padding: 12px 16px;
  border-bottom: 2px solid var(--border);
  position: sticky; top: 0;
  white-space: nowrap;
}
.table-modern tbody tr {
  transition: background .12s;
}
.table-modern tbody tr:hover { background: #f8faff; }
.table-modern tbody td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge-willing {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: .3px;
}
.badge-yes    { background: rgba(16,185,129,.15);  color: #059669; }
.badge-no     { background: rgba(239,68,68,.15);   color: #dc2626; }
.badge-maybe  { background: rgba(245,158,11,.15);  color: #d97706; }
.badge-none   { background: rgba(100,116,139,.12); color: var(--text-muted); }

.badge-type {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.badge-permanent { background: rgba(27,79,142,.12);  color: var(--primary); }
.badge-phd       { background: rgba(124,58,237,.12); color: #6d28d9; }
.badge-postdoc   { background: rgba(8,145,178,.12);  color: #0e7490; }
.badge-other     { background: rgba(100,116,139,.12);color: #475569; }

/* ── Timeline ─────────────────────────────────────────────────────────────── */
.event-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* ── Public register form ─────────────────────────────────────────────────── */
.public-page {
  min-height: 100vh;
  background: linear-gradient(145deg, #e8f0fe, #f0f4fc);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px;
}
.reg-card {
  max-width: 680px; width: 100%;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(0,0,0,.12);
  overflow: hidden;
}
.reg-header {
  background: linear-gradient(135deg, #0f2040 0%, #1B4F8E 60%, #2d6ecf 100%);
  padding: 40px 44px 32px;
  text-align: center;
  position: relative;
}
.reg-header::after {
  content: '';
  position: absolute; bottom: -1px; left: 0; right: 0;
  height: 32px;
  background: #fff;
  border-radius: 32px 32px 0 0;
}
.reg-header .conf-logo {
  font-size: 42px; font-weight: 900; color: #fff;
  letter-spacing: 2px; line-height: 1;
}
.reg-header .conf-sub {
  font-size: 14px; color: rgba(255,255,255,.8); margin-top: 6px;
}
.reg-header .conf-dates {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.15);
  border-radius: 30px;
  padding: 6px 20px;
  margin-top: 16px;
  font-size: 13px; color: #fff; font-weight: 600;
}
.reg-body { padding: 36px 44px 40px; }

.choice-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 12px; margin-bottom: 24px;
}
.choice-btn {
  cursor: pointer;
  padding: 16px 10px;
  border: 2px solid var(--border);
  border-radius: 12px;
  text-align: center;
  transition: all .2s;
  user-select: none;
}
.choice-btn input[type=radio] { display: none; }
.choice-btn .choice-icon { font-size: 28px; display: block; }
.choice-btn .choice-label { font-size: 13px; font-weight: 600; margin-top: 6px; display: block; }
.choice-btn:has(input:checked), .choice-btn.selected {
  border-color: var(--primary);
  background: rgba(27,79,142,.06);
}
.choice-btn.yes:has(input:checked)   { border-color: var(--success); background: rgba(16,185,129,.06); }
.choice-btn.no:has(input:checked)    { border-color: var(--danger);  background: rgba(239,68,68,.06); }
.choice-btn.maybe:has(input:checked) { border-color: var(--warning); background: rgba(245,158,11,.06); }

/* ── Login page ───────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(145deg, #0f2040, #1B4F8E, #2d6ecf);
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  width: 380px;
  background: #fff;
  border-radius: 20px;
  padding: 44px 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  text-align: center;
}
.login-logo {
  font-size: 36px; font-weight: 900; color: var(--primary);
  letter-spacing: 2px;
}
.login-sub { color: var(--text-muted); font-size: 13px; margin: 6px 0 28px; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn-primary-custom {
  background: linear-gradient(135deg, #1B4F8E, #2d6ecf);
  color: #fff; border: none;
  padding: 10px 22px; border-radius: 8px;
  font-weight: 600; font-size: 14px;
  cursor: pointer; transition: opacity .15s, transform .1s;
  text-decoration: none; display: inline-flex; align-items: center; gap: 7px;
}
.btn-primary-custom:hover { opacity: .9; color: #fff; transform: translateY(-1px); }
.btn-primary-custom:active { transform: none; }

/* ── Alerts ───────────────────────────────────────────────────────────────── */
.alert-float {
  position: fixed; top: 16px; right: 20px;
  z-index: 9999;
  min-width: 280px; max-width: 420px;
}

/* ── DataTable overrides ──────────────────────────────────────────────────── */
div.dataTables_wrapper { padding: 0; }
table.dataTable thead th { font-size: 11px !important; background: #f8fafc; }
div.dataTables_filter input { border-radius: 8px; border: 1px solid var(--border); padding: 5px 12px; }
div.dataTables_length select { border-radius: 6px; border: 1px solid var(--border); }

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { width: 0; overflow: hidden; }
  .main-content { margin-left: 0; }
  .choice-grid { grid-template-columns: 1fr; }
  .reg-body { padding: 24px 20px 28px; }
  .reg-header { padding: 28px 20px 22px; }
}

/* ── Misc utils ───────────────────────────────────────────────────────────── */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger)  !important; }
.text-warning { color: var(--warning) !important; }
.fw-700 { font-weight: 700; }
.fs-xs  { font-size: 11px; }
.fs-sm  { font-size: 12px; }
.rounded-card { border-radius: 14px; }
.shadow-soft { box-shadow: 0 2px 12px rgba(0,0,0,.08); }

/* email body textarea */
#body_html { font-family: monospace; font-size: 12.5px; }

/* campaign preview iframe */
.email-preview-frame {
  width: 100%; height: 480px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* participant status dot */
.status-dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 5px;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.app-footer {
  padding: 14px 32px 14px calc(var(--sidebar-width) + 32px);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid rgba(255,255,255,.06);
  opacity: .85;
}
.app-footer .footer-logo {
  height: 22px;
  width: auto;
  object-fit: contain;
  filter: brightness(0.85);
}
