/**
 * Feedback Reporter - Custom Styles
 * Bootstrap 5 Dark Mode Erweiterungen
 */

/* Branding Farben importieren */
@import url('branding.css');

/* ===================================
   CSS Variables
   =================================== */
:root {
  --fbr-sidebar-width: 260px;
  --fbr-sidebar-collapsed-width: 60px;
  --fbr-header-height: 60px;
  --fbr-footer-height: 50px;
  --fbr-border-radius: 8px;
  --fbr-transition: all 0.2s ease-in-out;
}

/* ===================================
   Layout
   =================================== */
body {
  background-color: #0d1117;
  min-height: 100vh;
}

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

.main-content {
  flex: 1;
  margin-left: var(--fbr-sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.content-area {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

/* ===================================
   Edit-Lock System
   =================================== */
.content-locked {
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
  transition: filter 0.3s ease;
}

.content-locked::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.1);
  z-index: 10;
}

/* Lock Banner */
#edit-lock-banner {
  z-index: 1000;
  position: sticky;
  top: 0;
  pointer-events: auto;
}

/* Takeover Countdown Modal */
.takeover-countdown-modal .modal-body {
  text-align: center;
  padding: 2rem;
}

.takeover-countdown-modal .countdown-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid var(--bs-warning);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 3rem;
  font-weight: bold;
  color: var(--bs-warning);
  animation: countdown-pulse 1s ease-in-out infinite;
}

@keyframes countdown-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.takeover-countdown-modal .countdown-text {
  font-size: 1.1rem;
  color: var(--bs-gray-400);
  margin-bottom: 1.5rem;
}

.takeover-countdown-modal .btn-group-vertical {
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
}

.takeover-countdown-modal .btn-group-vertical .btn {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

/* Takeover Request Sent State */
.takeover-request-sent {
  opacity: 0.7;
}

/* ===================================
   Sidebar
   =================================== */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--fbr-sidebar-width);
  height: 100vh;
  background: #161b22;
  border-right: 1px solid #30363d;
  display: flex;
  flex-direction: column;
  z-index: 1201;
}

.sidebar-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #30363d;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #e6edf3;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
}

.sidebar-brand:hover {
  color: #e6edf3;
}

