/* ── Admin Dashboard (admin.html) ─────────────────────────── */
:root {
  --brand:       #6C63FF;
  --brand-dark:  #4B44CC;
  --brand-glow:  rgba(108,99,255,.3);
  --surface:     #0e0e1a;
  --sidebar:     #12121e;
  --card:        #1a1a2e;
  --card2:       #22223a;
  --border:      rgba(255,255,255,.07);
  --text:        #f0f0f8;
  --muted:       #7878a0;
  --muted2:      #555570;
  --error:       #ff5e7a;
  --success:     #10B981;
  --warning:     #F59E0B;
  --info:        #3B82F6;
  --radius:      12px;
  --sidebar-w:   240px;
  --topbar-h:    60px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--surface);
  color: var(--text);
  height: 100vh;
  display: flex;
  overflow: hidden;
}

/* ══ SIDEBAR ══════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; left: 0; top: 0; bottom: 0;
  z-index: 100; transition: transform .25s;
}

.sidebar-logo {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
  text-decoration: none;
}
.sidebar-logo:hover {
  background: rgba(108,99,255,.08);
}
.sidebar-logo-icon {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--brand), #9B8AFF);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #fff; flex-shrink: 0;
}
.sidebar-logo-text { font-size: 15px; font-weight: 700; letter-spacing: -.2px; }
.sidebar-logo-text span { color: var(--brand); }

.sidebar-label {
  font-size: 10px; font-weight: 600; color: var(--muted2);
  letter-spacing: 1px; text-transform: uppercase;
  padding: 20px 20px 8px;
}

.sidebar-nav { flex: 1; padding: 8px 10px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--muted);
  cursor: pointer; transition: all .15s;
  user-select: none;
}
.nav-item:hover { background: var(--card); color: var(--text); }
.nav-item.active {
  background: rgba(108,99,255,.15);
  color: var(--brand);
}
.nav-item i { width: 16px; text-align: center; font-size: 13px; }
.nav-badge {
  margin-left: auto;
  background: var(--card2); color: var(--muted);
  font-size: 10px; font-weight: 600;
  padding: 2px 6px; border-radius: 10px; min-width: 20px; text-align: center;
}
.nav-item.active .nav-badge { background: rgba(108,99,255,.2); color: var(--brand); }

.sidebar-footer {
  padding: 16px; border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  background: var(--card2); cursor: pointer;
  transition: background .15s;
}
.sidebar-user:hover { background: var(--card); }
.sidebar-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #9B8AFF);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: var(--muted); }

/* ══ MAIN ════════════════════════════════════════════════════ */
.main {
  margin-left: var(--sidebar-w);
  flex: 1; display: flex; flex-direction: column;
  height: 100vh; overflow: hidden;
}

/* ── Sidebar overlay (mobile) */
#sidebar-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 99;
  background: rgba(0,0,0,.5);
}
#sidebar-overlay.show { display: block; }

/* ── Topbar */
.topbar {
  height: var(--topbar-h); flex-shrink: 0;
  background: var(--sidebar);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px; gap: 12px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 16px; font-weight: 600; flex: 1; }
.sidebar-toggle {
  display: none;
  background: transparent; border: none; cursor: pointer;
  color: var(--text); font-size: 18px; padding: 4px 8px;
  border-radius: 6px; line-height: 1;
}
.sidebar-toggle:hover { color: var(--brand); }
/* Search: only shown on pages that use it */
.topbar-search { position: relative; }
.topbar-search input {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 12px 7px 32px;
  font-size: 13px; color: var(--text); width: 200px;
  outline: none; transition: border-color .2s, width .2s;
  font-family: inherit;
}
.topbar-search input:focus { border-color: var(--brand); width: 240px; }
.topbar-search input::placeholder { color: var(--muted); }
.topbar-search .search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 12px; pointer-events: none;
}

/* ── Content */
.content {
  flex: 1; min-height: 0; overflow-y: auto; padding: 28px;
}

/* ── Page header */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-header h2 {
  font-size: 22px; font-weight: 700; letter-spacing: -.3px;
}
.page-header .sub {
  font-size: 13px; color: var(--muted); margin-top: 2px;
}

