/* ============================================================================
   OverlordsXI Wiki — Combat Reports Analytics Dashboard Styles
   Preserves the dark Crystal / FFXI visual system defined in styles.css.
   ============================================================================ */

.cr-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
  padding: 0.85rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.cr-toolbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.cr-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.7rem;
  border-radius: 99px;
  font-size: 0.8rem;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--text-primary);
}

.cr-user-role {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 99px;
  background: rgba(251, 191, 36, 0.18);
  color: var(--accent-gold);
}

.cr-auth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 1.25rem;
  margin-top: 1.2rem;
}

.cr-auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  box-shadow: var(--shadow-card);
}

.cr-auth-card h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.08rem;
  color: #fff;
}

.cr-notice {
  font-size: 0.84rem;
  color: var(--text-secondary);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  margin: 0.75rem 0;
}

.cr-notice-warn {
  background: rgba(251, 191, 36, 0.09);
  border-color: rgba(251, 191, 36, 0.35);
  color: #fde68a;
}

.cr-notice-danger {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.4);
  color: #fecdd3;
}

.cr-notice-ok {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.35);
  color: #a7f3d0;
}

.cr-form-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
}

.cr-form-row label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.cr-input,
.cr-select,
.cr-textarea {
  background: rgba(10, 15, 29, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  padding: 0.46rem 0.68rem;
}

.cr-input:focus,
.cr-select:focus,
.cr-textarea:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.18);
}

.cr-textarea {
  min-height: 70px;
  resize: vertical;
  width: 100%;
}

.cr-oauth-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
}

.cr-filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.6rem;
  padding: 0.9rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.cr-filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.cr-filter-field label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

.cr-check-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding-top: 1.15rem;
}

.cr-runs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.cr-runs-table th,
.cr-runs-table td {
  padding: 0.6rem 0.65rem;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  vertical-align: middle;
}

.cr-runs-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: rgba(10, 15, 29, 0.55);
  white-space: nowrap;
}

.cr-runs-table tbody tr {
  cursor: pointer;
  transition: background 0.12s;
}

.cr-runs-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.cr-pin-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 0.2rem 0.45rem;
  cursor: pointer;
  font-size: 0.82rem;
}

.cr-pin-btn.pinned {
  color: var(--accent-gold);
  border-color: var(--border-gold);
  background: rgba(251, 191, 36, 0.12);
}

.cr-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.14rem 0.5rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.cr-pill-victory { background: rgba(16, 185, 129, 0.16); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.35); }
.cr-pill-defeat { background: rgba(244, 63, 94, 0.16); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.35); }
.cr-pill-reset { background: rgba(148, 163, 184, 0.16); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.3); }
.cr-pill-warn { background: rgba(251, 191, 36, 0.16); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.35); }
.cr-pill-cyan { background: rgba(56, 189, 248, 0.14); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.35); }
.cr-pill-purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.35); }

.unavailable-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.1rem 0.42rem;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px dashed rgba(148, 163, 184, 0.35);
  color: var(--text-muted);
  cursor: help;
}

/* Report Detail View */
.cr-detail-header {
  background: linear-gradient(145deg, rgba(19, 28, 51, 0.96), rgba(15, 22, 41, 0.94));
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.1rem;
  box-shadow: var(--shadow-card);
}

.cr-detail-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
}

.cr-detail-title {
  margin: 0.3rem 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.38rem;
  color: #fff;
}

.cr-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-subtle);
}

.cr-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.95rem;
  margin-bottom: 1.15rem;
}

.cr-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
}

.cr-kpi-card h4 {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cr-kv-list {
  display: flex;
  flex-direction: column;
  gap: 0.34rem;
}

.cr-kv-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.84rem;
}

.cr-kv-row span:first-child {
  color: var(--text-muted);
}

.cr-kv-row strong {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--text-primary);
}

.cr-dmg-bar {
  display: flex;
  height: 10px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.9);
  margin: 0.65rem 0 0.45rem;
}

.cr-dmg-bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  font-size: 0.73rem;
  color: var(--text-muted);
}

