/* ── Reset & Base ────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --black: #000000;
  --white: #ffffff;
  --gray-bg: #f5f5f7;
  --near-black: #1d1d1f;
  --blue: #0071e3;
  --link-blue: #0066cc;
  --bright-blue: #2997ff;
  --text-primary: rgba(255,255,255,0.92);
  --text-secondary: rgba(255,255,255,0.64);
  --text-tertiary: rgba(255,255,255,0.4);
  --text-faint: rgba(255,255,255,0.24);
  --dark-surface: #1c1c1e;
  --dark-surface-2: #2c2c2e;
  --dark-surface-3: #3a3a3c;
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.16);
  --card-shadow: 0 2px 12px rgba(0,0,0,0.3);
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 8px;
  --r-lg: 8px;
  --r-pill: 8px;
  --transition: 0.18s ease;
  --nav-height: 52px;
  --mobile-nav-height: 56px;
  --safe-top: env(safe-area-inset-top, 0px);
  --theme-primary-rgb: 0,113,227;

  /* Status Colors */
  --status-open: #ff9f0a;
  --status-solved: #30d158;
  --status-reopened: #ff453a;

  /* Priority Colors */
  --priority-low: #64d2ff;
  --priority-medium: #ff9f0a;
  --priority-high: #ff6961;
  --priority-critical: #ff453a;
}

html { font-size: 16px; }

body {
  font-family: -apple-system, 'SF Pro Text', 'Inter', 'Helvetica Neue', Arial, sans-serif;
  background: var(--black);
  color: var(--text-primary);
  line-height: 1.47;
  letter-spacing: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body[data-theme="light"] {
  --black: #f4f7fb;
  --white: #0f172a;
  --text-primary: rgba(15,23,42,0.94);
  --text-secondary: rgba(51,65,85,0.74);
  --text-tertiary: rgba(71,85,105,0.58);
  --text-faint: rgba(71,85,105,0.36);
  --dark-surface: #ffffff;
  --dark-surface-2: #f1f5f9;
  --dark-surface-3: #e2e8f0;
  --border: rgba(15,23,42,0.11);
  --border-hover: rgba(37,99,235,0.24);
  --card-shadow: 0 2px 14px rgba(15,23,42,0.08);
  background: #f4f7fb;
}

button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }

/* ── Navigation Glass ────────────────────────────────────────── */
.nav-glass {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(var(--nav-height) + var(--safe-top));
  padding-top: var(--safe-top);
  background: rgba(0,0,0,0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  z-index: 1000;
  border-bottom: 1px solid var(--border);
}

body[data-theme="light"] .nav-glass {
  background: rgba(255,255,255,0.76);
}

.nav-inner {
  max-width: 1440px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.nav-left { display: flex; align-items: center; gap: 12px; }
.nav-logo { height: 22px; width: auto; }
.nav-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--white);
  margin-right: 8px;
}

.nav-tabs { display: flex; gap: 2px; margin-left: 8px; }
.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: transparent;
  border: none;
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.nav-tab:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }
.nav-tab.active { background: rgba(var(--theme-primary-rgb),0.16); color: var(--white); }

.mobile-tabbar { display: none; }

.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-user {
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0;
}
.nav-action {
  width: 28px; height: 28px;
  background: transparent;
}
.nav-action:hover { background: rgba(255,255,255,0.08); }

.btn-nav {
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--bright-blue);
  font-size: 12px;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.btn-nav:hover { background: rgba(255,255,255,0.06); }

body[data-theme="light"] .btn-nav {
  border-color: rgba(37,99,235,0.22);
}

/* ── Screens ─────────────────────────────────────────────────── */
.screen { min-height: 100vh; min-height: 100dvh; }
.screen-center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
}
.tab-content { padding-top: calc(var(--nav-height) + var(--safe-top)); }

#screen-login {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 8%, rgba(37, 99, 235, 0.28), transparent 34%),
    linear-gradient(135deg, #080c17 0%, #0d1320 50%, #132336 100%);
  border: 1px solid rgba(255,255,255,0.05);
}

body[data-theme="light"] #screen-login {
  background:
    radial-gradient(circle at 92% 8%, rgba(37, 99, 235, 0.18), transparent 34%),
    linear-gradient(135deg, #edf3ff 0%, #f8fbff 50%, #eaf2fb 100%);
}

.login-theme-button {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 50%;
  color: rgba(255,255,255,0.7);
}
.login-theme-button .material-symbols-rounded { font-size: 17px; }

body[data-theme="light"] .login-theme-button {
  background: rgba(15,23,42,0.04);
  border-color: rgba(15,23,42,0.12);
  color: rgba(15,23,42,0.68);
}

