﻿/* PresentTool™ Dashboard — view: team (v3.7.0)
   Org card · members table · invite modal · seats-full state. */

.view-team {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ─── Org / seat card ─────────────────────────────────── */
.team-org-card {
  background: var(--pt-surface-0);
  border: 1px solid var(--pt-border);
  border-radius: var(--pt-radius-lg);
  padding: 24px 28px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 28px;
  align-items: center;
  box-shadow: var(--pt-shadow-card);
  margin-bottom: 22px;
}
.team-org-card .org-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.team-org-card .org-name {
  font-family: var(--pt-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 24px;
  color: var(--pt-text);
  letter-spacing: -0.015em;
  margin: 0;
}
.team-org-card .org-meta {
  font-family: var(--pt-mono);
  font-size: 11.5px;
  color: var(--pt-text-muted);
  letter-spacing: 0.02em;
}
.team-org-card .tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--pt-accent-soft);
  color: var(--pt-primary);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}
.team-org-card .tier-badge svg { width: 11px; height: 11px; }

.team-org-card .seat-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.team-org-card .seat-progress .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--pt-mono);
  font-size: 11px;
  color: var(--pt-text-muted);
}
.team-org-card .seat-progress .row .lbl {
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.team-org-card .seat-progress .row .v {
  color: var(--pt-text);
  font-weight: 600;
  font-size: 14px;
}
.team-org-card .seat-progress.is-full .row .v { color: var(--pt-destructive); }
.team-org-card .seat-progress .hint {
  font-family: var(--pt-serif);
  font-style: italic;
  font-size: 12px;
  color: var(--pt-text-subtle);
}
.team-org-card .seat-progress.is-full .hint {
  color: var(--pt-destructive);
  font-family: var(--pt-sans);
  font-style: normal;
  font-weight: 500;
}

.seat-bar {
  height: 8px;
  background: var(--pt-surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.seat-bar > span {
  display: block;
  height: 100%;
  background: var(--pt-primary);
  border-radius: 999px;
  transition: width 0.3s ease;
}
.seat-bar.is-full > span { background: var(--pt-destructive); }

/* ─── Members toolbar ─────────────────────────────────── */
.members-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
  flex-wrap: wrap;
}
.members-toolbar h2 {
  font-family: var(--pt-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 22px;
  margin: 0;
  letter-spacing: -0.01em;
}
.members-toolbar .right {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.members-toolbar .count {
  font-family: var(--pt-mono);
  font-size: 11px;
  color: var(--pt-text-subtle);
  letter-spacing: 0.04em;
}

.seats-warning-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(160,114,42,0.10);
  color: var(--pt-warning);
  border: 1px solid rgba(160,114,42,0.25);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.seats-warning-chip:hover { background: rgba(160,114,42,0.16); text-decoration: none; }
.seats-warning-chip .arrow { opacity: 0.7; }

/* ─── Members table ───────────────────────────────────── */
.members-table {
  background: var(--pt-surface-0);
  border: 1px solid var(--pt-border);
  border-radius: var(--pt-radius-md);
  overflow: hidden;
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  box-shadow: var(--pt-shadow-card);
}
.members-table th, .members-table td {
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid var(--pt-border);
  font-size: 13px;
  vertical-align: middle;
}
.members-table tr:last-child td { border-bottom: 0; }
.members-table th {
  background: var(--pt-surface-1);
  font-family: var(--pt-mono);
  font-weight: 500;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pt-text-muted);
  padding-top: 12px;
  padding-bottom: 12px;
}
.members-table .name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}
.members-table .name-cell .name {
  font-weight: 600;
  color: var(--pt-text);
  font-size: 13.5px;
}
.members-table .name-cell .email-sub {
  font-family: var(--pt-serif);
  font-style: italic;
  color: var(--pt-text-subtle);
  font-size: 11.5px;
}
.members-table td.email {
  font-family: var(--pt-mono);
  font-size: 12px;
  color: var(--pt-text-muted);
}

.role-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: var(--pt-surface-2);
  color: var(--pt-text-muted);
}
.role-chip.owner { background: var(--pt-accent-soft); color: var(--pt-primary); }
.role-chip.admin { background: rgba(45,122,79,0.10); color: var(--pt-success); }

.role-select {
  font-family: var(--pt-sans);
  font-size: 12px;
  color: var(--pt-text);
  background: var(--pt-surface-0);
  border: 1px solid var(--pt-border);
  border-radius: 999px;
  padding: 4px 26px 4px 10px;
  appearance: none;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--pt-text-muted) 50%),
                    linear-gradient(135deg, var(--pt-text-muted) 50%, transparent 50%);
  background-position: calc(100% - 13px) center, calc(100% - 9px) center;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}
.role-select:focus {
  outline: none;
  border-color: var(--pt-primary);
  box-shadow: 0 0 0 3px var(--pt-accent-soft);
}

.members-table .actions {
  display: inline-flex;
  gap: 4px;
  justify-content: flex-end;
}
.kebab-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: transparent;
  border: 0;
  color: var(--pt-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}
.kebab-btn:hover { background: var(--pt-surface-2); color: var(--pt-text); }
.kebab-btn svg { width: 14px; height: 14px; }

.kebab-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--pt-surface-0);
  border: 1px solid var(--pt-border);
  border-radius: var(--pt-radius-sm);
  box-shadow: var(--pt-shadow-card);
  min-width: 180px;
  padding: 4px;
  z-index: 50;
}
.kebab-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 13px;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  border-radius: 4px;
  color: var(--pt-text);
  cursor: pointer;
}
.kebab-menu button:hover { background: var(--pt-surface-2); }
.kebab-menu button.danger { color: var(--pt-destructive); }
.kebab-menu button svg { width: 13px; height: 13px; }

