/* Справочник ответственных ВВИ */

.vvi {
    padding: 8px 4px 32px;
}

.vvi__head h1 {
    margin: 0 0 6px;
    font-size: 24px;
}

.vvi__head p {
    margin: 0 0 18px;
    max-width: 780px;
    color: #5b6472;
    font-size: 14px;
}

.vvi__state,
.vvi__error {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
}

.vvi__state {
    background: #f3f5f8;
    color: #4a5361;
}

.vvi__error {
    margin: 10px 0;
    background: #fdeceb;
    color: #8c1d18;
}

.vvi__panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px 16px;
    padding: 16px;
    border: 1px solid #dfe4ea;
    border-radius: 12px;
    background: #fff;
}

.vvi__panel label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #5b6472;
}

.vvi__panel select,
.vvi__panel input {
    padding: 8px 10px;
    border: 1px solid #cfd6df;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
}

.vvi__actions {
    display: flex;
    gap: 10px;
    margin: 14px 0;
}

.vvi__button {
    padding: 9px 14px;
    border: 1px solid #1565c0;
    border-radius: 8px;
    background: #1565c0;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}

.vvi__button:disabled {
    opacity: 0.6;
    cursor: default;
}

.vvi__button--ghost {
    border-color: #cfd6df;
    background: #fff;
    color: #39424f;
}

.vvi__tree {
    margin-top: 20px;
}

.vvi__tree h2 {
    margin: 0 0 10px;
    font-size: 18px;
}

.vvi__node {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 30px;
    border-bottom: 1px dashed #eef1f5;
}

.vvi__node-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #2c3440;
    cursor: pointer;
}

.vvi__node-name {
    white-space: nowrap;
}

.vvi__badge {
    padding: 2px 8px;
    border-radius: 999px;
    background: #e8f1fc;
    color: #14508f;
    font-size: 12px;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .vvi__node {
        flex-wrap: wrap;
    }

    .vvi__badge {
        margin-left: 26px;
    }
}

/* Таблица записей */
.vvi__toolbar {
    display: flex;
    gap: 12px;
    margin: 8px 0 14px;
}

.vvi__toolbar label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #5b6472;
}

.vvi__toolbar select {
    padding: 8px 10px;
    border: 1px solid #cfd6df;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
}

.vvi__scroll {
    overflow-x: auto;
}

.vvi__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.vvi__table th,
.vvi__table td {
    padding: 9px 10px;
    border-bottom: 1px solid #e5e8ee;
    text-align: left;
    vertical-align: top;
}

.vvi__table th {
    color: #657080;
    font-weight: 600;
    white-space: nowrap;
}

.vvi__person {
    font-weight: 500;
    color: #2c3440;
}

.vvi__muted {
    color: #7b8492;
    font-size: 12px;
}

.vvi__row--off td {
    color: #9aa2ae;
}

/* Окно добавления */
.vvi-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 12px;
    background: rgba(15, 23, 42, 0.45);
    overflow-y: auto;
}

.vvi-modal__panel {
    width: min(860px, 100%);
    padding: 18px 20px 20px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
}

.vvi-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.vvi-modal__head h2 {
    margin: 0;
    font-size: 20px;
}

.vvi-modal__close {
    border: none;
    background: none;
    font-size: 24px;
    line-height: 1;
    color: #7b8492;
    cursor: pointer;
}

.vvi-modal__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px 18px;
}

.vvi-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    color: #5b6472;
}

.vvi-search {
    display: flex;
    gap: 6px;
}

.vvi-search input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #cfd6df;
    border-radius: 8px;
    font-size: 14px;
}

.vvi-search button,
.vvi-results button {
    padding: 8px 12px;
    border: 1px solid #1565c0;
    border-radius: 8px;
    background: #1565c0;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}

.vvi-results {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 160px;
    overflow-y: auto;
}

.vvi-results button {
    text-align: left;
    border-color: #d8dee7;
    background: #f7f9fc;
    color: #2c3440;
}

.vvi-selected {
    padding: 6px 10px;
    border-radius: 8px;
    background: #e8f1fc;
    color: #14508f;
}

.vvi-check {
    flex-direction: row !important;
    align-items: center;
    gap: 8px !important;
}

.vvi-modal__tree {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 16px;
    padding: 10px 12px;
    border: 1px solid #e5e8ee;
    border-radius: 10px;
}

.vvi-modal__tree h3 {
    margin: 0 0 8px;
    font-size: 14px;
}

.vvi__node-label--modal {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    font-size: 13px;
    color: #2c3440;
}

.vvi-modal__actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

@media (max-width: 640px) {
    .vvi-modal__panel {
        padding: 14px;
    }
}

.vvi-picked {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid #cfd6df;
    border-radius: 8px;
    background: #f9fbfe;
    font-size: 13px;
    color: #2c3440;
}

.vvi-picked button {
    padding: 6px 10px;
    border: 1px solid #1565c0;
    border-radius: 7px;
    background: #fff;
    color: #1565c0;
    font-size: 12px;
    cursor: pointer;
}

.vvi__count {
    margin-left: 8px;
    color: #7b8492;
    font-size: 12px;
    font-weight: 400;
}

.vvi__kind {
    margin-left: auto;
    padding: 1px 8px;
    border-radius: 999px;
    background: #f1f4f9;
    color: #657080;
    font-size: 11px;
    white-space: nowrap;
}
