/*
 * AWCN Plagiarism Checker — sidebar/header theme.
 * Adapted from the awcn_2 LMS theme for visual consistency across AWCN tools.
 * Link this AFTER bootstrap.min.css so these rules take precedence.
 */

:root {
  --lms-sidebar-w: 256px;
  --lms-header-h: 64px;

  --lms-primary: #1a3c5e;
  --lms-primary-light: #2563eb;
  --lms-accent: #f0a500;

  --lms-sb-bg: #111827;
  --lms-sb-hover: #1f2937;
  --lms-sb-active-bg: rgba(37, 99, 235, 0.18);
  --lms-sb-active-border: #3b82f6;
  --lms-sb-active-text: #93c5fd;
  --lms-sb-text: rgba(255, 255, 255, 0.55);
  --lms-sb-muted: rgba(255, 255, 255, 0.3);
  --lms-sb-border: rgba(255, 255, 255, 0.06);

  --lms-header-bg: #ffffff;
  --lms-border: #e2e8f0;
  --lms-bg: #f4f6f9;
  --lms-text: #1e293b;
  --lms-muted: #64748b;

  --lms-danger: rgba(239, 68, 68, 0.75);
  --lms-danger-hover: #ef4444;

  --lms-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --lms-shadow-md: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 24px -14px rgba(15, 23, 42, 0.16);
  --lms-shadow-lg: 0 20px 45px rgba(15, 23, 42, 0.12);
}

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background:
    radial-gradient(circle at 100% 0%, rgba(37, 99, 235, 0.05), transparent 40%),
    radial-gradient(circle at 0% 100%, rgba(240, 165, 0, 0.04), transparent 40%),
    var(--lms-bg);
  background-attachment: fixed;
}

.lms-main {
  margin-left: var(--lms-sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.25s ease;
}
.lms-main.collapsed {
  margin-left: 0;
}
.lms-content {
  padding: 28px 24px;
  flex: 1;
}

.lms-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 90;
}
.lms-overlay.active {
  display: block;
}

.lms-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--lms-sidebar-w);
  background: linear-gradient(180deg, #0d1420 0%, var(--lms-sb-bg) 45%, #0d1420 100%);
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.04), 6px 0 24px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.25s ease;
}
.lms-sidebar::-webkit-scrollbar {
  width: 6px;
}
.lms-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}
.lms-sidebar.hidden {
  transform: translateX(-100%);
}

.lms-brand {
  height: var(--lms-header-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  border-bottom: 1px solid var(--lms-sb-border);
  flex-shrink: 0;
}
.lms-brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.lms-brand-icon span {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
}
.lms-brand-text {
  display: flex;
  flex-direction: column;
}
.lms-brand-name {
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.lms-brand-sub {
  font-size: 10px;
  color: var(--lms-sb-muted);
  letter-spacing: 0.04em;
}

.lms-sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--lms-sb-border);
  flex-shrink: 0;
}
.lms-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f0a500, #f59e0b);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}
.lms-user-info {
  min-width: 0;
}
.lms-user-name {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lms-user-role {
  display: block;
  font-size: 10px;
  color: var(--lms-sb-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.lms-nav {
  flex: 1;
  padding: 8px 0;
}
.lms-nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lms-sb-muted);
  padding: 14px 20px 5px;
}
.lms-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--lms-sb-text);
  font-size: 13.5px;
  font-weight: 400;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s;
  position: relative;
  cursor: pointer;
}
.lms-nav-item:hover {
  background: var(--lms-sb-hover);
  color: #fff;
  text-decoration: none;
}
.lms-nav-item.active {
  background: linear-gradient(90deg, var(--lms-sb-active-bg), transparent);
  color: var(--lms-sb-active-text);
  border-left-color: var(--lms-sb-active-border);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.08);
  font-weight: 500;
}
.lms-nav-item--danger {
  color: var(--lms-danger) !important;
}
.lms-nav-item--danger:hover {
  color: var(--lms-danger-hover) !important;
}
.lms-nav-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.lms-nav-icon svg {
  width: 17px;
  height: 17px;
}
.lms-nav-label-text {
  flex: 1;
}

