/* ============================================================
   Design tokens
   ============================================================ */
:root {
  /* "Signal library" instrument palette: deep navy, electric-indigo signal, energy amber */
  --bg: #0a0e1a;
  --bg-surface: #101728;
  --bg-card: #141d33;
  --border: #253150;
  --border-subtle: #1a2338;
  --text: #e9edf7;
  --text-muted: #8792ad;
  --accent: #7c9cff;
  --accent-hover: #9db4ff;
  --accent-dim: rgba(124, 156, 255, 0.14);
  --pulse: #ffb45a;            /* energy accent: watts / kWh / ratings */
  --pulse-dim: rgba(255, 180, 90, 0.14);
  --success: #46c98b;
  --warning: #ffb45a;
  --danger: #ff6b6b;
  --pending: #7c9cff;
  --radius: 8px;
  --radius-lg: 14px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.7);
  --transition: 150ms ease;
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* ============================================================
   Reset / base
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}
img, svg {
  display: block;
  max-width: 100%;
}
button {
  cursor: pointer;
  font-family: inherit;
}
input, select, textarea {
  font-family: inherit;
  color: var(--text);
}
ul, ol {
  list-style: none;
}
[hidden] {
  display: none !important;
}

/* ============================================================
   Top bar
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
  height: 56px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
}
.brand:hover {
  text-decoration: none;
  color: var(--accent);
}
.brand-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}
.topbar nav::-webkit-scrollbar {
  display: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color var(--transition), background var(--transition);
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
}
.nav-link:hover,
.nav-link.active {
  color: var(--text);
  background: var(--bg-card);
  text-decoration: none;
}

.user-area {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
  flex-shrink: 0;
}
.user-name {
  font-size: 0.8125rem;
  color: var(--text-muted);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  object-fit: cover;
  flex-shrink: 0;
}

/* ============================================================
   Tabs
   ============================================================ */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  padding: 0 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition);
  position: relative;
  bottom: -1px;
}
.tab-btn:hover {
  color: var(--text);
}
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-panel {
  padding: 1.25rem 1rem;
}

/* ============================================================
   Card grid + cards
   ============================================================ */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-dim), var(--shadow);
}

.card-sparkline {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
}

.card-body {
  padding: 0.875rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-subtitle {
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.15rem;
}

.card-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 0.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  align-items: center;
}

.card-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-top: 1px solid var(--border-subtle);
}

/* Brand/device card: eyebrow left, status pill pinned top-right of the box. */
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}
.card-status-pill:empty { display: none; }
/* Per-object-type counts under the card title (models/profiles/cycles). */
.card-counts {
  margin-top: 0.2rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.card-counts .dot { opacity: 0.5; margin: 0 0.15rem; }

/* ============================================================
   Badges
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.175rem 0.5rem;
  border-radius: 2rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.4;
  border: 1px solid transparent;
  white-space: nowrap;
  text-transform: uppercase;
}
.badge-approved { background: rgba(63, 185, 80, 0.15); color: var(--success); border-color: rgba(63, 185, 80, 0.3); }
.badge-pending  { background: rgba(56, 139, 253, 0.15); color: var(--pending); border-color: rgba(56, 139, 253, 0.3); }
.badge-rejected { background: rgba(248, 81, 73, 0.15);  color: var(--danger);  border-color: rgba(248, 81, 73, 0.3); }
.badge-removed  { background: rgba(139, 148, 158, 0.1); color: var(--text-muted); border-color: var(--border); }
.badge-rating   { background: rgba(210, 153, 34, 0.15); color: var(--warning); border-color: rgba(210, 153, 34, 0.3); }
.badge-type     { background: var(--accent-dim); color: var(--accent); border-color: rgba(0, 180, 216, 0.25); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition), color var(--transition), opacity var(--transition);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.4;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-surface);
  color: var(--text);
  border-color: var(--accent);
}
.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(248, 81, 73, 0.35);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(248, 81, 73, 0.1);
  border-color: var(--danger);
}
.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.8125rem;
}

/* ============================================================
   Forms
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.form-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
input[type="text"],
input[type="number"],
input[type="email"],
input[type="search"],
select,
textarea {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  width: 100%;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238b949e'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 10px 6px;
  padding-right: 2.25rem;
}
textarea {
  resize: vertical;
  min-height: 88px;
}
input[type="file"] {
  background: var(--bg-surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.75rem;
  font-size: 0.8125rem;
  width: 100%;
  color: var(--text-muted);
  cursor: pointer;
}
input[type="file"]:hover {
  border-color: var(--accent);
  color: var(--text);
}
.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.upload-form {
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0.75rem 2rem;
  overflow-y: auto;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 700px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 3rem);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.125rem 1.25rem 0.875rem;
  border-bottom: 1px solid var(--border-subtle);
  gap: 0.75rem;
  flex-shrink: 0;
}
.modal-title {
  font-family: var(--font-heading);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.modal-subtitle {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.375rem;
  line-height: 1;
  padding: 0.2rem 0.35rem;
  border-radius: var(--radius);
  cursor: pointer;
  flex-shrink: 0;
  transition: color var(--transition), background var(--transition);
}
.modal-close:hover {
  color: var(--text);
  background: var(--bg-surface);
}

.modal-body {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.25rem;
}

.modal-footer {
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* Modal sparkline area */
.modal-sparkline-area {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  flex-shrink: 0;
}

/* Modal sub-tabs */
.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  padding: 0 1.25rem;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.modal-tabs::-webkit-scrollbar { display: none; }

.modal-tab-btn {
  padding: 0.6rem 0.875rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition);
  position: relative;
  bottom: -1px;
}
.modal-tab-btn:hover { color: var(--text); }
.modal-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.modal-section {
  padding: 1.125rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

/* Detail grid */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
}
.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.detail-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  font-weight: 700;
}
.detail-value {
  font-size: 0.9rem;
  color: var(--text);
  font-family: var(--font-mono);
  word-break: break-all;
}