.sidebar-brand i { 
  font-size: 1.5rem;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav .nav-item {
  margin-bottom: 2px;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1.25rem;
  color: #8b949e; 
  text-decoration: none;
  border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
  color: #e6edf3;
  background: rgba(56, 139, 253, 0.15);
  border-left: 3px solid #388bfd;
}

.sidebar-nav .nav-link.active {
  color: #e6edf3;
  background: rgba(56, 139, 253, 0.15);
  border-left: 3px solid #388bfd;
}

.sidebar-nav .nav-link i {
  font-size: 1.1rem;
  width: 1.5rem;
  text-align: center;
}

.nav-divider {
  height: 1px;
  background: #30363d;
  margin: 0.75rem 1.25rem;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid #30363d;
}

/* Sidebar Toggle Button */
.sidebar-toggle-btn {
  position: absolute;
  right: -12px;
  top: 30px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #30363d;
  border: 1px solid #484f58;
  color: #8b949e;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--fbr-transition);
  z-index: 1001;
}

.sidebar-toggle-btn:hover {
  background: #484f58;
  color: #e6edf3;
}

.sidebar-toggle-btn i {
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

/* Collapsed Sidebar State */
.sidebar.collapsed {
  width: var(--fbr-sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-content {
  overflow-x: hidden;
}

.sidebar.collapsed .sidebar-brand span,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .sidebar-footer .version-info {
  display: none;
}

.sidebar.collapsed .sidebar-brand {
  justify-content: center;
  gap: 0;
}

.sidebar.collapsed .sidebar-header {
  padding: 1rem 0;
  display: flex;
  justify-content: center;
}

.sidebar.collapsed .sidebar-nav .nav-link {
  justify-content: center;
  gap: 0;
}

.sidebar.collapsed .sidebar-nav .nav-link i {
  width: 100%;
  text-align: center;
}

.sidebar.collapsed .sidebar-nav .nav-link.active {
  border-left: none;
  background: rgba(56, 139, 253, 0.15);
}

.sidebar.collapsed .sidebar-nav .nav-link:hover {
  background: rgba(56, 139, 253, 0.15);
}

.sidebar.collapsed .nav-divider {
  margin: 0.75rem 8px;
}

.sidebar.collapsed .sidebar-footer {
  padding: 0.5rem;
  text-align: center;
  display: none;
}

.sidebar.collapsed .sidebar-toggle-btn {
  
}
.sidebar.collapsed .sidebar-toggle-btn i {
  transform: rotate(180deg);
}

/* Adjust main content for collapsed sidebar */
.app-container.sidebar-collapsed .main-content {
  margin-left: var(--fbr-sidebar-collapsed-width);
}

/* Tooltip for collapsed sidebar items */
.sidebar.collapsed .nav-link {
  position: relative;
}

.sidebar.collapsed .nav-link::after {
  content: attr(data-title);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: #30363d;
  color: #e6edf3;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  font-size: 0.875rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease;
  z-index: 1100;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.sidebar.collapsed .nav-link:hover::after {
  opacity: 1;
  visibility: visible;
}

/* ===================================
   Header
   =================================== */
.main-header {
  height: var(--fbr-header-height);
  padding: 0 1.5rem;
  background: #161b22;
  border-bottom: 1px solid #30363d;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1200;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  color: #e6edf3;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-menu {
  display: flex;
  align-items: center;
  color: #e6edf3;
  text-decoration: none;
  padding: 0.25rem;
}

.user-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  object-fit: cover;
}

/* User list card avatar spacing */
.user-card .user-avatar,
.user-card .avatar-placeholder {
  width: 48px !important;
  height: 48px !important;
  min-width: 48px;
}

.user-avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #388bfd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

/* ===================================
   Footer
   =================================== */
.main-footer {
  height: var(--fbr-footer-height);
  padding: 0 1.5rem;
  background: #161b22;
  border-top: 1px solid #30363d;
  display: flex;
  align-items: center;
}

/* ===================================
   Cards
   =================================== */
.card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: var(--fbr-border-radius);
}

.card-header {
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid #30363d;
  padding: 0.875rem 1rem;
}

.card-title {
  color: #e6edf3;
  margin: 0;
}

/* ===================================
   Stat Cards
   =================================== */
.stat-card .card-body {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
  color: #e6edf3;
}

.stat-label {
  color: #8b949e;
  margin: 0;
  font-size: 0.875rem;
}

/* ===================================
   Quick Actions
   =================================== */
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid #30363d;
  border-radius: var(--fbr-border-radius);
  color: #8b949e;
  text-decoration: none;
  transition: var(--fbr-transition);
}

.quick-action-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #e6edf3;
  border-color: #388bfd;
}

.quick-action-btn i {
  font-size: 1.5rem;
}

/* ===================================
   Tables
   =================================== */
.table {
  color: #e6edf3;
  margin: 0;
}

.table th {
  font-weight: 600;
  color: #8b949e;
  border-bottom: 1px solid #30363d;
  padding: 0.75rem 1rem;
}

.table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #21262d;
  vertical-align: middle;
}

.table-hover tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* ===================================
   Forms
   =================================== */
.form-control,
.form-select {
  background: #0d1117;
  border: 1px solid #30363d;
  color: #e6edf3;
}

.form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23e6edf3' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  padding-right: 2.25rem;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.form-control:focus,
.form-select:focus {
  background: #0d1117;
  border-color: #388bfd;
  box-shadow: 0 0 0 3px rgba(56, 139, 253, 0.15);
  color: #e6edf3;
}

.form-control::placeholder {
  color: #6e7681;
}

.input-group-text {
  background: #21262d;
  border: 1px solid #30363d;
  color: #8b949e;
}

.form-label {
  color: #e6edf3;
  font-weight: 500;
  margin-bottom: 0.375rem;
}

.form-text {
  color: #6e7681;
}

.form-check-input {
  background-color: #0d1117;
  border-color: #30363d;
}

.form-check-input:checked {
  background-color: #388bfd;
  border-color: #388bfd;
}

/* ===================================
   Buttons
   =================================== */
.btn-primary {
  background: #388bfd;
  border-color: #388bfd;
}