.lms-sidebar-footer {
  border-top: 1px solid var(--lms-sb-border);
  padding: 8px 0 12px;
}

.lms-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--lms-header-h);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--lms-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.lms-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.lms-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--lms-muted);
  white-space: nowrap;
}
.lms-breadcrumb-sep {
  opacity: 0.4;
}
.lms-breadcrumb-current {
  color: var(--lms-text);
  font-weight: 500;
}
.lms-header-right {
  display: flex;
  align-items: center;
  gap: 4px;
}
.lms-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--lms-muted);
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.lms-icon-btn:hover {
  background: var(--lms-bg);
  color: var(--lms-text);
}
.lms-divider {
  width: 1px;
  height: 22px;
  background: var(--lms-border);
  margin: 0 4px;
}

.lms-profile-wrap {
  position: relative;
}
.lms-profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border-radius: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s;
}
.lms-profile-btn:hover {
  background: var(--lms-bg);
}
.lms-profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1d4ed8, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}
.lms-profile-text {
  text-align: left;
}
.lms-profile-name {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--lms-text);
  line-height: 1.2;
  white-space: nowrap;
}
.lms-profile-role {
  display: block;
  font-size: 10.5px;
  color: var(--lms-muted);
}
.lms-chevron {
  color: var(--lms-muted);
  display: flex;
  align-items: center;
}

.lms-profile-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--lms-border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  z-index: 200;
  overflow: hidden;
  animation: lmsDropIn 0.15s ease;
}
.lms-profile-dropdown.open {
  display: block;
}
@keyframes lmsDropIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.lms-dropdown-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
}
.lms-dropdown-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1d4ed8, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}
.lms-dropdown-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--lms-text);
  margin: 0 0 2px;
}
.lms-dropdown-role {
  font-size: 11px;
  color: var(--lms-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}
.lms-dropdown-divider {
  height: 1px;
  background: var(--lms-border);
  margin: 0;
}
.lms-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13.5px;
  color: var(--lms-text);
  text-decoration: none;
  transition: background 0.12s;
}
.lms-dropdown-item:hover {
  background: var(--lms-bg);
  text-decoration: none;
}
.lms-dropdown-item--danger {
  color: #dc2626;
}
.lms-dropdown-item--danger:hover {
  background: #fef2f2;
}

@media (max-width: 991px) {
  .lms-sidebar {
    transform: translateX(-100%);
  }
  .lms-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.18);
  }
  .lms-main {
    margin-left: 0 !important;
  }
  .lms-breadcrumb {
    display: none;
  }
}
@media (max-width: 575px) {
  .lms-profile-text {
    display: none;
  }
  .lms-chevron {
    display: none;
  }
}

/* ── Content helpers (cards/tables/badges polish) ─────────────── */
.lms-card {
  background: #fff;
  border: 1px solid var(--lms-border);
  border-radius: 14px;
  box-shadow: var(--lms-shadow-md);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.lms-card:has(.lms-stat-icon):hover {
  box-shadow: var(--lms-shadow-lg);
  transform: translateY(-2px);
}
.lms-stat-label {
  font-size: 12.5px;
  color: var(--lms-muted);
  font-weight: 500;
}
.lms-stat-value {
  font-family: 'Sora', sans-serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--lms-text);
}
.lms-page-title {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  color: var(--lms-text);
  letter-spacing: -0.01em;
}

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  border-radius: 9px;
  font-weight: 500;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}
.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: #1d4ed8;
  box-shadow: 0 1px 2px rgba(29, 78, 216, 0.15), 0 8px 16px -8px rgba(29, 78, 216, 0.45);
}
.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(29, 78, 216, 0.18), 0 12px 20px -8px rgba(29, 78, 216, 0.5);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-outline-primary:hover,
.btn-outline-secondary:hover,
.btn-outline-danger:hover,
.btn-outline-warning:hover,
.btn-outline-success:hover {
  transform: translateY(-1px);
  box-shadow: var(--lms-shadow-sm);
}
.btn-sm {
  border-radius: 7px;
}

