.stack {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.name {
    overflow: hidden;
    color: var(--text-primary);
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.meta {
    overflow: hidden;
    color: var(--text-tertiary);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toolbarFilters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.inlineFilter {
    display: inline-flex;
    height: var(--control-height);
    min-width: 132px;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 650;
}

.inlineFilter input {
    width: 96px;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
}

.inlineFilter input::placeholder {
    color: var(--text-tertiary);
}

.policyTabsBar {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 2px;
    border-bottom: 1px solid var(--border);
}

.policyTab {
    min-height: 40px !important;
    padding-right: 18px !important;
    padding-left: 18px !important;
    font-weight: 700 !important;
    text-transform: none !important;
}

.rowActions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.identity {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

.avatar {
    display: inline-flex;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-card-strong);
    color: var(--text-secondary);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.identityText {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.primaryText {
    overflow: hidden;
    color: var(--text-primary);
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.amountPositive {
    color: var(--success);
    font-weight: 760;
    white-space: nowrap;
}

.policyDrawer {
    width: min(720px, calc(100vw - 40px)) !important;
}

.drawerBody {
    gap: 16px;
}

.formSection {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.baseSection {
    padding-bottom: 2px;
}

.formGrid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: center;
    gap: 10px;
}

.fieldWide {
    grid-column: span 3;
}

.fieldCompact {
    grid-column: span 2;
}

.enabledField {
    display: flex;
    min-height: var(--control-height);
    grid-column: span 2;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    background: var(--bg-input);
}

.toggleLabel {
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 650;
    line-height: 16px;
    white-space: nowrap;
}

.timeRangeField {
    grid-column: span 4;
    width: 100% !important;
    max-width: none !important;
}

.sectionHeader {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sectionHeader h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 720;
}

.levelSection {
    min-width: 0;
    padding-top: 16px;
    padding-bottom: 2px;
    border-top: 1px solid var(--border);
}

.addLevelButton {
    height: 34px !important;
    min-height: 34px !important;
    padding-right: 10px !important;
    padding-left: 10px !important;
}

.levelTable {
    min-width: 0;
    overflow-x: auto;
    padding-bottom: 2px;
}

.levelHeader,
.levelRow {
    display: grid;
    min-width: 620px;
    grid-template-columns: 54px minmax(108px, 1fr) 82px minmax(104px, 1fr) 82px 64px 34px;
    align-items: center;
    gap: 6px;
}

.teamLevelHeader,
.teamLevelRow {
    display: grid;
    min-width: 580px;
    grid-template-columns: 54px minmax(130px, 1fr) 86px minmax(108px, 1fr) 64px 34px;
    align-items: center;
    gap: 6px;
}

.levelHeader {
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 650;
    line-height: 16px;
}

.teamLevelHeader {
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 650;
    line-height: 16px;
}

.levelList {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.levelRow :global(.MuiTextField-root),
.levelRow :global(.MuiFormControl-root),
.teamLevelRow :global(.MuiTextField-root),
.teamLevelRow :global(.MuiFormControl-root) {
    --admin-control-height: 34px;
    --admin-control-font-size: 13px;
}

@media (max-width: 760px) {
    .formGrid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fieldWide,
    .fieldCompact,
    .timeRangeField,
    .enabledField {
        grid-column: span 2;
    }

    .levelHeader,
    .teamLevelHeader {
        display: none;
    }

    .levelRow,
    .teamLevelRow {
        min-width: 0;
        grid-template-columns: repeat(2, minmax(0, 1fr)) 44px;
    }

    .levelRow > :nth-child(2),
    .levelRow > :nth-child(4),
    .teamLevelRow > :nth-child(2),
    .teamLevelRow > :nth-child(4) {
        grid-column: span 2;
    }
}
