/* Jamoa bo‘limi (`apps.teams`). Ranglar saytning o‘zgaruvchilaridan —
   qorong‘i rejim o‘zi ishlaydi. */

/* ------------------------------------------------------------ Bosh qism */
.team-hero {
  background: var(--navy-800);
  color: #fff;
  padding: 40px 0 44px;
}
.team-hero .breadcrumb a { color: #b9c8d6; }
.team-hero .breadcrumb .active { color: #fff; }
.team-hero__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.team-hero__title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 12px; }
.team-hero__title h1 { color: #fff; margin: 0; font-size: 2.6rem; font-weight: 800; }
.team-hero__ru { font-size: .85rem; font-weight: 700; color: #b9c8d6; border: 1px solid var(--navy-600); padding: 4px 12px; border-radius: 999px; }
.team-hero__lead { color: #d6e1ea; max-width: 62ch; margin: 0; line-height: 1.6; }
.team-hero__actions { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.team-hero__actions .btn-outline-light { border-width: 1.5px; }
.team-hero__note { font-size: .82rem; color: #b9c8d6; display: flex; gap: 8px; align-items: center; max-width: 46ch; text-align: right; }

/* --------------------------------------------------------- Kartochkalar */
.team-kinds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.team-kind {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 24px; display: flex; flex-direction: column; gap: 12px;
  color: var(--text); text-decoration: none; box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.team-kind:hover { color: var(--text); text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.team-kind__icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.3rem; background: var(--accent-soft); color: var(--accent-ink); }
.team-kind__name { font-size: 1.15rem; font-weight: 800; }
.team-kind__count { color: var(--text-muted); font-size: .88rem; }
.team-kind__go { margin-top: auto; color: var(--accent-ink); font-weight: 700; font-size: .9rem; }

.team-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.team-step { display: flex; gap: 16px; }
.team-step__n { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; background: var(--navy-800); color: #fff; font-weight: 800; display: grid; place-items: center; }
.team-step__title { font-weight: 800; margin-bottom: 4px; }
.team-step__text { color: var(--text-muted); font-size: .9rem; line-height: 1.6; margin: 0; }

.team-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.team-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.team-card--mine { border: 2px solid var(--ok-500); }
.team-card__head { display: flex; gap: 14px; align-items: center; }
.team-card__mark { width: 52px; height: 52px; border-radius: 50%; background: var(--navy-100); color: var(--navy-ink); font-weight: 800; display: grid; place-items: center; flex-shrink: 0; }
.team-card__name { font-weight: 800; line-height: 1.3; }
.team-card__place { font-size: .82rem; color: var(--text-muted); }
.team-card__chips { display: flex; gap: 8px; flex-wrap: wrap; }
.team-card .btn { margin-top: auto; }
.team-card--new { border: 2px dashed var(--border-firm); align-items: center; justify-content: center; text-align: center; color: var(--text-muted); text-decoration: none; }
.team-card--new:hover { color: var(--text-muted); text-decoration: none; border-color: var(--accent); }
.team-roles { font-size: .78rem; line-height: 1.55; background: var(--surface-alt); border-radius: 10px; padding: 8px 12px; }

.team-chip { font-size: .75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface-alt); color: var(--text); display: inline-flex; gap: 5px; align-items: center; white-space: nowrap; }
.team-chip--ok { background: var(--ok-bg); color: var(--ok-500); }
.team-chip--warn { background: var(--warn-bg); color: var(--warn-500); }
.team-chip--info { background: var(--info-bg); color: var(--info-500); }
.team-chip--accent { background: var(--accent-soft); color: var(--accent-ink); }

.team-filter { display: flex; gap: 12px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px; margin-bottom: 24px; }
.team-filter .form-control { flex: 1 1 260px; }
.team-filter .form-select { flex: 0 1 260px; }

/* ------------------------------------------------------ Jamoa ichki qismi */
.team-bar { background: var(--navy-900); color: #fff; }
.team-bar__inner { display: flex; align-items: center; gap: 14px; padding: 14px 0; flex-wrap: wrap; }
.team-bar__mark { width: 44px; height: 44px; border-radius: 50%; background: #fff; color: var(--navy-900); font-weight: 800; display: grid; place-items: center; overflow: hidden; }
.team-bar__mark img { width: 100%; height: 100%; object-fit: contain; }
.team-bar__name { font-weight: 800; font-size: 1.05rem; line-height: 1.3; }
.team-bar__sub { font-size: .78rem; color: #b9c8d6; }
.team-bar__role { font-size: .75rem; font-weight: 700; background: var(--navy-600); color: #ffb08c; padding: 4px 10px; border-radius: 999px; }
.team-bar__back { color: #b9c8d6; font-size: .82rem; font-weight: 600; margin-inline-end: 6px; }
.team-bar__back:hover { color: #fff; }

.team-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; padding: 28px 0 48px; }
.team-side { display: flex; flex-direction: column; gap: 4px; }
.team-side a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; color: var(--text); font-weight: 600; font-size: .92rem; text-decoration: none; }
.team-side a:hover { background: var(--surface-alt); color: var(--text); }
.team-side a.active { background: var(--accent-soft); color: var(--accent-ink); }
.team-side .badge { margin-inline-start: auto; }

.team-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.team-stat { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; }
.team-stat__label { font-size: .8rem; font-weight: 600; color: var(--text-muted); }
.team-stat__value { font-size: 1.7rem; font-weight: 800; }
.team-stat--warn { background: var(--warn-bg); border-color: transparent; }
.team-stat--warn .team-stat__label, .team-stat--warn .team-stat__value { color: var(--warn-500); }

.team-note { display: flex; gap: 12px; align-items: center; background: var(--info-bg); color: var(--info-500); border-radius: 14px; padding: 14px 18px; margin-bottom: 20px; font-size: .9rem; }
.team-note form { margin-inline-start: auto; }

.class-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.class-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 10px; color: var(--text); text-decoration: none; box-shadow: var(--shadow-sm); }
.class-card:hover { color: var(--text); text-decoration: none; border-color: var(--accent); }
.class-card__name { font-size: 1.35rem; font-weight: 800; }
.class-card__meta { font-size: .85rem; color: var(--text-muted); }
.class-card__go { color: var(--accent-ink); font-weight: 700; font-size: .88rem; margin-top: auto; }

.class-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.class-head__mark { width: 60px; height: 60px; border-radius: 16px; background: var(--navy-800); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 1.1rem; }
.class-head__title { margin: 0; font-size: 1.6rem; font-weight: 800; }
.class-head__sub { color: var(--text-muted); font-size: .88rem; }
.class-head .btn { margin-inline-start: auto; }

.member-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--navy-100); color: var(--navy-ink); font-size: .72rem; font-weight: 800; display: inline-grid; place-items: center; flex-shrink: 0; }

.kind-toggle { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; background: var(--surface-alt); padding: 5px; border-radius: 12px; }
.kind-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.kind-toggle label { text-align: center; padding: 10px; border-radius: 9px; font-weight: 700; cursor: pointer; color: var(--text-muted); }
.kind-toggle input:checked + label { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.kind-toggle input:focus-visible + label { outline: 2px solid var(--accent); }

.kind-choice { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.kind-choice input { position: absolute; opacity: 0; pointer-events: none; }
.kind-choice label { border: 1px solid var(--border-firm); border-radius: 12px; padding: 12px; text-align: center; font-weight: 700; cursor: pointer; }
.kind-choice input:checked + label { border: 2px solid var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.kind-choice input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 992px) {
  .team-kinds, .team-grid, .class-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .team-steps { grid-template-columns: 1fr; }
  .team-layout { grid-template-columns: 1fr; }
  .team-side { flex-direction: row; overflow-x: auto; }
  .team-side a { white-space: nowrap; }
  .team-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 576px) {
  .team-kinds, .team-grid, .class-grid, .kind-choice { grid-template-columns: 1fr; }
  .team-hero__actions { align-items: stretch; width: 100%; }
  .team-hero__note { text-align: left; }
}

/* ------------------------------------------------ Logotip va hujjat foni */
.team-card__mark.has-logo, .team-bar__mark.has-logo { background: #fff; padding: 3px; overflow: hidden; }
.team-card__mark img, .team-bar__mark img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.team-card__mark--lg { width: 72px; height: 72px; font-size: 1.3rem; }

.team-logo-preview { width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: var(--surface-alt); border: 1px dashed var(--border-firm); color: var(--text-faint); font-size: 1.4rem; overflow: hidden; }
.team-logo-preview img { width: 100%; height: 100%; object-fit: contain; background: #fff; }

.bg-choice { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
.bg-choice input { position: absolute; opacity: 0; pointer-events: none; }
.bg-choice label { display: grid; gap: 6px; cursor: pointer; text-align: center; font-size: .8rem; font-weight: 600; }
.bg-choice__thumb { aspect-ratio: 1 / 1.414; border-radius: 8px; border: 2px solid var(--border); overflow: hidden;
  display: grid; place-items: center; background: #fff; color: var(--text-faint); font-size: 1.4rem; }
.bg-choice__thumb img { width: 100%; height: 100%; object-fit: cover; }
.bg-choice input:checked + label .bg-choice__thumb { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bg-choice input:checked + label .bg-choice__label { color: var(--accent-ink); }
.bg-choice input:focus-visible + label .bg-choice__thumb { outline: 2px solid var(--accent); outline-offset: 2px; }
