@import url("tokens.css");
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;600&display=swap");

:root {
    --bg: #f4f1ea;
    --card: #fff;
    --text: #1f2430;
    --muted: #5c6578;
    --line: #d9d3c7;
    --accent: #2c5f4a;
    --danger: #9b2c2c;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* Оболочка кабинета и экран «Команда» (Figma 124:18724) — цвета дублируются
   hex-ом, чтобы страница не ломалась, если tokens.css не подгрузился. */
body.app-shell,
body:has(.team-page) {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f2f9ff;
    color: #000;
    font-family: "Roboto", "Segoe UI", Tahoma, sans-serif;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 40px;
    min-height: 100px;
    height: 100px;
    padding: 12px 40px;
    background: #f2f9ff;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.15);
    border-bottom: 0;
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border: 3px solid #5e58c6;
    border-radius: 500px;
    background: #f2f9ff;
    box-shadow: none;
    box-sizing: border-box;
}

.logo-mark img {
    display: block;
    width: 41.25px;
    height: 22px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    flex-wrap: wrap;
}

.nav-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 220px;
    height: 56px;
    padding: 10px 2px;
    border: 2px solid #eaedf3;
    border-radius: 8px;
    background: #f2f9ff;
    color: #000;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    box-sizing: border-box;
    opacity: 1;
}

.nav-icon {
    position: relative;
    display: block;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    overflow: hidden;
    color: #000;
}

.nav-icon img,
.nav-icon svg {
    display: block;
    position: absolute;
}

.nav-icon--dashboard svg { inset: 0; width: 24px; height: 24px; }
.nav-icon--team img,
.nav-icon--folder img,
.nav-icon--client img { inset: 0; width: 24px; height: 24px; }
.nav-icon--tasks img { width: 19.05px; height: 25.18px; left: 2.97px; top: -1.03px; }
.nav-icon--report img { width: 18px; height: 24px; left: 3.19px; top: 0; }

.nav-label { position: relative; }

a.nav-pill:hover {
    box-shadow:
        7px 7px 8px rgba(0, 0, 0, 0.06),
        -7px -7px 8px rgba(255, 255, 255, 0.68);
}

.nav-pill.active {
    background:
        linear-gradient(270deg, rgba(94, 88, 198, 0.3) 0%, rgba(194, 72, 183, 0.3) 49.52%, rgba(247, 121, 73, 0.3) 100%),
        #fff;
    border-color: transparent;
    color: #000;
}

.nav-pill.disabled {
    cursor: default;
    opacity: 1;
}

.topbar-end { display: flex; align-items: center; margin-left: auto; }

.user-menu { position: relative; }

.user-menu summary {
    display: flex;
    align-items: center;
    gap: 20px;
    list-style: none;
    cursor: pointer;
    padding: 0;
    background: transparent;
}

.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary::marker { content: ""; }
.user-menu[open] summary { background: transparent; }

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 2px;
    border-radius: 100px;
    background: #000;
    color: #fff;
    font-family: "Roboto", "Segoe UI", Tahoma, sans-serif;
    font-weight: 600;
    font-size: 22px;
    letter-spacing: 0.04em;
    line-height: 1;
    flex-shrink: 0;
    box-sizing: border-box;
}

.menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 2px solid #eaedf3;
    border-radius: 8px;
    background: #f2f9ff;
    box-sizing: border-box;
    color: #000;
}

.menu-btn img,
.menu-icon img {
    display: block;
    width: 32px;
    height: 26px;
}

.menu-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 2px solid #eaedf3;
    border-radius: 8px;
    background: #f2f9ff;
    color: #000;
    box-sizing: border-box;
}

.menu-icon svg { width: 32px; height: 26px; }

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border: 1px solid #eaedf3;
    border-radius: 8px;
    padding: 12px;
    min-width: 180px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    z-index: 20;
}

.user-dropdown .user-name { font-weight: 600; margin-bottom: 10px; color: #000; }

.user-dropdown button {
    width: 100%;
    background: transparent;
    color: #000;
    border: 1px solid #eaedf3;
    border-radius: 8px;
    padding: 8px 14px;
    cursor: pointer;
}

.wrap { max-width: 960px; margin: 32px auto; padding: 0 16px; }

.app-shell .wrap { flex: 1; }

body:has(.team-page) .wrap,
.wrap--fluid {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 52px 40px 40px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    flex: 1;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
}

.card.narrow { max-width: 420px; margin: 48px auto; }

.card h1 { margin-top: 0; font-size: 1.4rem; }

.card button {
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 4px;
    padding: 8px 14px;
    cursor: pointer;
}

label { display: block; margin: 12px 0; font-size: 0.9rem; }

input {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 4px;
}

.error { color: var(--danger); }

.todo { color: var(--muted); }

/* Экран «2. Пользователи», Figma node 124:18724 */
.team-page {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: 100%;
}

.team-page__head {
    padding-bottom: 40px;
    border-bottom: 2px solid #eaedf3;
}

.team-page__head h1 {
    margin: 0;
    font-family: "Roboto", "Segoe UI", Tahoma, sans-serif;
    font-size: 32px;
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1;
    color: #000;
}

.member-grid {
    display: grid;
    grid-template-columns: repeat(4, 380px);
    gap: 20px;
    margin-top: 48px;
    justify-content: start;
}

.member-card {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 380px;
    height: 64px;
    padding: 12px 20px;
    background: #fff;
    border: 2px solid #eaedf3;
    border-radius: 8px;
    box-sizing: border-box;
}

.member-card:hover {
    box-shadow:
        7px 7px 8px rgba(0, 0, 0, 0.06),
        -7px -7px 8px rgba(255, 255, 255, 0.68);
}

.member-card__text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.member-card__name,
.member-card__role {
    margin: 0;
    font-family: "Roboto", "Segoe UI", Tahoma, sans-serif;
    font-size: 22px;
    letter-spacing: 0.04em;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.member-card__name {
    font-weight: 600;
    color: #000;
}

.member-card__role {
    font-weight: 400;
    color: #a1a1a1;
}

.team-page__actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-top: auto;
    padding-top: 40px;
}

.btn-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    height: 64px;
    padding: 20px;
    border: 0;
    border-radius: 8px;
    background: #000;
    color: #fff;
    font-family: "Roboto", "Segoe UI", Tahoma, sans-serif;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
    flex-shrink: 0;
    appearance: none;
    -webkit-appearance: none;
}

.btn-add:hover {
    box-shadow:
        7px 7px 8px rgba(0, 0, 0, 0.06),
        -7px -7px 8px rgba(255, 255, 255, 0.68);
}

.btn-add--wide { width: 360px; }

.btn-add__icon {
    position: relative;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    overflow: visible;
}

.btn-add__icon img {
    position: absolute;
    top: 0;
    left: -1px;
    width: 33px;
    height: 32px;
    display: block;
}

@media (max-width: 1680px) {
    .member-grid { grid-template-columns: repeat(auto-fill, 380px); }
}

@media (max-width: 1280px) {
    .nav-pill { width: auto; min-width: 160px; padding: 10px 16px; }
}

@media (max-width: 900px) {
    .topbar { height: auto; min-height: 0; padding: 12px 20px; flex-wrap: wrap; }
    body:has(.team-page) .wrap,
    .wrap--fluid { padding: 32px 20px 24px; }
    .member-grid {
        grid-template-columns: 1fr;
        margin-top: 24px;
    }
    .member-card { width: 100%; }
    .team-page__actions { flex-direction: column-reverse; align-items: stretch; }
    .btn-add,
    .btn-add--wide { width: 100%; }
}