/* ── Login Card ──────────────────────────────────────────────── */
.login-card {
  width: min(808px, calc(100vw - 40px));
  min-height: 294px;
  display: grid;
  grid-template-columns: 1.2fr 0.98fr;
  background: #f7f9fc;
  border-radius: var(--r-lg);
  padding: 0;
  box-shadow: 0 24px 80px rgba(0,0,0,0.34);
  border: 1px solid rgba(255,255,255,0.08);
  animation: slideUp 0.2s ease;
  overflow: hidden;
}

body[data-theme="light"] .login-card {
  box-shadow: 0 22px 70px rgba(15,23,42,0.16);
}

.login-panel { min-width: 0; }

.login-hero-panel {
  display: flex;
  flex-direction: column;
  padding: 40px 34px 36px;
  background:
    radial-gradient(circle at 14% 18%, rgba(57, 132, 219, 0.22), transparent 30%),
    linear-gradient(135deg, #162f59 0%, #14304c 48%, #17343b 100%);
}

body[data-theme="light"] .login-hero-panel {
  background:
    radial-gradient(circle at 14% 18%, rgba(57, 132, 219, 0.18), transparent 30%),
    linear-gradient(135deg, #173966 0%, #163657 48%, #183d43 100%);
}

.login-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  justify-content: flex-start;
}

.login-logo {
  height: 26px;
  width: 26px;
  object-fit: contain;
  border-radius: 7px;
  background: rgba(255,255,255,0.09);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08);
}

.login-brand {
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--white);
}

.login-hero-title {
  max-width: 390px;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.14;
  color: rgba(255,255,255,0.92);
  margin-bottom: 16px;
  overflow-wrap: anywhere;
}

.login-hero-subtitle {
  color: rgba(255,255,255,0.72);
  font-size: 13px;
  font-weight: 700;
}

.login-hero-kicker {
  margin-top: auto;
  color: rgba(255,255,255,0.55);
  font-size: 10px;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-weight: 700;
  letter-spacing: 0;
}

.login-form-panel {
  padding: 32px 30px;
  background: #f7f9fc;
  color: #101828;
}

.login-title {
  font-size: 18px;
  font-weight: 800;
  text-align: left;
  margin-bottom: 4px;
  letter-spacing: 0;
  color: #101828;
}

.login-desc {
  font-size: 12px;
  color: #667085;
  text-align: left;
  margin-bottom: 18px;
  font-weight: 600;
}

.login-form-panel .field-label {
  color: #667085;
  margin-top: 14px;
  margin-bottom: 6px;
  font-size: 10px;
}

.login-form-panel .field-input {
  background: #eaf0fb;
  border-color: #d4def0;
  color: #111827;
  min-height: 37px;
  box-shadow: inset 0 1px 2px rgba(15,23,42,0.04);
}

.login-form-panel .field-input:focus {
  background: #eef4ff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.16);
}

.login-form-panel .field-input::placeholder { color: #667085; }
.login-form-panel .btn-primary {
  min-height: 36px;
  margin-top: 14px;
  background: #2659de;
  font-weight: 700;
}

.login-form-panel .error-box {
  background: #fff1f0;
  border-color: #ffd0cc;
  color: #b42318;
}

/* ── Error Box ───────────────────────────────────────────────── */
.error-box {
  margin-bottom: 16px;
  padding: 10px 14px;
  background: rgba(255,69,58,0.08);
  border: 1px solid rgba(255,69,58,0.2);
  border-radius: var(--r-sm);
  color: #ff453a;
  font-size: 0.82rem;
}

/* ── Form Fields ─────────────────────────────────────────────── */
.field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  margin-top: 16px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.field-input, .field-select, .field-textarea {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--white);
  font-size: 14px;
  font-family: inherit;
  letter-spacing: 0;
  transition: var(--transition);
  outline: none;
}

.field-input:focus, .field-select:focus, .field-textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,113,227,0.2);
  background: rgba(255,255,255,0.07);
}

.field-input::placeholder, .field-textarea::placeholder {
  color: var(--text-faint);
}

.field-select option { background: var(--dark-surface); color: var(--white); }

body[data-theme="light"] .field-select option {
  background: #ffffff;
  color: #0f172a;
}

body[data-theme="light"] .tool-action,
body[data-theme="light"] .diagnostics-panel,
body[data-theme="light"] .scanner-panel,
body[data-theme="light"] .diagnostic-row,
body[data-theme="light"] .scanner-meta-item,
body[data-theme="light"] .scanner-row,
body[data-theme="light"] .analytics-risk-item,
body[data-theme="light"] .analytics-throughput div {
  background: rgba(15,23,42,0.025);
}

.field-textarea { resize: vertical; min-height: 80px; }

.field-row { display: flex; gap: 12px; }
.field-col { flex: 1; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0;
  white-space: nowrap;
}
.btn-primary:hover { filter: brightness(1.12); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-full { width: 100%; justify-content: center; margin-top: 8px; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  background: transparent;
  color: var(--bright-blue);
  border: 1px solid rgba(41,151,255,0.25);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}
.btn-secondary:hover { background: rgba(41,151,255,0.08); border-color: rgba(41,151,255,0.4); }

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: transparent;
  color: #ff453a;
  border: 1px solid rgba(255,69,58,0.25);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}
