/**
 * Trial funnel admin panel — scoped under .admin-trial-dashboard
 */

.admin-trial-dashboard {
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

.trial-dash-inner {
  color: #e5e7eb;
}

.trial-dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}

.trial-dash-title {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  background: linear-gradient(135deg, #c4b5fd, #a78bfa 40%, #34d399);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.trial-dash-sub {
  margin: 6px 0 0;
  font-size: 14px;
  color: #9ca3af;
  max-width: 520px;
  line-height: 1.45;
}

.trial-dash-header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.trial-period-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.trial-period-btn {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(167, 139, 250, 0.35);
  background: rgba(30, 27, 60, 0.6);
  color: #e5e7eb;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.trial-period-btn:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(167, 139, 250, 0.6);
}

.trial-period-btn.active {
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.trial-period-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.trial-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.trial-card {
  background: linear-gradient(155deg, rgba(30, 27, 55, 0.95), rgba(17, 24, 39, 0.92));
  border-radius: 16px;
  padding: 20px 22px;
  border: 1px solid rgba(167, 139, 250, 0.12);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.trial-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(124, 58, 237, 0.15);
}

.trial-card--accent {
  border-color: rgba(99, 102, 241, 0.35);
}

.trial-card--convert {
  border-color: rgba(52, 211, 153, 0.35);
  background: linear-gradient(155deg, rgba(20, 45, 35, 0.5), rgba(17, 24, 39, 0.92));
}

.trial-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #a1a1aa;
  margin-bottom: 10px;
}

.trial-badge-week {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.2);
  color: #6ee7b7;
}

.trial-card-big {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f4f4f5;
}

.trial-card-mega {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #34d399;
  line-height: 1;
}

.trial-unit {
  font-size: 20px;
  font-weight: 600;
  color: #a1a1aa;
  margin-left: 4px;
}

.trial-card-foot {
  margin-top: 8px;
  font-size: 12px;
  color: #71717a;
}

.trial-mini-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trial-mini-row {
  display: grid;
  grid-template-columns: 22px 1fr 36px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #d4d4d8;
}

.trial-mini-row em {
  font-style: normal;
  text-align: right;
  color: #a78bfa;
}

.trial-mini-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.trial-mini-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
}

.trial-mini-fill.q1 {
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
}
.trial-mini-fill.q2 {
  background: linear-gradient(90deg, #f59e0b, #f97316);
}
.trial-mini-fill.q3 {
  background: linear-gradient(90deg, #ef4444, #ec4899);
}

.trial-section {
  margin-bottom: 32px;
}

.trial-section h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 14px;
  color: #f4f4f5;
}

.trial-funnel-viz {
  background: linear-gradient(180deg, rgba(24, 24, 40, 0.9), rgba(12, 12, 22, 0.95));
  border-radius: 16px;
  padding: 20px 24px;
  border: 1px solid rgba(167, 139, 250, 0.1);
}

.trial-funnel-row {
  margin-bottom: 14px;
}

.trial-funnel-row:last-child {
  margin-bottom: 0;
}

.trial-funnel-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 13px;
}

.trial-funnel-label {
  font-weight: 600;
  color: #d4d4d8;
  min-width: 88px;
}

.trial-funnel-count {
  font-variant-numeric: tabular-nums;
  color: #fafafa;
  font-weight: 700;
}

.trial-funnel-drop {
  font-size: 11px;
  color: #a78bfa;
}

.trial-funnel-track {
  height: 22px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
  position: relative;
}

.trial-funnel-fill {
  height: 100%;
  border-radius: 12px;
  position: relative;
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  min-width: 0;
}

.trial-funnel-fill-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 55%);
  pointer-events: none;
}