.resend-link {
  font-family: var(--pt-sans);
  font-size: 11.5px;
  color: var(--pt-primary);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 0;
}
.resend-link:hover { text-decoration: underline; }

/* Avatar circle (members) */
.avatar-circle {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--pt-sans);
  font-size: 13px;
  font-weight: 600;
  color: white;
  flex: 0 0 34px;
  background: var(--pt-primary);
}
.avatar-circle.pending {
  background: var(--pt-surface-2);
  color: var(--pt-text-muted);
  border: 1px dashed var(--pt-border-strong);
}

/* Upgrade-promo banner (seats full) */
.upgrade-promo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(160,114,42,0.06);
  border: 1px solid rgba(160,114,42,0.22);
  border-radius: var(--pt-radius-md);
  margin-bottom: 24px;
}
.upgrade-promo .ico {
  color: var(--pt-warning);
  flex: 0 0 16px;
}
.upgrade-promo .ico svg { width: 16px; height: 16px; }
.upgrade-promo .body {
  flex: 1;
  font-family: var(--pt-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--pt-text);
  line-height: 1.55;
}
.upgrade-promo .body b {
  font-family: var(--pt-sans);
  font-style: normal;
  font-weight: 600;
}
.upgrade-promo .body em { color: var(--pt-text-muted); }

/* ─── Invite modal ─────────────────────────────────────── */
.team-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,18,14,0.55);
  backdrop-filter: blur(2px);
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: pt-modal-fade 0.16s ease-out;
}
@keyframes pt-modal-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.team-modal {
  background: var(--pt-surface-0);
  border: 1px solid var(--pt-border);
  border-radius: var(--pt-radius-lg);
  box-shadow: var(--pt-shadow-modal);
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
}
.team-modal .head {
  padding: 22px 24px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.team-modal .head h3 {
  font-family: var(--pt-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 22px;
  margin: 0 0 4px;
  letter-spacing: -0.015em;
  color: var(--pt-text);
}
.team-modal .head .sub {
  font-size: 12.5px;
  color: var(--pt-text-muted);
}
.team-modal .head .close {
  background: transparent;
  border: 0;
  color: var(--pt-text-muted);
  cursor: pointer;
  width: 28px; height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.team-modal .head .close:hover { background: var(--pt-surface-2); color: var(--pt-text); }
.team-modal .head .close svg { width: 14px; height: 14px; }

.team-modal .body {
  padding: 4px 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}
.team-modal .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.team-modal .field .lbl {
  font-size: 12px;
  font-weight: 600;
  color: var(--pt-text);
  letter-spacing: 0.01em;
}
.team-modal .field .hint {
  font-size: 11.5px;
  color: var(--pt-text-subtle);
  font-family: var(--pt-serif);
  font-style: italic;
}
.team-modal .field-error {
  font-size: 12px;
  color: var(--pt-destructive);
  display: flex;
  align-items: center;
  gap: 6px;
}
.team-modal .field-error a {
  color: var(--pt-destructive);
  text-decoration: underline;
  font-weight: 500;
}
.team-modal input.pt-input { width: 100%; }

.role-radio-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.role-radio-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--pt-border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  background: var(--pt-surface-0);
}
.role-radio-item .radio {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid var(--pt-border-strong);
  flex: 0 0 16px;
  position: relative;
  background: var(--pt-surface-0);
  margin-top: 2px;
}
.role-radio-item input { display: none; }
.role-radio-item.is-checked .radio { border-color: var(--pt-primary); }
.role-radio-item.is-checked .radio::after {
  content: '';
  position: absolute;
  inset: 2px;
  background: var(--pt-primary);
  border-radius: 50%;
}
.role-radio-item.is-checked {
  background: var(--pt-accent-soft);
  border-color: var(--pt-accent-mid);
}
.role-radio-item .desc { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.role-radio-item .desc b {
  font-weight: 600;
  color: var(--pt-text);
  font-size: 13px;
}
.role-radio-item .desc span {
  font-size: 11.5px;
  color: var(--pt-text-muted);
  font-family: var(--pt-serif);
  font-style: italic;
}
.role-radio-item.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.team-modal .foot {
  padding: 14px 24px 18px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  border-top: 1px solid var(--pt-border);
  background: var(--pt-surface-1);
}

/* ─── Skeleton ─────────────────────────────────────────── */
.team-skel {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.team-skel .sk {
  background: linear-gradient(90deg, var(--pt-surface-2) 0%, var(--pt-surface-3) 50%, var(--pt-surface-2) 100%);
  background-size: 200% 100%;
  animation: pt-shimmer 1.2s linear infinite;
  border-radius: var(--pt-radius-md);
}
.team-skel .sk.org { height: 110px; }
.team-skel .sk.tbl { height: 320px; }

/* ─── Mobile ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .team-org-card {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 20px;
  }
  .members-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .members-toolbar .right { width: 100%; }
  .members-toolbar .right .btn { flex: 1; justify-content: center; }

  .members-table thead { display: none; }
  .members-table, .members-table tbody, .members-table tr, .members-table td { display: block; width: 100%; }
  .members-table tr {
    padding: 14px 16px;
    border-bottom: 1px solid var(--pt-border);
  }
  .members-table td {
    padding: 4px 0;
    border: 0;
  }
  .members-table td.email { font-size: 11.5px; }
  .members-table .actions { justify-content: flex-start; gap: 8px; margin-top: 6px; }

  .team-modal { max-height: 100vh; border-radius: 0; max-width: 100%; }
  .team-modal-overlay { padding: 0; }
}
