/* =========================
   TEAM PAGE
========================= */

.team-page {
    min-height: calc(100vh - 100px);
}


/* =========================
   HEADER
========================= */

.team-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 24px;
}

.team-header h3 {
    font-size: 21px;
}

.team-header p {
    margin-top: 5px;

    color: var(--text-soft);
    font-size: 13px;
}


/* =========================
   STATS
========================= */

.team-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;

    margin-bottom: 20px;
}

.team-stat {
    display: flex;
    align-items: center;
    gap: 14px;

    padding: 20px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    box-shadow: var(--shadow-sm);
}

.team-stat__icon {
    width: 46px;
    height: 46px;

    display: grid;
    place-items: center;

    flex-shrink: 0;

    border-radius: 12px;

    background: var(--primary-soft);
    color: var(--primary);

    font-size: 18px;
}

.team-stat > div:last-child {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.team-stat span {
    color: var(--text-soft);
    font-size: 12px;
}

.team-stat strong {
    color: var(--text);
    font-size: 23px;
}


/* =========================
   TOOLBAR
========================= */

.team-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;

    margin-bottom: 20px;
    padding: 18px;
}

.team-search {
    width: min(340px, 100%);

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 10px 13px;

    background: var(--surface-soft);

    border: 1px solid var(--border);
    border-radius: 10px;
}

.team-search i {
    color: var(--text-light);
}

.team-search input {
    width: 100%;

    border: none;
    outline: none;

    background: transparent;
    color: var(--text);

    font-family: inherit;
}

.team-search input::placeholder {
    color: var(--text-light);
}

.team-filters {
    display: flex;
    align-items: center;
    gap: 10px;
}

.team-select {
    min-height: 40px;

    padding: 0 12px;

    background: var(--surface-soft);
    color: var(--text);

    border: 1px solid var(--border);
    border-radius: 10px;

    outline: none;

    font-family: inherit;

    cursor: pointer;
}


/* =========================
   TEAM GRID
========================= */

.team-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;

    margin-bottom: 20px;
}


/* =========================
   MEMBER CARD
========================= */

.team-member {
    position: relative;

    padding: 22px;

    overflow: hidden;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    box-shadow: var(--shadow-sm);

    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.team-member:hover {
    transform: translateY(-3px);

    border-color: var(--primary);

    box-shadow:
        0 12px 30px rgba(15, 23, 42, 0.08);
}


/* TOP */

.team-member__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;

    margin-bottom: 18px;
}

.team-member__profile {
    display: flex;
    align-items: center;
    gap: 12px;

    min-width: 0;
}

.team-member__avatar {
    position: relative;

    width: 48px;
    height: 48px;

    display: grid;
    place-items: center;

    flex-shrink: 0;

    border-radius: 14px;

    background: var(--primary-soft);
    color: var(--primary);

    font-size: 13px;
    font-weight: 800;
}

.team-member__presence {
    position: absolute;

    right: -2px;
    bottom: -2px;

    width: 12px;
    height: 12px;

    border: 2px solid var(--surface);
    border-radius: 50%;
}

.team-member__presence.online {
    background: #22c55e;
}

.team-member__presence.busy {
    background: #f59e0b;
}

.team-member__presence.offline {
    background: #94a3b8;
}

.team-member__identity {
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 3px;
}

