/* ── Layout ── */
#app { display: flex; flex-direction: column; height: 100vh; }

/* ── App Bar (Row 1) ── */
.app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  z-index: 100;
  flex-shrink: 0;
}
.app-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

/* ── Filter Bar (Row 2) ── */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.filter-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.filter-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.filter-label {
  font-size: 12px;
  color: var(--text-secondary);
}
/* "★ default" marker rendered next to PM and Lead QSA dropdowns when the
   selected value is the system QoL pick (user's display_name) rather than
   an explicit user choice. Toggled by filters.js updateDefaultMarkers().
   Hidden state via the global .hidden class in base.css. */
.filter-default-marker {
  font-size: 11px;
  font-style: italic;
  color: var(--text-muted);
  margin-left: 4px;
  user-select: none;
}
/* Prominent "Showing X of Y" indicator in the right side of the filter
   bar. Always visible (when X==Y it just says "Showing 1412 of 1412" —
   consistent visual real estate, no element appearing/disappearing).
   Updated as a side-effect of getFiltered() so all three views keep it
   current. */
.filter-result-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.filter-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 6px;
}
/* .filter-toggle-label + .toggle-switch + theme overrides extracted to
 * css/settings.css (2026-05-06). Index.html loads settings.css. */
.panel-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
}
.panel-toggle-label input[type="checkbox"] { display: none; }
.toggle-label-text {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── View Controls Bar (Row 3) ── */
.view-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  min-height: 38px;
}
.view-controls-left {
  display: flex;
  align-items: center;
}
.view-controls-center {
  display: flex;
  align-items: center;
}
.view-controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Settings Dropdown ──
 * Extracted to css/settings.css (2026-05-06). All .settings-* base styles
 * + new .settings-pref-group/.settings-pref-grid classes live there. */

/* ── Notification Bell ── */
.notification-wrapper { position: relative; }
.notification-bell {
  background: none; border: none; font-size: 18px; cursor: pointer;
  padding: 4px 6px; border-radius: 4px; color: var(--text-secondary);
  position: relative; line-height: 1;
}
.notification-bell:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.notification-badge {
  position: absolute; top: 0; right: 0;
  background: #dc3545; color: #fff; font-size: 9px; font-weight: 700;
  min-width: 16px; height: 16px; line-height: 16px;
  border-radius: 8px; text-align: center; padding: 0 4px;
}
[data-theme="high-contrast"] .notification-badge { background: #ff4444; color: #ffffff; }
.notification-dropdown {
  position: absolute; top: 100%; right: 0; margin-top: 6px;
  background: var(--panel-bg); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--shadow-lg);
  width: 360px; max-height: 480px; z-index: 250; display: none;
  flex-direction: column;
}
.notification-dropdown.open { display: flex; }
.notification-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.notification-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.notification-mark-all {
  background: none; border: none; font-size: 11px; color: var(--accent);
  cursor: pointer; padding: 2px 6px;
}
.notification-mark-all:hover { text-decoration: underline; }
.notification-list { overflow-y: auto; flex: 1; max-height: 420px; }
.notification-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.1s;
}
.notification-item:hover { background: var(--bg-tertiary); }
.notification-item.unread { background: var(--accent-light); }
.notification-item.unread:hover { background: rgba(74, 108, 247, 0.12); }
.notification-item-message { font-size: 12px; color: var(--text-primary); line-height: 1.4; }
.notification-item-meta { font-size: 10px; color: var(--text-muted); }
.notification-empty {
  padding: 24px 14px; text-align: center;
  font-size: 12px; color: var(--text-muted); font-style: italic;
}
.notification-header-actions { display: flex; gap: 8px; }
.notification-item { position: relative; }
.notification-delete {
  position: absolute; top: 8px; right: 8px;
  background: none; border: none; color: var(--text-muted);
  font-size: 14px; cursor: pointer; padding: 0 2px; line-height: 1;
  opacity: 0; transition: opacity 0.15s;
}
.notification-item:hover .notification-delete { opacity: 0.6; }
.notification-delete:hover { opacity: 1 !important; color: #dc3545; }
.notification-load-more {
  padding: 10px 14px; text-align: center;
  border-top: 1px solid var(--border);
}
.notification-load-more-btn {
  background: none; border: none; color: var(--accent);
  font-size: 12px; cursor: pointer; padding: 4px 12px;
}
.notification-load-more-btn:hover { text-decoration: underline; }

/* ── Load Banner ── */
.load-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 60px 20px;
  text-align: center;
  flex: 1;
}
.load-banner h2 { color: var(--text-primary); font-size: 20px; font-weight: 600; }
.load-banner p { color: var(--text-secondary); max-width: 500px; }
.load-banner .load-buttons { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.load-banner input[type="file"] { display: none; }
.load-banner label {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: 8px; cursor: pointer;
  font-weight: 500; font-size: 13px;
  border: 2px dashed var(--border);
  color: var(--text-secondary);
  transition: border-color 0.15s, background 0.15s;
}
.load-banner label:hover { border-color: var(--accent); background: var(--accent-light); }
.load-banner label.loaded { border-color: #28a745; border-style: solid; color: #28a745; }
.file-status { font-size: 11px; color: var(--text-muted); }

/* ── Main Content ── */
.main-content {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* ── Auto-Export ── */
.settings-toggle.btn-auto-active {
  background: rgba(40, 167, 69, 0.15);
  color: #28a745;
  border-color: rgba(40, 167, 69, 0.3);
}

/* ── Status Bar ── */
.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 20px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.status-version { margin-left: auto; opacity: 0.6; }

/* ── Stage Pills (shared) ── */
.stage-pills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.stage-pill {
  padding: 3px 10px; font-size: 11px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--border); background: var(--input-bg); color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
}
.stage-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }
[data-theme="c128"] .stage-pill.active { background: #0a140a; color: #33ff33; border-color: #33ff33; }
[data-theme="ur6000"] .stage-pill.active { background: #0d0a00; color: #ffb000; border-color: #ffb000; }
[data-theme="haven3019"] .stage-pill.active { background: #0d1520; color: #7eb8d4; border-color: #7eb8d4; }
[data-theme="high-contrast"] .stage-pill.active { background: #ffff00; color: #000000; border-color: #ffff00; }
.filter-bar .stage-pills { margin-top: 0; align-items: center; }

/* ── Hierarchy Badge ── */
.hierarchy-badge {
  font-size: 10px;
  background: var(--accent-light);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 8px;
  cursor: pointer;
  margin-left: 4px;
  font-weight: 500;
  vertical-align: middle;
}
.hierarchy-badge:hover {
  background: var(--accent);
  color: #fff;
}
[data-theme="c128"] .hierarchy-badge:hover { background: #0a140a; color: #33ff33; border-color: #33ff33; }
[data-theme="ur6000"] .hierarchy-badge:hover { background: #0d0a00; color: #ffb000; border-color: #ffb000; }
[data-theme="haven3019"] .hierarchy-badge:hover { background: #0d1520; color: #7eb8d4; border-color: #7eb8d4; }
[data-theme="high-contrast"] .hierarchy-badge:hover { background: #ffff00; color: #000000; border-color: #ffff00; }
