/* ─────────────────────────────────────────────────────────────────────────────
   Bugnet Web App — Styles
   ───────────────────────────────────────────────────────────────────────────── */

:root {
  --cream:      #FFFFFF;
  --cream2:     #F5F7FB;
  --cream3:     #EEF1F7;
  --paper:      #F5F7FB;
  --coral:      #2E5BFF;
  --coral-lt:   #E7EDFF;
  --coral-md:   #9DB2FF;
  --sage:       #0B7A55;
  --sage-lt:    #E3F6EF;
  --sage-md:    #7FD9B5;
  --mustard:    #F5A524;
  --mustard-lt: #FFF3DC;
  --navy:       #0A0F1E;
  --ink:        #0E1320;
  --ink2:       #3F4757;
  --ink3:       #6B7385;
  --ink4:       #C3C9D6;
  --border:     #E4E7EE;
  --red:        #E5392A;
  --red-lt:     #FFE8E5;
  --f-head: 'Manrope', sans-serif;
  --f-body: 'Manrope', sans-serif;
  --f-hand: 'Manrope', sans-serif;
  --shadow-sm: 0 2px 8px rgba(14,19,32,0.08);
  --shadow-md: 0 6px 24px rgba(14,19,32,0.10);
  --shadow-lg: 0 16px 48px rgba(14,19,32,0.12);
  --sidebar-w: 240px;
  --radius: 12px;
  --radius-sm: 8px;
}