/* ══ BUTTONS ═════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 9px; font-size: 13px;
  font-weight: 500; cursor: pointer; border: none;
  transition: all .15s; font-family: inherit;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand), #9B8AFF);
  color: #fff; box-shadow: 0 4px 16px var(--brand-glow);
}
.btn-primary:hover { opacity: .9; transform: translateY(-1px); }
.btn-secondary {
  background: var(--card2); color: var(--muted);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--card); color: var(--text); }
.btn-danger { background: rgba(255,94,122,.15); color: var(--error); border: 1px solid rgba(255,94,122,.2); }
.btn-danger:hover  { background: rgba(255,94,122,.25); }
.btn-success { background: rgba(16,185,129,.15); color: var(--success); border: 1px solid rgba(16,185,129,.2); }
.btn-success:hover { background: rgba(16,185,129,.25); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }

/* Table row action buttons — always visible */
.data-table .btn.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  transition: all .15s;
}
.data-table .btn-secondary.btn-sm {
  background: var(--card2);
  border-color: var(--border);
  color: var(--text);
}
.data-table .btn-secondary.btn-sm:hover {
  background: var(--card3, var(--card));
  border-color: var(--brand);
  color: var(--brand);
}
.data-table .btn-danger.btn-sm {
  background: rgba(255,94,122,.08);
  border-color: rgba(255,94,122,.3);
  color: var(--error);
}
.data-table .btn-danger.btn-sm:hover {
  background: rgba(255,94,122,.18);
  border-color: var(--error);
  color: var(--error);
}

/* ══ STATS GRID ══════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 28px;
}
.stat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.stat-card-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat-card-value { font-size: 28px; font-weight: 700; letter-spacing: -.5px; }
.stat-card-sub   { font-size: 12px; color: var(--muted); }
.stat-brand   { color: var(--brand); }
.stat-success { color: var(--success); }
.stat-warning { color: var(--warning); }
.stat-error   { color: var(--error); }

/* ══ TABLE ═══════════════════════════════════════════════════ */
.table-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.table-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: 10px;
}
.table-title { font-size: 15px; font-weight: 600; }
.table-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  background: var(--card2); padding: 10px 16px;
  text-align: left; font-size: 11px; font-weight: 600;
  color: var(--muted); text-transform: uppercase; letter-spacing: .5px;
  white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
/* Checkbox column — keep header aligned with row cells */
.data-table th:first-child:has(input[type="checkbox"]) {
  width: 40px; padding: 10px 0; text-align: center;
}
.data-table td {
  padding: 12px 16px; border-top: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:hover td { background: rgba(255,255,255,.02); }
.data-table tr.report-row:hover td { background: rgba(108,99,255,.06); cursor: pointer; }

/* ── Badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: .3px;
  text-transform: capitalize; white-space: nowrap;
}
.badge-admin     { background: rgba(108,99,255,.18); color: #a8a2ff; }
.badge-pm        { background: rgba(16,185,129,.18); color: #34d399; }
.badge-backend   { background: rgba(59,130,246,.18); color: #60a5fa; }
.badge-frontend  { background: rgba(236,72,153,.18); color: #f472b6; }
.badge-active    { background: rgba(16,185,129,.18); color: var(--success); }
.badge-invited   { background: rgba(245,158,11,.18); color: var(--warning); }
.badge-disabled  { background: rgba(255,94,122,.18); color: var(--error); }
.badge-completed { background: rgba(16,185,129,.18); color: var(--success); }

/* ── Score badge */
.score-circle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  font-size: 12px; font-weight: 700;
  border: 2px solid;
}
.score-high   { border-color: var(--success); color: var(--success); background: rgba(16,185,129,.1); }
.score-mid    { border-color: var(--warning); color: var(--warning); background: rgba(245,158,11,.1); }
.score-low    { border-color: var(--error);   color: var(--error);   background: rgba(255,94,122,.1); }
.score-none   { border-color: var(--border);  color: var(--muted);   background: transparent; font-size:10px; }

/* ── Severity pills */
.sev-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.pill { padding: 2px 7px; border-radius: 10px; font-size: 10px; font-weight: 600; }
.pill-critical { background: rgba(255,94,122,.2); color: var(--error); }
.pill-error    { background: rgba(245,158,11,.2); color: var(--warning); }
.pill-warning  { background: rgba(59,130,246,.2); color: var(--info); }
.pill-info     { background: rgba(108,99,255,.2); color: #a8a2ff; }

/* ── Project color dot */
.proj-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.proj-name { display: flex; align-items: center; gap: 8px; }

/* ── User initials */
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-ava {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand), #9B8AFF);
}
.user-name  { font-weight: 500; }
.user-email { font-size: 11px; color: var(--muted); }

/* ── Empty state */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--muted);
}
.empty-state i { font-size: 36px; margin-bottom: 12px; opacity: .5; }
.empty-state p { font-size: 14px; margin-bottom: 4px; }
.empty-state .sub { font-size: 12px; color: var(--muted2); }

/* ── Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--card2) 25%, var(--card) 50%, var(--card2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Pagination */
.pagination {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 6px; padding: 14px 20px; border-top: 1px solid var(--border);
}
.page-info { font-size: 12px; color: var(--muted); margin-right: auto; }
.page-btn {
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--card2); border: 1px solid var(--border);
  color: var(--muted); font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s; font-family: inherit;
}
.page-btn:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.page-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.page-btn:disabled { opacity: .3; cursor: not-allowed; }

/* ══ MODAL ════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.7); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 18px; width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  transform: translateY(20px) scale(.97);
  transition: transform .25s, opacity .25s;
  opacity: 0;
}
.modal-overlay.open .modal { transform: none; opacity: 1; }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px 0;
}
.modal-title { font-size: 17px; font-weight: 700; }
.modal-close {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--card2); border: none; cursor: pointer;
  color: var(--muted); font-size: 14px; display: flex;
  align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.modal-close:hover { background: rgba(255,94,122,.15); color: var(--error); }

.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 0 24px 22px;
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ── Form fields in modal */
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 12px; font-weight: 500;
  color: var(--muted); margin-bottom: 6px;
}
.field label .req { color: var(--error); margin-left: 2px; }
.field input, .field select {
  width: 100%; background: var(--card2);
  border: 1.5px solid var(--border); border-radius: 9px;
  padding: 10px 12px; font-size: 13px; color: var(--text);
  outline: none; transition: border-color .2s, box-shadow .2s;
  font-family: inherit;
}
.field input:focus, .field select:focus { border-color: var(--brand); }
.field select option { background: var(--card2); }

/* ── Inline field validation */
.field input.field-invalid,
.field select.field-invalid {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 3px rgba(255,94,122,.12);
}
.field-err-msg {
  display: none; font-size: 11px; color: var(--error);
  margin-top: 5px; padding-left: 2px;
}
.field-err-msg.show { display: block; }

/* ── Projects multi-select chips */
.project-chips {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px;
}
.project-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 20px; font-size: 12px;
  border: 1.5px solid var(--border);
  cursor: pointer; transition: all .15s; user-select: none;
  background: var(--card2); color: var(--muted);
}
.project-chip.selected {
  border-color: transparent; color: #fff;
  background: linear-gradient(135deg, rgba(108,99,255,.5), rgba(155,138,255,.4));
}
.project-chip .dot {
  width: 8px; height: 8px; border-radius: 50%;
}

/* ── Alert in modal */
.modal-alert {
  padding: 10px 12px; border-radius: 8px;
  font-size: 13px; margin-bottom: 14px; display: none;
}
.modal-alert.show { display: block; }
.modal-alert.error   { background: rgba(255,94,122,.1); color: var(--error); border: 1px solid rgba(255,94,122,.2); }
.modal-alert.success { background: rgba(16,185,129,.1); color: var(--success); border: 1px solid rgba(16,185,129,.2); }