/* Envelope JSON */
.envelope-json {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow: auto;
  max-height: 300px;
  white-space: pre;
  tab-size: 2;
}

/* Rejection reason */
.rejection-reason {
  background: rgba(248, 81, 73, 0.07);
  border: 1px solid rgba(248, 81, 73, 0.25);
  border-radius: var(--radius);
  padding: 0.55rem 0.875rem;
  font-size: 0.8125rem;
  color: var(--danger);
}

/* ============================================================
   Toast notifications
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  max-width: 340px;
}
.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  font-size: 0.875rem;
  color: var(--text);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in 200ms ease;
  word-break: break-word;
}
.toast-success { border-left: 3px solid var(--success); }
.toast-error   { border-left: 3px solid var(--danger); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Empty / loading states
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  text-align: center;
}
.empty-icon {
  font-size: 2.25rem;
  opacity: 0.35;
  line-height: 1;
}
.empty-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
}
.empty-text {
  font-size: 0.875rem;
  max-width: 300px;
  line-height: 1.5;
}

.loading-spinner {
  width: 26px;
  height: 26px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
  flex-shrink: 0;
}
.loading-center {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2.5rem 1rem;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Filter rail
   ============================================================ */
.filter-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 1.25rem;
  padding: 0.875rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.filter-rail .form-group {
  flex: 1;
  min-width: 140px;
}
.filter-rail .filter-actions {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  flex-shrink: 0;
}

/* ============================================================
   Rating stars
   ============================================================ */
.rating-stars {
  display: flex;
  gap: 0.1rem;
  align-items: center;
}
.star {
  background: none;
  border: none;
  font-size: 1.375rem;
  line-height: 1;
  cursor: pointer;
  color: var(--border);
  transition: color var(--transition), transform var(--transition);
  padding: 0.1rem;
}
.star.filled { color: var(--warning); }
.star.hov    { color: var(--warning); }
.star:hover  { transform: scale(1.18); }
.rating-info {
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.rating-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
/* Inline "Rate quality:" caption before the device stars. */
.rating-caption { white-space: nowrap; }
/* Read-only derived rating on a profile row + device-card meta rating (gold). */
.profile-rating { font-weight: 400; font-size: 0.8125rem; color: var(--warning); }
.card-meta [data-devrating] { color: var(--warning); }

/* ============================================================
   Comments
   ============================================================ */
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.comment {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
}
.comment.is-reply {
  margin-left: 1.75rem;
  border-left: 2px solid var(--accent-dim);
}
.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  overflow: hidden;
  text-transform: uppercase;
}
.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.comment-body { flex: 1; min-width: 0; }
.comment-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.comment-author {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}
.comment-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.comment-text {
  font-size: 0.875rem;
  color: var(--text);
  margin-top: 0.25rem;
  word-break: break-word;
  white-space: pre-wrap;
}
.comment-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.375rem;
  flex-wrap: wrap;
}
.reply-btn {
  background: none;
  border: none;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: color var(--transition);
}
.reply-btn:hover { color: var(--accent); }
.reply-btn.danger:hover { color: var(--danger); }