[data-theme="dark"] {
  --red:        #FF6B5E;
  --red-lt:     #3A1519;
  --cream:      #070B16;
  --cream2:     #0E1426;
  --cream3:     #162044;
  --paper:      #070B16;
  --coral:      #2E5BFF;
  --coral-lt:   #1A2344;
  --coral-md:   #7EA0FF;
  --sage:       #4FD9A6;
  --sage-lt:    #0F2A22;
  --sage-md:    #7FD9B5;
  --mustard:    #F5B544;
  --mustard-lt: #2A2110;
  --navy:       #AEB7CC;
  --ink:        #E4E7EE;
  --ink2:       #B6BDCB;
  --ink3:       #6B7694;
  --ink4:       #3A4566;
  --border:     #1E2742;
}
[data-theme="dark"] body { background: #070B16; color: #E4E7EE; }
[data-theme="dark"] .sidebar { background: #0A0F1E; border-color: #1E2742; }
[data-theme="dark"] .form-card,
[data-theme="dark"] .detail-card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .project-card,
[data-theme="dark"] .comment,
[data-theme="dark"] .modal,
[data-theme="dark"] .bug-list { background: #0E1426; }
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-textarea,
[data-theme="dark"] .comment-form textarea { background: #070B16; color: #E4E7EE; border-color: #1E2742; }
[data-theme="dark"] .bug-row:hover { background: #141C33; }
[data-theme="dark"] .kanban-card { background: #0E1426 !important; border-color: #1E2742 !important; }
[data-theme="dark"] .kanban-col { background: #0A0F1E; }
[data-theme="dark"] .user-pill { background: #141C33; }
[data-theme="dark"] .filter-chip { background: #0E1426; border-color: #1E2742; color: #B6BDCB; }
[data-theme="dark"] .chat-panel { background: #0A0F1E; }
[data-theme="dark"] .toast { background: #1E2742; }
[data-theme="dark"] ::-webkit-scrollbar-track { background: #0E1426; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #3A4566; }

/* ─── Dark mode: page-specific components ────────────────────────────────── */
[data-theme="dark"] .plan-banner,
[data-theme="dark"] .usage-card,
[data-theme="dark"] .payment-card,
[data-theme="dark"] .pricing-card,
[data-theme="dark"] .invoice-card,
[data-theme="dark"] .billing-summary,
[data-theme="dark"] .member-list,
[data-theme="dark"] .invite-section,
[data-theme="dark"] .danger-zone,
[data-theme="dark"] .code-block,
[data-theme="dark"] .int-nav-btn,
[data-theme="dark"] .card-action-btn { background: #0E1426; }

[data-theme="dark"] .role-select,
[data-theme="dark"] .remove-btn,
[data-theme="dark"] .cc-input,
[data-theme="dark"] .dep-select,
[data-theme="dark"] .label-input { background: #070B16; color: #E4E7EE; border-color: #1E2742; }

[data-theme="dark"] .code-tab.active { background: #0E1426; color: var(--coral); border-bottom-color: #0E1426; }
[data-theme="dark"] .int-nav-btn.active { background: var(--coral-lt); }
[data-theme="dark"] .invoice-row:hover { background: #141C33; }
[data-theme="dark"] .no-payment { background: #070B16; }
[data-theme="dark"] #userMenu { background: #0E1426 !important; }
[data-theme="dark"] #userMenu a:hover,
[data-theme="dark"] #userMenu button:hover { background: #141C33 !important; }
[data-theme="dark"] .upgrade-banner { background: linear-gradient(135deg, #2A2110, #2a2418) !important; border-color: #5a4a2a !important; }
[data-theme="dark"] .upgrade-banner * { color: #E4E7EE; }
[data-theme="dark"] #integrateBanner { background: linear-gradient(135deg, #0F2A22, #1a2e2a) !important; border-color: #2a5a4a !important; }
[data-theme="dark"] #integrateBanner * { color: #E4E7EE; }
[data-theme="dark"] .danger-zone { border-color: var(--red); }
[data-theme="dark"] .member-row:hover { background: #141C33; }
[data-theme="dark"] .pending-row:hover { background: #141C33; }
[data-theme="dark"] .stat-icon-navy,
[data-theme="dark"] .badge-navy { background: #141C33; }
[data-theme="dark"] .git-connected-card,
[data-theme="dark"] .connect-prompt,
[data-theme="dark"] .provider-opt { background: #0E1426; }
[data-theme="dark"] .provider-opt.selected { background: var(--coral-lt); }
[data-theme="dark"] .bug-priority.critical { background: #3A1519; color: #FF8A7E; }
[data-theme="dark"] .bug-priority.high { color: #F5B544; }
[data-theme="dark"] .info-icon { border-color: #6B7694; color: #B6BDCB; background: #141C33; }
[data-theme="dark"] .info-icon:hover { border-color: var(--coral); color: var(--coral); background: #2A1219; }
[data-theme="dark"] .info-bubble { background: #0E1426; color: #E4E7EE; box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
[data-theme="dark"] .info-bubble::before { border-bottom-color: #0E1426; }
[data-theme="dark"] #notifPanel { background: #070B16; border-color: #1E2742; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html {
  overflow-x: hidden;
}
body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  max-width: 100vw;
}
a { color: inherit; text-decoration: none; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--cream2); }
::-webkit-scrollbar-thumb { background: var(--coral-md); border-radius: 3px; }

/* ─── Layout ──────────────────────────────────────────────────────────────── */

.app-layout {
  display: flex;
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
}

/* ─── Sidebar ─────────────────────────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
}

.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1.5px solid var(--border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-head);
  font-weight: 700;
  font-size: 20px;
}
.sidebar-logo .net { color: var(--coral); }

.sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink2);
  transition: all 0.15s;
}
.nav-item:hover {
  background: var(--cream2);
  color: var(--ink);
}
.nav-item.active {
  background: var(--coral-lt);
  color: var(--coral);
}
.nav-sub {
  display: block;
  padding: 5px 16px 5px 50px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink3);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.nav-sub:hover { color: var(--ink); background: var(--cream2); }
.nav-sub.active { color: var(--coral); }

.nav-group { display: flex; flex-direction: column; }
.nav-group-toggle { cursor: pointer; }
.nav-group-label { flex: 1; }
.nav-group-toggle .nav-chevron {
  margin-left: auto;
  transition: transform 0.2s;
}
.nav-group.expanded .nav-group-toggle .nav-chevron {
  transform: rotate(180deg);
}
.nav-group-items {
  display: flex;
  flex-direction: column;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease-out;
}
.nav-group.expanded .nav-group-items {
  max-height: 480px;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1.5px solid var(--border);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--cream2);
  border-radius: 100px;
  cursor: pointer;
}
.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--coral);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}
.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Refer a Colleague banner (sidebar) ──────────────────────────────────── */

.referral-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 12px;
  padding: 10px 12px;
  text-align: left;
  background: linear-gradient(135deg, var(--sage-lt), var(--coral-lt));
  border: 1.5px solid var(--coral-md);
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.referral-banner:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(46,91,255, 0.18);
}
.referral-banner-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--coral);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.referral-banner-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.referral-banner-text strong {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
}
.referral-banner-text span {
  font-size: 11px;
  line-height: 1.3;
  color: var(--ink2);
}
.referral-banner-text b { color: var(--coral); }

/* ─── Refer a Colleague modal ─────────────────────────────────────────────── */

.referral-modal-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  margin-bottom: 18px;
  background: var(--cream2);
  border: 1.5px solid var(--border);
  border-radius: 12px;
}
.referral-modal-badge {
  flex-shrink: 0;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  background: var(--coral);
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.referral-modal-hero p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink2);
}
.referral-share-block { margin-bottom: 18px; }
.referral-share-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.referral-share-row .form-input {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  cursor: text;
}
.referral-share-row .btn { flex-shrink: 0; }
.referral-share-hint {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink2);
}
.referral-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink2);
}
.referral-or::before,
.referral-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.referral-status {
  font-size: 12.5px;
  margin-top: 8px;
  min-height: 0;
}
.referral-status.success { color: var(--sage); }
.referral-status.error { color: var(--red); }
.referral-list { margin-top: 8px; }
.referral-earned {
  font-size: 13px;
  color: var(--ink2);
  padding: 10px 12px;
  margin-top: 14px;
  background: var(--sage-lt);
  border-radius: 8px;
}
.referral-earned strong { color: var(--sage); }
.referral-history-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink2);
  margin: 16px 0 8px;
}
.referral-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
}
.referral-row-email {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.referral-pill {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
}
.referral-pill.done { background: var(--sage-lt); color: var(--sage); }
.referral-pill.pending { background: var(--cream2); color: var(--ink2); }

/* ─── Main Content ────────────────────────────────────────────────────────── */

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 32px 40px;
  max-width: 1100px;
  min-width: 0;
  overflow-x: hidden;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}
.page-header > :first-child {
  flex: 1 1 auto;
  min-width: 0;
}
.page-header > :last-child {
  flex-shrink: 0;
}
.page-title {
  font-family: var(--f-head);
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.page-subtitle {
  font-size: 14px;
  color: var(--ink3);
  margin-top: 4px;
}

/* ─── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--f-body);
  font-weight: 700;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  transition: all 0.18s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-sm { font-size: 13px; padding: 8px 18px; }
.btn-md { font-size: 14px; padding: 10px 24px; }
.btn-lg { font-size: 16px; padding: 14px 34px; }
.btn-primary {
  background: var(--coral);
  color: #fff;
  box-shadow: 0 3px 0 #1E44D8, var(--shadow-sm);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 5px 0 #1E44D8, var(--shadow-md); }
.btn-primary:active { transform: translateY(1px); box-shadow: 0 1px 0 #1E44D8; }
.btn-ghost {
  background: transparent;
  color: var(--ink2);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: var(--ink3); color: var(--ink); }
.btn-outline {
  background: transparent;
  color: var(--coral);
  border: 2px solid var(--coral);
}
.btn-outline:hover { background: var(--coral-lt); }
.btn-sage {
  background: var(--sage);
  color: #fff;
  box-shadow: 0 3px 0 #3a6259, var(--shadow-sm);
}
.btn-sage:hover { transform: translateY(-2px); }

/* ─── Stat Cards ──────────────────────────────────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}

.stat-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: box-shadow 0.2s;
}
.stat-card:hover { box-shadow: var(--shadow-sm); }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon-coral { background: var(--coral-lt); color: var(--coral); }
.stat-icon-sage  { background: var(--sage-lt);  color: var(--sage); }
.stat-icon-mustard { background: var(--mustard-lt); color: var(--mustard); }
.stat-icon-navy  { background: #E8EDF2; color: var(--navy); }

.stat-info { display: flex; flex-direction: column; }
.stat-value {
  font-family: var(--f-head);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 13px;
  color: var(--ink3);
  font-weight: 600;
}

/* ─── Content Sections ────────────────────────────────────────────────────── */

.content-section {
  margin-bottom: 36px;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title {
  font-family: var(--f-head);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ─── Project Cards ───────────────────────────────────────────────────────── */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 16px;
}

.project-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.2s;
  cursor: pointer;
  display: block;
}
.project-card:hover {
  border-color: var(--coral-md);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.project-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.project-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--coral);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-head);
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
}
.project-name {
  font-family: var(--f-head);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}
.project-slug {
  font-size: 12px;
  color: var(--ink3);
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
}
.project-desc {
  font-size: 13px;
  color: var(--ink2);
  margin-bottom: 14px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-stats {
  display: flex;
  gap: 8px;
}

/* ─── Badges ──────────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 100px;
}
.badge-coral  { background: var(--coral-lt); color: var(--coral); }
.badge-sage   { background: var(--sage-lt);  color: var(--sage); }
.badge-mustard { background: var(--mustard-lt); color: var(--mustard); }
.badge-navy   { background: #E8EDF2; color: var(--navy); }
.badge-ghost  { background: var(--cream2); color: var(--ink3); }

/* ─── Bug List ────────────────────────────────────────────────────────────── */

.bug-list {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* The bugs page list is a real table: a sortable header row sits above rows
   whose cells line up under it. Rather than letting the columns squeeze
   together (or wrap) on a narrow screen, the whole table keeps its width and
   scrolls sideways, so every column heading and its data stay readable. Only
   .bug-table opts in — the dashboard's recent-bugs list has no header row and
   should stay fluid. */
.bug-table {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.bug-table .bug-list-header,
.bug-table .bug-row {
  min-width: 760px;
}

.bug-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
  cursor: pointer;
}
.bug-row:last-child { border-bottom: none; }
.bug-row:hover { background: var(--cream2); }

.bug-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.bug-status-dot.open        { background: var(--coral); }
.bug-status-dot.in_progress { background: var(--mustard); }
.bug-status-dot.resolved    { background: var(--sage); }
.bug-status-dot.closed      { background: var(--ink4); }
.bug-status-dot.wont_fix    { background: var(--ink3); }

.bug-main {
  flex: 1;
  min-width: 0;
}
.bug-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bug-meta {
  font-size: 12px;
  color: var(--ink3);
  margin-top: 2px;
  display: flex;
  gap: 12px;
}

.bug-priority {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.bug-priority.critical { background: var(--red-lt); color: #C2261A; }
.bug-priority.high     { background: var(--mustard-lt); color: #8A5A00; }
.bug-priority.medium   { background: var(--coral-lt); color: var(--coral); }
.bug-priority.low      { background: var(--cream2); color: var(--ink3); }

.bug-upvotes {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--ink3);
  flex-shrink: 0;
}

/* ─── Bug Detail ──────────────────────────────────────────────────────────── */

.bug-detail-header {
  margin-bottom: 24px;
}
.bug-detail-title {
  font-family: var(--f-head);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.bug-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: var(--ink3);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
}

.detail-main {
  min-width: 0;
}

.detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.detail-card h3 {
  font-family: var(--f-head);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--ink);
}
.detail-card p,
.detail-card pre {
  font-size: 14px;
  color: var(--ink2);
  line-height: 1.6;
}
.detail-card pre {
  white-space: pre-wrap;
  background: var(--cream2);
  border: 1px solid var(--border);
  box-shadow: none;
  color: var(--ink2);
}
[data-theme="dark"] .detail-card pre {
  background: #070B16;
  border-color: #1E2742;
  color: #B6BDCB;
}

/* Bug page: custom metadata and performance snapshot */
.meta-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.meta-table th, .meta-table td { text-align: left; vertical-align: top; padding: 6px 8px; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.meta-table tr:last-child th, .meta-table tr:last-child td { border-bottom: 0; }
.meta-table th { width: 34%; font-weight: 700; color: var(--ink3); }
.meta-table td { color: var(--ink2); }
.meta-table code { font-size: 12px; }
.perf-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.perf-tile { background: var(--cream2); border: 1px solid var(--border); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.perf-tile-value { font-size: 16px; font-weight: 800; color: var(--ink); }
.perf-tile-label { font-size: 11px; font-weight: 600; color: var(--ink3); text-transform: uppercase; letter-spacing: 0.04em; }

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--ink4);
  color: var(--ink4);
  font-size: 11px;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, serif;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  line-height: 1;
  transition: border-color 0.15s, color 0.15s;
}
.info-icon:hover {
  border-color: var(--coral);
  color: var(--coral);
}
.info-bubble {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  font-style: normal;
  font-family: var(--f-body);
  line-height: 1.5;
  padding: 8px 12px;
  border-radius: 6px;
  width: 220px;
  white-space: normal;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  pointer-events: none;
}
.info-bubble::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: var(--ink);
}
.info-icon.active .info-bubble {
  display: block;
}

.detail-field {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.detail-field:last-child { border-bottom: none; }
.detail-field-label { color: var(--ink3); font-weight: 600; }
.detail-field-value { font-weight: 700; color: var(--ink); }
/* Long free-text values (OS, device string) sit under their label instead of
   squeezing it. */
.detail-field.stacked { flex-direction: column; gap: 3px; }
.detail-field.stacked .detail-field-value { font-weight: 600; overflow-wrap: anywhere; }

/* ─── Comments ────────────────────────────────────────────────────────────── */

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

.comment {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.comment.internal {
  border-left: 3px solid var(--mustard);
  background: var(--mustard-lt);
}
.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}
.comment-author {
  font-weight: 700;
  color: var(--ink);
}
.comment-time {
  color: var(--ink3);
}
.comment-body {
  font-size: 14px;
  color: var(--ink2);
  line-height: 1.6;
}

.comment-form {
  margin-top: 20px;
}
.comment-form textarea {
  width: 100%;
  min-height: 100px;
  padding: 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--f-body);
  font-size: 14px;
  resize: vertical;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s;
}
.comment-form textarea:focus {
  outline: none;
  border-color: var(--coral);
}
.comment-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

/* ─── Forms ───────────────────────────────────────────────────────────────── */

.form-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 700px;
}

.form-group {
  margin-bottom: 20px;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}
.form-hint {
  font-size: 12px;
  color: var(--ink3);
  margin-top: 4px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--f-body);
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.15s;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--coral);
}
.form-textarea {
  min-height: 100px;
  resize: vertical;
}
.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239C8E7A' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1.5px solid var(--border);
}

/* ─── Filters Bar ─────────────────────────────────────────────────────────── */

.filters-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-chip {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink2);
  background: #fff;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-chip:hover { border-color: var(--ink3); }
.filter-chip.active { background: var(--coral); color: #fff; border-color: var(--coral); }

/* ─── Empty State ─────────────────────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--ink3);
}
.empty-state svg { margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ─── Modal ───────────────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14,19,32,0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 560px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px;
  transform: translateY(20px);
  transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title {
  font-family: var(--f-head);
  font-size: 20px;
  font-weight: 700;
}
.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--cream2);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink3);
  transition: all 0.15s;
}
.modal-close:hover { background: var(--coral-lt); color: var(--coral); }

/* ─── Toast ───────────────────────────────────────────────────────────────── */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--navy);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
}
.toast.success { background: var(--sage); }
.toast.error   { background: var(--red); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Inline spinner (busy buttons, e.g. "Uploading…") ───────────────────── */

.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Live Chat Panel ─────────────────────────────────────────────────────── */

.chat-panel {
  width: 320px;
  background: #fff;
  border-right: 1.5px solid var(--border);
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  bottom: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.25s cubic-bezier(.22,.68,0,1.1);
}
.chat-panel.open {
  transform: translateX(0);
}

.main-content {
  transition: margin-left 0.25s cubic-bezier(.22,.68,0,1.1);
}
body.chat-open .main-content {
  margin-left: calc(var(--sidebar-w) + 320px);
}

.chat-panel-header {
  padding: 18px 18px 14px;
  border-bottom: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chat-panel-title {
  font-family: var(--f-head);
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-panel-title .live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sage);
  animation: pulse 2s ease-in-out infinite;
}
.chat-panel-close {
  width: 28px;
  height: 28px;
  border: none;
  background: var(--cream2);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink3);
  transition: all 0.15s;
  flex-shrink: 0;
}
.chat-panel-close:hover {
  background: var(--coral-lt);
  color: var(--coral);
}

.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.chat-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 18px;
  cursor: pointer;
  transition: background 0.1s;
  position: relative;
  border-bottom: 1px solid var(--border);
}
.chat-item:last-child { border-bottom: none; }
.chat-item:hover { background: var(--cream2); }
.chat-item.unread { background: var(--cream2); }

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}
.chat-avatar.coral  { background: var(--coral); }
.chat-avatar.sage   { background: var(--sage); }
.chat-avatar.mustard { background: var(--mustard); }
.chat-avatar.navy   { background: var(--navy); }

.chat-content {
  flex: 1;
  min-width: 0;
}
.chat-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.chat-time {
  font-size: 11px;
  color: var(--ink3);
  font-weight: 500;
  flex-shrink: 0;
}
.chat-preview {
  font-size: 12px;
  color: var(--ink3);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-item.unread .chat-preview {
  color: var(--ink2);
  font-weight: 600;
}
.chat-project-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--sage);
  background: var(--sage-lt);
  padding: 1px 6px;
  border-radius: 4px;
  margin-top: 4px;
}

.chat-unread-badge {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--coral);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 12px;
  right: 16px;
}

.chat-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink3);
  font-size: 13px;
}
.chat-empty svg { margin-bottom: 8px; opacity: 0.5; }

.chat-panel-footer {
  padding: 12px 18px;
  border-top: 1.5px solid var(--border);
  font-size: 12px;
  color: var(--ink3);
  text-align: center;
  font-weight: 600;
}

/* Nav item badge for unread count */
.nav-badge {
  background: var(--coral);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  margin-left: auto;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ─── Notification Bell Visibility ─────────────────────────────────────── */

#notifBellMobile { display: none; }

/* ─── Mobile Top Bar ──────────────────────────────────────────────────────── */

.mobile-top-bar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 110;
  height: 52px;
  padding: 0 12px;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .mobile-top-bar { background: rgba(22,33,62,0.95); border-color: #2a3a5c; }

.mobile-hamburger {
  display: flex;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  flex-shrink: 0;
}
.mobile-hamburger:hover { background: var(--cream2); }
[data-theme="dark"] .mobile-hamburger { color: #E4E7EE; }
[data-theme="dark"] .mobile-hamburger:hover { background: #1e2f54; }

.mobile-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-head);
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  text-decoration: none;
}
.mobile-logo .net { color: var(--coral); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(14,19,32,0.4);
  backdrop-filter: blur(4px);
  z-index: 49;
}
.sidebar-overlay.open { display: block; }

/* ─── Responsive: Tablet ─────────────────────────────────────────────────── */

@media (max-width: 860px) {
  .mobile-top-bar { display: flex; }
  #notifBellDesktop { display: none !important; }
  #notifBellMobile { display: flex !important; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(.22,.68,0,1.1);
    z-index: 60;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding: 20px 16px;
    padding-top: 64px;
    max-width: 100%;
    overflow-x: hidden;
  }

  body.chat-open .main-content { margin-left: 0; }
  .chat-panel { left: 0; width: 100%; z-index: 100; }

  .detail-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; gap: 12px; align-items: stretch; }
  .page-header .btn { align-self: flex-start; }
  .page-header > :last-child { flex-wrap: wrap; }
  .upgrade-banner > div { flex-wrap: wrap; }
  .upgrade-banner > div > div { min-width: 0; flex-basis: calc(100% - 64px) !important; }
  .upgrade-banner .btn { margin-left: 34px; }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .form-card {
    padding: 20px 16px;
    max-width: 100%;
  }

  /* Touch-friendly button targets */
  .btn-sm { padding: 10px 18px; min-height: 44px; }
  .btn-md { padding: 12px 24px; min-height: 44px; }
  .filter-chip { padding: 10px 16px; min-height: 44px; display: inline-flex; align-items: center; }

  /* Kanban: horizontal scroll */
  #kanbanView {
    grid-template-columns: repeat(4, 240px) !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Bug list rows: stack for touch */
  .bug-row {
    padding: 14px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .bug-meta { flex-wrap: wrap; }

  /* ...except inside the bugs-page table, where wrapping would break the
     column alignment. There the row keeps its shape and the table scrolls
     horizontally instead. */
  .bug-table .bug-row {
    flex-wrap: nowrap;
    padding: 12px 20px;
    gap: 10px;
  }
  .bug-table .bug-meta { flex-wrap: nowrap; }

  /* Modal full width on tablet */
  .modal {
    width: 95%;
    padding: 20px;
    max-height: 90vh;
  }

  /* Toast at bottom center */
  .toast-container {
    right: 16px;
    left: 16px;
    bottom: 16px;
  }
  .toast { text-align: center; }

  /* Fix inline grid layouts on dashboard */
  .dashboard-analytics-grid {
    grid-template-columns: 1fr !important;
  }

  /* Billing grid */
  .billing-grid { grid-template-columns: 1fr; }
}

/* ─── Responsive: Phone ──────────────────────────────────────────────────── */

@media (max-width: 480px) {
  .main-content {
    padding: 12px;
    padding-top: 60px;
  }

  .page-title { font-size: 22px; }
  .page-subtitle { font-size: 13px; }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .stat-card {
    padding: 14px;
    gap: 10px;
  }
  .stat-icon { width: 38px; height: 38px; }
  .stat-value { font-size: 22px; }
  .stat-label { font-size: 11px; }

  /* Search and sort stack vertically */
  .mobile-search-bar {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .mobile-search-bar .form-input,
  .mobile-search-bar .form-select {
    max-width: 100% !important;
    width: 100% !important;
  }

  /* Filters scroll horizontally */
  .filters-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .filters-bar::-webkit-scrollbar { display: none; }
  .filter-chip { flex-shrink: 0; }

  /* Kanban: single column scroll */
  #kanbanView {
    grid-template-columns: repeat(4, 200px) !important;
  }

  /* Bug detail */
  .bug-detail-title { font-size: 20px; }
  .detail-grid { max-width: 100%; overflow-x: hidden; }
  .detail-main, .detail-sidebar { max-width: 100%; min-width: 0; overflow: hidden; }
  .detail-card { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .detail-field { flex-wrap: wrap; gap: 4px; }
  .detail-field select, .detail-field input[type="text"], .detail-field input[type="date"], .detail-field input[type="url"] {
    max-width: 100% !important;
    box-sizing: border-box;
  }
  .bug-detail-meta { flex-wrap: wrap; gap: 6px; }
  .md-content { overflow-wrap: break-word; word-break: break-word; }
  .md-content pre, .md-content code { overflow-x: auto; max-width: 100%; }

  /* Forms full width */
  .form-input, .form-select, .form-textarea {
    font-size: 16px; /* Prevents iOS zoom on focus */
  }

  /* Comments */
  .comment { padding: 12px; }
  .comment-form textarea { min-height: 80px; }

  /* Detail cards */
  .detail-card { padding: 14px; }

  /* Section spacing */
  .content-section { margin-bottom: 24px; }
  .section-header { flex-direction: column; gap: 8px; align-items: flex-start; }

  /* Onboarding */
  .onboarding-container { padding: 12px !important; }
  .onboarding-card { padding: 24px 20px !important; }
  .option-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .step-title { font-size: 20px !important; }

  /* Login */
  .login-card { padding: 28px 20px !important; }

  /* Settings */
  .settings-avatar-section { flex-direction: column; text-align: center; }

  /* Bulk bar */
  #bulkBar { flex-wrap: wrap !important; }
  #bulkBar .form-select { max-width: 100% !important; flex: 1; min-width: 0; }

  /* Empty state */
  .empty-state { padding: 32px 16px; }
}

/* ─── Responsive: Extra small phones ─────────────────────────────────────── */

@media (max-width: 360px) {
  .stats-grid { grid-template-columns: 1fr; }
  .option-grid { grid-template-columns: 1fr !important; }
  .step-actions { flex-direction: column; }
  .step-actions .btn { width: 100%; justify-content: center; }
  .page-title { font-size: 20px; }
}

/* ─── Mobile utility classes ─────────────────────────────────────────────── */

.mobile-full-width {
  max-width: 100% !important;
  width: 100% !important;
}

/* ─── Mobile overrides for inline styles ─────────────────────────────────── */

@media (max-width: 860px) {
  /* Settings page selects with max-width:200px */
  .form-card .form-select[style*="max-width:200px"],
  .form-card .form-select[style*="max-width: 200px"] {
    max-width: 100% !important;
    width: 100% !important;
  }

  /* Integrate page form groups */
  .form-group[style*="max-width:400px"],
  .form-group[style*="max-width: 400px"],
  div[style*="max-width:440px"] {
    max-width: 100% !important;
  }

  /* 3-column grids in settings → 1 column on mobile */
  div[style*="grid-template-columns:1fr 1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Bulk bar selects */
  #bulkBar select[style*="max-width:140px"] {
    max-width: 100% !important;
  }
}

@media (max-width: 480px) {
  /* All inline max-width selects go full width on phones */
  .form-select[style*="max-width"] {
    max-width: 100% !important;
    width: 100% !important;
  }

  .form-input[style*="max-width"] {
    max-width: 100% !important;
    width: 100% !important;
  }

  /* Settings 3-col grids → stack */
  div[style*="grid-template-columns:1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    font-size: 12px !important;
  }
}

/* ─── Kanban Board ─────────────────────────────────────────────────────── */
.kanban-col {
  background: var(--cream2);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 200px;
}
.kanban-count {
  font-size: 11px;
  font-weight: 700;
  background: var(--border);
  color: var(--ink3);
  padding: 1px 6px;
  border-radius: 10px;
}
.kanban-card:hover {
  border-color: var(--sage) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.kanban-thumb {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  background: var(--cream2);
}

/* ─── Markdown content ─────────────────────────────────────────────────── */
.md-content { font-size: 14px; line-height: 1.7; }
.md-content pre { margin: 8px 0; }
.md-content a { text-decoration: underline; }

/* ─── Code snippets ───────────────────────────────────────────────────── */
code {
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 13px;
  background: var(--cream2);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--coral);
  font-weight: 600;
}
pre {
  background: var(--navy);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 12px 0;
  overflow-x: auto;
  border: 1.5px solid rgba(255,255,255,0.08);
  box-shadow: 0 4px 16px rgba(10,15,30,0.18);
}
pre code {
  background: none;
  border: none;
  padding: 0;
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.7;
  font-weight: 400;
}
[data-theme="dark"] code {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.1);
}
[data-theme="dark"] pre {
  background: #0d1117;
  border-color: rgba(255,255,255,0.06);
}

/* ─── Dependencies ─────────────────────────────────────────────────── */
.dep-blocker { color: var(--coral); font-weight: 700; }
.dep-blocks  { color: var(--sage);  font-weight: 700; }

/* ─── Overdue badge ───────────────────────────────────────────────── */
.overdue-tag {
  color: var(--coral);
  font-weight: 800;
  font-size: 11px;
  animation: pulse 2s ease-in-out infinite;
}

/* ─── Compact Mode ────────────────────────────────────────────────── */
.compact .bug-row { padding: 8px 16px; }
.compact .bug-title { font-size: 13px; }
.compact .bug-meta { font-size: 11px; }
.compact .stat-card { padding: 12px; }
.compact .stat-value { font-size: 20px; }
.compact .stat-label { font-size: 11px; }
.compact .detail-card { padding: 12px; margin-bottom: 12px; }
.compact .detail-card h3 { font-size: 13px; margin-bottom: 6px; }
.compact .detail-field { padding: 4px 0; }
.compact .detail-field-label { font-size: 11px; }
.compact .detail-field-value { font-size: 12px; }
.compact .comment { padding: 10px 0; }
.compact .comment-body { font-size: 13px; }
.compact .page-header { margin-bottom: 20px; }
.compact .page-title { font-size: 22px; }
.compact .section-title { font-size: 16px; }
.compact .form-card { padding: 16px; }
.compact .badge { font-size: 10px; padding: 1px 6px; }
.compact .project-card { padding: 14px; }
.compact .stats-grid { gap: 10px; }
.compact .sidebar-nav .nav-item { padding: 8px 16px; font-size: 13px; }
.compact .filters-bar { padding: 8px 12px; gap: 6px; }
.compact .kanban-card { padding: 10px; }
.compact .kanban-card h4 { font-size: 12px; }

/* ─── Logging View ────────────────────────────────────────────────────────── */
.logging-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
  gap: 16px;
}
.logging-row:first-child {
  border-top: 1px solid var(--border);
}
.logging-row:hover {
  background: var(--cream2);
}
.logging-row-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.logging-status-indicator {
  padding-top: 4px;
  flex-shrink: 0;
}
.logging-row-main {
  min-width: 0;
  flex: 1;
}
.logging-row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}
.logging-issue-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.logging-unhandled {
  font-size: 10px;
  font-weight: 700;
  color: var(--coral);
  background: var(--coral-lt);
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}
.logging-row-detail {
  margin-bottom: 4px;
}
.logging-error-msg {
  font-size: 12px;
  color: var(--coral);
  font-weight: 600;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.logging-row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}
.logging-project-badge {
  font-weight: 700;
  color: var(--ink3);
  background: var(--cream2);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  letter-spacing: 0.3px;
}
.logging-category {
  font-size: 11px;
}
.logging-row-right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}
.logging-row-times {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 60px;
}
.logging-time-label {
  font-size: 12px;
  color: var(--ink3);
  white-space: nowrap;
}
.logging-mini-graph {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 20px;
  min-width: 80px;
}
.logging-graph-bar {
  width: 4px;
  background: var(--ink4);
  border-radius: 1px;
  min-height: 2px;
}
.logging-row:hover .logging-graph-bar {
  background: var(--ink3);
}
.logging-row-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 40px;
}
.logging-stat-events {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.logging-stat-upvotes {
  font-size: 12px;
  color: var(--ink4);
}
.logging-row-status-badge {
  min-width: 70px;
  text-align: center;
}
.logging-status-text {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}
.logging-status-text.open {
  color: var(--sage);
  background: var(--sage-lt);
}
.logging-status-text.in_progress {
  color: var(--navy);
  background: var(--cream2);
}
.logging-status-text.resolved {
  color: var(--sage);
  background: var(--sage-lt);
}
.logging-status-text.closed {
  color: var(--ink3);
  background: var(--cream2);
}

/* Column headers for logging view */
#loggingContent::before {
  content: '';
  display: block;
}

@media (max-width: 768px) {
  .logging-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .logging-row-right {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
  }
  .logging-mini-graph {
    display: none;
  }
}

/* ─── Capture-mark theme: dashboard touches ──────────────────────────────── */
[data-theme="dark"] .sidebar-logo .wordmark,
[data-theme="dark"] .mobile-logo .wordmark { color: #E8ECF6; }
[data-theme="dark"] .bn-mark { color: #7EA0FF; }

/* ─── Error-type chips ───────────────────────────────────────────────────────
   The exception/error class a bug report names (bug_reports.error_type), shown
   on the bug list and detail. errorTypeChip() in app.js hashes the name onto
   one of these ten colours, so a given type always gets the same colour. */
.error-type-chip {
  display: inline-flex;
  align-items: center;
  max-width: 220px;
  font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  padding: 1px 7px;
  border-radius: 10px;
  border: 1px solid currentColor;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.error-type-chip[onclick] { cursor: pointer; }
.error-type-chip[onclick]:hover { filter: brightness(0.95); }
.error-type-chip.et-0 { color: #C4281C; background: #FDECEA; }
.error-type-chip.et-1 { color: #B54708; background: #FEF0E6; }
.error-type-chip.et-2 { color: #8A6100; background: #FDF5DC; }
.error-type-chip.et-3 { color: #107C54; background: #E4F6EE; }
.error-type-chip.et-4 { color: #0B7A75; background: #E2F5F4; }
.error-type-chip.et-5 { color: #0969C8; background: #E5F1FC; }
.error-type-chip.et-6 { color: #2E4BCF; background: #E9EDFD; }
.error-type-chip.et-7 { color: #7A3EB1; background: #F3EBFA; }
.error-type-chip.et-8 { color: #B0287F; background: #FBE9F4; }
.error-type-chip.et-9 { color: #5D6B82; background: #EEF0F4; }
[data-theme="dark"] .error-type-chip.et-0 { color: #FF8A7E; background: #3A1519; }
[data-theme="dark"] .error-type-chip.et-1 { color: #FFA66B; background: #3A2112; }
[data-theme="dark"] .error-type-chip.et-2 { color: #F5C451; background: #342A10; }
[data-theme="dark"] .error-type-chip.et-3 { color: #4FD3A0; background: #0F2E24; }
[data-theme="dark"] .error-type-chip.et-4 { color: #4CD1C8; background: #0E2D2C; }
[data-theme="dark"] .error-type-chip.et-5 { color: #6CB6FF; background: #0F2438; }
[data-theme="dark"] .error-type-chip.et-6 { color: #8FA2FF; background: #181F42; }
[data-theme="dark"] .error-type-chip.et-7 { color: #C79BF2; background: #2A1838; }
[data-theme="dark"] .error-type-chip.et-8 { color: #F28ACB; background: #37152B; }
[data-theme="dark"] .error-type-chip.et-9 { color: #B6BDCB; background: #1C2436; }

/* ─── Admin Mode badge (admin pages only, injected by initAdminModeBadge) ─── */
/* Hidden until the page confirms admin access by adding body.admin-mode */
body:not(.admin-mode) .admin-header,
body:not(.admin-mode) .admin-mode-badge { display: none !important; }
.admin-header { display: flex; justify-content: flex-end; align-items: center; margin: -8px 0 16px; }
@media (max-width: 860px) { .admin-header { display: none; } }
.admin-mode-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--coral); color: #fff;
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 3px 9px; border-radius: 100px; white-space: nowrap;
  animation: adminPulse 3s ease-in-out infinite;
}
.admin-mode-badge::before {
  content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: #fff; opacity: 0.8;
}
@keyframes adminPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(46,91,255,0.3); }
  50% { box-shadow: 0 0 0 6px rgba(46,91,255,0); }
}