/* ── Invite link box */
.invite-box {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px;
  margin-top: 12px; display: none;
}
.invite-box.show { display: block; }
.invite-link-label { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.invite-link-text {
  font-size: 12px; word-break: break-all; color: #a8a2ff;
  margin-bottom: 8px; line-height: 1.4;
}
.copy-btn {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 10px; font-size: 11px; color: var(--muted);
  cursor: pointer; font-family: inherit; transition: all .15s;
}
.copy-btn:hover { border-color: var(--brand); color: var(--brand); }

/* ── Filter bar */
.filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-select {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px;
  font-size: 12px; color: var(--text);
  outline: none; cursor: pointer;
  font-family: inherit;
}
.filter-select:focus { border-color: var(--brand); }
.filter-select option { background: var(--card); }

/* ── Tabs in content */
.content-tabs {
  display: flex; gap: 4px; margin-bottom: 22px;
  background: var(--card); border-radius: 10px; padding: 4px;
  width: fit-content; border: 1px solid var(--border);
}
.ctab {
  padding: 8px 16px; border-radius: 7px; font-size: 13px;
  font-weight: 500; cursor: pointer; color: var(--muted);
  transition: all .15s; border: none; background: transparent;
  font-family: inherit;
}
.ctab.active { background: var(--brand); color: #fff; }

/* ── Spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.25);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .6s linear infinite;
  display: none;
}
.loading .spinner { display: block; }
.loading .btn-text { display: none; }

/* ── Toast */
.toast-wrap {
  position: fixed; bottom: 28px; right: 28px;
  display: flex; flex-direction: column; gap: 10px; z-index: 1000;
  pointer-events: none;
}
.toast {
  pointer-events: all;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 13px; font-weight: 500;
  min-width: 280px; max-width: 400px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.3);
  display: flex; align-items: center; gap: 12px;
  animation: slideInToast .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes slideInToast {
  from { opacity:0; transform:translateX(40px) scale(.95); }
  to   { opacity:1; transform:translateX(0)    scale(1);   }
}
.toast .toast-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.toast-msg { flex: 1; line-height: 1.4; }
.toast.success {
  border-color: rgba(16,185,129,.3);
  background: linear-gradient(135deg, rgba(16,185,129,.08) 0%, var(--card) 60%);
}
.toast.success .toast-icon { background: rgba(16,185,129,.15); color: var(--success); }
.toast.error {
  border-color: rgba(255,94,122,.3);
  background: linear-gradient(135deg, rgba(255,94,122,.08) 0%, var(--card) 60%);
}
.toast.error .toast-icon { background: rgba(255,94,122,.15); color: var(--error); }
.toast.info {
  border-color: rgba(108,99,255,.3);
  background: linear-gradient(135deg, rgba(108,99,255,.08) 0%, var(--card) 60%);
}
.toast.info .toast-icon { background: rgba(108,99,255,.15); color: var(--brand); }
.toast.warning {
  border-color: rgba(245,158,11,.3);
  background: linear-gradient(135deg, rgba(245,158,11,.08) 0%, var(--card) 60%);
}
.toast.warning .toast-icon { background: rgba(245,158,11,.15); color: var(--warning); }

/* ── Projects grid (project management tab) */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.project-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  cursor: pointer; transition: border-color .2s, transform .15s;
  position: relative;
}
.project-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.project-card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.project-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.project-card-name { font-size: 15px; font-weight: 600; }
.project-card-desc { font-size: 12px; color: var(--muted); margin-bottom: 14px; line-height: 1.4; }
.project-card-stats { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }

/* ── Responsive */
@media (max-width: 1200px) {
  :root { --sidebar-w: 210px; }
}
@media (max-width: 1024px) {
  :root { --sidebar-w: 190px; }
  .nav-item { font-size: 13px; padding: 9px 14px; }
  .content { padding: 20px; }
  .stats-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 240px; }
  .sidebar { transform: translateX(-100%); z-index: 101; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .topbar-search { display: none; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .sidebar-toggle { display: flex; align-items: center; }
}

/* ══ TABLE SCROLL CONTAINER ═════════════════════════════════ */
.table-body-wrap {
  overflow-y: auto;
  overflow-x: auto;
}
.table-body-wrap::-webkit-scrollbar { width: 5px; height: 5px; }
.table-body-wrap::-webkit-scrollbar-track { background: var(--card); }
.table-body-wrap::-webkit-scrollbar-thumb { background: var(--card2); border-radius: 10px; }
.table-body-wrap::-webkit-scrollbar-thumb:hover { background: var(--brand); }

/* ══ BULK SELECT BAR — fixed top (CloudFront style) ════════ */
.bulk-bar {
  position: fixed;
  top: var(--topbar-h);
  left: var(--sidebar-w);
  right: 0;
  z-index: 110;
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 11px 28px;
  background: var(--card);
  border-bottom: 2px solid var(--brand);
  box-shadow: 0 4px 24px rgba(108,99,255,.2);
  font-size: 13px;
  animation: slideDown .2s cubic-bezier(.34,1.2,.64,1);
}
@keyframes slideDown {
  from { opacity:0; transform:translateY(-100%); }
  to   { opacity:1; transform:translateY(0);     }
}
.bulk-bar.show { display: flex; }
.bulk-bar-left { display: flex; align-items: center; gap: 12px; }
.bulk-bar-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: rgba(108,99,255,.15); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.bulk-bar-actions { display: flex; align-items: center; gap: 8px; }
.bulk-count {
  font-weight: 600; font-size: 13px; color: var(--text);
}
/* Compensate content area when bulk bar is visible */
.content.bulk-active { padding-top: calc(28px + 50px); transition: padding-top .2s; }

/* Reports count badge in toolbar */
.reports-count-badge {
  display: inline-flex; align-items: center;
  background: var(--card2); border: 1px solid var(--border);
  color: var(--muted); font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 20px;
}

/* Checkbox column — TD matches TH alignment */
.cb-wrap {
  display: flex; align-items: center; justify-content: center;
  width: 40px; padding: 0 !important; text-align: center;
}
input[type="checkbox"] {
  width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer;
  display: block; margin: 0 auto;
}

/* ══ TOOLS PANEL ════════════════════════════════════════════ */
.tools-panel {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 20px;
}
.tools-panel-title {
  font-size: 11px; font-weight: 700; color: var(--muted2);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.tools-grid {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.tool-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 20px; font-size: 11px; font-weight: 600;
  border: 1px solid; white-space: nowrap;
}
.tool-chip-security { background: rgba(255,94,122,.1); color: var(--error); border-color: rgba(255,94,122,.25); }
.tool-chip-quality  { background: rgba(59,130,246,.1); color: var(--info); border-color: rgba(59,130,246,.25); }
.tool-chip-style    { background: rgba(16,185,129,.1); color: var(--success); border-color: rgba(16,185,129,.25); }
.tool-chip-ast      { background: rgba(108,99,255,.1); color: var(--brand); border-color: rgba(108,99,255,.25); }
.tool-chip-ci       { background: rgba(245,158,11,.1); color: var(--warning); border-color: rgba(245,158,11,.25); }

/* ══ PROJECT CARD IMPROVEMENTS ══════════════════════════════ */
.project-card-reviewer {
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border);
  font-size: 11px; color: var(--muted);
  display: flex; align-items: center; gap: 8px;
}
.project-card-reviewer .rev-ava {
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #9B8AFF);
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.project-card-reviewer .rev-name { font-weight: 600; color: var(--text); }

/* ══ RUN REVIEW BUTTON ANIMATION ════════════════════════════ */
@keyframes pulse-brand {
  0%, 100% { box-shadow: 0 0 0 0 rgba(108,99,255,.4); }
  50%       { box-shadow: 0 0 0 8px rgba(108,99,255,0); }
}
.btn-run-review {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #fff; border: none;
  animation: pulse-brand 2s infinite;
}
.btn-run-review:hover { opacity: .9; transform: translateY(-1px); }
.btn-run-review:disabled { animation: none; }

/* ══ REVIEW RUNNING STATE ══════════════════════════════════ */
.run-review-wrap {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px; margin-top: 16px;
  display: none;
}
.run-review-wrap.show { display: block; }
.run-progress {
  height: 4px; background: var(--card); border-radius: 2px; overflow: hidden; margin-top: 10px;
}
.run-progress-bar {
  height: 100%; background: linear-gradient(90deg, var(--brand), #10B981);
  border-radius: 2px; width: 0%;
  transition: width .3s;
  animation: progress-pulse 1.5s ease-in-out infinite;
}
@keyframes progress-pulse {
  0%   { opacity: 1; }
  50%  { opacity: .6; }
  100% { opacity: 1; }
}

/* ══ SCORE TREND ════════════════════════════════════════════ */
.score-trend {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 8px;
}
.trend-up   { background: rgba(16,185,129,.15); color: var(--success); }
.trend-down { background: rgba(255,94,122,.15); color: var(--error); }
.trend-flat { background: rgba(120,120,160,.15); color: var(--muted); }

/* ══ REPORT ROW HOVER ═══════════════════════════════════════ */
.data-table tr.report-row { cursor: pointer; transition: background .12s; }
.data-table tr.report-row:hover td { background: rgba(108,99,255,.07); }
.data-table tr.report-row.selected td { background: rgba(108,99,255,.12); }

/* ══ ISSUE CARD IN DETAIL MODAL ═════════════════════════════ */
.issue-card {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; margin-bottom: 6px;
}
.issue-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.issue-title { font-weight: 600; font-size: 13px; flex: 1; }
.issue-file  { font-size: 10px; color: var(--muted2); font-family: 'JetBrains Mono', monospace; margin-top: 4px; }
.issue-desc  { font-size: 12px; color: var(--muted); line-height: 1.5; }
.issue-sugg  {
  font-size: 11px; color: var(--success); background: rgba(16,185,129,.08);
  border: 1px solid rgba(16,185,129,.15); border-radius: 6px;
  padding: 5px 8px; margin-top: 6px; line-height: 1.4;
}

/* ══ ISSUE BREAKDOWN BARS ═══════════════════════════════════ */
.issue-bar-row {
  display: flex; align-items: center; gap: 10px;
}
.issue-bar-label {
  width: 80px; font-size: 12px; font-weight: 500; flex-shrink: 0;
}
.issue-bar-track {
  flex: 1; height: 7px; background: var(--border);
  border-radius: 99px; overflow: hidden;
}
.issue-bar-fill {
  height: 100%; border-radius: 99px;
  width: 0%; transition: width .5s ease;
}
.issue-bar-count {
  width: 36px; text-align: right; font-size: 12px;
  font-weight: 600; color: var(--text); flex-shrink: 0;
}

/* ══ LANGUAGE CONFIG PAGE ════════════════════════════════════ */

/* Simple two-column layout — no flex chain tricks */
.lc-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
}

/* ── Library (left): scrollable, max height tied to viewport ── */
.lc-library {
  min-width: 0;
}

/* The card grid scrolls via its own container */
.lc-grid-scroll {
  max-height: calc(100vh - var(--topbar-h) - 175px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(108,99,255,.3) transparent;
}
.lc-grid-scroll::-webkit-scrollbar { width: 5px; }
.lc-grid-scroll::-webkit-scrollbar-track { background: transparent; }
.lc-grid-scroll::-webkit-scrollbar-thumb { background: rgba(108,99,255,.3); border-radius: 99px; }

.lc-section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 700; color: var(--text); /* FIX: bigger title */
  margin-bottom: 6px;
}
.lc-total-badge {
  margin-left: auto;
  background: linear-gradient(135deg, var(--brand), #9B8AFF);
  color: #fff; font-size: 12px; font-weight: 700;
  padding: 3px 12px; border-radius: 99px;
  box-shadow: 0 2px 8px rgba(108,99,255,.3);
}
.lc-lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 12px;
  /* leave room for bottom padding after last row */
  padding-bottom: 8px;
}

/* ── Language Card ── */
.lc-lang-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 14px 14px 10px;
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s, transform .12s, background .18s;
  user-select: none;
  position: relative;
}
.lc-lang-card::before {
  /* FIX: subtle top color accent line */
  content: '';
  position: absolute; top: 0; left: 16px; right: 16px;
  height: 2px; border-radius: 0 0 4px 4px;
  background: transparent;
  transition: background .18s;
}
.lc-lang-card:hover {
  border-color: rgba(108,99,255,.5);
  box-shadow: 0 6px 24px rgba(108,99,255,.15);
  transform: translateY(-2px);
  background: rgba(255,255,255,.02);
}
.lc-lang-card.selected {
  border-color: var(--brand);
  background: rgba(108,99,255,.1);
  box-shadow: 0 0 0 4px rgba(108,99,255,.18), 0 6px 24px rgba(108,99,255,.15);
}
/* FIX: color accent on selected card top */
.lc-lang-card.selected::before { background: var(--brand); }

/* ── Card header row ── */
.lc-card-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.lc-lang-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.lc-lang-name {
  font-size: 13px; font-weight: 700; color: var(--text); flex: 1;
  line-height: 1.2;
}
.lc-lang-rules {
  font-size: 12px; font-weight: 700; /* FIX: bigger badge text */
  background: rgba(255,255,255,.07); color: var(--muted);
  padding: 3px 9px; border-radius: 99px;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.lc-lang-card.selected .lc-lang-rules {
  background: var(--brand); color: #fff; border-color: transparent;
  box-shadow: 0 2px 6px rgba(108,99,255,.35);
}

/* Selected checkmark — floats outside card corner, never overlaps badge */
.lc-lang-card { overflow: visible; }
.lc-lang-card.selected::after {
  content: '✓';
  position: absolute; top: -9px; right: -9px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--brand); color: #fff;
  font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  line-height: 20px; text-align: center;
  box-shadow: 0 2px 6px rgba(108,99,255,.4);
  z-index: 1;
}

/* ── Expand subtypes button ── */
.lc-expand-btn {
  width: 100%; background: transparent; border: none;
  color: var(--muted); font-size: 12px; cursor: pointer; /* FIX: bigger text */
  display: flex; align-items: center; gap: 6px;
  padding: 6px 0 0; transition: color .15s;
  border-top: 1px solid var(--border); margin-top: 4px;
}
.lc-expand-btn:hover { color: var(--brand); }
.lc-expand-btn i { transition: transform .2s; margin-left: auto; }
.lc-expand-btn.open i { transform: rotate(180deg); }

/* ── Subtypes panel ── */
.lc-subtypes {
  margin-top: 10px; display: none;
  flex-direction: column; gap: 4px;
  padding-top: 4px;
}
.lc-subtypes.open { display: flex; }
.lc-subtype-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--muted); cursor: pointer; /* FIX: bigger font */
  padding: 6px 8px; border-radius: 8px;
  transition: background .12s, color .12s;
}
.lc-subtype-row:hover { background: rgba(255,255,255,.05); color: var(--text); }
.lc-subtype-row input[type=checkbox] {
  width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; flex-shrink: 0;
}
.lc-subtype-rules {
  margin-left: auto; font-size: 11px; /* FIX: slightly bigger */
  background: var(--card2); color: var(--muted);
  padding: 2px 7px; border-radius: 99px;
  border: 1px solid var(--border);
}