/* ── Badges (soft pill style) ────────────────────────────────────── */
.badge {
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 5px 10px;
  border-radius: 999px;
}
.badge.bg-success { background: #f0fdf4 !important; color: #15803d; border: 1px solid #bbf7d0; }
.badge.bg-danger { background: #fef2f2 !important; color: #b91c1c; border: 1px solid #fecaca; }
.badge.bg-warning { background: #fffbeb !important; color: #92400e; border: 1px solid #fde68a; }
.badge.bg-secondary { background: #f1f5f9 !important; color: #475569; border: 1px solid #e2e8f0; }
.badge.bg-light { color: #475569; }

/* ── Alerts (soft pastel with accent bar) ───────────────────────── */
.alert {
  border-radius: 10px;
  border: 1px solid transparent;
  border-left-width: 4px;
  box-shadow: var(--lms-shadow-sm);
}
.alert-success { background: #f0fdf4; border-color: #bbf7d0; border-left-color: #22c55e; color: #15803d; }
.alert-danger { background: #fef2f2; border-color: #fecaca; border-left-color: #ef4444; color: #b91c1c; }
.alert-warning { background: #fffbeb; border-color: #fde68a; border-left-color: #f0a500; color: #92400e; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; border-left-color: #2563eb; color: #1d4ed8; }

/* ── Interactive datatable (listing tables inside .table-responsive) ── */
.lms-card .table-responsive table thead th {
  background: #f8fafc;
  border-bottom: 2px solid var(--lms-border) !important;
  padding-top: 11px;
  padding-bottom: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.lms-card .table-responsive table thead th:not(:last-child) {
  border-right: 1px solid var(--lms-border);
}
.lms-card .table-responsive table thead th.lms-sortable {
  cursor: pointer;
  user-select: none;
  padding-right: 22px;
  position: relative;
}
.lms-card .table-responsive table thead th.lms-sortable:hover {
  background: #eef2f7;
  color: var(--lms-text);
}
.lms-card .table-responsive table thead th.lms-sortable::after {
  content: '';
  position: absolute;
  right: 8px;
  top: 50%;
  margin-top: -5px;
  border: 4px solid transparent;
  border-top-color: #b9c2cf;
  opacity: 0.7;
}
.lms-card .table-responsive table thead th.lms-sortable[aria-sort="ascending"]::after {
  border-top-color: transparent;
  border-bottom-color: var(--lms-primary-light);
  margin-top: -9px;
  opacity: 1;
}
.lms-card .table-responsive table thead th.lms-sortable[aria-sort="descending"]::after {
  border-top-color: var(--lms-primary-light);
  opacity: 1;
}

.lms-card .table-responsive table tbody tr {
  transition: background-color 0.1s ease;
}
.lms-card .table-responsive table tbody tr:nth-child(even) {
  background-color: rgba(15, 23, 42, 0.016);
}
.lms-card .table-responsive table tbody tr:hover {
  background-color: #eaf1fd;
}
.lms-card .table-responsive table tbody tr td,
.lms-card .table-responsive table tbody tr th {
  padding-top: 11px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--lms-border) !important;
  font-variant-numeric: tabular-nums;
}
.lms-card .table-responsive table tbody tr td:not(:last-child) {
  border-right: 1px solid rgba(226, 232, 240, 0.6);
}

/* ── Forms ───────────────────────────────────────────────────────── */
.form-control,
.form-select {
  border-radius: 9px;
  border-color: var(--lms-border);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--lms-primary-light);
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.12);
}

/* ── Pagination ──────────────────────────────────────────────────── */
.pagination .page-link {
  border-radius: 8px;
  margin: 0 2px;
  border-color: var(--lms-border);
  color: var(--lms-text);
}
.pagination .page-item.active .page-link {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: #1d4ed8;
}

/* ── Dashboard stat tiles with icon ─────────────────────────────── */
.lms-stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.lms-stat-icon--blue { background: linear-gradient(135deg, #eff6ff, #dbeafe); color: #2563eb; }
.lms-stat-icon--aqua { background: linear-gradient(135deg, #ecfdf5, #d1fae5); color: #199e70; }
.lms-stat-icon--violet { background: linear-gradient(135deg, #f2f0fd, #e5e1fb); color: #4a3aa7; }
.lms-stat-icon--orange { background: linear-gradient(135deg, #fff2ec, #ffe4d5); color: #eb6834; }

/* ── Similarity risk breakdown bar chart ────────────────────────── */
.lms-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.lms-bar-row {
  display: grid;
  grid-template-columns: 84px 1fr 40px;
  align-items: center;
  gap: 12px;
}
.lms-bar-label {
  font-size: 13px;
  color: var(--lms-muted);
  text-align: right;
}
.lms-bar-track {
  height: 18px;
  background: var(--lms-bg);
  border-radius: 4px;
  overflow: hidden;
}
.lms-bar-fill {
  height: 100%;
  border-radius: 0 4px 4px 0;
  min-width: 4px;
  transition: width 0.5s ease;
}
/* Colors mirror Report::SEVERITY_BANDS (the single source of truth) so this
   chart never drifts out of sync with the report page's severity badges. */
.lms-bar-fill--low { background: #16a34a; }
.lms-bar-fill--moderate { background: #ca8a04; }
.lms-bar-fill--high { background: #8b0000; }
.lms-bar-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--lms-text);
  font-variant-numeric: tabular-nums;
}

/* ── Upload activity column chart ───────────────────────────────── */
.lms-column-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 140px;
}
.lms-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 6px;
  min-width: 0;
}
.lms-column-bar {
  width: 100%;
  max-width: 22px;
  background: var(--lms-primary-light);
  border-radius: 4px 4px 0 0;
  min-height: 3px;
  transition: height 0.4s ease;
}
.lms-column-label {
  font-size: 10px;
  color: var(--lms-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ── Submission completion progress bars ────────────────────────── */
.lms-progress-track {
  height: 8px;
  background: var(--lms-bg);
  border-radius: 4px;
  overflow: hidden;
}
.lms-progress-fill {
  height: 100%;
  background: var(--lms-primary-light);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.lms-snippet {
  background-color: #fff3cd;
  border-left: 3px solid #f0a500;
  padding: 0.6rem 0.85rem;
  margin-bottom: 0.5rem;
  border-radius: 6px;
  font-size: 14px;
}
.lms-snippet--source {
  background-color: #eef2ff;
  border-left-color: #6366f1;
}
/* Per-source colors come from inline styles (Report::MATCH_COLORS is the
   single source of truth); these rules only carry the shared shape/behavior
   so PHP and CSS never need to keep a color list in sync. */
mark.lms-mark {
  border-radius: 3px;
  padding: 0 2px;
  border-bottom: 2px solid transparent;
  box-decoration-break: clone;
  cursor: pointer;
  position: relative;
}
/* Source number badge (matches the "#N" shown on the source's match card/
   sidebar row) — content pulled straight from the server-rendered
   data-source-number attribute, no markup duplication needed. */
mark.lms-mark::before {
  content: attr(data-source-number);
  position: relative;
  top: -0.5em;
  font-size: 0.6em;
  font-weight: 700;
  margin-right: 1px;
  vertical-align: top;
  opacity: 0.75;
}
mark.lms-mark.lms-mark--exact {
  border-bottom-width: 3px;
  font-weight: 600;
}
/* Semantic-only matches (flagged by meaning-similarity, not shared wording)
   get a dashed underline instead of solid, so a verbatim copy and a
   possible paraphrase are never visually conflated. */
mark.lms-mark.lms-mark--semantic {
  border-bottom-style: dashed;
  border-bottom-width: 2px;
  font-style: italic;
}
.lms-mark--semantic-legend {
  border-bottom: 2px dashed currentColor;
  padding: 0 2px;
  font-style: italic;
  cursor: default;
}
/* Selection state driven by assets/js/report-navigator.js: the active
   match stands out, everything else dims so it's unambiguous which
   passage is currently selected/synced with the modal and sidebar. */
mark.lms-mark.lms-mark--active {
  outline: 2px solid #1e293b;
  outline-offset: 1px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.25);
}
mark.lms-mark.lms-mark--dimmed {
  opacity: 0.35;
  filter: grayscale(35%);
}
/* Match Groups filter chips (Reports/view.view.php, Reports/highlight.view.php) */
.lms-group-filter-chip {
  cursor: pointer;
  font-size: 0.78rem;
  padding: 0.35rem 0.65rem;
  transition: opacity 0.15s ease, transform 0.1s ease;
}
.lms-group-filter-chip:hover {
  opacity: 0.85;
}
.lms-group-filter-chip.lms-group-filter-chip--active {
  outline: 2px solid #1e293b;
  outline-offset: 1px;
}
.lms-snippet.lms-snippet--group-hidden,
.lms-card.lms-card--group-hidden {
  display: none;
}

/* Document Details strip + ranked Top Sources list (Reports/view.view.php) */
.lms-doc-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
}
.lms-top-source-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  transition: background 0.12s ease;
}
.lms-top-source-row:hover {
  background: var(--lms-bg);
  color: inherit;
}

/* Source identity badge (Partials/sourceBadge.view.php) — a colored-ring
   numbered circle (matches the number on this source's highlights in the
   document) plus a colored source-type pill, reused everywhere a matched
   source is listed. Circle uses a pale fill + dark text + colored ring
   (not a solid fill) so every slot in the 12-color report palette clears
   WCAG text contrast, including the lighter hues a solid white-on-color
   fill would fail. */
.lms-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.lms-source-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}
.lms-source-badge--sm .lms-source-number {
  width: 18px;
  height: 18px;
  font-size: 0.65rem;
  border-width: 1.5px;
}
.lms-source-type-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}
.lms-source-badge--sm .lms-source-type-pill {
  font-size: 0.62rem;
  padding: 0.1rem 0.45rem;
}

/* Instant search hits (Reports/highlight.view.php, report-navigator.js) */
mark.lms-search-hit {
  background: #fde68a;
  color: #1e293b;
  border-radius: 2px;
  padding: 0 1px;
}
mark.lms-search-hit.lms-search-hit--current {
  background: #f59e0b;
  outline: 2px solid #b45309;
  outline-offset: 1px;
}

/* Virtual scrolling placeholders (Reports/highlight.view.php) */
.lms-chunk-placeholder {
  display: block;
  min-height: 4em;
  background: repeating-linear-gradient(
    90deg,
    var(--lms-border) 0,
    var(--lms-border) 40%,
    transparent 40%,
    transparent 100%
  );
  background-size: 200% 1.4em;
  background-repeat: no-repeat;
  background-position: 0 0.3em, 0 2em, 0 3.7em;
  opacity: 0.5;
  margin: 0.5em 0;
}

/* Integrity Review severity badge (Documents/integrity.view.php, Documents/show.view.php) */
.lms-integrity-severity {
  font-size: 1rem;
  padding: 0.5em 0.9em;
}

/* Similarity ring (overall score gauge) */
.lms-similarity-ring {
  --pct: 0;
  --ring-color: #64748b;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: conic-gradient(var(--ring-color) calc(var(--pct) * 1%), var(--lms-border) 0);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.lms-similarity-ring__inner {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.lms-similarity-ring__pct {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--lms-text);
  line-height: 1;
}
.lms-similarity-ring__band {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--lms-muted);
  margin-top: 2px;
}

/* Match overview sidebar */
.lms-match-overview {
  position: sticky;
  top: 84px;
}
.lms-match-overview-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}
.lms-match-overview-row:hover {
  background: var(--lms-bg);
}
.lms-match-overview-row--active {
  background: var(--lms-bg);
  font-weight: 600;
  box-shadow: inset 3px 0 0 0 currentColor;
}
.lms-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.report-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 2000;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 1.5rem;
}
.report-modal-open {
  display: flex;
}
.report-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(1px);
}
.report-modal-dialog {
  position: relative;
  max-width: 860px;
  width: 100%;
  z-index: 1;
}
.report-modal-content {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 25px 50px rgba(15, 23, 42, 0.2);
  overflow: hidden;
}
.report-modal-header,
.report-modal-footer {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
}
.report-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.report-modal-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}
.report-modal-close {
  border: none;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  color: #334155;
  cursor: pointer;
}
.report-modal-body {
  padding: 1.25rem;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  background: #f8fafc;
}
.report-modal-source-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}
.report-modal-source-swatch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  cursor: pointer;
}
.report-modal-source-swatch--active {
  border-color: currentColor;
  font-weight: 700;
}
.report-modal-also-matches {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  background: #fffbeb;
}
/* Word-level diff (match modal side-by-side comparison) */
.lms-diff-text {
  line-height: 1.9;
  font-size: 14px;
}
.lms-diff-insert {
  background: #dcfce7;
  color: #166534;
  border-radius: 3px;
  padding: 0 3px;
}
.lms-diff-delete {
  background: #fee2e2;
  color: #991b1b;
  text-decoration: line-through;
  border-radius: 3px;
  padding: 0 3px;
}
.report-modal-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
.report-modal-nav-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 999px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}
.report-modal-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.report-modal-nav-count {
  font-size: 0.8rem;
  color: #64748b;
}

.lms-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, #1f2937, var(--lms-sb-bg) 65%);
  padding: 24px;
}
.lms-login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
  padding: 36px 32px;
}
.lms-login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

/* ── Split-panel auth layout ─────────────────────────────────── */
.lms-auth-wrap {
  min-height: 100vh;
  display: flex;
}
.lms-auth-panel {
  flex: 1 1 50%;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px;
  background:
    radial-gradient(circle at 15% 20%, rgba(59, 130, 246, 0.25), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(240, 165, 0, 0.18), transparent 50%),
    linear-gradient(160deg, #0b1220 0%, var(--lms-sb-bg) 55%, #0b1220 100%);
  color: #fff;
  overflow: hidden;
}
.lms-auth-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.5;
  pointer-events: none;
}
.lms-auth-crest {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  background: #fff;
  padding: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
}
.lms-auth-crest img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.lms-auth-title {
  font-family: 'Sora', sans-serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}
.lms-auth-subtitle {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.65);
  max-width: 380px;
  margin-bottom: 36px;
  position: relative;
  z-index: 1;
}
.lms-auth-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  z-index: 1;
}
.lms-auth-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
}
.lms-auth-features .lms-auth-feature-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #93c5fd;
}
.lms-auth-form-panel {
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--lms-bg);
  padding: 24px;
}
.lms-auth-form-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.08);
  padding: 40px 36px;
}
.lms-auth-form-mobile-brand {
  display: none;
}
@media (max-width: 991px) {
  .lms-auth-panel {
    display: none;
  }
  .lms-auth-form-mobile-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
  }
}

