#bug-report-btn { cursor: pointer; transition: opacity 0.2s; }
#bug-report-btn:hover { opacity: 0.8; }
#bug-report-modal .card { box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
#bug-report-form textarea { resize: vertical; min-height: 120px; }
.info-box { padding: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; font-size: 0.9em; color: var(--muted); }
.hint { font-size: 0.8em; color: var(--muted); margin-top: 4px; }

/* Header and Layout */
.bug-reports-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.bug-reports-header h2 { margin: 0; }
.bug-reports-header p { margin: 4px 0 0 0; }
.bug-reports-header .btn { flex-shrink: 0; }

/* Alert Messages */
.bug-alert { margin-top: 12px; padding: 12px; border-left: 3px solid; }
.bug-alert-error { background: rgba(255,0,0,0.1); border-color: #f44336; color: #f44336; }
.bug-alert-success { background: rgba(76,175,80,0.1); border-color: #4caf50; color: #4caf50; }
.bug-alert-error-text { color: #f44336; }

/* Detail View */
.bug-detail-card { margin-top: 16px; }
.bug-detail-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.bug-detail-title-wrapper { display: flex; align-items: center; gap: 16px; }
.bug-detail-title { margin: 0; }
.bug-detail-submitted { font-size: 0.9em; }

/* Grid Layout */
.bug-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; align-items: center; }
.bug-field-row { display: flex; align-items: center; gap: 8px; }
.bug-field-row-gap { display: flex; gap: 8px; align-items: center; }

/* Type Badge */
.bug-type-badge { padding: 4px 8px; border-radius: 4px; font-size: 0.85em; font-weight: 600; background: #2196F3; color: #fff; }

/* Toggle Switch */
.bug-toggle-label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.bug-toggle-text { font-weight: 600; font-size: 0.9em; }

/* Status */
.bug-status-form { display: inline-block; }
.bug-status-select { 
  padding: 12px; 
  font-size: 16px;
  min-height: 44px;
}
.bug-status-badge { padding: 4px 8px; border-radius: 4px; font-size: 0.85em; font-weight: 600; margin-left: 8px; }
.bug-status-pending { background: #ff9800; color: #fff; }
.bug-status-open { background: #2196F3; color: #fff; }
.bug-status-in-progress { background: #9c27b0; color: #fff; }
.bug-status-in_progress { background: #9c27b0; color: #fff; }
.bug-status-testing { background: #00bcd4; color: #fff; }
.bug-status-complete { background: #8bc34a; color: #fff; }
.bug-status-not-planned { background: #607d8b; color: #fff; }
.bug-status-not_planned { background: #607d8b; color: #fff; }
.bug-status-closed { background: #4caf50; color: #fff; }
.bug-status-default { background: #888; color: #fff; }

/* Action Buttons */
.bug-action-form { display: inline-block; margin: 0; }
.bug-btn-close { background: #4caf50; border-color: #4caf50; color: #fff; padding: 4px 12px; font-size: 0.9em; }
.bug-btn-delete { padding: 4px 12px; font-size: 0.9em; }
.bug-btn-close.xs { padding: 3px 8px; font-size: 11px; }
.bug-btn-delete.xs { padding: 3px 8px; font-size: 11px; }

/* Content Sections */
.bug-section { margin-bottom: 16px; }
.bug-content-box { padding: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; margin-top: 4px; word-break: break-all; font-size: 0.9em; }
.bug-description-box { padding: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; margin-top: 4px; white-space: pre-wrap; }

/* User Communication Section */
.bug-user-comm { margin-bottom: 16px; padding: 16px; background: rgba(33,150,243,0.05); border: 1px solid rgba(33,150,243,0.2); border-radius: 4px; }
.bug-user-comm h4 { margin-top: 0; margin-bottom: 12px; }
.bug-user-comm-label { display: block; margin-bottom: 8px; font-weight: 600; }
.bug-user-note-textarea { width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--card); color: var(--text); font-family: inherit; box-sizing: border-box; resize: vertical; }
.bug-save-status { font-size: 0.9em; color: #4caf50; display: none; }

/* Details/Summary */
.bug-details { margin-top: 4px; }
.bug-details summary { cursor: pointer; padding: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; }
.bug-details-content { padding: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; margin-top: 4px; max-height: 300px; overflow-y: auto; }
.bug-details-pre { margin: 0; font-size: 0.85em; white-space: pre-wrap; word-wrap: break-word; }

/* Permissions */
.bug-perm-allowed { color: #4caf50; }
.bug-perm-denied { color: #ff9800; }
.bug-perm-list { margin: 4px 0; padding-left: 20px; }

/* Attachments */
.bug-attachments-list { margin-top: 8px; }
.bug-attachment-item { padding: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; margin-bottom: 8px; }
.bug-attachment-header { display: flex; justify-content: space-between; align-items: center; }
.bug-attachment-size { font-size: 0.9em; margin-left: 8px; }
.bug-attachment-image { margin-top: 8px; max-width: 100%; max-height: 400px; border: 1px solid var(--line); border-radius: 4px; }

/* Technical Details */
.bug-tech-details { padding: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; margin-top: 4px; font-size: 0.9em; }
.bug-tech-detail-row { margin-top: 4px; }

/* Comments */
.bug-comments-section { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.bug-comment-item { padding: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; margin-bottom: 8px; }
.bug-comment-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.bug-comment-date { font-size: 0.9em; }
.bug-comment-text { white-space: pre-wrap; }
.bug-comment-textarea { width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--card); color: var(--text); font-family: inherit; box-sizing: border-box; }
.bug-comment-submit { margin-top: 8px; }

/* Filter Form */
.bug-filter-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 12px; }
.bug-filter-label { display: block; margin-bottom: 4px; font-size: 0.9em; }
.bug-filter-actions { display: flex; align-items: flex-end; gap: 8px; }

/* List View */
.bug-list-card { margin-top: 16px; }
.bug-list-empty { margin-top: 12px; }
.bug-table-wrapper { margin-top: 12px; }
.bug-table-description { max-width: 300px; white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.table td.bug-table-description,
.card table.table td.bug-table-description {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  max-width: 300px !important;
}
.bug-type-column,
.bug-type-column .bug-type-badge {
  text-align: left;
  white-space: nowrap !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}
.bug-type-stack {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.bug-status-inline-mobile {
  display: none;
}
.bug-table-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.bug-pagination { margin-top: 16px; display: flex; justify-content: center; gap: 8px; align-items: center; }

/* Badges */
.bug-badge { padding: 4px 8px; border-radius: 4px; font-size: 0.85em; font-weight: 600; }
.bug-badge-published { background: #4caf50; color: #fff; }
.bug-badge-not-published { background: #888; color: #fff; }

@media (max-width: 768px) {
  #bug-report-modal .card { max-width: 95%; max-height: 95vh; }
  #bug-report-btn { padding: 6px 10px; font-size: 0.85em; }
  .bug-report-table .bug-user-column,
  .bug-report-table .bug-page-column {
    display: none;
  }
  .bug-report-table .bug-status-column {
    display: none;
  }
  .bug-type-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .bug-status-inline-mobile {
    display: inline-flex;
    white-space: nowrap;
  }
  .bug-detail-grid { grid-template-columns: 1fr; }
}