.stage-blue {
  background: linear-gradient(90deg, #2563eb, #3b82f6);
}
.stage-teal {
  background: linear-gradient(90deg, #0d9488, #14b8a6);
}
.stage-orange {
  background: linear-gradient(90deg, #ea580c, #f59e0b);
}
.stage-red {
  background: linear-gradient(90deg, #dc2626, #f43f5e);
}
.stage-green {
  background: linear-gradient(90deg, #059669, #34d399);
}

.trial-daily-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  min-height: 160px;
  padding: 12px 8px 4px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  overflow-x: auto;
}

.trial-daily-col {
  flex: 1;
  min-width: 10px;
  max-width: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.trial-daily-stack {
  width: 100%;
  height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
}

.trial-daily-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: height 0.35s ease;
}

.trial-daily-bar--sig {
  background: linear-gradient(180deg, #6366f1, #4338ca);
}
.trial-daily-bar--conv {
  background: linear-gradient(180deg, #34d399, #059669);
}

.trial-daily-x {
  font-size: 9px;
  color: #71717a;
  transform: rotate(-45deg);
  transform-origin: center;
  white-space: nowrap;
}

.trial-daily-legend {
  display: flex;
  gap: 20px;
  margin-top: 12px;
  font-size: 12px;
  color: #a1a1aa;
}

.trial-legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}
.trial-legend-swatch.sig {
  background: #6366f1;
}
.trial-legend-swatch.conv {
  background: #34d399;
}

.trial-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.trial-snap {
  background: rgba(39, 39, 58, 0.6);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid rgba(167, 139, 250, 0.12);
  text-align: center;
}

.trial-snap-n {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: #c4b5fd;
}

.trial-snap-l {
  font-size: 12px;
  color: #a1a1aa;
}

.trial-snap-meta {
  margin-top: 12px;
  font-size: 13px;
  color: #9ca3af;
}

.trial-drip-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.trial-drip-table th,
.trial-drip-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.trial-drip-table th {
  color: #a1a1aa;
  font-weight: 600;
}

.trial-drip-bar-wrap {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.trial-drip-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7c3aed, #34d399);
  transition: width 0.4s ease;
}

.trial-users-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.trial-users-toolbar h2 {
  margin: 0;
  flex: 1 1 auto;
}

.trial-filter-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.trial-filter-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.25);
  color: #d4d4d8;
  font-size: 12px;
  cursor: pointer;
}

.trial-filter-btn.active {
  border-color: #a78bfa;
  background: rgba(124, 58, 237, 0.25);
  color: #fff;
}

.trial-sort-label {
  font-size: 13px;
  color: #a1a1aa;
  display: flex;
  align-items: center;
  gap: 8px;
}

.trial-sort-label select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #1f2937;
  color: #e5e7eb;
}

.trial-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.trial-users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 720px;
}

.trial-users-table th,
.trial-users-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.trial-users-table th {
  color: #9ca3af;
  font-weight: 600;
  white-space: nowrap;
}

.trial-status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.trial-status-active {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}
.trial-status-exhausted {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}
.trial-status-converted {
  background: rgba(52, 211, 153, 0.2);
  color: #6ee7b7;
}
.trial-status-abandoned {
  background: rgba(113, 113, 122, 0.25);
  color: #d4d4d8;
}

.trial-q-dots {
  display: inline-flex;
  gap: 5px;
  vertical-align: middle;
}

.trial-q-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.trial-q-dot.filled {
  background: linear-gradient(135deg, #a78bfa, #6366f1);
  border-color: transparent;
}

.trial-btn-copy {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 6px;
  border: 1px solid rgba(167, 139, 250, 0.35);
  background: transparent;
  color: #c4b5fd;
  cursor: pointer;
}

.trial-btn-copy:hover {
  background: rgba(124, 58, 237, 0.2);
}

.trial-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}

.trial-page-info {
  font-size: 13px;
  color: #9ca3af;
}

.trial-empty-hint {
  color: #71717a;
  font-size: 14px;
  margin: 12px 0;
}

.trial-dash-error {
  text-align: center;
  padding: 40px 20px;
  color: #fca5a5;
}

@media (max-width: 640px) {
  .trial-dash-header-actions {
    align-items: stretch;
    width: 100%;
  }
  .trial-period-group {
    justify-content: flex-start;
  }
}