.btn-danger:hover { background: rgba(255,69,58,0.08); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}
.btn-ghost:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.06);
  border: none;
  border-radius: var(--r-sm);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: var(--transition);
}
.btn-icon:hover { background: rgba(255,255,255,0.1); color: var(--white); }

.btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: none;
  border-radius: var(--r-xs);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}
.btn-sm-success { background: rgba(48,209,88,0.15); color: var(--status-solved); }
.btn-sm-success:hover { background: rgba(48,209,88,0.25); }
.btn-sm-warning { background: rgba(255,159,10,0.15); color: var(--status-open); }
.btn-sm-warning:hover { background: rgba(255,159,10,0.25); }
.btn-sm-ghost { background: rgba(255,255,255,0.06); color: var(--text-secondary); }
.btn-sm-ghost:hover { background: rgba(255,255,255,0.1); }

.btn-vote {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-tertiary);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}
.btn-vote:hover { background: rgba(255,255,255,0.08); }
.btn-vote.voted {
  background: rgba(0,113,227,0.12);
  border-color: rgba(0,113,227,0.25);
  color: var(--bright-blue);
}

/* ── Page Header ─────────────────────────────────────────────── */
.dash-container {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px 24px 48px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  min-width: 0;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.section-heading {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
  margin-bottom: 16px;
}

/* ── Stats Grid ──────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--dark-surface);
  border-radius: var(--r-md);
  padding: 18px 16px;
  border: 1px solid var(--border);
  transition: var(--transition);
  min-width: 0;
}
.stat-card:hover { border-color: var(--border-hover); }

.stat-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.stat-card-header .material-symbols-rounded {
  font-size: 16px;
  color: var(--text-tertiary);
}

.stat-label {
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0;
  text-transform: uppercase;
  font-weight: 600;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.1;
}

/* ── Insights Row ────────────────────────────────────────────── */
.insights-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.insight-card {
  background: var(--dark-surface);
  border-radius: var(--r-md);
  padding: 20px;
  border: 1px solid var(--border);
  min-width: 0;
}

.insight-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.insight-header .material-symbols-rounded {
  font-size: 18px;
  color: var(--bright-blue);
}
.insight-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.insight-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.insight-row:last-child { border-bottom: none; }
.insight-row-label {
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: capitalize;
  overflow-wrap: anywhere;
}
.insight-row-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.insight-bar {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
}
.insight-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--bright-blue);
  transition: width 0.4s ease;
}

/* ── Filter Bar ──────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--text-faint);
  pointer-events: none;
}
.search-input {
  display: block;
  width: 100%;
  padding: 9px 40px 9px 38px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--white);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}
.search-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,113,227,0.2);
  background: rgba(255,255,255,0.07);
}
.search-input::placeholder { color: var(--text-faint); }

.search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  padding: 1px 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
  font-family: inherit;
  color: var(--text-faint);
  pointer-events: none;
}

.filter-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.filter-select {
  width: auto !important;
  padding: 8px 30px 8px 10px !important;
  font-size: 13px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  -webkit-appearance: none;
  appearance: none;
}

.dashboard-command-row,
.issues-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -12px 0 18px;
}

.dashboard-command-row {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.listing-label {
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.issues-toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.listing-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.listing-action .material-symbols-rounded {
  font-size: 18px;
}

.listing-action:hover,
.listing-action.active {
  color: var(--bright-blue);
  border-color: rgba(var(--theme-primary-rgb),0.38);
  background: rgba(var(--theme-primary-rgb),0.1);
}

.changelog-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin: -8px 0 18px;
}

.issues-list-compact .issue-card {
  padding-top: 10px;
  padding-bottom: 10px;
}

.issues-list-compact .issue-meta {
  gap: 8px;
}

/* ── View Tabs ───────────────────────────────────────────────── */
.view-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.view-tab {
  padding: 8px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: -1px;
}
.view-tab:hover { color: var(--text-secondary); }
.view-tab.active {
  color: var(--bright-blue);
  border-bottom-color: var(--bright-blue);
}

/* ── Bulk Actions Bar ────────────────────────────────────────── */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(0,113,227,0.08);
  border: 1px solid rgba(0,113,227,0.2);
  border-radius: var(--r-sm);
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--bright-blue);
  font-weight: 500;
}

/* ── Issues List ─────────────────────────────────────────────── */
.issues-list { display: flex; flex-direction: column; gap: 6px; }

