/* ====================================================================
   Team Owners redesign — added 2026-06-05
   Bento KPI + per-owner cards with toggle switches + chip-style staff
   assignment. Replaces the cramped checkbox grid.
   ==================================================================== */

.to-heading { margin: 0 0 16px 0; }
.to-h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: var(--text);
}
.to-sub {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.to-kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 10px;
}

.to-section-header {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 12px 0 12px 0;
}

.to-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Per-owner card */
.to-card-v2 {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 16px 18px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.to-card-admin {
  background: linear-gradient(180deg, rgba(37,99,235,.04), var(--surface-card));
}

/* Collapsible body — hidden by default, shown when .is-open is on the card */
.to-card-v2 .to-card-body {
  display: none;
}
.to-card-v2.is-open .to-card-body {
  display: block;
  animation: to-card-slide .18s ease;
}
@keyframes to-card-slide {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Make the header row look clickable; chevron animates on open */
.to-row-toggle { cursor: pointer; }
.to-row-toggle:hover .to-name { text-decoration: underline; }
.to-card-chevron {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  margin-left: 6px;
  transition: transform .18s ease;
  user-select: none;
  flex: 0 0 auto;
}
.to-card-v2.is-open .to-card-chevron {
  transform: rotate(180deg);
}

.to-remove-btn {
  flex: 0 0 auto;
}

.to-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.to-avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.4px;
}

.to-info { flex: 1 1 auto; min-width: 0; }
.to-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.to-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.to-phone {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
}

.to-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.to-pill-primary {
  background: rgba(37,99,235,.12);
  color: var(--primary);
}
.to-pill-warning {
  background: rgba(114,59,0,.12);
  color: var(--warning, #723b00);
}

.to-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--success, #006c4a);
  white-space: nowrap;
}
.to-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success, #006c4a);
}

.to-admin-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.to-divider {
  height: 1px;
  background: var(--border);
  margin: 14px -4px;
}

.to-subsection { padding: 0; }
.to-subsection-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.to-subsection-sub {
  font-size: 11.5px;
  margin-bottom: 10px;
}

/* Permission rows */
.perm-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.perm-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface, #f8f9ff);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.perm-row:hover { border-color: var(--primary); }
.perm-row-sensitive { background: rgba(186,26,26,.03); }

.perm-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: rgba(0,0,0,.04);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.perm-text { flex: 1 1 auto; min-width: 0; }
.perm-label {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.perm-desc {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-muted);
}
.sensitive-pill {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 99px;
  background: rgba(186,26,26,.12);
  color: var(--error-red, #ba1a1a);
}

/* iOS-style toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex: 0 0 auto;
}
.toggle-switch input {
  position: absolute;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.toggle-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #d1d5db;
  border-radius: 22px;
  transition: background .18s ease;
  pointer-events: none;
}
.toggle-slider::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .18s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
}

/* Staff chips */
.staff-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.staff-chip-v2 {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text);
  background: var(--surface, #f8f9ff);
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.staff-chip-v2:hover { border-color: var(--primary); }
.staff-chip-v2.checked {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.staff-chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0,0,0,.06);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.staff-chip-v2.checked .staff-chip-icon {
  background: rgba(255,255,255,.25);
  color: #fff;
}
