.team-page {
    --team-primary: var(--color-primary);
    --team-primary-hover: #0f1d3b;
    --team-text: #1f2937;
    --team-muted: #667085;
    --team-border: #e4e8ef;
    --team-soft: #f8fafc;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0;
}

.team-header {
    margin-bottom: 1.25rem;
}

.team-header-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.team-header-row .page-header {
    margin-bottom: 0;
}

.team-create-btn {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--team-primary);
    color: #fff;
    font-family: var(--font-sans);
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.72rem 1.15rem;
    text-decoration: none;
    transition: background 0.16s, transform 0.16s, box-shadow 0.16s;
}

.team-create-btn:hover {
    background: var(--team-primary-hover);
    box-shadow: 0 10px 24px rgba(27, 42, 74, 0.18);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

.team-module-tabs {
    margin-top: 1rem;
}

.team-filter-panel {
    margin-bottom: 0.6rem;
}

.team-search-wrap {
    position: relative;
    margin-bottom: 0.75rem;
}

.team-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    display: flex;
    align-items: center;
    color: #98a2b3;
    pointer-events: none;
    transform: translateY(-50%);
}

.team-search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.82rem 5.4rem 0.82rem 2.7rem;
    border: 1px solid #d0d7e2;
    border-radius: var(--radius-md);
    background: #fff;
    color: var(--team-text);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
}

.team-search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.team-search-input::placeholder {
    color: #9aa4b2;
}

.team-search-label {
    display: block;
}

.team-search-btn {
    position: absolute;
    right: 0.45rem;
    top: 50%;
    border: none;
    border-radius: 8px;
    background: var(--team-primary);
    color: #fff;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    padding: 0.42rem 0.95rem;
    transform: translateY(-50%);
    transition: background 0.15s;
}

.team-search-btn:hover {
    background: var(--team-primary-hover);
}

.team-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    margin-bottom: 0.6rem;
}

.team-filter-select {
    min-width: 170px;
    appearance: none;
    border: 1px solid #d0d7e2;
    border-radius: 9px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%23808a98' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 0.6rem center;
    color: #4b5563;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    outline: none;
    padding: 0.38rem 1.9rem 0.38rem 0.72rem;
    transition: border-color 0.15s, background-color 0.15s;
}

.team-filter-select:focus,
.team-filter-select:hover {
    border-color: #8fa4c8;
}

.team-filter-select.active {
    border-color: #36598f;
    background-color: #f4f8ff;
    color: #36598f;
    font-weight: 600;
}

.team-filter-reset {
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #8a93a2;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.78rem;
    padding: 0.36rem 0.54rem;
    transition: color 0.15s, background 0.15s;
}

.team-filter-reset:hover {
    background: #eef3fb;
    color: #2f456d;
}

.team-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
}

.team-active-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    border: 1px solid #d4deee;
    border-radius: 999px;
    background: #eff4fb;
    color: #345179;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.76rem;
    padding: 0.22rem 0.56rem;
}

.team-active-tag:hover {
    background: #e6eefb;
    color: #2b4468;
}

.team-active-tag span {
    color: #8097ba;
    line-height: 1;
}

.team-result-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.82rem;
    color: #6b7280;
    font-size: 0.82rem;
}

.team-result-count strong {
    color: #1f2c44;
    font-weight: 800;
}

.team-list {
    display: flex;
    flex-direction: column;
    gap: 0.72rem;
}

.team-card[hidden] {
    display: none;
}

.team-card {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 0.95rem;
    align-items: start;
    border: 1px solid var(--team-border);
    border-radius: var(--radius-sm);
    background: #fff;
    padding: 0.95rem 1rem 0.85rem;
}

.team-card--clickable {
    cursor: pointer;
}

.team-card--clickable:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

.team-card__logo {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f7f8fa;
    flex-shrink: 0;
}

.team-card__logo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.team-card__logo span {
    color: #2b4d7d;
    font-family: var(--font-serif);
    font-size: 1.45rem;
    font-weight: 700;
}

.team-card__body {
    min-width: 0;
}

.team-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.3rem;
}

.team-card__title {
    margin: 0;
    color: var(--team-primary);
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.35;
}

.team-card__title a {
    color: var(--team-primary);
    text-decoration: none;
}

.team-card__title a:hover,
.team-card__title a:visited:hover {
    color: var(--team-primary-hover);
    text-decoration: none;
}

.team-card__title a:visited {
    color: var(--team-primary);
}

.team-card__department {
    margin-top: 0.16rem;
    color: #374151;
    font-size: 0.87rem;
}

.team-card__badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.32rem;
    flex-shrink: 0;
}

.team-badge {
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: #e9f2ff;
    color: #1d5faa;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.team-card__summary {
    display: -webkit-box;
    margin: 0 0 0.55rem;
    overflow: hidden;
    color: #4b5563;
    font-size: 0.86rem;
    line-height: 1.58;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.team-card__summary--muted {
    color: #98a2b3;
}

.team-members {
    display: flex;
    flex-wrap: wrap;
    gap: 0.34rem;
}

.team-member {
    display: inline-flex;
    max-width: 185px;
    min-width: 0;
    align-items: center;
    gap: 0.42rem;
    border: 1px solid #e4e7ec;
    border-radius: 999px;
    background: var(--team-soft);
    padding: 0.18rem 0.56rem 0.18rem 0.22rem;
}

.team-member img,
.team-member > span {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
}

.team-member img {
    display: block;
    object-fit: cover;
    object-position: top center;
}

.team-member > span {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--team-primary);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
}

.team-member strong,
.team-member small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-member strong {
    color: #334155;
    font-size: 0.74rem;
    line-height: 1.2;
}

.team-member small {
    color: #7a8698;
    font-size: 0.66rem;
    line-height: 1.2;
}

.team-member--more {
    justify-content: center;
    color: #36598f;
    font-size: 0.74rem;
    font-weight: 800;
    padding-left: 0.56rem;
}

.team-empty {
    padding: 3.4rem 1.2rem;
    border: 1px solid #e2e6ef;
    border-radius: 12px;
    background: #fff;
    text-align: center;
}

.team-empty--filtered {
    margin-top: 0.72rem;
}

.team-empty__title {
    margin-bottom: 0.4rem;
    color: #475467;
    font-size: 1rem;
    font-weight: 700;
}

.team-empty__sub {
    color: #98a2b3;
    font-size: 0.86rem;
}

@media (max-width: 900px) {
    .team-card {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    .team-card__logo {
        width: 64px;
        height: 64px;
    }

}

@media (max-width: 700px) {
    .team-page {
        padding: 0 0.2rem;
    }

    .team-header-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .team-create-btn {
        width: 100%;
    }

    .team-card {
        grid-template-columns: 56px minmax(0, 1fr);
        gap: 0.7rem;
        padding: 0.85rem 0.82rem 0.72rem;
    }

    .team-card__logo {
        width: 56px;
        height: 56px;
        border-radius: 8px;
    }

    .team-card__top {
        flex-direction: column;
        gap: 0.38rem;
    }

    .team-card__badges {
        justify-content: flex-start;
    }

    .team-card__title {
        font-size: 0.99rem;
    }

}