.issue-card {
  background: var(--dark-surface);
  border-radius: var(--r-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--border);
  min-width: 0;
}
.issue-card:hover {
  background: var(--dark-surface-2);
  border-color: var(--border-hover);
}
.issue-card.feature-card {
  border-color: rgba(48,209,88,0.22);
}
.issue-card.feature-card:hover {
  border-color: rgba(48,209,88,0.42);
}
.issue-card.selected {
  border-color: rgba(0,113,227,0.4);
  background: rgba(0,113,227,0.06);
}

.issue-checkbox {
  width: 16px; height: 16px;
  border: 1.5px solid var(--text-faint);
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}
.issue-checkbox.checked {
  background: var(--blue);
  border-color: var(--blue);
}
.issue-checkbox.checked::after {
  content: '';
  width: 8px;
  height: 5px;
  border-left: 1.5px solid white;
  border-bottom: 1.5px solid white;
  transform: rotate(-45deg) translateY(-1px);
}

.issue-priority-bar {
  width: 3px;
  height: 36px;
  border-radius: 2px;
  flex-shrink: 0;
}

.issue-main { flex: 1; min-width: 0; }

.issue-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.issue-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.issue-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  letter-spacing: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.issue-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.issue-meta-item .material-symbols-rounded { font-size: 13px; }

.issue-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ── Status & Priority Badges ────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-xs);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
  flex-shrink: 0;
}

.badge-open { background: rgba(255,159,10,0.12); color: var(--status-open); }
.badge-solved { background: rgba(48,209,88,0.12); color: var(--status-solved); }
.badge-reopened { background: rgba(255,69,58,0.12); color: var(--status-reopened); }

.badge-low { background: rgba(100,210,255,0.1); color: var(--priority-low); }
.badge-medium { background: rgba(255,159,10,0.1); color: var(--priority-medium); }
.badge-high { background: rgba(255,105,97,0.1); color: var(--priority-high); }
.badge-critical { background: rgba(255,69,58,0.12); color: var(--priority-critical); }
.badge-stale { background: rgba(255,204,0,0.12); color: #ffd60a; }
.badge-unassigned { background: rgba(191,90,242,0.12); color: #bf5af2; }
.badge-feature { background: rgba(48,209,88,0.12); color: var(--status-solved); }
.badge-feature .material-symbols-rounded { font-size: 12px; }

/* ── Operations Tools ───────────────────────────────────────── */
.triage-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: -4px 0 16px;
}

.tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}
.tool-chip .material-symbols-rounded { font-size: 15px; }
.tool-chip:hover { background: rgba(255,255,255,0.07); color: var(--text-primary); border-color: var(--border-hover); }
.tool-chip.active {
  color: var(--bright-blue);
  border-color: rgba(41,151,255,0.35);
  background: rgba(41,151,255,0.1);
}
.tool-chip.ghost { color: var(--text-tertiary); }

.modal-subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-tertiary);
}

.analytics-workbench {
  margin-top: 18px;
  display: grid;
  gap: 16px;
}

.analytics-workbench-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding-top: 4px;
}

.analytics-tools-grid {
  margin-bottom: 0;
}

.analytics-ops-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(0, 1.28fr);
  gap: 16px;
  align-items: start;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.tool-action {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 86px;
  padding: 14px;
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-primary);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}
.tool-action:hover {
  background: rgba(255,255,255,0.06);
  border-color: var(--border-hover);
}
.tool-action > .material-symbols-rounded {
  color: var(--bright-blue);
  font-size: 22px;
  flex-shrink: 0;
}
.tool-action strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 3px;
}
.tool-action small {
  display: block;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.4;
}

.diagnostics-panel {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 16px;
}

.diagnostics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.diagnostics-header h4 {
  font-size: 14px;
  font-weight: 600;
}

.diagnostics-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.diagnostic-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--r-xs);
  font-size: 13px;
}
.diagnostic-row span { color: var(--text-tertiary); }
.diagnostic-row strong {
  color: var(--text-secondary);
  font-weight: 600;
  text-align: right;
}
.diagnostic-row.ok strong { color: var(--status-solved); }
.diagnostic-row.warn strong { color: var(--status-open); }

.scanner-panel {
  margin-top: 14px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 16px;
}

.analytics-ops-grid .scanner-panel { margin-top: 0; }

