/* Team Management Styles */

.team-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.shared-lists-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shared-list-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.list-icon {
  font-size: 20px;
}

.list-info {
  flex: 1;
}

.list-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.list-permission {
  font-size: 12px;
  color: var(--text-muted);
}

.list-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  min-width: auto;
}

.member-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-icon-danger {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #fee2e2;
  color: #dc2626;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  line-height: 1;
  padding: 0;
}

.btn-icon-danger:hover {
  background: #ef4444;
  color: white;
  transform: scale(1.1);
}

/* ================================
   Team Admin Page
   ================================ */

/* Stats bar */
.admin-stats-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.admin-stat {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  text-align: center;
}

.admin-stat-value {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.admin-stat-label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Section layout */
.admin-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 20px;
}

.admin-section h4 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
}

.admin-section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 16px;
}

/* Invite link */
.admin-invite-link-section {
  background: var(--bg-elevated);
}

.admin-invite-link-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.admin-invite-link-info {
  flex: 1;
  min-width: 200px;
}

.admin-invite-link-info h4 {
  margin-bottom: 2px;
}

.admin-invite-link-info p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.admin-invite-link-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-invite-code {
  background: var(--bg-input);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Bulk add */
.admin-bulk-add {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-bulk-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 14px;
  resize: vertical;
  min-height: 80px;
}

.admin-bulk-textarea::placeholder {
  color: var(--text-muted);
}

.admin-bulk-textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.admin-bulk-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: flex-end;
}

.admin-bulk-role-select {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-bulk-role-select label {
  font-size: 14px;
  color: var(--text-secondary);
}

.form-select-sm {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 13px;
  cursor: pointer;
}

.form-select-sm:focus {
  outline: none;
  border-color: var(--primary);
}

/* Members header */
.admin-members-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-members-header h4 {
  margin: 0;
  white-space: nowrap;
}

.admin-members-search {
  position: relative;
  width: 260px;
}

.admin-members-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
}

.admin-members-search .form-input {
  padding-left: 36px;
  height: 38px;
  font-size: 14px;
}

/* Bulk actions bar */
.admin-bulk-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.admin-bulk-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin-right: 8px;
}

/* Members table */
.admin-members-table-wrap {
  overflow-x: auto;
}

.admin-members-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-members-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.admin-members-table th {
  background: var(--bg-elevated);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.admin-members-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-members-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.admin-members-table tbody tr.row-pending {
  opacity: 0.8;
}

.admin-members-table tbody tr.row-selected {
  background: var(--primary-light);
}

.col-check {
  width: 40px;
  text-align: center;
}

.col-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}

.col-name {
  min-width: 160px;
}

.col-email {
  min-width: 200px;
  color: var(--text-secondary);
}

.col-role {
  width: 120px;
}

.col-status {
  width: 90px;
}

.col-date {
  width: 100px;
  color: var(--text-muted);
  white-space: nowrap;
}

.col-actions {
  width: 130px;
  text-align: right;
}

.col-actions .btn-sm {
  margin-right: 4px;
}

/* Member name cell */
.admin-member-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

/* Role select in table */
.role-select {
  padding: 4px 8px;
  font-size: 13px;
  border-radius: 6px;
  min-width: 90px;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge.active {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.status-badge.pending {
  background: rgba(250, 204, 21, 0.15);
  color: #facc15;
}

/* Empty row */
.admin-empty-row {
  text-align: center;
  padding: 32px 16px !important;
  color: var(--text-muted);
  font-size: 14px;
}

/* Small icon button */
.btn-icon-sm {
  width: 24px;
  height: 24px;
  font-size: 16px;
}

/* ================================
   Responsive - Team Admin
   ================================ */

@media (max-width: 768px) {
  .admin-stats-bar {
    flex-wrap: wrap;
  }

  .admin-stat {
    min-width: calc(50% - 8px);
  }

  .admin-invite-link-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-invite-link-actions {
    width: 100%;
  }

  .admin-invite-code {
    max-width: 100%;
    flex: 1;
    min-width: 0;
  }

  .admin-bulk-controls {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .admin-members-search {
    width: 100%;
  }

  .admin-members-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-bulk-actions {
    gap: 6px;
  }

  .admin-bulk-actions .btn-sm {
    padding: 4px 10px;
    font-size: 11px;
  }

  .col-email {
    display: none;
  }

  .col-date {
    display: none;
  }

  .admin-section {
    padding: 16px;
  }
}
