/* Team dashboard — matches Installer SOP white + blue theme */
body.avw-team-active {
  background: #ffffff;
}

body.avw-team-active #avw-sop-shell {
  display: none !important;
}

#avw-team-view {
  display: none !important;
  flex-direction: column;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #1e293b;
  line-height: 1.6;
  background: #ffffff;
}

body.avw-team-active #avw-team-view {
  display: flex !important;
}

#avw-team-view {
  --team-blue: #1a4a7a;
  --team-blue-light: #2563eb;
  --team-blue-bg: #f0f5fa;
  --team-text: #1e293b;
  --team-muted: #64748b;
  --team-border: #e2e8f0;
  --team-surface: #ffffff;
  --team-done: #166534;
  --team-done-bg: #dcfce7;
}

.team-header {
  background: var(--team-blue);
  color: #fff;
  padding: 1rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.team-header-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.team-back {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.team-back:hover {
  background: rgba(255, 255, 255, 0.12);
}

.team-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 1rem;
}

.team-brand img {
  height: 28px;
  width: auto;
}

.team-main {
  flex: 1;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
}

.team-hero h1 {
  font-size: 1.65rem;
  color: var(--team-blue);
  margin-bottom: 0.35rem;
}

.team-hero p {
  color: var(--team-muted);
  font-size: 0.95rem;
}

.team-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0 1rem;
}

.team-nav-btn {
  border: 1px solid var(--team-border);
  background: var(--team-surface);
  color: var(--team-text);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-size: 0.88rem;
  cursor: pointer;
}

.team-nav-btn.active {
  background: var(--team-blue);
  border-color: var(--team-blue);
  color: #fff;
}

.team-panel {
  background: var(--team-surface);
  border: 1px solid var(--team-border);
  border-radius: 12px;
  padding: 1.25rem;
}

.team-panel--reviews-full {
  padding-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 12rem);
}

.reviews-full-frame {
  width: 100%;
  flex: 1;
  min-height: 70vh;
  height: calc(100vh - 14rem);
  border: 1px solid var(--team-border);
  border-radius: 10px;
  background: #fff;
}

.team-panel + .team-panel {
  margin-top: 1rem;
}

.team-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.team-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.team-panel-head h2 {
  font-size: 1.1rem;
  color: var(--team-blue);
  margin: 0;
  border: none;
  padding: 0;
}

.team-btn {
  border: 1px solid var(--team-border);
  background: var(--team-surface);
  color: var(--team-text);
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  font-size: 0.88rem;
  cursor: pointer;
}

.team-btn:hover {
  border-color: var(--team-blue-light);
  color: var(--team-blue-light);
}

.team-btn-primary {
  background: var(--team-blue);
  border-color: var(--team-blue);
  color: #fff;
}

.team-btn-primary:hover {
  background: var(--team-blue-light);
  border-color: var(--team-blue-light);
  color: #fff;
}

.team-btn-danger {
  color: #b91c1c;
  border-color: #fecaca;
}

.team-btn-danger:hover {
  color: #991b1b;
  border-color: #f87171;
}

.team-hint,
.team-note {
  font-size: 0.9rem;
  color: var(--team-muted);
  margin-bottom: 0.75rem;
}

.team-loading,
.team-empty {
  font-size: 0.95rem;
  color: var(--team-muted);
}

.team-table-wrap {
  overflow-x: auto;
  margin-bottom: 1rem;
}

.team-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.team-table th,
.team-table td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--team-border);
  vertical-align: middle;
}

.team-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--team-muted);
  background: var(--team-blue-bg);
}

.team-table a {
  color: var(--team-blue-light);
  font-weight: 500;
}

.team-empty-cell {
  color: var(--team-muted);
  text-align: center;
  padding: 1.25rem !important;
}

.team-status {
  display: inline-block;
  font-size: 0.85rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: var(--team-blue-bg);
  color: var(--team-blue);
}

.team-status--done {
  background: var(--team-done-bg);
  color: var(--team-done);
}

.team-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.team-badge--rating { background: #fef3c7; color: #b45309; }
.team-badge--started { background: #dbeafe; color: #1d4ed8; }
.team-badge--opened { background: #e2e8f0; color: #475569; }

.team-avg {
  font-weight: 700;
  color: var(--team-blue);
}

.team-date {
  font-size: 0.85rem;
  color: var(--team-muted);
}

.team-delete {
  border: none;
  background: transparent;
  color: var(--team-muted);
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: underline;
}

.team-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.team-stat-card {
  background: var(--team-blue-bg);
  border: 1px solid var(--team-border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

.team-stat-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--team-muted);
}

.team-stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--team-blue);
  margin-top: 0.15rem;
}

.team-subnav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.rev-subtab {
  border: 1px solid var(--team-border);
  background: #fff;
  color: var(--team-text);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
  cursor: pointer;
}

.rev-subtab.active {
  background: var(--team-blue);
  border-color: var(--team-blue);
  color: #fff;
}

.team-subhead {
  font-size: 0.95rem;
  color: var(--team-blue);
  margin: 1.25rem 0 0.5rem;
  border: none;
  padding: 0;
}

.team-footer {
  text-align: center;
  font-size: 0.82rem;
  color: var(--team-muted);
  padding: 1rem 1.25rem 1.5rem;
  border-top: 1px solid var(--team-border);
}