/* Team dashboard — complements styles.css tokens */

/* Outer `#team-dashboard.app-shell` provides horizontal padding; inner `.card.team-inner` holds dashboard content. */
.team-inner {
  width: 100%;
  box-sizing: border-box;
}

.team-dash__crumb {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0 0 0.35rem;
}

.team-dash__crumb a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.team-dash__crumb a:hover {
  text-decoration: underline;
}

.team-dash__title {
  margin: 0 0 1.25rem;
  font-size: clamp(1.25rem, 4vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.team-dash__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  padding: clamp(0.85rem, 2vw, 1rem) clamp(0.75rem, 2vw, 1.1rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  box-sizing: border-box;
}

.team-dash__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: min(100%, 14rem);
}

.team-dash__field--grow {
  flex: 1 1 min(100%, 16rem);
  min-width: 0;
}

.team-dash__label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.team-dash__input,
.team-dash__select {
  font: inherit;
  font-size: 0.9375rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
}

.team-dash__input:focus-visible,
.team-dash__select:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.team-dash__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.team-dash__chip {
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

.team-dash__chip[aria-pressed="true"] {
  background: var(--accent-fill-subtle);
  border-color: var(--accent-fill);
  color: var(--accent-fill);
}

.team-dash__chip:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.team-dash__reset {
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  margin-left: auto;
  flex: 0 0 auto;
}

.team-dash__reset:hover {
  background: var(--bg);
}

.team-dash__widgets {
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(min(100%, 15.5rem), 1fr)
  );
  gap: clamp(0.85rem, 2vw, 1.15rem);
  margin-bottom: 1.5rem;
  align-items: stretch;
}

.team-dash__widget {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
}

.team-dash__widget-title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.35;
}

.team-dash__widget-body {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.45;
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.team-dash__widget-stat {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.12;
  max-width: 100%;
  overflow-wrap: break-word;
}

.team-dash__widget-stat--sub {
  font-size: 1.2rem;
  margin-top: 0.35rem;
}

.team-dash__widget-stat-btn {
  display: block;
  width: 100%;
  margin: 0;
  font: inherit;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  text-align: center;
  cursor: pointer;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.team-dash__widget-stat-btn--lg {
  font-size: clamp(1.15rem, 4vw + 0.5rem, 1.65rem);
  padding: 0.55rem 0.6rem;
  max-width: 100%;
  box-sizing: border-box;
}

.team-dash__widget-stat-btn--sm {
  font-size: clamp(0.95rem, 2.5vw + 0.5rem, 1.1rem);
  padding: 0.45rem 0.5rem;
  max-width: 100%;
  box-sizing: border-box;
}

.team-dash__widget-stat-btn:not(:disabled):hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.team-dash__widget-stat-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.team-dash__widget-stat-btn--pressed {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(0, 120, 200, 0.35);
}

.team-dash__widget-stat-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.team-dash__lapsed-btn-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.4rem;
  flex: 1 1 0;
  min-width: 0;
}

.team-dash__lapsed-btn-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  line-height: 1.35;
  max-width: 100%;
  overflow-wrap: break-word;
  padding: 0 0.15rem;
}

.team-dash__widget-split--lapsed {
  margin-top: 0.65rem;
}

.team-dash__widget-split {
  display: flex;
  align-items: stretch;
  gap: 0.65rem;
  margin-top: 0.15rem;
  width: 100%;
  min-width: 0;
}

.team-dash__widget-split > div {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  padding: 0 0.2rem;
  box-sizing: border-box;
}

.team-dash__widget-split .team-dash__widget-stat {
  font-size: clamp(1rem, 2.5vw + 0.65rem, 1.6rem);
  line-height: 1.1;
}

.team-dash__widget-split .team-dash__widget-body {
  font-size: 0.8125rem;
  line-height: 1.35;
  margin-top: 0.15rem;
}

.team-dash__widget-split hr {
  width: 1px;
  border: none;
  background: var(--border);
  margin: 0;
  align-self: stretch;
}

.team-dash__progress {
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  margin-top: 0.15rem;
  overflow: hidden;
  flex-shrink: 0;
}

.team-dash__progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-fill), var(--accent));
  transition: width 0.25s ease;
}

.team-dash__table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 0;
}

.team-dash__table-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--muted);
}

.team-inner table {
  width: 100%;
  min-width: 52rem;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.team-inner th,
.team-inner td {
  padding: 0.75rem 0.85rem;
  text-align: left;
  vertical-align: top;
}

.team-inner thead th {
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--surface);
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
}

.team-inner tbody td {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border);
}

.team-inner tbody tr:hover td {
  background: var(--accent-soft);
}

.team-inner tbody tr:last-child td {
  border-bottom: none;
}

.team-dash__cell-name {
  font-weight: 600;
  color: var(--text);
}

.team-dash__cell-muted {
  color: var(--muted);
}

.team-dash__badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.team-dash__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem 0.2rem 0.35rem;
  border-radius: 6px;
  border: 1px solid transparent;
  max-width: 100%;
}

.team-dash__badge-icon {
  width: 14px;
  height: 16px;
  flex-shrink: 0;
}

.team-dash__badge--l1 {
  color: var(--accent-fill);
  background: var(--accent-soft);
  border-color: var(--badge-team-l1-border);
}

.team-dash__badge--l2 {
  color: var(--badge-team-l2-fg);
  background: var(--badge-team-l2-bg);
  border-color: var(--badge-team-l2-border);
}

.team-dash__badge--l3 {
  color: var(--badge-team-l3-fg);
  background: var(--badge-team-l3-bg);
  border-color: var(--badge-team-l3-border);
}

.team-dash__badge--payroll {
  color: var(--badge-team-payroll-fg);
  background: var(--badge-team-payroll-bg);
  border-color: var(--badge-team-payroll-border);
}

.team-dash__badge-more {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--muted);
}

.team-dash__dash {
  color: var(--muted);
}

.team-dash__expiry-cell {
  font-size: 0.8125rem;
  line-height: 1.35;
}

.team-dash__expiry-tier {
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.team-dash__expiry-line {
  font-weight: 600;
  color: var(--text);
}

.team-dash__expiry-line--window {
  color: var(--expiry-window-fg);
}

.team-dash__expiry-line--overdue {
  color: var(--danger);
}

.xero-header__home {
  text-decoration: none;
}

@media (max-width: 900px) {
  .team-dash__widget-stat {
    font-size: clamp(1.35rem, 5vw, 1.75rem);
  }

  .team-dash__table-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 720px) {
  .team-dash__toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .team-dash__field,
  .team-dash__field--grow {
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
  }

  .team-dash__reset {
    margin-left: 0;
    width: 100%;
    text-align: center;
  }

  .team-dash__widget-split {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .team-dash__widgets {
    grid-template-columns: 1fr;
  }

  .team-dash__widget-split {
    flex-direction: column;
    gap: 0.75rem;
  }

  .team-dash__widget-split hr {
    width: 100%;
    height: 1px;
    align-self: stretch;
  }

  .team-inner th,
  .team-inner td {
    padding: 0.5rem 0.5rem;
    font-size: 0.8125rem;
  }

  .team-inner tbody td {
    padding: 0.85rem 0.65rem;
  }

  .team-inner thead th {
    border-bottom-width: 2px;
  }

  .team-inner th {
    white-space: normal;
    max-width: 9rem;
    line-height: 1.25;
  }

  .team-inner table {
    min-width: 46rem;
  }

  .team-dash__badge {
    font-size: 0.6875rem;
  }

  .team-dash__expiry-cell {
    font-size: 0.75rem;
  }
}
