/* Plenaria — Academic Conference Management
   (C) 2026+ C-MRiC | https://www.c-mric.com

   Plenaria palette, drawn from the arc-P logo mark: the deep purple of
   the stem and upper bowl (#4A2C82), the lavender of the lower bowl
   (#B3A0D6) and the paler lavender of the signal lines (#C9BEE0). The
   crimson accent (#E2001A) and the Poppins typeface carry over from the
   parent C-MRiC identity.
   ─────────────────────────────────────────── */

:root {
  /* Plenaria brand */
  --brand-purple:   #4a2c82;
  --brand-lavender: #b3a0d6;
  --brand-signal:   #c9bee0;

  --sidebar-bg:     #2a1950;
  --sidebar-hover:  #3a2568;
  --sidebar-active: #4a2c82;
  --sidebar-text:   #d5cbea;
  --sidebar-muted:  #9a8cc0;
  --sidebar-width:  260px;
  --topbar-h:       60px;
  --accent:         #4a2c82;
  --accent-dark:    #3a2266;
  --accent-light:   #efeaf8;
  --accent-red:     #e2001a;
  --border:         #e3dfec;
  --card-shadow:    0 2px 8px rgba(42,25,80,.10);
}

/* Bootstrap 5.3 reads its component colors from these CSS variables,
   so overriding them here re-themes .btn-primary/.text-primary/
   .bg-primary/links etc. without needing a custom Bootstrap build. */
:root {
  --bs-primary:            var(--accent);
  --bs-primary-rgb:        74, 44, 130;
  --bs-link-color:         var(--accent);
  --bs-link-color-rgb:     74, 44, 130;
  --bs-link-hover-color:   var(--accent-dark);
  --bs-link-hover-color-rgb: 58, 34, 102;
}
.btn-primary {
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: var(--accent-dark);
  --bs-btn-hover-border-color: var(--accent-dark);
  --bs-btn-active-bg: var(--accent-dark);
  --bs-btn-active-border-color: var(--accent-dark);
}

/* ── Layout ── */
body {
  background: #f6f5fa;
  font-family: 'Poppins', -apple-system, 'Segoe UI', system-ui, sans-serif;
}

.wrapper { display:flex; min-height:100vh; }

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

#sidebar .sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  text-decoration: none;
}
/* Uses the reversed mark — the counter is punched out, so the sidebar
   background shows through it rather than a white disc. The mark's own
   viewBox carries ~9/96 padding per side, so the box is sized larger than
   the ink you actually see. */
#sidebar .sidebar-brand .brand-mark {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  margin-left: -4px;          /* pull the glyph's built-in padding back to the edge */
}
#sidebar .sidebar-brand .brand-logo {
  font-size: 1.55rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -.7px;
  line-height: 1.1;
}
#sidebar .sidebar-brand .brand-sub {
  font-size: .66rem;
  color: var(--sidebar-muted);
  letter-spacing: .6px;
  line-height: 1.25;          /* the descriptor wraps to two lines at 260px */
  text-transform: uppercase;
  margin-top: 1px;
}

#sidebar .conf-selector {
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
#sidebar .conf-selector select {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  color: #fff;
  font-size: .82rem;
  border-radius: 6px;
  padding: 6px 10px;
}
#sidebar .conf-selector select option { background: var(--sidebar-bg); }

#sidebar .nav-section {
  padding: 14px 20px 4px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
}

#sidebar .nav-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 6px;
  padding: 10px 20px 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  transition: color .15s;
}
#sidebar .nav-section-toggle:hover { color: var(--sidebar-text); }
#sidebar .nav-section-toggle .nav-caret {
  font-size: .62rem;
  transition: transform .2s ease;
}
#sidebar .nav-section-toggle.collapsed .nav-caret { transform: rotate(-90deg); }

#sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: .88rem;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
#sidebar .nav-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
  border-left-color: rgba(255,255,255,.3);
}
#sidebar .nav-link.active {
  background: var(--sidebar-active);
  color: #fff;
  border-left-color: var(--accent-red);
  font-weight: 600;
}
#sidebar .nav-link .nav-icon { width: 18px; text-align: center; opacity: .85; }
#sidebar .nav-link .badge-pill {
  margin-left: auto;
  font-size: .7rem;
  padding: 2px 7px;
  border-radius: 50px;
  background: rgba(255,255,255,.2);
}

#sidebar .sidebar-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: .75rem;
  color: var(--sidebar-muted);
}

/* ── 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;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1040;
  gap: 12px;
}
#topbar .topbar-title {
  font-weight: 600;
  font-size: .95rem;
  color: #2c3e50;
  flex: 1;
}
#topbar .user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  color: #555;
}
#topbar .user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
}

/* ── Page area ── */
.page-body { padding: 28px 28px 60px; flex: 1; }

/* ── Cards ── */
.card {
  border: none;
  box-shadow: var(--card-shadow);
  border-radius: 10px;
}
.card-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: .9rem;
  border-radius: 10px 10px 0 0 !important;
}

