/* ============================================================
   DEBUG — Debug Console Panel & Button
   ============================================================
   Source: css/styles.css lines 984-1062
   ============================================================ */

#pbf-debug-btn {
  position: fixed !important; bottom: 12px !important; right: 12px !important; z-index: 99999 !important;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--navy-light, #142240); border: 2px solid var(--gold, #D4AF37);
  color: var(--gold, #D4AF37); font-size: 16px; cursor: pointer;
  display: flex !important; align-items: center; justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.5); transition: all 0.2s;
}
#pbf-debug-btn.fab-hidden,
#ai-ops-fab.fab-hidden { display: none !important; visibility: hidden !important; opacity: 0 !important; }
#pbf-debug-btn:hover { transform: scale(1.1); background: var(--gold, #D4AF37); color: var(--navy, #0B162A); }
#pbf-debug-btn .dbg-badge {
  position: absolute; top: -4px; right: -4px; background: #ef4444; color: white;
  border-radius: 50%; width: 18px; height: 18px; font-size: 10px; font-weight: 700;
  display: none; align-items: center; justify-content: center; line-height: 18px; text-align: center;
}
#pbf-debug-panel {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 99998;
  max-height: 70vh; background: #0a0f1a; border-top: 2px solid var(--gold, #D4AF37);
  transform: translateY(100%); transition: transform 0.3s ease;
  display: flex; flex-direction: column; font-family: 'Courier New', monospace;
}
#pbf-debug-panel.open { transform: translateY(0); }
.dbg-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.5rem 0.75rem; background: #111827; border-bottom: 1px solid #1f2937;
  flex-shrink: 0;
}
.dbg-header-title { color: var(--gold, #D4AF37); font-weight: 700; font-size: 0.8rem; font-family: 'Montserrat', sans-serif; }
.dbg-header-actions { display: flex; gap: 0.5rem; }
.dbg-header-actions button {
  background: none; border: 1px solid #374151; color: #9ca3af; font-size: 0.65rem;
  padding: 0.2rem 0.5rem; border-radius: 4px; cursor: pointer; font-family: 'Montserrat', sans-serif;
}
.dbg-header-actions button:hover { color: white; border-color: #6b7280; }
.dbg-tabs { display: flex; gap: 0; border-bottom: 1px solid #1f2937; flex-shrink: 0; }
.dbg-tab {
  padding: 0.35rem 0.75rem; font-size: 0.68rem; color: #6b7280; cursor: pointer;
  border-bottom: 2px solid transparent; font-family: 'Montserrat', sans-serif;
}
.dbg-tab.active { color: var(--gold, #D4AF37); border-bottom-color: var(--gold, #D4AF37); }
.dbg-tab:hover { color: #d1d5db; }
.dbg-body { overflow-y: auto; flex: 1; padding: 0.5rem; max-height: 55vh; }
.dbg-entry {
  padding: 0.35rem 0.5rem; border-bottom: 1px solid #1f293722; font-size: 0.68rem;
  line-height: 1.4; display: flex; gap: 0.5rem; align-items: flex-start;
}
.dbg-entry:hover { background: #111827; }
.dbg-code { color: #f59e0b; font-weight: 700; white-space: nowrap; min-width: 60px; }
.dbg-sev-error { border-left: 3px solid #ef4444; }
.dbg-sev-warn { border-left: 3px solid #f59e0b; }
.dbg-sev-info { border-left: 3px solid #3b82f6; }
.dbg-sev-success { border-left: 3px solid #22c55e; }
.dbg-time { color: #4b5563; font-size: 0.6rem; white-space: nowrap; }
.dbg-msg { color: #e5e7eb; flex: 1; word-break: break-word; }
.dbg-msg .dbg-detail { color: #9ca3af; font-size: 0.6rem; display: block; margin-top: 2px; }
.dbg-empty { color: #4b5563; text-align: center; padding: 2rem; font-size: 0.75rem; }
.dbg-status-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem; padding: 0.5rem;
}
.dbg-status-card {
  background: #111827; border: 1px solid #1f2937; border-radius: 6px;
  padding: 0.5rem 0.6rem; font-size: 0.68rem;
}
.dbg-status-card .dbg-label { color: #6b7280; font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.5px; }
.dbg-status-card .dbg-value { color: #e5e7eb; margin-top: 0.2rem; }
.dbg-status-card .dbg-value.ok { color: #22c55e; }
.dbg-status-card .dbg-value.fail { color: #ef4444; }
.dbg-status-card .dbg-value.warn { color: #f59e0b; }
body.day-mode #pbf-debug-panel { background: #f8f9fa; border-top-color: #2563eb; }
body.day-mode .dbg-header { background: #e5e7eb; border-bottom-color: #d1d5db; }
body.day-mode .dbg-header-title { color: #1e40af; }
body.day-mode .dbg-entry { border-bottom-color: #e5e7eb; }
body.day-mode .dbg-entry:hover { background: #f1f5f9; }
body.day-mode .dbg-msg { color: #1f2937; }
body.day-mode .dbg-tab.active { color: #1e40af; border-bottom-color: #1e40af; }
body.day-mode .dbg-code { color: #b45309; }
body.day-mode .dbg-status-card { background: #fff; border-color: #e5e7eb; }
body.day-mode #pbf-debug-btn { background: #e5e7eb; border-color: #2563eb; color: #2563eb; }