/* ── Right Panel ── */
.lc-panel { position: relative; }
.lc-panel-sticky {
  position: sticky; top: 16px;
  background: var(--card);
  border: 1px solid rgba(108,99,255,.2);
  border-radius: 16px;
  padding: 20px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,.2);
  max-height: calc(100vh - var(--topbar-h) - 128px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(108,99,255,.3) transparent;
}
.lc-panel-sticky::-webkit-scrollbar { width: 4px; }
.lc-panel-sticky::-webkit-scrollbar-thumb { background: rgba(108,99,255,.3); border-radius: 99px; }
/* FIX: accent gradient stripe at top of panel */
.lc-panel-sticky::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), #9B8AFF, #61dafb);
}
.lc-panel-section { margin-bottom: 20px; } /* FIX: more spacing */
.lc-panel-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
  color: var(--muted); margin-bottom: 10px; /* FIX: more gap below label */
  display: flex; align-items: center; gap: 7px;
}
.lc-panel-label i { color: var(--brand); }
.lc-project-select {
  width: 100%; padding: 10px 14px; border-radius: 10px; /* FIX: taller select */
  background: var(--card2); border: 1.5px solid var(--border);
  color: var(--text); font-size: 14px; cursor: pointer; /* FIX: bigger font */
  transition: border-color .15s;
}
.lc-project-select:focus { outline: none; border-color: var(--brand); }

