.tabsBar {
    display: flex;
    align-items: center;
    min-height: 48px;
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
}

.tab {
    min-height: 48px;
    text-transform: none;
}

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

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

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

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

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

.ruleDrawer,
.instanceDrawer {
    width: min(1120px, calc(100vw - 32px));
}

.drawerBody {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

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

.sectionHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

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

.formGrid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 12px;
    align-items: start;
}

.fieldWide {
    grid-column: 1 / -1;
}

.timeRangeField {
    grid-column: span 2;
}

.switchField {
    display: flex;
    min-height: var(--control-height);
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    padding: 0 12px;
    color: var(--text-secondary);
    font-size: var(--admin-font-size);
}

.levelTable {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 8px;
    overflow-x: auto;
}

.agentLevelHeader,
.agentLevelRow,
.bdLevelHeader,
.bdLevelRow,
.coinSellerLevelHeader,
.coinSellerLevelRow {
    display: grid;
    min-width: 920px;
    align-items: center;
    gap: 8px;
}

.agentLevelHeader,
.bdLevelHeader,
.coinSellerLevelHeader {
    min-height: 34px;
    border-radius: 8px;
    background: var(--bg-card-strong);
    padding: 0 10px;
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 720;
}

.agentLevelRow,
.bdLevelRow,
.coinSellerLevelRow {
    min-height: 44px;
}

.agentLevelHeader,
.agentLevelRow {
    grid-template-columns: 72px minmax(130px, 1fr) 110px 110px 120px 110px 76px 44px;
}

.bdLevelHeader,
.bdLevelRow {
    grid-template-columns: 72px minmax(160px, 1fr) 130px 130px 120px 44px;
}

.coinSellerLevelHeader,
.coinSellerLevelRow {
    grid-template-columns: minmax(160px, 1fr) 130px 130px 130px 92px 44px;
}

@media (max-width: 900px) {
    .formGrid {
        grid-template-columns: 1fr;
    }

    .timeRangeField {
        grid-column: auto;
    }
}
