/* ══════════════════════════════════════════════════════════════
   REPORTS PAGE — List view, peek panel, report body, comments
   ══════════════════════════════════════════════════════════════ */

/* ── Reports tab layout ── */

.reports-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.reports-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

.reports-new-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  background: var(--purple);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.reports-new-btn:hover { opacity: 0.85; }
.reports-new-btn svg { stroke: #fff; }

/* ── Report list entries ── */

.reports-list {
  display: flex;
  flex-direction: column;
}

.report-entry {
  display: grid;
  grid-template-columns: 110px 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  cursor: pointer;
  transition: background 0.1s;
}
.report-entry:hover {
  background: var(--hover);
  border-radius: 4px;
}

/* Fading horizontal dividers between entries */
.report-entry + .report-entry {
  border-top: 1px solid transparent;
  border-image: linear-gradient(
    to right,
    transparent 0px,
    var(--border) 10px,
    var(--border) calc(100% - 10px),
    transparent 100%
  ) 1;
}

.report-entry-date {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.report-entry-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-entry-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.report-entry-desc {
  font-size: 12px;
  color: var(--text-light);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

/* Shimmer entries */
.shimmer-entry {
  pointer-events: none;
}

.reports-empty {
  padding: 48px 0;
  text-align: center;
  color: var(--text-light);
  font-size: 14px;
}

/* ── Tag pills ── */

.report-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 10px;
  white-space: nowrap;
}

.tag-blue       { background: var(--blue-bg);   color: var(--blue); }
.tag-green      { background: var(--green-bg);  color: var(--green); }
.tag-red        { background: var(--red-bg);    color: var(--red); }
.tag-purple     { background: var(--purple-bg); color: var(--purple); }
.tag-yellow     { background: var(--amber-bg);  color: var(--amber); }
.tag-orange     { background: var(--amber-bg);  color: var(--amber); }
.tag-pink       { background: var(--red-bg);    color: var(--red); }
.tag-gray       { background: var(--tag-bg);    color: var(--text-muted); }
.tag-brown      { background: var(--tag-bg);    color: var(--text-muted); }
.tag-default    { background: var(--tag-bg);    color: var(--text-muted); }

/* ── Peek overlay ── */

.peek-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 100;
  pointer-events: none;
  transition: background 0.35s ease;
}
.peek-overlay.open {
  background: rgba(0, 0, 0, 0.25);
  pointer-events: auto;
}

/* ── Peek panel ── */

.peek-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 60%;
  height: 100vh;
  background: var(--bg);
  border-left: 1px solid var(--border);
  z-index: 101;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.peek-panel.open {
  transform: translateX(0);
}

.peek-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.peek-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.peek-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.peek-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.1s;
}
.peek-close:hover {
  background: var(--hover);
  color: var(--text);
}

/* ── 3-dot menu ── */

.peek-menu-wrap {
  position: relative;
}

.peek-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.1s;
}
.peek-menu-btn:hover {
  background: var(--hover);
  color: var(--text);
}

.peek-menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 200px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  padding: 4px;
  z-index: 110;
  display: none;
}
.peek-menu-dropdown.open {
  display: block;
}

.peek-menu-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
  background: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}
.peek-menu-option:hover {
  background: var(--hover);
}
.peek-menu-option svg {
  flex-shrink: 0;
  color: var(--text-muted);
}

/* ── Peek body ── */

.peek-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px 40px;
}

/* ── Peek fields (Notion-style property rows) ── */

.peek-fields {
  margin-bottom: 16px;
}

.peek-title-input {
  width: 100%;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  background: none;
  border: none;
  outline: none;
  padding: 0;
  margin-bottom: 16px;
  font-family: 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, sans-serif;
}
.peek-title-input::placeholder {
  color: var(--text-light);
}

.peek-field-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 6px 0;
  min-height: 32px;
}

.peek-field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  min-width: 90px;
  padding-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.peek-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.peek-tag-add-wrap {
  position: relative;
  display: inline-flex;
}

.peek-tag-add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-size: 14px;
  color: var(--text-light);
  background: var(--tag-bg);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.1s;
}
.peek-tag-add:hover {
  background: var(--hover);
  color: var(--text);
}

/* Tag remove button */
.tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  width: 14px;
  height: 14px;
  font-size: 11px;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.6;
  padding: 0;
  line-height: 1;
}
.tag-remove:hover { opacity: 1; }

/* Tag dropdown */
.tag-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 180px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  padding: 4px;
  z-index: 120;
  display: none;
}
.tag-dropdown.open {
  display: block;
}

.tag-dropdown-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text);
  background: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}
.tag-dropdown-option:hover {
  background: var(--hover);
}
.tag-dropdown-option.selected {
  font-weight: 600;
}

.tag-dropdown-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tag-dropdown-check {
  margin-left: auto;
  font-size: 12px;
  color: var(--green);
}

.peek-desc-input {
  width: 100%;
  font-size: 13px;
  color: var(--text);
  background: none;
  border: none;
  outline: none;
  padding: 4px 0;
  resize: vertical;
  font-family: 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.5;
}
.peek-desc-input::placeholder {
  color: var(--text-light);
}

.peek-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

/* ── Report body (Roy's doc style) ── */

.peek-report-body {
  min-height: 200px;
  line-height: 1.5;
  font-size: 14px;
  color: var(--text);
}

