/* Partners dashboard styles */

.dashboard-login-container {
  max-width: 480px;
  margin: 48px auto;
  padding: 0 24px;
  text-align: center;
}

/* Global styles.css sets `p { text-align: justify }` which overrides the
   container's centering on multi-line paragraphs (they wrap left-aligned).
   This forces paragraphs inside the login container to stay centered,
   matching the H1 above them. Applies to CTSA dashboard login/expired
   pages, CTSA admin dashboard login/expired pages, and the partners
   equivalents. */
.dashboard-login-container p {
  text-align: center;
}

.dashboard-login-subtitle {
  color: #666;
  margin-bottom: 24px;
}

.dashboard-login-form {
  background: #faf8ff;
  border-radius: 16px;
  padding: 24px;
  text-align: left;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
}

.dashboard-login-form label {
  display: block;
  font-size: 16px;
  margin-bottom: 6px;
}

.dashboard-login-form input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 16px;
}

.dashboard-login-form button {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  background: #5d4fad;
  color: #eee;
  border: none;
  border-radius: 4px;
  font-family: "OpenSans", sans-serif;
  font-weight: lighter;
  font-size: 18px;
  cursor: pointer;
  text-transform: uppercase;
}

.dashboard-login-form button:hover {
  background: #4a3f8a;
}

.dashboard-login-error {
  color: #c62828;
  margin-top: 16px;
}

.dashboard-login-help {
  margin-top: 24px;
  font-size: 14px;
  color: #666;
}

.dashboard-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.dashboard-header {
  margin-bottom: 24px;
}

.dashboard-welcome {
  color: #666;
  margin: 4px 0 0 0;
}

.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.dashboard-stat-card {
  background: #faf8ff;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  position: relative;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
}

.dashboard-stat-label {
  display: block;
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.dashboard-stat-value {
  display: block;
  font-size: 28px;
  font-weight: 600;
  color: #111;
}

.dashboard-stat-pending {
  color: #5d4fad;
}

.dashboard-stat-sublabel {
  display: block;
  font-size: 14px;
  font-weight: 400;
  color: #666;
  margin-top: 4px;
}

.dashboard-stat-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 10px;
  right: 10px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #bbb;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  cursor: help;
  text-transform: none;
  letter-spacing: normal;
  outline: none;
}

.dashboard-stat-info::before {
  content: "?";
}

.dashboard-stat-info:hover,
.dashboard-stat-info:focus {
  background: #5d4fad;
}

.dashboard-stat-tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 220px;
  background: #333;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.dashboard-stat-tooltip::after {
  content: "";
  position: absolute;
  bottom: 100%;
  right: 4px;
  border: 5px solid transparent;
  border-bottom-color: #333;
}

.dashboard-stat-info:hover .dashboard-stat-tooltip,
.dashboard-stat-info:focus .dashboard-stat-tooltip {
  display: block;
}

.dashboard-chart-card,
.dashboard-breakdown-card,
.dashboard-links-card,
.dashboard-transactions-card,
.dashboard-info-card {
  background: #faf8ff;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
}

.dashboard-chart-card h2,
.dashboard-breakdown-card h2,
.dashboard-links-card h2,
.dashboard-transactions-card h2 {
  font-size: 18px;
  margin: 0 0 16px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid #e6e0f2;
  text-align: left;
}

.dashboard-line-chart {
  width: 100%;
  height: auto;
  max-height: 260px;
}

.dashboard-no-data {
  color: #666;
  font-style: italic;
  text-align: center;
  padding: 24px;
}

.dashboard-breakdown-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #e6e0f2;
}

.dashboard-breakdown-item:last-of-type {
  border-bottom: none;
}

.dashboard-breakdown-count {
  font-weight: 600;
  font-size: 18px;
}

.dashboard-breakdown-earnings {
  color: #666;
  min-width: 80px;
  text-align: right;
}

.dashboard-breakdown-bar {
  height: 8px;
  background: #e8b4b4;
  border-radius: 4px;
  margin-top: 12px;
  overflow: hidden;
}

.dashboard-breakdown-bar-full {
  height: 100%;
  background: #5d4fad;
}

.dashboard-link-group {
  margin-bottom: 12px;
}

.dashboard-link-group label {
  display: block;
  font-size: 13px;
  color: #666;
  margin-bottom: 4px;
}

.dashboard-link-row {
  display: flex;
  gap: 8px;
}

.dashboard-link-row input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  font-family: monospace;
  font-size: 13px;
}

.dashboard-copy-btn {
  padding: 8px 14px;
  background: #5d4fad;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}

.dashboard-copy-btn:hover {
  background: #4a3f8a;
}

.dashboard-copy-btn.copied {
  background: #4caf50;
}

.dashboard-link-note {
  font-size: 12px;
  color: #666;
  margin-top: 12px;
}

.dashboard-link-note code {
  background: #eee;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 11px;
}

.dashboard-transactions-table {
  width: 100%;
  border-collapse: collapse;
}

.dashboard-transactions-table th,
.dashboard-transactions-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #e6e0f2;
  font-size: 14px;
}

.dashboard-transactions-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #666;
}

.dashboard-transactions-table tbody tr {
  transition: background-color 0.12s ease;
}

.dashboard-transactions-table tbody tr:hover {
  background: #f3eefb;
}

.dashboard-transactions-table th:last-child,
.dashboard-transactions-table td:last-child {
  text-align: right;
}

.dashboard-info-card {
  font-size: 13px;
  color: #444;
}

@media (max-width: 600px) {
  .dashboard-container { padding: 16px; }
  .dashboard-stat-value { font-size: 22px; }
  .dashboard-link-row { flex-direction: column; }
}

/* Admin dashboard additions */

.dashboard-admin-leaderboard td,
.dashboard-admin-leaderboard th {
  white-space: nowrap;
}

.dashboard-admin-leaderboard th:last-child,
.dashboard-admin-leaderboard td:last-child {
  text-align: right;
}

@media (max-width: 600px) {
  .dashboard-admin-leaderboard {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