/* ── File dropzone (drag & drop upload) ─────────────────────────── */
.lms-dropzone {
  border: 2px dashed var(--lms-border);
  border-radius: 12px;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  color: var(--lms-muted);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.lms-dropzone:hover,
.lms-dropzone:focus-visible {
  border-color: var(--lms-primary-light);
}
.lms-dropzone.lms-dropzone-active {
  border-color: var(--lms-primary-light);
  background: rgba(37, 99, 235, 0.05);
}
.lms-dropzone.is-invalid {
  border-color: var(--lms-danger-hover);
}
.lms-dropzone-icon {
  color: var(--lms-primary-light);
}

/* ── Category status pills (per-participant submission chips) ──── */
.lms-category-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--lms-border);
  color: var(--lms-muted);
  background: #fff;
  white-space: nowrap;
}
.lms-category-pill--done {
  color: #15803d;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

/* Print stylesheet — plagiarism report pages (Reports/view, Reports/highlight) */
@media print {
  .lms-sidebar,
  .lms-header,
  .report-modal,
  .btn,
  #lmsExportStatsCsv,
  .lms-group-filter-chip {
    display: none !important;
  }
  .lms-main {
    margin: 0 !important;
  }
  .lms-content {
    padding: 0 !important;
    width: 100% !important;
  }
  .lms-card {
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
    break-inside: avoid;
  }
  body {
    background: #fff !important;
  }
}