/* ── Mode toggle ── */
.lc-mode-toggle { display: flex; flex-direction: column; gap: 8px; } /* FIX: more gap */
.lc-mode-opt {
  display: flex; align-items: center; gap: 12px; /* FIX: center-align */
  padding: 12px 14px; border-radius: 10px; /* FIX: more padding */
  border: 2px solid var(--border); cursor: pointer; /* FIX: thicker border */
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.lc-mode-opt:has(input:checked) {
  border-color: var(--brand);
  background: rgba(108,99,255,.1);
  box-shadow: 0 0 0 3px rgba(108,99,255,.12);
}
.lc-mode-opt input { accent-color: var(--brand); width: 16px; height: 16px; flex-shrink: 0; }
.lc-mode-label { display: flex; flex-direction: column; gap: 3px; }
.lc-mode-label i { color: var(--brand); margin-right: 5px; }
.lc-mode-label strong { font-size: 13px; color: var(--text); font-weight: 600; }
.lc-mode-label small { font-size: 11px; color: var(--muted); }

/* ── Chips ── */
.lc-chips {
  display: flex; flex-wrap: wrap; gap: 7px; /* FIX: more gap */
  min-height: 34px; /* FIX: taller min */
  align-content: flex-start;
}
.lc-chip {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; /* FIX: bigger */
  padding: 5px 12px 5px 10px; border-radius: 99px; /* FIX: more padding */
  border: 1.5px solid; cursor: pointer;
  transition: opacity .15s, transform .1s;
  white-space: nowrap;
}
.lc-chip:hover { opacity: .8; transform: scale(.97); }
.lc-chip i { font-size: 11px; }
.lc-chip-remove { font-size: 10px; opacity: .55; margin-left: 1px; }
.lc-chip-empty {
  font-size: 12px; color: var(--muted2); font-style: italic; /* FIX: bigger */
  padding: 4px 0;
}
.lc-chip-sub {
  background: rgba(255,255,255,.05); color: var(--text);
  border-color: rgba(255,255,255,.12);
  font-size: 12px; font-weight: 500;
}

/* ── Rule Meter ── */
.lc-rule-meter {
  background: linear-gradient(135deg, rgba(108,99,255,.08), rgba(155,138,255,.05));
  border: 1px solid rgba(108,99,255,.2); /* FIX: brand border */
  border-radius: 12px;
  padding: 16px; margin-top: 0;
}
.lc-rule-meter-top {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 10px;
}
.lc-rule-count-label { font-size: 12px; color: var(--muted); font-weight: 600; } /* FIX: bigger */
.lc-rule-count-val {
  font-size: 28px; font-weight: 800; color: var(--brand);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-shadow: 0 0 20px rgba(108,99,255,.4);
}
.lc-rule-bar-track {
  height: 8px; background: rgba(255,255,255,.06); /* FIX: taller bar */
  border-radius: 99px; overflow: hidden; margin-bottom: 12px;
}
.lc-rule-bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--brand), #9B8AFF, #61dafb);
  border-radius: 99px; transition: width .5s cubic-bezier(.4,0,.2,1); width: 0%;
}
.lc-rule-breakdown { display: flex; flex-direction: column; gap: 5px; } /* FIX: more gap */
.lc-rb-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--muted); /* FIX: bigger */
}
.lc-rb-row span:last-child { font-weight: 700; color: var(--text); }