.add-comment {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.875rem;
}
.add-comment textarea { min-height: 72px; }
.reply-indicator {
  font-size: 0.75rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-row {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* ============================================================
   Load more
   ============================================================ */
.load-more-area {
  display: flex;
  justify-content: center;
  margin-top: 1.25rem;
}

/* ============================================================
   Section headers
   ============================================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.section-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}

/* ============================================================
   Admin - stat grid
   ============================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.875rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.125rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.stat-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  font-weight: 700;
}
.stat-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}
.stat-value.c-pending  { color: var(--pending); }
.stat-value.c-approved { color: var(--success); }
.stat-value.c-rejected { color: var(--danger); }
.stat-value.c-removed  { color: var(--text-muted); }
.stat-value.c-ban      { color: var(--warning); }

/* ============================================================
   Admin - analytics chart
   ============================================================ */
.analytics-chart {
  display: block;
  border-radius: 6px;
  background: var(--surface);
  padding: 10px 4px 4px;
}

/* ============================================================
   Admin - table
   ============================================================ */
.table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.admin-table th {
  text-align: left;
  padding: 0.55rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--bg-surface);
}
.admin-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: var(--bg-surface); }
.action-cell {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
/* Admin pages use a wider max-width so tables don't overflow the viewport */
.admin-main {
  padding-inline: max(1rem, calc((100% - 1500px) / 2));
}

/* Admin user avatar cell */
.user-cell {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.user-cell-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  overflow: hidden;
  text-transform: uppercase;
}
.user-cell-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Admin pill */
.pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.pill-admin { background: rgba(210, 153, 34, 0.15); color: var(--warning); border-color: rgba(210, 153, 34, 0.3); }

/* Truncated text */
.truncate {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}

/* Admin review card (in review queue) */
.review-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  gap: 0;
}
.review-card-spark {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 120px;
}
.review-card-body {
  padding: 0.875rem 1rem;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.review-card-title {
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.review-card-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

/* Admin info note */
.admin-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.875rem;
  line-height: 1.5;
}

/* ============================================================
   Utility classes
   ============================================================ */
.text-muted  { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success{ color: var(--success); }
.text-accent { color: var(--accent); }
.mono { font-family: var(--font-mono); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.flex-row { display: flex; align-items: center; gap: 0.5rem; }
.w-full { width: 100%; }

/* ============================================================
   Responsive - 768px breakpoint
   ============================================================ */
@media (min-width: 768px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid  { grid-template-columns: repeat(5, 1fr); }
  .form-row   { flex-direction: row; }
  .detail-grid { grid-template-columns: repeat(3, 1fr); }
  .tab-panel  { padding: 1.5rem 1.5rem; }
  .modal-overlay { padding: 2.5rem 1.5rem; }
}

@media (min-width: 1100px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .tab-panel { padding: 1.5rem 2rem; }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
  }
}

/* ============================================================
   v2: hierarchy browse (breadcrumb, devices, profiles), upload preview
   ============================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  font-size: .875rem;
}
.owner-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .75rem;
  padding: .5rem .75rem;
  background: var(--surface2);
  border-radius: var(--radius);
  font-size: .8125rem;
  color: var(--text-muted);
}
.owner-actions::before { content: 'Owner:'; margin-right: .25rem; }
.crumb {
  background: none;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  font: inherit;
}
.crumb:hover { text-decoration: underline; }
.crumb.current { color: var(--text); cursor: default; }
.crumb-sep { color: var(--text-muted); }

.device-card .card-actions { display: flex; gap: .5rem; align-items: center; }
.star-btn { min-width: 2.4rem; }
.star-btn.on { color: var(--warning); border-color: var(--warning); }

/* Pill-toggle checkboxes in the filter rail */
.filter-fav {
  flex: 0 0 auto;
  min-width: 0;
}
.filter-fav label {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .49rem .75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: 0;
  text-transform: none;
  transition: border-color .15s, background .15s, color .15s;
  user-select: none;
  line-height: 1.4;
}
.filter-fav label:hover { border-color: var(--accent); color: var(--text); }
.filter-fav input[type="checkbox"] {
  accent-color: var(--accent);
  width: .875rem;
  height: .875rem;
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}
.filter-fav:has(input:checked) label {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}
/* Theme all other checkboxes/radios to the accent. */
input[type="checkbox"], input[type="radio"] {
  accent-color: var(--accent);
  width: 1.05rem;
  height: 1.05rem;
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}

.profile-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .85rem 1rem;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  transition: border-color .15s, background .15s;
}
.profile-row:hover { border-color: var(--accent); background: var(--bg-surface); }
.profile-name { font-weight: 600; display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.profile-meta { color: var(--text-muted); font-size: .8125rem; white-space: nowrap; padding-left: .5rem; }

.upload-preview {
  margin: .75rem 0;
  padding: .75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}

/* Admin merge bar + generic table message rows */
.merge-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1rem;
  padding: .6rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.merge-bar select { flex: 1; min-width: 9rem; max-width: 22rem; }
.merge-bar-label {
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  flex-shrink: 0;
  white-space: nowrap;
}
.merge-bar-hint {
  font-size: .7rem;
  color: var(--text-muted);
  flex: 2;
  min-width: 10rem;
}
.merge-controls { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.merge-controls input {
  flex: 1;
  min-width: 12rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: .45rem .6rem;
  font-family: var(--font-mono, monospace);
  font-size: .8125rem;
}
.admin-search-bar {
  display: flex;
  gap: .5rem;
  margin-bottom: .75rem;
}
.admin-search-bar input { max-width: 28rem; }

/* ============================================================
   Catalog hierarchy (Brands → Devices → Profiles → Cycles)
   ============================================================ */
.cat-breadcrumb {
  display: flex;
  align-items: center;
  gap: .3rem;
  flex-wrap: wrap;
  font-size: .8125rem;
  padding: .5rem .875rem;
  margin-bottom: .875rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.cat-bc-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: .8125rem;
  color: var(--accent);
  cursor: pointer;
  line-height: 1.5;
}
.cat-bc-btn:hover { text-decoration: underline; }
.cat-bc-sep { color: var(--text-muted); user-select: none; padding: 0 .05rem; }
.cat-bc-current { color: var(--text); font-weight: 600; }
.cat-list {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.cat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color .15s;
}
.cat-card.cat-pending { border-left: 3px solid var(--warning); }
.cat-card-info { flex: 1; min-width: 0; }
.cat-card-name {
  font-weight: 600;
  font-size: .9375rem;
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
  line-height: 1.3;
}
.cat-card-meta {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .2rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.cat-card-actions {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.btn-drill {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(99,152,220,.2);
  border-radius: var(--radius);
  padding: .3rem .7rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, color .12s, border-color .12s;
  line-height: 1.4;
}
.btn-drill:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.tbl-msg { text-align: center; padding: 1.75rem; color: var(--text-muted); }
.admin-table-wrap { overflow-x: auto; }
.maint-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.maint-card-title { font-weight: 600; display: flex; align-items: center; gap: .5rem; }

/* ============================================================
   v2 design pass: mono eyebrows, page head, energy accents, maintenance
   ============================================================ */

/* Mono, tracked, uppercase eyebrow - the data-logger signature treatment */
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
}

.page-head {
  padding: 1.5rem 0 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.75rem;
}
.page-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.2vw, 2.35rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: .5rem 0 0;
}
.page-lede {
  color: var(--text-muted);
  max-width: 46ch;
  margin: .6rem 0 0;
  font-size: .95rem;
}

/* Data values render in mono so numbers align and read as measured output */
.mono-data { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Energy accent for the rating badge (star = energy amber) */
.badge-rating { color: var(--pulse); border-color: var(--pulse-dim); background: var(--pulse-dim); }

/* Card top edge glows as a faint signal line */
.card { position: relative; }
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: .35;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* App shell (index + create): fills the body flex space and propagates column layout to footer */
#app-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Boot splash - shown until the maintenance/admin state is resolved */
#boot:not([hidden]) {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg);
}

/* Maintenance */
#maintenance-screen:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(124, 156, 255, 0.10), transparent 60%),
    var(--bg);
}
.maint-inner { text-align: center; max-width: 34rem; }
.maint-wave { filter: drop-shadow(0 0 14px rgba(124, 156, 255, 0.45)); }
.maint-eyebrow {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 1.25rem;
}
.maint-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  margin: .5rem 0 0;
}
.maint-text { color: var(--text-muted); margin-top: .85rem; line-height: 1.6; }

.maint-banner {
  background: var(--pulse-dim);
  color: var(--pulse);
  border-bottom: 1px solid var(--pulse-dim);
  text-align: center;
  padding: .5rem 1rem;
  font-size: .8125rem;
  font-family: var(--font-mono);
}

/* Centered container: bars stay full-width (backgrounds edge-to-edge) while their
   content and the main column align to a comfortable max width with sane gutters. */
.topbar,
main,
.site-footer,
.maint-banner {
  padding-inline: max(1.25rem, calc((100% - 1180px) / 2));
}
main {
  padding-block: 1.75rem 3.5rem;
}
@media (max-width: 640px) {
  main { padding-block: 1.25rem 2.5rem; }
}

/* Footer credits */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .5rem;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: .8125rem;
  margin-top: auto;
}
.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .foot-sep { opacity: .5; }

