/* WTReporting — demo cu tab-uri identic admin, wisetraveler.ro/raportare
   Prefix: wrd- (WiseTraveler Reporting Demo)
   Culori: navy #1A1A2E, coral #E94560, purple #6d28d9
*/

/* ── Root ── */
.wrd-root {
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 0.9375rem;
  color: #212529;
  background: transparent;
}

/* ── Main tab bar ── */
.wrd-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.wrd-tabs::-webkit-scrollbar { display: none; }

.wrd-tab {
  flex-shrink: 0;
  padding: 8px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.wrd-tab:hover { color: #1A1A2E; }
.wrd-tab--active { color: #6d28d9; border-bottom-color: #6d28d9; font-weight: 600; }

/* ── Sub-tab bar (inside panels) ── */
.wrd-subtabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 1.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.wrd-subtabs::-webkit-scrollbar { display: none; }

.wrd-subtab {
  flex-shrink: 0;
  padding: 7px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.wrd-subtab:hover { color: #1A1A2E; }
.wrd-subtab--active { color: #6d28d9; border-bottom-color: #6d28d9; }

/* ── Panels ── */
.wrd-panel { min-height: 200px; }
.wrd-subpanel { min-height: 100px; }

/* ── KPI grid (5 cards) ── */
.wrd-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
@media (min-width: 640px) {
  .wrd-kpi-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .wrd-kpi-grid { grid-template-columns: repeat(5, 1fr); }
}

.wrd-kpi-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  border-top: 3px solid #6d28d9;
}
.wrd-kpi-label {
  font-size: 11px;
  font-weight: 500;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.wrd-kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.1;
  word-break: break-all;
}
.wrd-kpi-delta { font-size: 12px; font-weight: 500; margin-top: 2px; }
.wrd-delta { display: inline-flex; align-items: center; gap: 0.15em; font-weight: 600; }
.wrd-delta--up   { color: #10b981; }
.wrd-delta--down { color: #ef4444; }
.wrd-delta--neutral { color: #9ca3af; }

/* ── Chart row (2 columns) ── */
.wrd-chart-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 0;
}
@media (min-width: 900px) {
  .wrd-chart-row { grid-template-columns: 1fr 1fr; }
}

/* ── Chart card ── */
.wrd-chart-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 16px;
}
.wrd-chart-title {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 16px;
}
.wrd-chart-wrap { position: relative; height: 280px; }
.wrd-chart-wrap--doughnut { height: 260px; }

/* ── Two-column layout ── */
.wrd-two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}
@media (min-width: 860px) {
  .wrd-two-col { grid-template-columns: 320px 1fr; }
}
.wrd-two-col .wrd-chart-card { margin-bottom: 0; }

/* ── Table ── */
.wrd-table-wrap {
  overflow-x: auto;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  margin-bottom: 16px;
}
.wrd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.wrd-table thead th {
  background: #f9fafb;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: #6b7280;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  border-bottom: 2px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
}
.wrd-table thead th:last-child { border-right: none; }
.wrd-table tbody tr { border-bottom: 1px solid #f3f4f6; transition: background 0.12s; }
.wrd-table tbody tr:last-child { border-bottom: none; }
.wrd-table tbody tr:hover { background: #f9fafb; }
.wrd-table td {
  padding: 10px 14px;
  color: #374151;
  vertical-align: middle;
  border-right: 1px solid #f3f4f6;
}
.wrd-table td:last-child { border-right: none; }
.wrd-num { text-align: right; font-variant-numeric: tabular-nums; }
.wrd-empty { text-align: center; padding: 40px 20px !important; color: #9ca3af; font-size: 13px; }

/* ── Segment badge ── */
.wrd-badge-seg {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: #ede9fe;
  color: #5b21b6;
  white-space: nowrap;
}

/* ── Severity badges ── */
.wrd-badge-sev {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.wrd-badge-sev--critical { background: #fee2e2; color: #991b1b; }
.wrd-badge-sev--high     { background: #ffedd5; color: #9a3412; }
.wrd-badge-sev--medium   { background: #fef3c7; color: #92400e; }
.wrd-badge-sev--low      { background: #f3f4f6; color: #374151; }

/* ── Stage badges ── */
.wrd-badge-stage {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}
.wrd-badge-stage.growth  { background: #d1fae5; color: #065f46; }
.wrd-badge-stage.mature  { background: #dbeafe; color: #1e40af; }
.wrd-badge-stage.decline { background: #fee2e2; color: #991b1b; }
.wrd-badge-stage.launch  { background: #fef3c7; color: #92400e; }

/* ── Churn risk bar ── */
.wrd-risk-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}
.wrd-risk-bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #e5e7eb;
  overflow: hidden;
}
.wrd-risk-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #10b981, #f59e0b, #ef4444);
}
.wrd-risk-val {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  min-width: 30px;
  text-align: right;
}

/* ── Loading ── */
.wrd-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.875rem;
  padding: 3rem 1rem;
  color: #6b7280;
  font-size: 0.875rem;
}
.wrd-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(109, 40, 217, 0.15);
  border-top-color: #6d28d9;
  border-radius: 50%;
  animation: wrd-spin 0.7s linear infinite;
}
@keyframes wrd-spin { to { transform: rotate(360deg); } }

/* ── Export & Rapoarte tab ── */
.wrd-demo-notice {
  background: #ede9fe;
  color: #5b21b6;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  margin-bottom: 20px;
  border-left: 3px solid #6d28d9;
}

.wrd-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.wrd-export-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 16px;
}

.wrd-export-controls {
  display: flex;
  gap: 10px;
  flex: 1;
  flex-wrap: wrap;
}

.wrd-select {
  padding: 7px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  color: #111827;
  cursor: pointer;
}

.wrd-export-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.wrd-export-btn {
  padding: 7px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, background 0.3s;
}
.wrd-export-btn:disabled { opacity: 0.6; cursor: default; }
.wrd-export-btn--pdf   { background: #ef4444; color: #fff; }
.wrd-export-btn--excel { background: #10b981; color: #fff; }
.wrd-export-btn--csv   { background: #6d28d9; color: #fff; }
.wrd-export-btn:hover:not(:disabled) { opacity: 0.87; }

/* Export status dots */
.wrd-status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.wrd-dot--ready   { background: #10b981; }
.wrd-dot--pending { background: #f59e0b; }
.wrd-dot--expired { background: #9ca3af; }
.wrd-dot--failed  { background: #ef4444; }

/* Format badges */
.wrd-badge-fmt {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.wrd-badge-fmt--pdf   { background: #fee2e2; color: #991b1b; }
.wrd-badge-fmt--excel { background: #d1fae5; color: #065f46; }
.wrd-badge-fmt--csv   { background: #ede9fe; color: #5b21b6; }

/* Download link style */
.wrd-export-dl {
  display: inline-block;
  padding: 3px 10px;
  background: #6d28d9;
  color: #fff;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

/* ── Error / unavailable ── */
.wrd-unavail {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.5rem;
  border: 1px solid #fee2e2;
  border-radius: 8px;
  background: #fff5f5;
  font-size: 0.875rem;
  color: #6b7280;
}
.wrd-unavail strong { color: #991b1b; font-size: 0.9375rem; }
.wrd-unavail p { margin: 0; }