.panel-subtitle {
  margin-top: 3px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.scanner-add {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.scanner-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.scanner-add .field-input {
  margin: 0;
}

.scanner-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scanner-report-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.scanner-terminal {
  min-height: 148px;
  max-height: 260px;
  overflow: auto;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(48,209,88,0.22);
  border-radius: var(--r-sm);
  background: #050807;
  color: #d7ffe4;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
}

.scanner-terminal-line {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.scanner-terminal-line span {
  color: rgba(215,255,228,0.52);
}

.scanner-terminal-line code {
  white-space: pre-wrap;
  word-break: break-word;
  color: inherit;
}

.scanner-terminal-line.success code { color: #8cffaa; }
.scanner-terminal-line.warn code { color: #ffd37a; }
.scanner-terminal-line.error code { color: #ff8b8b; }

.scanner-meta-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  font-size: 12px;
}
.scanner-meta-item span { color: var(--text-tertiary); }
.scanner-meta-item strong {
  color: var(--text-secondary);
  font-weight: 700;
  text-align: right;
  overflow-wrap: anywhere;
}
.scanner-meta-item.ok strong { color: var(--status-solved); }
.scanner-meta-item.warn strong { color: var(--status-open); }

.scanner-list.is-scanning {
  opacity: 0.72;
}

.scanner-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}

.scanner-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.scanner-url {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.scanner-main small {
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.35;
}

.scanner-state {
  width: fit-content;
  padding: 2px 7px;
  border-radius: var(--r-xs);
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.scanner-ok .scanner-state { background: rgba(48,209,88,0.13); color: var(--status-solved); }
.scanner-warn .scanner-state { background: rgba(255,159,10,0.13); color: var(--status-open); }
.scanner-down .scanner-state { background: rgba(255,69,58,0.13); color: var(--status-reopened); }

.scanner-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.scanner-remove:hover {
  color: var(--status-reopened);
}

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.modal-card {
  background: var(--dark-surface);
  border-radius: var(--r-lg);
  width: min(520px, 100%);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  padding: 28px 32px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  border: 1px solid var(--border);
  animation: slideUp 0.2s ease;
  overscroll-behavior: contain;
}

.modal-card-wide { width: min(860px, 100%); }
.modal-card-shortcuts { width: min(440px, 100%); }

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.modal-heading {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
}

.detail-header-left { flex: 1; min-width: 0; }

.detail-id {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 0;
  margin-bottom: 2px;
  display: block;
}

/* ── Upload Area ─────────────────────────────────────────────── */
.upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  border: 2px dashed rgba(255,255,255,0.1);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.upload-area:hover { border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.02); }
.upload-area.has-file { border-color: var(--blue); border-style: solid; }

.upload-icon { font-size: 28px; color: var(--text-faint); }
.upload-text { font-size: 13px; color: var(--text-tertiary); }

.upload-preview {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--r-sm);
  object-fit: contain;
}

/* ── Detail View ─────────────────────────────────────────────── */
.detail-section { margin-bottom: 20px; }
.detail-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0;
  margin-bottom: 6px;
}
.detail-text { font-size: 14px; line-height: 1.55; color: var(--text-primary); }

.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
  padding: 16px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}

.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.screenshot-container {
  margin-top: 8px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  text-align: center;
}
.detail-image {
  max-width: 100%;
  max-height: 400px;
  border-radius: var(--r-sm);
  cursor: pointer;
  object-fit: contain;
  transition: var(--transition);
}
.detail-image:hover { opacity: 0.9; }
.screenshot-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 24px;
  color: var(--text-faint);
  font-size: 13px;
}

/* ── Comments ────────────────────────────────────────────────── */
.comments-section { margin-top: 24px; }
.comments-section .detail-label { margin-bottom: 12px; }

.comment-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }

.comment-item {
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--r-sm);
  border: 1px solid rgba(255,255,255,0.04);
}

.comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.comment-author {
  font-size: 13px;
  font-weight: 600;
  color: var(--bright-blue);
}

.comment-time {
  font-size: 11px;
  color: var(--text-faint);
}

.comment-body {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-delete {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  transition: var(--transition);
  display: flex;
  align-items: center;
}
.comment-delete:hover { color: #ff453a; background: rgba(255,69,58,0.1); }

.comment-form {
  display: flex;
  gap: 8px;
}
.comment-input {
  flex: 1;
  padding: 10px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--white);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  resize: none;
  min-height: 40px;
  transition: var(--transition);
}
.comment-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,113,227,0.2);
}
.comment-input::placeholder { color: var(--text-faint); }

/* ── Activity Log ────────────────────────────────────────────── */
.log-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  font-size: 13px;
  color: var(--text-tertiary);
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.log-item:last-child { border-bottom: none; }
.log-action {
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: capitalize;
}
.log-details {
  font-size: 12px;
  color: var(--text-faint);
  font-style: italic;
}
.log-time { font-size: 11px; color: var(--text-faint); margin-left: auto; white-space: nowrap; }

/* ── Keyboard Shortcuts ──────────────────────────────────────── */
.shortcuts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--r-sm);
}

.shortcut-item kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 3px 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  color: var(--text-secondary);
}

.shortcut-item span {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ── Toast Notifications ─────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--dark-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  font-size: 14px;
  color: var(--text-primary);
  min-width: 280px;
  max-width: 420px;
  animation: toastIn 0.25s ease;
}

.toast-success { border-left: 3px solid var(--status-solved); }
.toast-error { border-left: 3px solid var(--status-reopened); }
.toast-info { border-left: 3px solid var(--bright-blue); }

