/* ========================================
   TaskBook — My Team page
   ======================================== */

:root {
  --team-pending: #4B7BF5;
  --team-completed: #16A34A;
  --team-border: #E5E7EB;
  --team-radius: 15px;
  --team-row-height: 92px;
}

.page-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 32px 32px;
}

/* ========== Top Bar ========== */

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--primary-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #FFFFFF;
}

.brand-logo svg {
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary-navy);
  letter-spacing: -0.01em;
}

.brand-subtitle {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 2px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-add-employee {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-navy);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-btn);
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease;
  white-space: nowrap;
}

.btn-add-employee:hover {
  background: var(--primary-navy-hover);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  transition: background 150ms ease, color 150ms ease;
}

.btn-icon:hover {
  background: rgba(26, 43, 72, 0.06);
  color: var(--primary-navy);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--avatar-bg);
  color: var(--avatar-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  user-select: none;
}

/* ========== Page Header ========== */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.page-title {
  font-size: 27px;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-subtitle {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 4px;
}

.search-box {
  position: relative;
  flex-shrink: 0;
  width: 280px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-label);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 36px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-btn);
  background: var(--bg-card);
  font-size: 14px;
  color: var(--text-heading);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.search-input::placeholder {
  color: var(--text-label);
}

.search-input:focus {
  border-color: #CBD5E1;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.06);
}

/* ========== Dashboard ========== */

.team-dashboard {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

@supports (display: grid) {
  .team-dashboard {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.team-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--team-border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 140px;
  min-width: 120px;
}

.team-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-heading);
  font-variant-numeric: tabular-nums;
}

.team-stat-card.is-overdue .team-stat-value {
  color: #DC2626;
}

.team-stat-card.is-review .team-stat-value {
  color: #6366F1;
}

.team-stat-card.is-done .team-stat-value {
  color: #16A34A;
}

.team-stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.team-review-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #EEF2FF;
  border: 1px solid #C7D2FE;
  color: #3730A3;
  font-size: 14px;
  font-weight: 600;
}

.team-review-banner[hidden] {
  display: none;
}

.team-review-banner-link {
  color: #312E81;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.team-review-banner-link:hover {
  text-decoration: underline;
}

.team-overdue-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #FEE2E2;
  color: #B91C1C;
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
}

/* ========== Team Card ========== */

.team-card {
  background: var(--bg-card);
  border: 1px solid var(--team-border);
  border-radius: var(--team-radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.table-header,
.employee-row {
  display: grid;
  grid-template-columns: var(--grid-cols) 36px;
  align-items: center;
  column-gap: 8px;
  padding: 0 24px;
}

.table-header {
  padding-top: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-row);
}

.table-header > div {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-label);
}

.table-header .col-pending,
.table-header .col-completed {
  text-align: center;
}

.employee-row {
  min-height: var(--team-row-height);
  padding-top: 0;
  padding-bottom: 0;
  border-bottom: 1px solid #F1F5F9;
  transition: background 150ms ease;
  cursor: pointer;
  color: inherit;
}

.employee-row:last-child {
  border-bottom: none;
}

.employee-row:hover {
  background: var(--hover-row);
}

.employee-row:hover .employee-name {
  color: #0F172A;
}

.employee-row:hover .col-chevron {
  color: var(--primary-navy);
}

.employee-row:focus-visible {
  outline: 2px solid #BFDBFE;
  outline-offset: -2px;
  border-radius: 4px;
}

.employee-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #94A3B8;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.employee-delete-btn:hover {
  background: #FEF2F2;
  color: #DC2626;
}

.employee-delete-btn:focus-visible {
  outline: 2px solid #FECACA;
  outline-offset: 1px;
  color: #DC2626;
}

.sl-number {
  font-size: 14px;
  font-weight: 500;
  color: #94A3B8;
  font-variant-numeric: tabular-nums;
}

.col-employee-group {
  display: flex;
  align-items: center;
  min-width: 0;
}

.employee-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.row-connector {
  flex: 1;
  height: 0;
  border-top: 1px dotted var(--dotted-line);
  margin: 0 12px;
  min-width: 32px;
  opacity: 0.85;
}

.employee-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--border-light);
}

.employee-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.team-review-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--submitted-blue, #6366F1);
  vertical-align: middle;
}

.employee-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-heading);
  white-space: nowrap;
  transition: color 150ms ease;
}

.employee-role {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
}

.task-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 72px;
  line-height: 1.15;
}

.task-count {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.task-count.pending {
  color: var(--team-pending);
}

.task-count.completed {
  color: var(--team-completed);
}

.task-label {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 2px;
}

.col-chevron {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: #94A3B8;
  transition: color 150ms ease;
}

.col-chevron svg {
  width: 18px;
  height: 18px;
}

.add-employee-dashed {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 54px;
  margin-top: 16px;
  padding: 0 16px;
  background: transparent;
  border: 1.5px dashed #CBD5E1;
  border-radius: 12px;
  color: #475569;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.add-employee-dashed:hover {
  background: #F8FAFC;
  border-color: #94A3B8;
  color: var(--primary-navy);
}

.add-employee-dashed svg {
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .team-dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-wrapper {
    padding: 16px 16px 32px;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .search-box {
    width: 100%;
  }

  .table-header,
  .employee-row {
    grid-template-columns: 40px minmax(120px, 1fr) 64px 72px 20px 32px;
    padding-left: 16px;
    padding-right: 12px;
    column-gap: 4px;
  }

  .employee-row {
    min-height: 80px;
  }

  .employee-delete-btn {
    width: 30px;
    height: 30px;
  }

  .task-count {
    font-size: 18px;
  }

  .table-header .col-pending,
  .table-header .col-completed {
    font-size: 9px;
  }

  .row-connector {
    margin: 0 8px;
    min-width: 20px;
  }

  .btn-add-employee {
    padding: 8px 12px;
    font-size: 13px;
  }

  .top-bar {
    margin-bottom: 16px;
  }

  .page-title {
    font-size: 24px;
  }

  .employee-name {
    font-size: 15px;
  }
}

@media (max-width: 520px) {
  .brand-subtitle {
    display: none;
  }

  .row-connector {
    display: none;
  }

  .employee-role {
    font-size: 12px;
  }

  .task-label {
    font-size: 10px;
  }

  .task-stat {
    min-width: 56px;
  }
}