.team-member__identity strong {
    overflow: hidden;

    color: var(--text);

    font-size: 13px;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-member__identity span {
    overflow: hidden;

    color: var(--text-soft);

    font-size: 10px;

    text-overflow: ellipsis;
    white-space: nowrap;
}


/* VIEW BUTTON */

.team-member__view {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    flex-shrink: 0;

    border: none;
    border-radius: 8px;

    background: var(--surface-soft);
    color: var(--text-soft);

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.team-member__view:hover {
    background: var(--primary-soft);
    color: var(--primary);

    transform: translateY(-1px);
}


/* STATUS */

.team-member__status {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    width: fit-content;

    margin-bottom: 18px;
    padding: 6px 9px;

    border-radius: 999px;

    font-size: 10px;
    font-weight: 700;
}

.team-member__status::before {
    content: "";

    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: currentColor;
}

.team-member__status.online {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
}

.team-member__status.busy {
    background: rgba(245, 158, 11, 0.14);
    color: #d97706;
}

.team-member__status.offline {
    background: rgba(148, 163, 184, 0.14);
    color: #64748b;
}


/* DETAILS */

.team-member__details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;

    margin-bottom: 18px;
}

.team-member__detail {
    padding: 11px;

    background: var(--surface-soft);

    border-radius: 10px;
}

.team-member__detail span {
    display: block;

    margin-bottom: 4px;

    color: var(--text-light);

    font-size: 9px;
}

.team-member__detail strong {
    color: var(--text);

    font-size: 12px;
}


/* PERFORMANCE */

.team-member__performance {
    padding-top: 16px;

    border-top: 1px solid var(--border);
}

.team-member__performance-top {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;

    margin-bottom: 8px;
}

.team-member__performance-top span {
    color: var(--text-soft);
    font-size: 10px;
}

.team-member__performance-top strong {
    color: var(--text);
    font-size: 11px;
}

.team-member__progress {
    width: 100%;
    height: 6px;

    overflow: hidden;

    background: var(--surface-soft);

    border-radius: 999px;
}

.team-member__progress-bar {
    height: 100%;

    background: var(--primary);

    border-radius: inherit;

    transition: width 0.3s ease;
}


/* =========================
   EMPTY STATE
========================= */

.team-empty {
    min-height: 260px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 8px;

    margin-bottom: 20px;
    padding: 30px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    text-align: center;
}

.team-empty[hidden] {
    display: none;
}

.team-empty i {
    margin-bottom: 7px;

    color: var(--text-light);

    font-size: 32px;
}

.team-empty strong {
    color: var(--text);
}

.team-empty span {
    color: var(--text-soft);
    font-size: 11px;
}


/* =========================
   PAGINATION
========================= */

.team-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    padding: 16px 18px;

    color: var(--text-soft);
    font-size: 12px;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pagination-button {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    border: none;
    border-radius: 8px;

    background: var(--surface-soft);
    color: var(--text);

    cursor: pointer;
}

.pagination-button:hover:not(:disabled) {
    background: var(--primary);
    color: #fff;
}

.pagination-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#teamCurrentPage {
    min-width: 42px;

    text-align: center;

    color: var(--text);

    font-weight: 700;
}


/* =========================
   TEAM MODAL
========================= */

.team-modal {
    position: fixed;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    opacity: 0;
    visibility: hidden;

    z-index: 2000;

    transition:
        opacity 0.2s ease,
        visibility 0.2s ease;
}

.team-modal.open {
    opacity: 1;
    visibility: visible;
}

.team-modal__backdrop {
    position: absolute;
    inset: 0;

    background: rgba(2, 6, 23, 0.68);

    backdrop-filter: blur(4px);
}

.team-modal__content {
    position: relative;

    width: min(570px, 100%);

    overflow: hidden;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 18px;

    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.28);

    transform:
        translateY(10px)
        scale(0.98);

    transition: transform 0.2s ease;
}

.team-modal.open .team-modal__content {
    transform:
        translateY(0)
        scale(1);
}


/* MODAL HEADER */

.team-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    padding: 20px;

    border-bottom: 1px solid var(--border);
}

.team-modal__member {
    display: flex;
    align-items: center;
    gap: 12px;
}

.team-modal__avatar {
    width: 50px;
    height: 50px;

    display: grid;
    place-items: center;

    flex-shrink: 0;

    border-radius: 14px;

    background: var(--primary-soft);
    color: var(--primary);

    font-size: 13px;
    font-weight: 800;
}

.team-modal__member span {
    color: var(--text-soft);
    font-size: 10px;
}

.team-modal__member h3 {
    margin-top: 3px;

    color: var(--text);
    font-size: 18px;
}


/* MODAL BODY */

.team-modal__body {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;

    padding: 22px;
}

.team-detail {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.team-detail span {
    color: var(--text-soft);
    font-size: 10px;
}

.team-detail strong {
    color: var(--text);
    font-size: 12px;
    word-break: break-word;
}


/* =========================
   DARK MODE
========================= */

body.dark-theme .team-member:hover {
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.2);
}

body.dark-theme .team-member__presence {
    border-color: var(--surface);
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1200px) {

    .team-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .team-search {
        width: 100%;
    }

    .team-filters {
        width: 100%;
    }

    .team-select {
        flex: 1;
    }

    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


@media (max-width: 1000px) {

    .team-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}


@media (max-width: 700px) {

    .team-header {
        align-items: stretch;
        flex-direction: column;
    }

    .team-header .button {
        align-self: flex-start;
    }

    .team-filters {
        flex-direction: column;
    }

    .team-select {
        width: 100%;
    }

    .team-grid {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 520px) {

    .team-stats {
        grid-template-columns: 1fr;
    }

    .team-header .button {
        width: 100%;
    }

    .team-pagination {
        align-items: flex-start;
        flex-direction: column;
    }

    .team-modal {
        padding: 12px;
    }

    .team-modal__body {
        grid-template-columns: 1fr;
    }
}