.toast .material-symbols-rounded { font-size: 18px; flex-shrink: 0; }
.toast-success .material-symbols-rounded { color: var(--status-solved); }
.toast-error .material-symbols-rounded { color: var(--status-reopened); }
.toast-info .material-symbols-rounded { color: var(--bright-blue); }

.toast-text { flex: 1; font-size: 13px; }

@keyframes toastIn { from { opacity: 0; transform: translateY(8px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-4px); } }

/* ── Lightbox ────────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  animation: fadeIn 0.15s ease;
  cursor: zoom-out;
}
.lightbox-img {
  max-width: 95%;
  max-height: 95vh;
  object-fit: contain;
  border-radius: var(--r-sm);
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* ── Analytics Grid ──────────────────────────────────────────── */
.analytics-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.analytics-summary-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  background: var(--dark-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.analytics-summary-card .material-symbols-rounded {
  color: var(--bright-blue);
  font-size: 22px;
  flex-shrink: 0;
}

.analytics-summary-card.warn .material-symbols-rounded { color: var(--status-open); }
.analytics-summary-card strong {
  display: block;
  font-size: 24px;
  line-height: 1;
  color: var(--text-primary);
}
.analytics-summary-card small {
  display: block;
  margin-top: 5px;
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 600;
}

.analytics-briefing {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: 16px;
  margin-bottom: 16px;
}

.analytics-briefing-card {
  background: var(--dark-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px;
  min-width: 0;
}

.analytics-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.analytics-card-header h3 {
  font-size: 15px;
  font-weight: 700;
}

.analytics-risk-list {
  display: grid;
  gap: 8px;
}

.analytics-risk-item {
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 11px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.analytics-risk-item:hover {
  background: rgba(255,255,255,0.055);
  border-color: var(--border-hover);
}

.analytics-risk-item .issue-priority-bar {
  width: 4px;
  height: 36px;
}

.analytics-risk-item strong {
  display: block;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-risk-item small {
  display: block;
  margin-top: 3px;
  color: var(--text-tertiary);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.analytics-throughput {
  display: grid;
  gap: 10px;
}

.analytics-throughput div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}

.analytics-throughput strong {
  font-size: 23px;
  color: var(--text-primary);
}

.analytics-throughput small {
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 700;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.analytics-card {
  background: var(--dark-surface);
  border-radius: var(--r-md);
  padding: 24px;
  border: 1px solid var(--border);
  min-width: 0;
}

.analytics-card-wide { grid-column: 1 / -1; }

.analytics-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.bar-chart { display: flex; flex-direction: column; gap: 10px; }

.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.bar-label {
  font-size: 13px;
  color: var(--text-secondary);
  width: 80px;
  text-transform: capitalize;
  flex-shrink: 0;
  overflow-wrap: anywhere;
}

.bar-track {
  flex: 1;
  height: 24px;
  background: rgba(255,255,255,0.04);
  border-radius: var(--r-xs);
  overflow: hidden;
  position: relative;
}

.bar-fill {
  height: 100%;
  border-radius: var(--r-xs);
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--white);
  min-width: fit-content;
}

.analytics-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.analytics-metric-card { border: 1px solid var(--border); }
.analytics-metric-value {
  font-size: 24px;
  margin-top: 4px;
}

.empty-inline {
  padding: 18px 0;
  color: var(--text-faint);
  font-size: 13px;
}

/* ── Empty State ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-faint);
}
.empty-state .material-symbols-rounded { font-size: 40px; margin-bottom: 12px; display: block; }
.empty-state p { font-size: 14px; }

/* ── Loading ─────────────────────────────────────────────────── */
.spinner {
  width: 24px; height: 24px;
  border: 2px solid rgba(255,255,255,0.08);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── Assignees ───────────────────────────────────────────────── */
.detail-section-wide { grid-column: span 2; }

.assignee-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}

.assignee-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 4px;
  background: rgba(100, 210, 255, 0.1);
  border: 1px solid rgba(100, 210, 255, 0.28);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
}

.assignee-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #64d2ff, #0a84ff);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.assignee-remove {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-secondary);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
  padding: 0;
}
.assignee-remove:hover { background: rgba(255, 69, 58, 0.4); color: #fff; }

.assignee-add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.assignee-add:hover { border-color: var(--bright-blue); color: var(--bright-blue); background: rgba(100, 210, 255, 0.05); }

.assignee-empty { font-size: 13px; color: var(--text-faint); padding: 4px 0; }

/* Assignee Picker Popover */
.assignee-picker-pop {
  z-index: 10000;
  width: 300px;
  max-height: 360px;
  background: rgba(28, 28, 30, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.assignee-picker-search {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  padding: 12px 14px;
  font-size: 13px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

.assignee-picker-list {
  overflow-y: auto;
  flex: 1;
  padding: 4px;
}

.assignee-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.assignee-picker-item:hover { background: rgba(255, 255, 255, 0.06); }

.assignee-picker-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--bright-blue);
  margin: 0;
  cursor: pointer;
}

.assignee-picker-name {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}
.assignee-picker-email {
  display: block;
  font-size: 11px;
  color: var(--text-faint);
}

.assignee-picker-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.3);
}

.btn-sm-primary {
  background: var(--bright-blue);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.btn-sm-primary:hover { background: #50b8e8; }

/* ── Changelog ───────────────────────────────────────────────── */
.changelog-app-switcher {
  display: flex;
  gap: 8px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  margin-bottom: 24px;
  flex-wrap: wrap;
  min-width: 0;
}

.changelog-app-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-radius: var(--r-xs);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  flex: 1;
  justify-content: center;
  min-width: 0;
  min-height: 40px;
}
.changelog-app-btn:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.04); }
.changelog-app-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.changelog-body { min-height: 300px; }

.changelog-timeline {
  position: relative;
  padding-left: 28px;
}
.changelog-timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(to bottom, var(--border), transparent);
}

