/* Управление командой внутри рабочего пространства CRM */
.employee-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}
.employee-stats > div {
    display: grid;
    min-height: 112px;
    align-content: center;
    padding: 19px 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}
.employee-stats span, .employee-stats small { color: var(--muted); font-size: 12px; }
.employee-stats span { font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.employee-stats strong { margin: 2px 0; color: var(--ink); font-size: 32px; line-height: 1.05; }
.employee-stats .is-active strong { color: var(--success); }
.employee-stats .is-inactive strong { color: var(--muted); }
.employee-search { justify-content: flex-start; }
.employee-search .search-field { max-width: 720px; }
.employee-card { margin-bottom: 20px; }
.employee-list { display: grid; }
.employee-row {
    display: grid;
    grid-template-columns: 46px minmax(250px, 1fr) 95px 130px 115px auto;
    align-items: center;
    gap: 15px;
    min-height: 100px;
    padding: 17px 21px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}
.employee-row:last-child { border-bottom: 0; }
.employee-row:hover { background: #fbfdfd; }
.employee-row.is-disabled { background: #fafafa; }
.employee-row.is-disabled .employee-avatar, .employee-row.is-disabled .employee-identity { opacity: .68; }
.employee-avatar {
    display: inline-flex;
    width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #eafffc;
    background: linear-gradient(145deg, #1ba79b, #0f7770);
    font-size: 16px;
    font-weight: 850;
}
.employee-identity { display: grid; min-width: 0; gap: 3px; }
.employee-identity > div { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.employee-identity strong { overflow: hidden; color: var(--ink); font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.employee-identity p { overflow: hidden; margin: 0; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.employee-self, .employee-owner, .employee-groups span {
    padding: 3px 7px;
    border-radius: 999px;
    color: var(--primary-dark);
    background: var(--primary-soft);
    font-size: 10px;
    font-weight: 800;
}
.employee-owner { color: var(--info); background: var(--info-soft); }
.employee-groups { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.employee-groups small { color: var(--muted-light); font-size: 10px; }
.employee-fact { display: grid; gap: 1px; }
.employee-fact strong { color: var(--ink-soft); font-size: 14px; }
.employee-fact span { color: var(--muted); font-size: 10px; }
.employee-state {
    justify-self: start;
    padding: 6px 9px;
    border-radius: 999px;
    color: #8c5d5d;
    background: #fff0f0;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}
.employee-state.is-active { color: var(--success); background: var(--success-soft); }
.employee-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.employee-actions form { margin: 0; }
.row-action--warning { color: var(--warning); }
.row-action--warning:hover { background: var(--warning-soft); }
.employee-groups-card { margin-top: 20px; }
.employee-group-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.employee-group-row {
    display: flex;
    min-height: 82px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 20px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.employee-group-row:nth-child(3n) { border-right: 0; }
.employee-group-row > div:first-child { display: grid; gap: 3px; }
.employee-group-row strong { color: var(--ink); font-size: 14px; }
.employee-group-row span { color: var(--muted); font-size: 11px; }
.employee-form-card { max-width: 980px; }
.employee-form-card--narrow { max-width: 720px; }
.employee-password-grid { grid-template-columns: 1fr; }
.field-group--checkbox { padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-subtle); }
.checkbox-line { display: flex !important; align-items: center; gap: 10px; font-size: 14px; }
.employee-form-card .field-group ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1220px) {
    .employee-row { grid-template-columns: 46px minmax(230px, 1fr) 90px 110px auto; }
    .employee-row .employee-fact:nth-of-type(2) { display: none; }
    .employee-group-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .employee-group-row:nth-child(3n) { border-right: 1px solid var(--line); }
    .employee-group-row:nth-child(2n) { border-right: 0; }
}
@media (max-width: 900px) {
    .employee-row { grid-template-columns: 46px minmax(190px, 1fr) auto; }
    .employee-fact, .employee-state { display: none; }
    .employee-actions { grid-column: 2 / -1; justify-content: flex-start; padding-top: 10px; border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
    .employee-stats { grid-template-columns: 1fr; }
    .employee-stats > div { min-height: 92px; }
    .employee-search .search-field { max-width: none; }
    .employee-group-list { grid-template-columns: 1fr; }
    .employee-group-row, .employee-group-row:nth-child(2n), .employee-group-row:nth-child(3n) { border-right: 0; }
    .employee-form-card .field-group ul { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .employee-row { grid-template-columns: 42px minmax(0, 1fr); padding: 15px; }
    .employee-avatar { width: 42px; height: 42px; }
    .employee-actions { grid-column: 1 / -1; }
    .employee-identity strong, .employee-identity p { white-space: normal; }
}