/* ── Summary Card ── */
.lc-summary-card {
  background: rgba(108,99,255,.07);
  border: 1px solid rgba(108,99,255,.22);
  border-radius: 12px; padding: 14px; margin-top: 16px; /* FIX: more spacing */
}
.lc-summary-title {
  font-size: 11px; font-weight: 700; color: var(--brand);
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px;
}
.lc-summary-row {
  display: flex; gap: 10px; align-items: flex-start; /* FIX: more gap */
  font-size: 13px; color: var(--muted); margin-bottom: 7px; /* FIX: bigger font */
  line-height: 1.4;
}
.lc-summary-row strong { color: var(--text); min-width: 90px; flex-shrink: 0; }

/* ── Empty / no-project state ── */
#lc-no-project {
  padding: 48px 20px; /* FIX: more breathing room */
  text-align: center; color: var(--muted);
}
#lc-no-project i {
  font-size: 36px; display: block; margin-bottom: 14px; opacity: .35;
}
#lc-no-project p { font-size: 13px; line-height: 1.5; }

/* ── Platform Insights ── */
.lc-insights {
  margin-top: 28px;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden;
}
.lc-insights-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; cursor: pointer; font-size: 14px; font-weight: 600; /* FIX: bigger */
  transition: background .15s;
}
.lc-insights-header:hover { background: var(--card2); }
.lc-insights-header i { transition: transform .25s; }
.lc-insights-body { padding: 0 20px 20px; } /* FIX: more padding */
.lc-insights-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-top: 8px;
}
.lc-compare-card { border-radius: 12px; padding: 16px; } /* FIX: more padding */
.lc-compare-have {
  background: rgba(16,185,129,.07);
  border: 1px solid rgba(16,185,129,.22);
}
.lc-compare-gap {
  background: rgba(245,158,11,.07);
  border: 1px solid rgba(245,158,11,.22);
}
.lc-compare-head {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px;
}
.lc-compare-have .lc-compare-head { color: var(--success); }
.lc-compare-gap  .lc-compare-head { color: var(--warning); }
.lc-compare-card ul { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.lc-compare-card ul li {
  font-size: 13px; color: var(--muted); line-height: 1.45; /* FIX: bigger */
  padding-left: 16px; position: relative;
}
.lc-compare-have ul li::before { content: '✓'; position: absolute; left: 0; color: var(--success); font-weight: 800; }
.lc-compare-gap  ul li::before { content: '→'; position: absolute; left: 0; color: var(--warning); font-weight: 800; }
.lc-compare-card ul li em { color: var(--brand); font-style: normal; font-weight: 600; }

/* ── Save button ── */
.lc-save-btn {
  position: relative; overflow: hidden;
  margin-top: 20px !important; /* FIX: ensure spacing */
  height: 44px; font-size: 14px; /* FIX: taller, bigger text */
  letter-spacing: .3px;
}
.lc-save-btn.saving::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(255,255,255,.15);
  animation: lcpulse .6s ease infinite alternate;
}
@keyframes lcpulse { from { opacity: 0; } to { opacity: 1; } }

/* ── Responsive ── */
@media (max-width: 1200px) {
  .lc-layout { grid-template-columns: 1fr 280px; }
  .lc-lang-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
@media (max-width: 900px) {
  .lc-layout { grid-template-columns: 1fr; }
  .lc-panel-sticky { position: static; max-height: none; }
  /* On single-column layout let .content handle the scroll — no inner scroll needed */
  .lc-grid-scroll { max-height: none; overflow-y: visible; }
}
@media (max-width: 768px) {
  /* Language Config responsive: smaller cards, full scroll */
  .lc-lang-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .lc-lang-card { padding: 12px 12px 8px; }
  .lc-lang-icon { width: 32px; height: 32px; font-size: 14px; }
  .lc-lang-name { font-size: 12px; }
  .lc-lang-rules { font-size: 11px; padding: 2px 7px; }
}
@media (max-width: 600px) {
  .lc-lang-grid { grid-template-columns: 1fr 1fr; }
  /* Ensure rules badge never overflows card on small screens */
  .lc-card-head { gap: 6px; }
  .lc-lang-rules { padding: 2px 6px; font-size: 10px; }
}
