/**
 * VIVEREA – Team (Premium SaaS · Linear / Notion / Apple-inspiriert)
 * Abgestimmt mit tickets-premium: helles Canvas, weisse Karten, weiche Schatten.
 */

/* ── Seiten-Canvas ───────────────────────────────────────── */
.team-page-section {
  background: #f8f9fb;
  padding: 2.75rem 0 4.5rem;
  min-height: calc(100vh - 100px);
}

.team-page-container {
  max-width: 1040px;
  margin: 0 auto;
}

/* Kein „doppeltes Panel“: Inhalt liegt auf Canvas, Karten sind die Module */
.admin-module.team-module {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  padding: 0 !important;
  margin-bottom: 0 !important;
}

/* ── Page Header ─────────────────────────────────────────── */
.team-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.5rem 0 2.75rem;
  margin: 0;
  border: none;
}

.team-page-head h1 {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #0f172a;
}

.team-page-lead {
  margin: 0.65rem 0 0;
  font-size: 1rem;
  line-height: 1.6;
  color: #64748b;
  max-width: 32rem;
  font-weight: 450;
}

.team-btn-primary {
  flex-shrink: 0;
  border: none;
  border-radius: 14px;
  padding: 0.7rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 650;
  font-family: inherit;
  cursor: pointer;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
  transition:
    filter 0.18s ease,
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.22s ease;
}

.team-btn-primary:hover {
  filter: brightness(1.04);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.32);
}

.team-btn-primary:active {
  transform: translateY(0);
}

/* ── Member Grid ─────────────────────────────────────────── */
.team-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

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

/* ── Member Card ─────────────────────────────────────────── */
.team-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 22px 24px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  transition:
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.22s ease,
    border-color 0.2s ease;
}

.team-card:hover {
  transform: translateY(-3px);
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.09);
}

.team-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0.65rem;
}

.team-card-name {
  margin: 0;
  font-size: 1.1875rem;
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: #0f172a;
  min-width: 0;
}

.team-card-email {
  margin: 0 0 1.15rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #64748b;
}

.team-card-email.is-muted {
  color: #94a3b8;
  font-style: normal;
}

.team-card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 4px;
}

.team-card-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.team-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.team-card-actions button {
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fafbfc;
  border-radius: 11px;
  padding: 0.5rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  color: #475569;
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.18s ease;
}

.team-card-actions button:hover {
  background: #fff;
  border-color: rgba(15, 23, 42, 0.14);
  color: #0f172a;
  transform: translateY(-1px);
}

.team-card-actions .team-toggle-btn {
  background: transparent;
  color: #64748b;
}

.team-card-actions .team-toggle-btn:hover {
  background: #f1f5f9;
  color: #334155;
}

.team-card-date {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(15, 23, 42, 0.05);
}

/* ── Badges (Pills) ─────────────────────────────────────── */
.team-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  line-height: 1.2;
}

/* Rolle: Admin = ruhig dunkel */
.team-badge--role-admin {
  background: #1e293b;
  color: #f8fafc;
}

/* Rolle: Mitarbeiter = hell */
.team-badge--role-staff {
  background: #f1f5f9;
  color: #475569;
}

.team-badge--active {
  background: #d1fae5;
  color: #047857;
}

.team-badge--inactive {
  background: #f1f5f9;
  color: #64748b;
}

/* ── Empty State (Premium Card) ──────────────────────────── */
.team-empty {
  max-width: 520px;
  margin: 2rem auto 0;
  text-align: center;
  padding: 3.25rem 2.25rem;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.team-empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.25rem;
  border-radius: 16px;
  background: linear-gradient(145deg, #f1f5f9, #e8ecf4);
  display: grid;
  place-items: center;
  color: #64748b;
}

.team-empty-icon svg {
  width: 26px;
  height: 26px;
  opacity: 0.85;
}

.team-empty h2 {
  margin: 0 0 0.65rem;
  font-size: 1.1875rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.team-empty p {
  margin: 0 0 1.75rem;
  font-size: 0.9375rem;
  color: #64748b;
  line-height: 1.65;
  max-width: 34rem;
  margin-left: auto;
  margin-right: auto;
}

.team-loading {
  text-align: center;
  padding: 3.5rem 1.5rem;
  color: #94a3b8;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ── Modal ───────────────────────────────────────────────── */
.team-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
  z-index: 1600;
}

.team-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.team-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  z-index: 1610;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.team-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.team-modal-card {
  width: min(460px, 100%);
  background: #ffffff;
  border-radius: 22px;
  box-shadow:
    0 24px 64px rgba(15, 23, 42, 0.12),
    0 0 0 1px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  transform: scale(0.96) translateY(8px);
  opacity: 0;
  transition:
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.28s ease;
}

.team-modal.is-open .team-modal-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.team-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 1.35rem 1.5rem 1.1rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.team-modal-head-text {
  min-width: 0;
}

.team-modal-title {
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #0f172a;
  margin: 0;
  line-height: 1.25;
}

.team-modal-subtitle {
  margin: 0.4rem 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #64748b;
  font-weight: 450;
}

.team-modal-close {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: none;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.06);
  color: #64748b;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    transform 0.15s ease;
}

.team-modal-close:hover {
  background: rgba(15, 23, 42, 0.1);
  color: #0f172a;
  transform: scale(1.03);
}

.team-modal-body {
  padding: 1.5rem 1.5rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.team-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.team-field-label {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #475569;
  text-transform: none;
}

.team-field-input,
.team-field-select {
  width: 100%;
  min-height: 48px;
  box-sizing: border-box;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  padding: 0 1rem;
  font-size: 0.9375rem;
  font-family: inherit;
  color: #0f172a;
  background: #f8fafc;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.2s ease;
}

.team-field-input::placeholder {
  color: #94a3b8;
}

.team-field-input:hover,
.team-field-select:hover {
  border-color: rgba(15, 23, 42, 0.14);
  background: #fff;
}

.team-field-input:focus,
.team-field-select:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.45);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.team-field-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.team-field-error {
  font-size: 0.8125rem;
  color: #b91c1c;
  margin: 0;
}

.team-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 1.15rem 1.5rem 1.35rem;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  background: #fafbfc;
}

.team-modal-btn {
  border-radius: 14px;
  padding: 0.62rem 1.15rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  min-height: 44px;
  transition:
    filter 0.15s ease,
    transform 0.15s ease,
    background 0.15s ease;
}

.team-modal-btn-ghost {
  background: transparent;
  color: #64748b;
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.team-modal-btn-ghost:hover {
  background: #fff;
  color: #334155;
  border-color: rgba(15, 23, 42, 0.14);
  transform: translateY(-1px);
}

.team-modal-btn-primary {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
}

.team-modal-btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

html.team-modal-open {
  overflow: hidden;
}
