/* ============================================
   Report Generation — Type Selection & Viewer
   ============================================ */

/* -------------------------------------------
   Type Selection Overlay
   ------------------------------------------- */
.report-select-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: var(--z-modal, 1000);
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  animation: reportFadeIn 0.15s ease;
}

.report-select-modal {
  background: var(--color-surface, #fff);
  border-radius: var(--radius-xl, 16px);
  box-shadow: var(--shadow-xl, 0 24px 48px rgba(0,0,0,0.18));
  width: 480px;
  max-width: calc(100vw - 32px);
  padding: 28px 32px 32px;
  position: relative;
}

.report-select-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.report-select-modal__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text, #1a1a1a);
}

.report-select-modal__close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--color-text-muted, #999);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}

.report-select-modal__close:hover {
  background: var(--color-surface-secondary, #f5f5f5);
  color: var(--color-text, #1a1a1a);
}

.report-select-modal__desc {
  font-size: 13px;
  color: var(--color-text-secondary, #666);
  margin-bottom: 20px;
}

/* -------------------------------------------
   Type Cards
   ------------------------------------------- */
.report-select-modal__options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.report-type-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--color-border, #e0e0e0);
  border-radius: var(--radius-lg, 12px);
  background: var(--color-surface, #fff);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  font-family: inherit;
  width: 100%;
}

.report-type-card:hover {
  border-color: var(--color-primary, #2563EB);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.1);
  transform: translateY(-1px);
}

.report-type-card:active {
  transform: translateY(0);
}

.report-type-card__icon {
  font-size: 28px;
  flex-shrink: 0;
  margin-top: 2px;
}

.report-type-card__body {
  flex: 1;
  min-width: 0;
}

.report-type-card__name {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text, #1a1a1a);
  margin-bottom: 4px;
}

.report-type-card__desc {
  font-size: 12px;
  color: var(--color-text-secondary, #666);
  line-height: 1.5;
}

/* -------------------------------------------
   Loading State
   ------------------------------------------- */
.report-select-modal__loading {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  gap: 16px;
}

.report-select-modal__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border, #e0e0e0);
  border-top-color: var(--color-primary, #2563EB);
  border-radius: 50%;
  animation: reportSpin 0.8s linear infinite;
}

.report-select-modal__loading-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text, #1a1a1a);
}

.report-select-modal__loading-sub {
  font-size: 12px;
  color: var(--color-text-muted, #999);
}

/* -------------------------------------------
   Report Viewer Overlay
   ------------------------------------------- */
.report-viewer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-modal, 1000) + 10);
  background: rgba(0, 0, 0, 0.7);
  align-items: stretch;
  justify-content: stretch;
  animation: reportFadeIn 0.2s ease;
}

.report-viewer {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

/* -------------------------------------------
   Viewer Toolbar
   ------------------------------------------- */
.report-viewer__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #1a1a1a;
  color: #fff;
  flex-shrink: 0;
  gap: 12px;
}

.report-viewer__toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.report-viewer__toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.report-viewer__title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.9;
}

.report-viewer__btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  font-family: inherit;
}

.report-viewer__btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.report-viewer__btn--close {
  font-size: 20px;
  padding: 2px 10px;
  line-height: 1;
  border: none;
  background: none;
}

.report-viewer__btn--close:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* -------------------------------------------
   Viewer Iframe
   ------------------------------------------- */
.report-viewer__frame-container {
  flex: 1;
  overflow: hidden;
}

.report-viewer__frame {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}

/* ============================================
   Report Queue (inside Reports tab)
   ============================================ */

.report-queue {
  padding: 20px;
}

.report-queue__header {
  margin-bottom: 20px;
}

.report-queue__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text, #1a1a1a);
  margin: 0 0 4px;
}

.report-queue__subtitle {
  font-size: 12px;
  color: var(--color-text-muted, #999);
  margin: 0;
}

.report-queue__empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--color-text-muted, #999);
  font-size: 13px;
}

/* Report card */
.report-queue__card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--color-border, #e0e0e0);
  border-radius: var(--radius-lg, 12px);
  background: var(--color-surface, #fff);
  margin-bottom: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.report-queue__card:hover {
  border-color: var(--color-border-hover, #ccc);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.report-queue__card--detailed {
  border-left: 3px solid #c4a35a;
}

.report-queue__card--summary {
  border-left: 3px solid #4aa8e5;
}

.report-queue__card-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.report-queue__card-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.report-queue__card-info {
  min-width: 0;
}

.report-queue__card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text, #1a1a1a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.report-queue__card-meta {
  font-size: 11px;
  color: var(--color-text-muted, #999);
  margin-top: 2px;
}

/* Card action buttons */
.report-queue__card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.report-queue__btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid var(--color-border, #e0e0e0);
  border-radius: 6px;
  background: var(--color-surface, #fff);
  color: var(--color-text-secondary, #666);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.report-queue__btn:hover {
  border-color: var(--color-border-hover, #ccc);
  background: var(--color-surface-secondary, #f5f5f5);
  color: var(--color-text, #1a1a1a);
}

.report-queue__btn--view {
  background: var(--color-primary, #2563EB);
  color: #fff;
  border-color: var(--color-primary, #2563EB);
  padding: 5px 14px;
}

.report-queue__btn--view:hover {
  background: var(--color-primary-hover, #d45300);
  border-color: var(--color-primary-hover, #d45300);
  color: #fff;
}

/* -------------------------------------------
   Animations
   ------------------------------------------- */
@keyframes reportFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes reportSpin {
  to { transform: rotate(360deg); }
}

/* -------------------------------------------
   Responsive
   ------------------------------------------- */
@media (max-width: 560px) {
  .report-select-modal {
    padding: 20px;
  }

  .report-viewer__toolbar {
    flex-wrap: wrap;
    padding: 8px 12px;
  }

  .report-viewer__toolbar-right {
    flex-wrap: wrap;
  }

  .report-viewer__btn {
    font-size: 11px;
    padding: 5px 10px;
  }

  .report-queue__card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .report-queue__card-actions {
    flex-wrap: wrap;
    width: 100%;
  }

  .report-queue__card-title {
    max-width: 100%;
  }
}

/* ====================================================================
   Engine Output Frame — iframe container for Claude-styled outputs
   ==================================================================== */
.engine-output-wrap {
  width: 100%;
  min-height: 500px;
  height: calc(100vh - 280px);
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(160deg, #e8f4fd 0%, #c5e4f9 50%, #8ecbf2 100%);
}

.engine-output-frame {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 12px;
}