/* Section headers (white text on colored bg) */
.rpt-h1 {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  background: #000;
  padding: 8px 14px;
  border-radius: 4px;
  margin: 24px 0 12px;
  text-transform: uppercase;
}
.rpt-h1:first-child { margin-top: 0; }
.rpt-h1.bg-green  { background: #1B5E20; }
.rpt-h1.bg-purple { background: #4A148C; }

/* Sub-headers */
.rpt-h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 16px 0 8px;
}
.rpt-h2.underline { text-decoration: underline; }

.rpt-h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 12px 0 6px;
}

/* Body text */
.rpt-para {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 8px;
}

/* Bullets */
.rpt-list {
  margin: 0 0 8px 24px;
  padding: 0;
}
.rpt-bullet {
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 4px;
  color: var(--text);
}

/* Accent-colored bullet labels (rotate per section) */
.rpt-label-cyan    { background: #00BCD4; color: #fff; padding: 1px 6px; border-radius: 3px; font-weight: 700; }
.rpt-label-black   { background: #000;    color: #fff; padding: 1px 6px; border-radius: 3px; font-weight: 700; }
.rpt-label-magenta { background: #E91E63; color: #fff; padding: 1px 6px; border-radius: 3px; font-weight: 700; }
.rpt-label-green   { background: #4CAF50; color: #fff; padding: 1px 6px; border-radius: 3px; font-weight: 700; }
.rpt-label-blue    { background: #2196F3; color: #fff; padding: 1px 6px; border-radius: 3px; font-weight: 700; }
.rpt-label-purple  { background: #9C27B0; color: #fff; padding: 1px 6px; border-radius: 3px; font-weight: 700; }

/* Highlighted metrics */
.rpt-green  { color: #4CAF50; font-weight: 700; }
.rpt-red    { color: #F44336; font-weight: 700; }
.rpt-yellow { background: #FFEB3B; color: #000; font-weight: 700; padding: 1px 4px; border-radius: 2px; }

/* Divider */
.rpt-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

/* Callout */
.rpt-callout {
  background: var(--tag-bg);
  border-radius: 6px;
  padding: 12px 14px;
  margin: 8px 0;
  display: flex;
  gap: 8px;
  font-size: 14px;
  line-height: 1.5;
}

.rpt-callout-icon {
  flex-shrink: 0;
  font-size: 18px;
}

/* Quote */
.rpt-quote {
  border-left: 3px solid var(--border);
  padding: 4px 14px;
  margin: 8px 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

/* Toggle */
.rpt-toggle {
  margin: 8px 0;
}
.rpt-toggle summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  padding: 4px 0;
}
.rpt-toggle-content {
  padding-left: 20px;
  margin-top: 4px;
}

/* ── Comments section ── */

.peek-comments-section {
  margin-top: 8px;
}

.peek-comments-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.peek-comments {
  margin-bottom: 12px;
}

.peek-comment {
  padding: 10px 0;
}
.peek-comment + .peek-comment {
  border-top: 1px solid var(--border);
}

.peek-comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.comment-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.comment-author {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.comment-time {
  font-size: 11px;
  color: var(--text-light);
}

.comment-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  padding-left: 32px;
}

.peek-no-comments {
  font-size: 13px;
  color: var(--text-light);
  font-style: italic;
  padding: 8px 0;
}

.peek-comment-input-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}

.peek-comment-input {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  font-family: 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, sans-serif;
  transition: border-color 0.15s;
}
.peek-comment-input:focus {
  border-color: var(--purple);
}

.peek-comment-send {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  background: var(--purple);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.peek-comment-send:hover { opacity: 0.85; }

/* ── Toast notification ── */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: var(--bg);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 200;
}
.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Print stylesheet (for Save as PDF) ── */

@media print {
  .sidebar,
  .topbar,
  .peek-header,
  .peek-fields,
  .peek-comments-section,
  .peek-comment-input-wrap,
  .peek-overlay,
  .toast {
    display: none !important;
  }
  .peek-panel {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    transform: none !important;
    border: none !important;
    box-shadow: none !important;
  }
  .peek-body {
    padding: 20px !important;
    overflow: visible !important;
  }
  .peek-report-body {
    break-inside: auto;
  }
  .rpt-h1 { break-after: avoid; }
}

/* ── Rich text editor toolbar ── */

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
}

.et-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  font-family: 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, sans-serif;
}
.et-btn:hover {
  background: var(--hover);
  color: var(--text);
}

.et-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 4px;
}

.editor-content {
  outline: none;
  min-height: 200px;
  padding: 4px 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  cursor: text;
}
.editor-content:focus {
  outline: none;
}
.editor-content:empty::before {
  content: 'Start typing...';
  color: var(--text-light);
  font-style: italic;
}

.editor-save-indicator {
  font-size: 11px;
  color: var(--text-light);
  text-align: right;
  height: 16px;
  opacity: 0;
  transition: opacity 0.2s;
}
.editor-save-indicator.visible {
  opacity: 1;
}

/* Code block */
.rpt-code {
  background: var(--tag-bg);
  border-radius: 6px;
  padding: 12px 14px;
  margin: 8px 0;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  line-height: 1.5;
  overflow-x: auto;
  color: var(--text);
}

/* Figure/image */
.rpt-figure {
  margin: 12px 0;
}
.rpt-caption {
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
  margin-top: 6px;
}

/* ── Shimmer blocks (reuse base animation) ── */

.shimmer-block {
  background: linear-gradient(
    90deg,
    var(--tag-bg) 25%,
    var(--hover) 50%,
    var(--tag-bg) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