/* ---- Contribute page (create.html) ---- */
input[type="url"] {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  width: 100%;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input[type="url"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.contribute-card[hidden] { display: none; }
.contribute-card {
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 1rem;
}
.consent-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
}
.consent-row input[type="checkbox"] { width: auto; }
.contribute-guide {
  margin: .75rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .8125rem;
}
.contribute-guide > summary {
  padding: .5rem .75rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  list-style: none;
}
.contribute-guide > summary::-webkit-details-marker { display: none; }
.contribute-guide > summary::before { content: '▶  '; font-size: .7em; }
.contribute-guide[open] > summary::before { content: '▼  '; }
.contribute-guide ul {
  margin: 0;
  padding: .25rem .75rem .75rem 1.75rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.contribute-guide li { margin-bottom: .25rem; }
.contribute-result {
  max-width: 560px;
  margin-top: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--success);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}
.result-title { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 1.05rem; margin-bottom: 0.25rem; }

/* ---- Community catalog (browse cards) ---- */
.add-cta {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
}
.card-community {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  margin-top: 0.6rem;
}
.add-profile { flex-wrap: wrap; margin-top: 1rem; }
.card-manual { color: var(--accent); text-decoration: none; }
.card-manual:hover { text-decoration: underline; }
.community-msg { font-size: 0.75rem; }
.device-stars {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-basis: 100%;
  margin-top: 0.35rem;
}

/* ---- Settings editor ---- */
.modal-wide { max-width: 780px; }
.se-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem 1rem; }
.se-input { font-size: .8125rem; padding: .4rem .6rem; width: 100%; box-sizing: border-box; }
.se-grid .form-group { margin: 0; }
.se-grid label { font-size: .75rem; margin-bottom: .2rem; }
@media (max-width: 600px) { .se-grid { grid-template-columns: 1fr; } }

