/* team-dashboard.css
   Matches the Email Snipper design system from style.css:
   - Indigo primary (#6366f1), gradient buttons, premium shadows
   - Inter font, -0.01em letter-spacing, no visible card borders
   - Diagonal grid body background
   All design-token CSS vars are inherited from style.css.
*/

/* ── Hidden utility ── */
.hidden { display: none !important; }

/* ── Container ── */
.td-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--spacing-xl) 24px 60px;
}

/* ── User info in header ── */
.td-user-info {
  text-align: right;
  line-height: 1.25;
}
.td-user-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
}
.td-user-email {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* ── Cards — no visible border, shadow-primary like main app ── */
.td-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-primary);
  padding: var(--spacing-xl);
  border: none;
}

.td-card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 0 0 var(--spacing-sm) 0;
}

.td-muted {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
}

.td-msg {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

/* ── Grid ── */
.td-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--spacing-md);
}
@media (max-width: 960px) {
  .td-grid { grid-template-columns: 1fr; }
}

/* ── Overview stat cards (inside Overview card) ── */
.td-overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-sm);
}
@media (max-width: 700px) {
  .td-overview { grid-template-columns: 1fr; }
}

.td-stat-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  border: var(--border-subtle);
}
.td-stat-label {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  font-weight: 600;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.td-stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ── Actions row ── */
.td-actions {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

/* ── Form elements ── */
.td-form { margin-top: var(--spacing-sm); }
.td-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.875rem;
  color: var(--text-primary);
}
.td-input,
.td-select {
  width: 100%;
  border: var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.625rem 0.75rem;
  font-size: 0.9375rem;
  font-family: inherit;
  outline: none;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.td-input:focus,
.td-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.td-input::placeholder {
  color: var(--text-tertiary);
}

/* ── Tables ── */
.td-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: var(--border-subtle);
  margin-top: var(--spacing-sm);
}
.td-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 960px;
}
.td-table th,
.td-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--bg-tertiary);
  vertical-align: middle;
  font-size: 0.875rem;
}
.td-table th {
  background: var(--bg-secondary);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
}
.td-table tbody tr:last-child td { border-bottom: none; }
.td-table tbody tr:hover td { background: var(--bg-secondary); }
.td-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── Role badges ── */
.td-role-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.td-role-owner {
  background: rgba(99, 102, 241, 0.10);
  color: var(--primary-dark);
}
.td-role-admin {
  background: rgba(16, 185, 129, 0.10);
  color: #047857;
}
.td-role-member {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

/* ── Analytics hero cards ── */
.td-hero-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-sm);
  margin-top: var(--spacing-sm);
}
@media (max-width: 900px) {
  .td-hero-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .td-hero-cards { grid-template-columns: 1fr; }
}
.td-hero-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  border: var(--border-subtle);
}
.td-hero-value {
  margin-top: 4px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ── Chart cards ── */
.td-charts {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
}
.td-chart-card {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  border: var(--border-subtle);
  min-height: 200px;
}
.td-chart-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
}