.cr-legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

/* Diagnostics Findings */
.cr-findings-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  margin-bottom: 1.15rem;
}

.cr-findings-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.cr-findings-header h3 {
  margin: 0;
  font-size: 1rem;
  color: #fff;
}

.cr-finding-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.cr-finding-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-cyan);
  background: rgba(10, 15, 29, 0.55);
}

.cr-finding-item.sev-critical {
  border-left-color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.08);
}

.cr-finding-item.sev-warning {
  border-left-color: var(--accent-gold);
  background: rgba(251, 191, 36, 0.07);
}

.cr-finding-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.cr-finding-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: #fff;
}

.cr-finding-detail {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.cr-jump-btn {
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--accent-cyan);
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 0.16rem 0.48rem;
  cursor: pointer;
}

.cr-jump-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #fff;
}

/* Charts */
.cr-chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  margin-bottom: 1.15rem;
}

.cr-chart-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
}

.cr-chart-header h3 {
  margin: 0;
  font-size: 0.98rem;
  color: #fff;
}

.cr-chart-toggles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.cr-toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.55rem;
  border-radius: 99px;
  font-size: 0.74rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.cr-toggle-chip.active {
  color: #fff;
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.14);
}

.cr-canvas-wrap {
  position: relative;
  width: 100%;
  height: 290px;
}

.cr-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

.cr-chart-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 30;
  background: rgba(7, 11, 20, 0.95);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.72rem;
  font-size: 0.76rem;
  color: var(--text-primary);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.75);
  min-width: 190px;
  max-width: 280px;
}

.cr-chart-tooltip.hidden {
  display: none;
}

/* Feedback & Notes Grid */
.cr-split-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.cr-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
}

.cr-panel h3 {
  margin: 0 0 0.7rem;
  font-size: 0.98rem;
  color: #fff;
}

.cr-feedback-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.cr-fb-chip {
  padding: 0.32rem 0.68rem;
  border-radius: 99px;
  font-size: 0.78rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
}

.cr-fb-chip.active {
  background: rgba(251, 191, 36, 0.16);
  border-color: var(--accent-gold);
  color: #fde68a;
  font-weight: 600;
}

.cr-note-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  background: rgba(10, 15, 29, 0.55);
  border: 1px solid var(--border-subtle);
  margin-bottom: 0.45rem;
}

.cr-note-meta {
  font-size: 0.74rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.2rem;
}

.cr-note-body {
  font-size: 0.84rem;
  color: var(--text-primary);
  white-space: pre-wrap;
}

/* Timeline Table */
.cr-timeline-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.cr-timeline-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.cr-timeline-table th,
.cr-timeline-table td {
  padding: 0.42rem 0.55rem;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}

.cr-timeline-table th {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(10, 15, 29, 0.55);
}

.cr-timeline-table tr.ev-highlight {
  background: rgba(56, 189, 248, 0.14);
}

.cr-timeline-table tr.ev-danger {
  background: rgba(244, 63, 94, 0.1);
}

.cr-mono {
  font-family: var(--font-mono);
}

.cr-dropzone {
  border: 2px dashed rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  background: rgba(15, 23, 42, 0.45);
  margin-top: 0.7rem;
  transition: border-color 0.15s, background 0.15s;
}

.cr-dropzone.dragover {
  border-color: var(--accent-gold);
  background: rgba(251, 191, 36, 0.08);
}

.cr-share-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  background: rgba(10, 15, 29, 0.6);
  border: 1px solid var(--border-subtle);
  margin-top: 0.45rem;
  font-size: 0.8rem;
}

.cr-btn-danger {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.4);
  font-size: 0.78rem;
  padding: 0.34rem 0.68rem;
  border-radius: 6px;
  cursor: pointer;
}

.cr-btn-danger:hover {
  background: rgba(244, 63, 94, 0.28);
  color: #fff;
}

.cr-btn-sm {
  padding: 0.32rem 0.62rem;
  font-size: 0.78rem;
}

.cr-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 760px) {
  .cr-canvas-wrap {
    height: 230px;
  }
}