/* ---- Device header card (store browse) ---- */
.device-header-card {
  background: var(--surface2, var(--bg-card));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.device-header-meta { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-bottom: .4rem; }
.device-header-title { font-size: 1.125rem; font-weight: 600; margin: 0 0 .3rem; }
.device-header-model { font-weight: 400; color: var(--text-muted, #888); }
.device-header-stats { font-size: .8125rem; color: var(--text-muted, #888); display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .4rem; }
.device-header-link { font-size: .8125rem; color: var(--accent); text-decoration: none; }
.device-header-link:hover { text-decoration: underline; }
.device-header-owner { font-size: .75rem; color: var(--text-muted, #888); }

/* ---- Phase editor ---- */
.pe-pending-row { display: flex; align-items: center; gap: .5rem; padding: .5rem 0; border-top: 1px solid var(--border-subtle); flex-wrap: wrap; }
.pe-name-input { flex: 1; min-width: 120px; max-width: 220px; }
.pe-phase-list { display: flex; flex-direction: column; gap: .35rem; margin-top: .5rem; }
.pe-phase-row { display: flex; align-items: center; gap: .5rem; padding: .35rem .5rem; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius); font-size: .8125rem; }
.pe-phase-swatch { width: 12px; height: 12px; border-radius: 2px; flex-shrink: 0; }
.pe-phase-name { flex: 1; font-weight: 500; }
.pe-phase-range { color: var(--text-muted); font-family: var(--font-mono); font-size: .72rem; }
.pe-phase-del { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 0 .25rem; font-size: 1rem; line-height: 1; }
.pe-phase-del:hover { color: var(--danger); }
.cg-phase-band { pointer-events: none; }
.cg-drag-preview { pointer-events: none; }

/* ---- Interactive cycle graph (detail modal) ---- */
.cycle-graph { width: 100%; }
.cycle-graph-svg { width: 100%; height: 170px; display: block; background: var(--bg-surface); border-radius: var(--radius); cursor: crosshair; touch-action: none; }
.cg-area { fill: var(--accent-dim); stroke: none; }
.cg-line { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linejoin: round; }
.cg-cross { stroke: var(--accent); stroke-width: 1; stroke-dasharray: 3 3; opacity: .7; }
.cg-dot { fill: var(--accent); stroke: var(--bg-surface); stroke-width: 1.5; }
.cycle-graph-readout { font-size: .8125rem; margin-top: .5rem; font-family: 'JetBrains Mono', monospace; }

/* ============================================================
   Content reports & moderation
   ============================================================ */
/* Public "report" affordance: a quiet flag button on cards / views. */
.report-btn {
  color: var(--text-muted);
  padding-left: .55rem;
  padding-right: .55rem;
}
.report-btn:hover { color: var(--danger); border-color: rgba(255, 107, 107, 0.4); }
.view-toolbar { display: flex; justify-content: flex-end; margin-bottom: .5rem; }

/* Report modal acknowledgement (already reported). */
.report-already {
  background: rgba(63, 185, 80, 0.1);
  border: 1px solid rgba(63, 185, 80, 0.3);
  color: var(--success);
  border-radius: var(--radius);
  padding: .75rem .9rem;
  font-size: .875rem;
}

/* Reports tab button count badge. */
.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 .35rem;
  margin-left: .35rem;
  border-radius: 2rem;
  background: rgba(255, 107, 107, 0.18);
  color: var(--danger);
  font-size: .6875rem;
  font-weight: 700;
}

/* Clickable overview stat cards (open reports -> reports tab). */
.stat-card-link { cursor: pointer; transition: border-color var(--transition), transform var(--transition); }
.stat-card-link:hover { border-color: var(--accent); transform: translateY(-1px); }

/* Per-object-type breakdown under a stat value (pending/approved/removed). */
.stat-breakdown { margin-top: .35rem; font-size: .7rem; color: var(--text-muted); line-height: 1.5; }

/* Repeat-offender strike badge (users table + review card). */
.strike-badge {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  padding: .1rem .45rem;
  border-radius: 2rem;
  font-size: .7rem;
  font-weight: 700;
  background: var(--pulse-dim);
  color: var(--warning);
  border: 1px solid rgba(255, 180, 90, 0.3);
  white-space: nowrap;
}
.strike-badge.strike-high { background: rgba(255, 107, 107, 0.16); color: var(--danger); border-color: rgba(255, 107, 107, 0.35); }

/* Admin review queue: one consolidated card per reported object. */
.report-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--danger);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.report-group-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}
.report-target { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.report-type-badge { background: var(--accent-dim); color: var(--accent); border-color: rgba(124, 156, 255, 0.25); }
.report-target-title { font-weight: 600; font-size: .95rem; }
.report-live-status { text-transform: uppercase; }
.report-identity {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem;
  font-size: .8125rem;
  color: var(--text);
  margin: .4rem 0 .15rem;
}
.report-identity .ri-main { font-weight: 600; }
.report-identity .ri-type {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: var(--radius-sm);
  padding: .05rem .35rem;
}
.report-identity .ri-sep { color: var(--text-muted); }
.report-identity .ri-view { margin-left: .25rem; }
.report-path { font-size: .7rem; color: var(--text-muted); margin: .15rem 0 .6rem; word-break: break-all; }
.report-creator { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.report-creator-name { font-size: .8125rem; font-weight: 600; }

.report-items {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin: .25rem 0 .75rem;
}
.report-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: .55rem .7rem;
}
.report-item-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .3rem; }
.report-reason-chip {
  font-size: .6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--warning);
  background: var(--pulse-dim);
  border: 1px solid rgba(255, 180, 90, 0.3);
  padding: .1rem .45rem;
  border-radius: 2rem;
}
.report-item-who { font-size: .8rem; font-weight: 600; }
.report-item-date { font-size: .72rem; }
.report-item-comment { font-size: .875rem; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.report-actions { display: flex; gap: .5rem; flex-wrap: wrap; padding-top: .6rem; border-top: 1px solid var(--border-subtle); }