/* ── Stat cards ── */
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 18px;
}
.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-icon.blue   { background: #dbeafe; color: #1d4ed8; }
.stat-icon.green  { background: #dcfce7; color: #16a34a; }
.stat-icon.red    { background: #fee2e2; color: #dc2626; }
.stat-icon.yellow { background: #fef3c7; color: #d97706; }
.stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.stat-icon.teal   { background: #ccfbf1; color: #0d9488; }
.stat-value { font-size: 1.8rem; font-weight: 700; color: #1e293b; line-height:1; }
.stat-label { font-size: .8rem; color: #64748b; margin-top: 4px; }

/* ── Badges / status ── */
.badge-submitted     { background: #dbeafe; color: #1d4ed8; }
.badge-under_review  { background: #fef3c7; color: #b45309; }
.badge-accepted      { background: #dcfce7; color: #15803d; }
.badge-rejected      { background: #fee2e2; color: #b91c1c; }
.badge-revision      { background: #fce7f3; color: #9d174d; }
.badge-withdrawn     { background: #f1f5f9; color: #64748b; }

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: capitalize;
}

/* ── Tables ── */
.table-cmric th {
  background: #f8fafc;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #64748b;
  border-bottom: 2px solid var(--border);
}
.table-cmric td { vertical-align: middle; font-size: .88rem; }
.table-cmric tbody tr:hover { background: #f8fafc; }

/* ── Forms ── */
.form-section-title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #94a3b8;
  margin: 20px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e2e8f0;
}

/* ── Score sliders ── */
.score-row { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.score-label { width: 160px; font-size: .85rem; color: #374151; flex-shrink: 0; }
.score-row input[type=range] { flex: 1; accent-color: var(--accent); }
.score-display {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  flex-shrink: 0;
}

/* ── COI indicator ── */
.coi-warning  { color: #dc2626; }
.coi-ok       { color: #16a34a; }
.coi-row      { background: #fff5f5 !important; }

/* ── Conflict tag ── */
.conflict-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .72rem;
  background: #fee2e2;
  color: #b91c1c;
  margin: 2px;
}

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header h1 { font-size: 1.4rem; font-weight: 700; color: #1e293b; margin: 0; }

/* ── Auth pages ── */
.auth-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--sidebar-bg) 0%, var(--accent) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  padding: 40px 44px;
  width: 100%;
  max-width: 480px;
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo .logo-mark {
  width: 76px;
  height: 76px;
  margin-bottom: 8px;         /* the mark's own padding supplies the rest */
}
.auth-logo .logo-text {
  font-size: 2.1rem;
  font-weight: 600;
  color: var(--brand-purple);
  letter-spacing: -1px;
  line-height: 1.1;
}
.auth-logo .logo-sub {
  font-size: .72rem;
  color: #6b5a94;
  letter-spacing: .8px;
  text-transform: uppercase;
  margin-top: 3px;
}
.auth-logo .logo-org {
  font-size: .7rem;
  color: #9689b8;
  margin-top: 8px;
  line-height: 1.35;
}

/* ── Standalone document pages (FAQ, Terms) ── */
.doc-mark {
  width: 64px;
  height: 64px;
  margin-bottom: 4px;         /* the mark's own padding supplies the rest */
}

/* ── Expertise checkboxes ── */
.expertise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}
.expertise-grid .form-check-label { font-size: .85rem; }

/* ── Analytics charts ── */
.chart-card { height: 300px; }

/* ── Program layout ── */
.program-session {
  border-left: 4px solid var(--accent);
  padding: 12px 16px;
  margin-bottom: 16px;
  background: #fff;
  border-radius: 0 8px 8px 0;
  box-shadow: var(--card-shadow);
}
.program-paper {
  padding: 10px 0;
  border-bottom: 1px dashed #e2e8f0;
}
.program-paper:last-child { border-bottom: none; }

/* ── Responsive ── */
@media (max-width: 768px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); }
  #main-content { margin-left: 0; }
  .page-body { padding: 16px; }
}

/* ── Utilities ── */
.text-muted-sm { font-size: .78rem; color: #94a3b8; }
.divider-sm { border-color: #e2e8f0; margin: 16px 0; }
.btn-cmric {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 20px;
  font-size: .88rem;
  font-weight: 600;
  transition: background .15s;
}
.btn-cmric:hover { background: var(--accent-dark); color: #fff; }
.btn-cmric-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  padding: 7px 18px;
  font-size: .88rem;
  font-weight: 600;
}

/* ── Invite link box ── */
.invite-link-box {
  background: #f0f4f8;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 14px;
  font-family: monospace;
  font-size: .82rem;
  word-break: break-all;
}

/* Footer */
.main-footer {
  padding: 16px 28px;
  font-size: .75rem;
  color: #94a3b8;
  border-top: 1px solid var(--border);
  background: #fff;
}