.btn-primary:hover {
  background: #58a6ff;
  border-color: #58a6ff;
}

.btn-outline-primary {
  color: #388bfd;
  border-color: #388bfd;
}

.btn-outline-primary:hover {
  background: #388bfd;
  color: #fff;
}

.btn-outline-secondary {
  color: #8b949e;
  border-color: #30363d;
}

.btn-outline-secondary:hover {
  background: #21262d;
  color: #e6edf3;
  border-color: #30363d;
}

/* ===================================
   Badges
   =================================== */
.badge {
  font-weight: 500;
  padding: 0.35em 0.65em;
}

/* Status Badges */
.badge-inbox { background: #388bfd; }
.badge-in_progress { background: #d29922; color: #000; }
.badge-review { background: #3fb950; }
.badge-done { background: #238636; }
.badge-rejected { background: #f85149; }

/* Priority Badges */
.badge-critical { background: #f85149; }
.badge-high { background: #d29922; color: #000; }
.badge-medium { background: #388bfd; }
.badge-low { background: #6e7681; }

/* Type Badges */
.badge-bug { background: #f85149; }
.badge-feature { background: #a371f7; }
.badge-design { background: #f778ba; }
.badge-text { background: #56d364; }
.badge-data { background: #79c0ff; }
.badge-performance { background: #d29922; color: #000; }
.badge-other { background: #6e7681; }

/* ===================================
   Login Page
   =================================== */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(180deg, #0d1117 0%, #161b22 100%);
}

.login-container {
  width: 100%;
  max-width: 400px;
}

.login-card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 2rem;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo i {
  font-size: 3rem;
}

.login-title {
  margin: 1rem 0 0.5rem;
  font-size: 1.5rem;
  color: #e6edf3;
}

.login-subtitle {
  font-size: 0.875rem;
}

.login-footer {
  margin-top: 2rem;
  text-align: center;
}

/* ===================================
   Error Pages
   =================================== */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.error-container {
  text-align: center;
}

.error-icon i {
  font-size: 5rem;
}

.error-code {
  font-size: 6rem;
  font-weight: 700;
  color: #e6edf3;
  margin: 1rem 0;
  line-height: 1;
}

.error-title {
  font-size: 1.5rem;
  color: #e6edf3;
  margin-bottom: 0.5rem;
}

.error-message {
  color: #8b949e;
  margin-bottom: 2rem;
}

.error-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.error-stack {
  text-align: left;
  background: #0d1117;
  padding: 1rem;
  border-radius: 6px;
  font-size: 0.75rem;
  overflow-x: auto;
  max-height: 200px;
}

/* ===================================
   Installation Steps
   =================================== */
.installation-steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.step-number {
  width: 32px;
  height: 32px;
  background: #388bfd;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}

.step-content h6 {
  margin: 0 0 0.25rem;
  color: #e6edf3;
}

/* ===================================
   Timeline (Changelog)
   =================================== */
.timeline {
  padding: 1rem;
}

.timeline-date {
  margin-bottom: 0.5rem;
  padding-top: 1rem;
}

.timeline-date:first-child {
  padding-top: 0;
}

.timeline-item {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #30363d;
}

.timeline-item:last-child {
  border-bottom: none;
}

.timeline-marker {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.timeline-marker i {
  font-size: 14px;
}

.timeline-content {
  flex: 1;
  min-width: 0;
}

.timeline-title {
  font-weight: 600;
  color: #e6edf3;
  text-decoration: none;
}

.timeline-title:hover {
  color: #58a6ff;
  text-decoration: underline;
}

.timeline-desc {
  color: #8b949e;
  font-size: 0.875rem;
}

/* ===================================
   Backlog Board
   =================================== */
.backlog-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.backlog-column {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: var(--fbr-border-radius);
  display: flex;
  flex-direction: column;
  min-height: 400px;
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #30363d;
  flex-shrink: 0;
}

.column-body {
  padding: 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Backlog Cards */
.backlog-card {
  display: block;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 0.75rem;
  text-decoration: none;
  color: #e6edf3;
  transition: border-color 0.2s, background 0.2s, opacity 0.2s, transform 0.2s;
  cursor: grab;
}

.backlog-card:hover {
  border-color: #58a6ff;
  background: #161b22;
  color: #e6edf3;
}

/* Drag & Drop States */
.backlog-card.dragging {
  opacity: 0.5;
  transform: scale(0.98);
  cursor: grabbing;
}

.backlog-card:active {
  cursor: grabbing;
}

.drop-zone {
  transition: background 0.2s, border-color 0.2s;
  flex: 1;
  min-height: 100px;
}

.drop-zone.drag-over {
  background: rgba(56, 139, 253, 0.1);
  border: 2px dashed #388bfd;
  border-radius: 6px;
}

.drop-zone .backlog-empty {
  pointer-events: none;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-header-mini {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.card-title-mini {
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta-mini {
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: #8b949e;
}

.card-meta-mini i {
  margin-right: 0.25rem;
}

/* Backlog Card Footer with Assignees */
.card-footer-mini {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.5rem;
}

.card-footer-mini .card-assignees {
  flex-shrink: 0;
}

.card-footer-mini .card-meta-mini {
  flex-wrap: wrap;
}

/* ===================================
   Activity Feed
   =================================== */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.activity-item {
  display: flex;
  gap: 0.75rem;
}

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #21262d;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #8b949e;
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-content p {
  font-size: 0.875rem;
  margin: 0;
}

.activity-content a {
  color: #58a6ff;
  text-decoration: none;
}

.activity-content a:hover {
  text-decoration: underline;
}

/* ===================================
   MD Preview
   =================================== */
.md-preview {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

.md-preview h1,
.md-preview h2,
.md-preview h3 {
  border-bottom: 1px solid #30363d;
  padding-bottom: 0.3em;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

.md-preview code {
  background: #0d1117;
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-size: 0.85em;
}


.md-preview pre {
  background: #0d1117;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
}

.md-preview pre code {
  background: none;
  padding: 0;
}

.md-preview table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.md-preview th,
.md-preview td {
  border: 1px solid #30363d;
  padding: 0.5rem 1rem;
}

.md-preview blockquote {
  border-left: 4px solid #388bfd;
  padding-left: 1rem;
  margin-left: 0;
  color: #8b949e;
}

/* ===================================
   Code Highlighting
   =================================== */
pre {
  position: relative;
}

pre code {
  font-family: 'SF Mono', 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.5;
}

.code-copy-btn {
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 5;
}

pre:hover .code-copy-btn {
  opacity: 1;
}

/* JSON specific styling */
#raw-json-code {
  font-family: 'SF Mono', 'Consolas', 'Monaco', 'Courier New', monospace;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ===================================
   Responsive
   =================================== */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    /* Mobile: immer volle Breite, nicht collapsed */
    width: var(--fbr-sidebar-width) !important;
  }
  
  .sidebar.show {
    transform: translateX(0);
  }
  
  /* Auf Mobile: Collapse-Button verstecken */
  .sidebar-toggle-btn {
    display: none !important;
  }
  
  /* Mobile: collapsed-Klasse ignorieren - immer volle Sidebar zeigen */
  .sidebar.collapsed .sidebar-brand span,
  .sidebar.collapsed .nav-link span,
  .sidebar.collapsed .sidebar-footer .version-info {
    display: block !important;
  }
  
  .sidebar.collapsed .sidebar-brand {
    justify-content: flex-start !important;
    gap: 0.75rem !important;
  }
  
  .sidebar.collapsed .sidebar-header {
    padding: 1rem 1.25rem !important;
    justify-content: flex-start !important;
  }
  
  .sidebar.collapsed .sidebar-nav .nav-link {
    justify-content: flex-start !important;
    gap: 0.75rem !important;
  }
  
  .sidebar.collapsed .sidebar-nav .nav-link i {
    width: 1.5rem !important;
    text-align: center !important;
  }
  
  .sidebar.collapsed .nav-divider {
    margin: 0.75rem 1.25rem !important;
  }
  
  .sidebar.collapsed .sidebar-footer {
    display: block !important;
    padding: 1rem 1.25rem !important;
    text-align: left !important;
  }
  
  /* Tooltips auf Mobile nicht anzeigen */
  .sidebar.collapsed .nav-link::after {
    display: none !important;
  }
  
  .main-content {
    margin-left: 0 !important;
  }
  
  /* Overlay wenn Sidebar offen */
  .sidebar.show::before {
    content: '';
    position: fixed;
    top: 0;
    left: var(--fbr-sidebar-width);
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
  }
  
  .backlog-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  .content-area {
    padding: 1rem;
  }
  
  .stat-card .card-body {
    flex-direction: column;
    text-align: center;
  }
}

/* ===================================
   Avatar Stack (Read-Only, für Listen)
   =================================== */
.avatar-stack,
.stacked-avatars,
.user-avatar-stack {
  display: flex;
  align-items: center;
}

.avatar-stack-item,
.stacked-avatar,
.user-avatar {
  width: 28px;
  height: 28px;
  margin-left: -8px;
  border: 2px solid var(--bs-card-bg, #161b22);
  border-radius: 50%;
  background: var(--bs-primary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.15s, z-index 0s;
  position: relative;
  overflow: hidden;
}

.avatar-stack-item:first-child,
.stacked-avatar:first-child,
.user-avatar:first-child {
  margin-left: 0;
}

.avatar-stack-item:hover,
.stacked-avatar:hover,
.user-avatar:hover {
  transform: scale(1.15);
  z-index: 10 !important;
}

.avatar-stack-item img,
.stacked-avatar img,
.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-stack-more,
.stacked-avatar-more,
.user-avatar-more {
  width: 28px;
  height: 28px;
  background: var(--bs-secondary);
  color: var(--bs-light);
  font-size: 10px;
  font-weight: 600;
}

/* Kleine Variante (für kompakte Listen) */
.avatar-stack-sm .avatar-stack-item,
.stacked-avatars-sm .stacked-avatar {
  width: 22px;
  height: 22px;
  font-size: 9px;
  margin-left: -6px;
}

.avatar-stack-sm .avatar-stack-item:first-child,
.stacked-avatars-sm .stacked-avatar:first-child {
  margin-left: 0;
}

.avatar-stack-sm .avatar-stack-more,
.stacked-avatars-sm .stacked-avatar-more {
  width: 22px;
  height: 22px;
  font-size: 8px;
}

/* ===================================
   Attachment Dropdown
   =================================== */
.dropdown-toggle.no-arrow::after {
  display: none;
}

.attachment-item .dropdown {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.attachment-item:hover .dropdown {
  opacity: 1;
}

#upload-limits-info {
  margin-top: 1rem;
}

/* ===================================
   Attachment Image Placeholder (Broken)
   =================================== */
.attachment-img-placeholder {
  height: 150px;
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(108, 117, 125, 0.15) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  border-radius: 0.375rem 0.375rem 0 0;
  position: relative;
}

.attachment-img-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 10px,
    rgba(255,255,255,0.02) 10px,
    rgba(255,255,255,0.02) 20px
  );
  border-radius: inherit;
}

.attachment-img-placeholder i {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
  color: #dc3545;
}

.attachment-img-placeholder span {
  font-size: 0.75rem;
  opacity: 0.8;
  color: #6c757d;
}

/* ===================================
   Comment UI
   =================================== */
.fbr-comment {
  padding: 0.5rem;
  border-radius: 6px;
  transition: background-color 0.15s ease;
}

.fbr-comment:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.fbr-comment:hover .comment-actions {
  opacity: 1 !important;
}

.fbr-comment .comment-content {
  white-space: pre-wrap;
  word-break: break-word;
}

#comment-dropzone-overlay {
  display: none!important; 
  pointer-events: none; 
  z-index: 10;
}

#comment-dropzone-overlay.show-overlay {
  display: flex!important; 
}

/* ===================================
   Status Pills
   =================================== */
.status-pills {
  display: inline-flex;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--bs-border-color);
}

.status-pill {
  border: none;
  border-right: 1px solid var(--bs-border-color);
  padding: 6px 12px;
  background: var(--bs-tertiary-bg);
  color: var(--bs-body-color);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-pill:last-child {
  border-right: none;
}

.status-pill:hover {
  background: var(--bs-secondary-bg);
}

.status-pill.active {
  font-weight: 500;
}

/* Status-spezifische Farben wenn aktiv */
.status-pill.active[data-status="inbox"] {
  background: var(--bs-primary);
  color: white;
}

.status-pill.active[data-status="in_progress"] {
  background: var(--bs-warning);
  color: black;
}

.status-pill.active[data-status="review"] {
  background: var(--bs-info);
  color: white;
}

.status-pill.active[data-status="done"] {
  background: var(--bs-success);
  color: white;
}

.status-pill.active[data-status="rejected"] {
  background: var(--bs-danger);
  color: white;
}

/* ===================================
   Priority Flames
   =================================== */
.priority-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.priority-flames {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 0px;
}

.priority-flames .flame {
  font-size: 18px;
  transition: color 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
  opacity: 0.25;
}

.priority-flames .flame.filled {
  opacity: 1;
}

/* Leere Flammen: Jede hat ihre eigene Farbe (abgetönt) */
.priority-flames .flame[data-value="1"]:not(.filled) { color: #6c757d; }
.priority-flames .flame[data-value="2"]:not(.filled) { color: #28a745; }
.priority-flames .flame[data-value="3"]:not(.filled) { color: #ffc107; }
.priority-flames .flame[data-value="4"]:not(.filled) { color: #fd7e14; }
.priority-flames .flame[data-value="5"]:not(.filled) { color: #dc3545; }

/* Gefüllte Flammen: Alle haben die Farbe des aktuellen Levels */
.priority-flames[data-level="1"] .flame.filled { color: #6c757d; }
.priority-flames[data-level="2"] .flame.filled { color: #28a745; }
.priority-flames[data-level="3"] .flame.filled { color: #ffc107; }
.priority-flames[data-level="4"] .flame.filled { color: #fd7e14; }
.priority-flames[data-level="5"] .flame.filled { color: #dc3545; }

/* Interaktiver Modus */
.priority-flames.interactive {
  cursor: pointer;
}

.priority-flames.interactive .flame {
  cursor: pointer;
}

.priority-flames.interactive .flame:hover {
  transform: scale(1.3);
}

/* Hover-Preview: Alle aktiven Flammen bekommen die Farbe der gehoverten */
.priority-flames.interactive[data-preview-level="1"] .flame.filled { color: #6c757d; }
.priority-flames.interactive[data-preview-level="2"] .flame.filled { color: #28a745; }
.priority-flames.interactive[data-preview-level="3"] .flame.filled { color: #ffc107; }
.priority-flames.interactive[data-preview-level="4"] .flame.filled { color: #fd7e14; }
.priority-flames.interactive[data-preview-level="5"] .flame.filled { color: #dc3545; }

.priority-label {
  font-size: 13px;
  color: var(--bs-secondary-color);
  min-width: 50px;
}

/* Mini-Flames für Listen */
.priority-flames-mini {
  display: inline-flex;
  gap: 2px;
  align-items: center;
}

.priority-flames-mini .flame {
  font-size: 12px;
  opacity: 0.25;
}

.priority-flames-mini .flame.filled {
  opacity: 1;
}

.priority-flames-mini[data-level="1"] .flame.filled { color: #6c757d; }
.priority-flames-mini[data-level="2"] .flame.filled { color: #28a745; }
.priority-flames-mini[data-level="3"] .flame.filled { color: #ffc107; }
.priority-flames-mini[data-level="4"] .flame.filled { color: #fd7e14; }
.priority-flames-mini[data-level="5"] .flame.filled { color: #dc3545; }

/* ===================================
   Type Buttons
   =================================== */
.type-btn-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.type-btn {
  padding: 5px 10px;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
  color: var(--bs-secondary-color);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.type-btn:hover {
  border-color: var(--bs-primary);
  color: var(--bs-body-color);
}

.type-btn.active {
  background: var(--bs-primary);
  border-color: var(--bs-primary);
  color: white;
}

/* ===================================
   Assignees Stack
   =================================== */
.assignees-stack {
  display: flex;
  align-items: center;
}

.assignee-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: white;
  margin-left: -8px;
  border: 2px solid var(--bs-card-bg, #1e1e1e);
  text-decoration: none;
  transition: transform 0.15s, z-index 0s;
  position: relative;
  background: var(--bs-primary);
  overflow: hidden;
}

.assignee-avatar:first-child {
  margin-left: 0;
}

.assignee-avatar:hover {
  transform: scale(1.15);
  z-index: 10;
}

.assignee-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.assignee-avatar .remove-btn,
.assignee-avatar .assignee-remove {
  position: absolute;
  inset: 0;
  background: rgba(220, 53, 69, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
}

.assignee-avatar:hover .remove-btn,
.assignee-avatar:hover .assignee-remove {
  display: flex;
}

.assignee-add {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--bs-secondary-color);
  margin-left: -8px;
  border: 2px dashed var(--bs-border-color);
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
}

.assignee-add:hover {
  border-color: var(--bs-primary);
  color: var(--bs-primary);
  background: rgba(var(--bs-primary-rgb), 0.1);
}

.assignee-avatar.more {
  background: var(--bs-secondary);
  font-size: 11px;
  cursor: default;
}

.assignee-avatar.more:hover {
  transform: none;
}

/* Assignee Dropdown */
.assignee-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  width: 250px;
  background: var(--bs-card-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 100;
  padding: 8px;
}

.assignee-dropdown .search-input {
  margin-bottom: 8px;
}

.assignee-list {
  max-height: 200px;
  overflow-y: auto;
}

.assignee-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.assignee-option:hover {
  background: var(--bs-tertiary-bg);
}

.assignee-option .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.assignee-option .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.assignee-empty {
  padding: 12px;
  text-align: center;
  color: var(--bs-secondary-color);
  font-size: 13px;
}

/* Kleinere Variante für Listen */
.assignees-stack-sm .assignee-avatar {
  width: 24px;
  height: 24px;
  font-size: 10px;
  margin-left: -6px;
}

.assignees-stack-sm .assignee-avatar:first-child {
  margin-left: 0;
}

.assignees-stack-more {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 600;
  color: var(--bs-secondary-color);
  margin-left: -6px;
  background: var(--bs-tertiary-bg);
  border: 2px solid var(--bs-card-bg, #1e1e1e);
}

/* ===================================
   Asset Group Cards (Report Detail)
   =================================== */
.asset-group-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--bs-border-color);
  border-radius: 0.375rem;
  overflow: hidden;
}

.asset-group-header {
  padding: 0.4rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--bs-border-color);
  font-size: 0.85rem;
  font-weight: 500;
}

.asset-group-body {
  padding: 0.5rem 0.75rem;
  max-height: 180px;
  overflow-y: auto;
}

.asset-group-body ul li {
  padding: 2px 0;
}

/* Asset Attach Button */
.asset-attach-btn {
  opacity: 0;
  transition: opacity 0.15s;
}

.asset-group-body ul li:hover .asset-attach-btn {
  opacity: 1;
}

.asset-attach-btn:hover {
  color: var(--bs-info) !important;
}

.asset-attach-btn:disabled {
  opacity: 1 !important;
}

/* Spin animation for asset attach */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin {
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

/* ===================================
   Tech Group Cards (Report Detail - Metadata Groups)
   =================================== */
.tech-group-card {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--bs-border-color);
  border-radius: 0.375rem;
  overflow: hidden;
}

.tech-group-header {
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid var(--bs-border-color);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--bs-gray-400);
}

.tech-group-body {
  padding: 0.75rem;
}

.tech-group-body .row > div {
  padding-bottom: 0.25rem;
}

/* ===================================
   Markdown Documentation
   =================================== */

/* Raw Markdown Text View */
.md-raw-text {
  background: #161b22;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--fbr-border-radius);
  padding: 1rem;
  margin: 0;
  max-height: 600px;
  overflow: auto;
}

.md-raw-text code {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #e6edf3;
}

/* Rendered Markdown Preview */
.markdown-body {
  overflow-x: auto;
  max-width: 100%;
}

.markdown-body pre {
  max-width: 100%;
  overflow-x: auto;
  background: #161b22;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--fbr-border-radius);
  padding: 1rem;
}

pre code {
  overflow-wrap: normal;
  white-space: pre-wrap;
  word-break: break-word;
  word-wrap: break-word;
}

.markdown-body code {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
  font-size: 0.875rem;
}

.markdown-body table {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  display: block;
}

/* MD View Toggle Active State */
#md-view-toggle .btn.active {
  pointer-events: none;
}