.changelog-entry {
  position: relative;
  margin-bottom: 20px;
}

.changelog-marker {
  position: absolute;
  left: -25px;
  top: 14px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 0 2px var(--border);
}

.changelog-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 16px 18px;
  transition: all 0.2s ease;
  min-width: 0;
}
.changelog-card:hover { border-color: rgba(255, 255, 255, 0.15); background: rgba(255, 255, 255, 0.05); }

.changelog-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.changelog-type {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0;
}

.changelog-version {
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: 6px;
}

.changelog-date {
  font-size: 12px;
  color: var(--text-faint);
  margin-left: auto;
}

.changelog-delete {
  background: transparent;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.changelog-delete:hover { color: #ff453a; background: rgba(255, 69, 58, 0.1); }

.changelog-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}

.changelog-content {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
  white-space: pre-wrap;
  margin-bottom: 10px;
  overflow-wrap: anywhere;
}

.changelog-footer {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-faint);
}

.changelog-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  font-size: 15px;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .analytics-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .analytics-briefing,
  .analytics-ops-grid { grid-template-columns: 1fr; }
  .analytics-grid { grid-template-columns: 1fr; }
  .analytics-metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-inner { padding: 0 18px; }
  .nav-title { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (max-width: 768px) {
  .nav-glass {
    height: calc(var(--mobile-nav-height) + var(--safe-top));
    padding-top: var(--safe-top);
  }
  .nav-inner { padding: 0 12px; }
  .nav-left { min-width: 0; gap: 8px; }
  .nav-tabs { display: none; }
  .nav-title { font-size: 13px; max-width: 132px; }
  .nav-right { gap: 6px; }
  .nav-action { width: 34px; height: 34px; }
  .btn-nav { padding: 6px 10px; border-radius: var(--r-sm); }
  .mobile-tabbar {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 1200;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 6px;
    background: rgba(28,28,30,0.92);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.42);
  }
  body[data-theme="light"] .mobile-tabbar {
    background: rgba(255,255,255,0.9);
    box-shadow: 0 12px 30px rgba(15,23,42,0.16);
  }
  .mobile-tabbar .nav-tab {
    min-width: 0;
    min-height: 52px;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    padding: 6px 4px;
    font-size: 11px;
    border-radius: var(--r-xs);
  }
  .mobile-tabbar .nav-tab .material-symbols-rounded { font-size: 18px; }
  .tab-content {
    padding-top: calc(var(--mobile-nav-height) + var(--safe-top));
    padding-bottom: 92px;
  }
  .dash-container { padding: 20px 16px 112px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .insights-row { grid-template-columns: 1fr; }
  .stat-card { padding: 14px 12px; }
  .stat-value { font-size: 24px; }
  .filter-bar { flex-direction: column; }
  .search-box { min-width: 100%; }
  .dashboard-command-row,
  .issues-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .issues-toolbar-actions,
  .dashboard-command-row {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .listing-action { justify-content: center; }
  .changelog-filter-row { grid-template-columns: 1fr; }
  .filter-group {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .filter-select { width: 100% !important; }
  .page-header { flex-direction: column; }
  .page-title { font-size: 25px; }
  .header-actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .header-actions .btn-primary,
  .header-actions .btn-secondary,
  .page-header > .btn-primary { width: 100%; justify-content: center; }
  .triage-tools {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .triage-tools::-webkit-scrollbar { display: none; }
  .tool-chip { flex: 0 0 auto; }
  .view-tabs {
    overflow-x: auto;
    scrollbar-width: none;
  }
  .view-tabs::-webkit-scrollbar { display: none; }
  .view-tab { flex: 0 0 auto; padding: 10px 14px; }
  .bulk-bar { flex-wrap: wrap; align-items: stretch; }
  .bulk-bar .btn-sm { flex: 1 1 auto; justify-content: center; }
  .tools-grid { grid-template-columns: 1fr; }
  .modal-overlay { align-items: flex-start; padding: 10px; overflow-y: auto; }
  .modal-card {
    width: 100%;
    max-height: calc(100dvh - 20px);
    border-radius: var(--r-sm);
    padding: 22px;
  }
  .modal-card-wide,
  .modal-card-shortcuts { width: 100%; }
  .modal-header { position: sticky; top: 0; z-index: 1; background: var(--dark-surface); padding-bottom: 12px; }
  .analytics-card { padding: 18px; }
  .analytics-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-summary-card { padding: 14px; }
  .analytics-briefing-card { padding: 16px; }
  .analytics-workbench-header { flex-direction: column; }
  .analytics-metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .bar-row { align-items: flex-start; flex-direction: column; gap: 6px; }
  .bar-label { width: auto; }
  .bar-track { width: 100%; height: 26px; }
  .diagnostics-header { align-items: flex-start; flex-direction: column; }
  .scanner-header-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .scanner-header-actions .btn-sm { justify-content: center; }
  .scanner-add, .scanner-row { flex-direction: column; align-items: stretch; }
  .scanner-report-meta { grid-template-columns: 1fr; }
  .scanner-actions { justify-content: flex-end; }
  .issue-card { flex-wrap: wrap; gap: 8px; }
  .issue-priority-bar { width: 100%; height: 3px; }
  .issue-title-row { flex-wrap: wrap; align-items: flex-start; }
  .issue-name { width: 100%; white-space: normal; overflow: visible; }
  .issue-meta { gap: 8px; align-items: flex-start; }
  .issue-actions { justify-content: flex-end; width: 100%; }
  .field-row { flex-direction: column; gap: 0; }
  .detail-meta-grid { grid-template-columns: 1fr 1fr; }
  .nav-user { display: none; }
  .search-kbd { display: none; }
  .shortcuts-grid { grid-template-columns: 1fr; }
  .login-card {
    width: min(520px, calc(100vw - 24px));
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .login-hero-panel {
    padding: 28px 24px;
    min-height: 240px;
  }
  .login-hero-title {
    font-size: 25px;
    max-width: 100%;
  }
  .login-form-panel { padding: 28px 24px; }
  .changelog-app-switcher {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .changelog-app-switcher::-webkit-scrollbar { display: none; }
  .changelog-app-btn { flex: 0 0 auto; min-width: 132px; }
  .changelog-timeline { padding-left: 18px; }
  .changelog-timeline::before { left: 5px; }
  .changelog-marker {
    left: -18px;
    width: 12px;
    height: 12px;
  }
  .changelog-card { padding: 14px; }
  .changelog-date { margin-left: 0; width: 100%; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .screen-center { align-items: flex-start; padding: 70px 12px 24px; }
  .login-theme-button { top: 16px; right: 16px; }
  .login-card {
    width: 100%;
    border-radius: var(--r-sm);
    margin-top: 0;
  }
  .login-hero-panel {
    padding: 24px 20px;
    min-height: 218px;
  }
  .login-header { margin-bottom: 22px; }
  .login-hero-title { font-size: 24px; }
  .login-form-panel { padding: 24px 20px; }
  .modal-card { padding: 18px; }
  .dash-container { padding: 16px 12px 112px; }
  .page-header { margin-bottom: 18px; gap: 12px; }
  .page-title { font-size: 24px; }
  .page-subtitle { font-size: 13px; }
  .filter-group { grid-template-columns: 1fr; }
  .issues-toolbar-actions,
  .dashboard-command-row { grid-template-columns: 1fr; }
  .header-actions { grid-template-columns: 1fr; }
  .scanner-header-actions { grid-template-columns: 1fr; }
  .detail-meta-grid { grid-template-columns: 1fr; }
  .analytics-summary-grid { grid-template-columns: 1fr; }
  .analytics-risk-item strong { white-space: normal; }
  .analytics-metrics-grid { grid-template-columns: 1fr; }
  .analytics-card { padding: 16px; }
  .changelog-app-btn { min-width: 118px; padding: 9px 12px; }
  .changelog-timeline { padding-left: 0; }
  .changelog-timeline::before,
  .changelog-marker { display: none; }
  .toast-container { left: 12px; right: 12px; bottom: 96px; }
  .toast { min-width: 0; width: 100%; }
}

@media (max-height: 620px) and (max-width: 768px) {
  .screen-center { align-items: flex-start; }
  .login-card {
    margin-top: 0;
  }
  .login-hero-panel,
  .login-form-panel { padding-top: 20px; padding-bottom: 20px; }
  .login-header { margin-bottom: 16px; }
  .login-desc { margin-bottom: 16px; }
}
